@dcl/profile-site 0.6.7-6162920852.commit-91b418e → 0.6.7-6189036856.commit-f0dd9a5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ import{e as Qa,r as Vi,i as pt,s as jp,c as F,b as Wi,B as ee,a as ah,d as ue,g as nn,_ as R,f as Ui,h as Pp}from"./index-64ad135a.js";function Dp(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Za={},An={},zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.walletLogo=void 0;const $p=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' 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=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' 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 `}};zi.walletLogo=$p;var qi={};Object.defineProperty(qi,"__esModule",{value:!0});qi.ScopedLocalStorage=void 0;class Bp{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}qi.ScopedLocalStorage=Bp;var Wr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0});const Fp=Qa;function ru(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Hp(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}let Vp=class extends Fp.EventEmitter{emit(e,...r){let n=e==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")ru(s,this,r);else{const o=s.length,a=Hp(s);for(let c=0;c<o;c+=1)ru(a[c],this,r)}return!0}};yr.default=Vp;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.EVENTS=void 0;sn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var $n={},Ya={},Qt={},Wp=Mn;Mn.default=Mn;Mn.stable=lh;Mn.stableStringify=lh;var Ti="[...]",ch="[Circular]",dr=[],lr=[];function uh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Mn(t,e,r,n){typeof n>"u"&&(n=uh()),Ra(t,"",0,[],void 0,0,n);var i;try{lr.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,hh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;dr.length!==0;){var s=dr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Dr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),dr.push([n,r,e,i])):lr.push([e,r,t]):(n[r]=t,dr.push([n,r,e]))}function Ra(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){Dr(ch,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Dr(Ti,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Dr(Ti,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Ra(t[a],a,a,n,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var u=c[a];Ra(t[u],u,a,n,t,s,o)}}n.pop()}}function Up(t,e){return t<e?-1:t>e?1:0}function lh(t,e,r,n){typeof n>"u"&&(n=uh());var i=Ia(t,"",0,[],void 0,0,n)||t,s;try{lr.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,hh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;dr.length!==0;){var o=dr.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Ia(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){Dr(ch,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Dr(Ti,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Dr(Ti,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Ia(t[a],a,a,n,t,s,o);else{var c={},u=Object.keys(t).sort(Up);for(a=0;a<u.length;a++){var l=u[a];Ia(t[l],l,a,n,t,s,o),c[l]=t[l]}if(typeof i<"u")dr.push([i,e,t]),i[e]=c;else return c}n.pop()}}function hh(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(lr.length>0)for(var n=0;n<lr.length;n++){var i=lr[n];if(i[1]===e&&i[0]===r){r=i[2],lr.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(Qt,"__esModule",{value:!0});Qt.EthereumProviderError=Qt.EthereumRpcError=void 0;const zp=Wp;class fh extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return zp.default(this.serialize(),Jp,2)}}Qt.EthereumRpcError=fh;class qp extends fh{constructor(e,r,n){if(!Gp(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}Qt.EthereumProviderError=qp;function Gp(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Jp(t,e){if(e!=="[Circular]")return e}var Ka={},Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.errorValues=Zt.errorCodes=void 0;Zt.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}};Zt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Zt,r=Qt,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(f,d=i){if(Number.isInteger(f)){const y=f.toString();if(h(e.errorValues,y))return e.errorValues[y].message;if(u(f))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return d}t.getMessageFromCode=o;function a(f){if(!Number.isInteger(f))return!1;const d=f.toString();return!!(e.errorValues[d]||u(f))}t.isValidCode=a;function c(f,{fallbackError:d=s,shouldIncludeStack:y=!1}={}){var m,C;if(!d||!Number.isInteger(d.code)||typeof d.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(f instanceof r.EthereumRpcError)return f.serialize();const p={};if(f&&typeof f=="object"&&!Array.isArray(f)&&h(f,"code")&&a(f.code)){const _=f;p.code=_.code,_.message&&typeof _.message=="string"?(p.message=_.message,h(_,"data")&&(p.data=_.data)):(p.message=o(p.code),p.data={originalError:l(f)})}else{p.code=d.code;const _=(m=f)===null||m===void 0?void 0:m.message;p.message=_&&typeof _=="string"?_:d.message,p.data={originalError:l(f)}}const v=(C=f)===null||C===void 0?void 0:C.stack;return y&&f&&v&&typeof v=="string"&&(p.stack=v),p}t.serializeError=c;function u(f){return f>=-32099&&f<=-32e3}function l(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function h(f,d){return Object.prototype.hasOwnProperty.call(f,d)}})(Ka);var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.ethErrors=void 0;const Xa=Qt,dh=Ka,De=Zt;Gi.ethErrors={rpc:{parse:t=>Ke(De.errorCodes.rpc.parse,t),invalidRequest:t=>Ke(De.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Ke(De.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Ke(De.errorCodes.rpc.methodNotFound,t),internal:t=>Ke(De.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ke(e,t)},invalidInput:t=>Ke(De.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Ke(De.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Ke(De.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Ke(De.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Ke(De.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Ke(De.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>yn(De.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>yn(De.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>yn(De.errorCodes.provider.unsupportedMethod,t),disconnected:t=>yn(De.errorCodes.provider.disconnected,t),chainDisconnected:t=>yn(De.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Xa.EthereumProviderError(e,r,n)}}};function Ke(t,e){const[r,n]=ph(e);return new Xa.EthereumRpcError(t,r||dh.getMessageFromCode(t),n)}function yn(t,e){const[r,n]=ph(e);return new Xa.EthereumProviderError(t,r||dh.getMessageFromCode(t),n)}function ph(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Qt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=Ka;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Gi;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Zt;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ya);var ge={},Ji={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Ji);Object.defineProperty(ge,"__esModule",{value:!0});ge.EthereumAddressFromSignedMessageResponse=ge.SubmitEthereumTransactionResponse=ge.SignEthereumTransactionResponse=ge.SignEthereumMessageResponse=ge.isRequestEthereumAccountsResponse=ge.SelectProviderResponse=ge.WatchAssetReponse=ge.RequestEthereumAccountsResponse=ge.SwitchEthereumChainResponse=ge.AddEthereumChainResponse=ge.isErrorResponse=void 0;const Tt=Ji;function Qp(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}ge.isErrorResponse=Qp;function Zp(t){return{method:Tt.Web3Method.addEthereumChain,result:t}}ge.AddEthereumChainResponse=Zp;function Yp(t){return{method:Tt.Web3Method.switchEthereumChain,result:t}}ge.SwitchEthereumChainResponse=Yp;function Kp(t){return{method:Tt.Web3Method.requestEthereumAccounts,result:t}}ge.RequestEthereumAccountsResponse=Kp;function Xp(t){return{method:Tt.Web3Method.watchAsset,result:t}}ge.WatchAssetReponse=Xp;function e0(t){return{method:Tt.Web3Method.selectProvider,result:t}}ge.SelectProviderResponse=e0;function t0(t){return t&&t.method===Tt.Web3Method.requestEthereumAccounts}ge.isRequestEthereumAccountsResponse=t0;function r0(t){return{method:Tt.Web3Method.signEthereumMessage,result:t}}ge.SignEthereumMessageResponse=r0;function n0(t){return{method:Tt.Web3Method.signEthereumTransaction,result:t}}ge.SignEthereumTransactionResponse=n0;function i0(t){return{method:Tt.Web3Method.submitEthereumTransaction,result:t}}ge.SubmitEthereumTransactionResponse=i0;function s0(t){return{method:Tt.Web3Method.ethereumAddressFromSignedMessage,result:t}}ge.EthereumAddressFromSignedMessageResponse=s0;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.LIB_VERSION=void 0;Bn.LIB_VERSION="3.7.1";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=Ya,r=ge,n=Bn;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(l){return l!==void 0?(0,e.getMessageFromCode)(l):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(l="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${l}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(l,h){const f=(0,e.serializeError)(o(l),{shouldIncludeStack:!0}),d=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");d.searchParams.set("version",n.LIB_VERSION),d.searchParams.set("code",f.code.toString());const y=a(f.data,h);return y&&d.searchParams.set("method",y),d.searchParams.set("message",f.message),Object.assign(Object.assign({},f),{docUrl:d.href})}t.serializeError=s;function o(l){return typeof l=="string"?{message:l,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(l)?Object.assign(Object.assign({},l),{message:l.errorMessage,code:l.errorCode,data:{method:l.method,result:l.result}}):l}function a(l,h){var f;const d=(f=l)===null||f===void 0?void 0:f.method;if(d)return d;if(h!==void 0)return typeof h=="string"?h:Array.isArray(h)?h.length>0?h[0].method:void 0:h.method}function c(l){var h;if(typeof l=="number")return l;if(u(l))return(h=l.code)!==null&&h!==void 0?h:l.errorCode}t.getErrorCode=c;function u(l){return typeof l=="object"&&l!==null&&(typeof l.code=="number"||typeof l.errorCode=="number")}})($n);var on={},bh={exports:{}},ka={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var r=Vi(),n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=n(o);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(ka,ka.exports);var er=ka.exports,gh=er.Buffer;function Qi(t,e){this._block=gh.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Qi.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=gh.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var a=s%n,c=Math.min(i-o,n-a),u=0;u<c;u++)r[a+u]=t[o+u];s+=c,o+=c,s%n===0&&this._update(r)}return this._len+=i,this};Qi.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};Qi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var an=Qi,o0=pt,vh=an,a0=er.Buffer,c0=[1518500249,1859775393,-1894007588,-899497514],u0=new Array(80);function Fn(){this.init(),this._w=u0,vh.call(this,64,56)}o0(Fn,vh);Fn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function l0(t){return t<<5|t>>>27}function h0(t){return t<<30|t>>>2}function f0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Fn.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var u=~~(c/20),l=l0(r)+f0(u,n,i,s)+o+e[c]+c0[u]|0;o=s,s=i,i=h0(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Fn.prototype._hash=function(){var t=a0.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var d0=Fn,p0=pt,yh=an,b0=er.Buffer,g0=[1518500249,1859775393,-1894007588,-899497514],v0=new Array(80);function Hn(){this.init(),this._w=v0,yh.call(this,64,56)}p0(Hn,yh);Hn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function y0(t){return t<<1|t>>>31}function m0(t){return t<<5|t>>>27}function _0(t){return t<<30|t>>>2}function w0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Hn.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=y0(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var u=~~(c/20),l=m0(r)+w0(u,n,i,s)+o+e[c]+g0[u]|0;o=s,s=i,i=_0(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Hn.prototype._hash=function(){var t=b0.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var S0=Hn,E0=pt,mh=an,C0=er.Buffer,x0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],R0=new Array(64);function Vn(){this.init(),this._w=R0,mh.call(this,64,56)}E0(Vn,mh);Vn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function I0(t,e,r){return r^t&(e^r)}function k0(t,e,r){return t&e|r&(t|e)}function T0(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function A0(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function M0(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function N0(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Vn.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,u=this._h|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<64;++l)e[l]=N0(e[l-2])+e[l-7]+M0(e[l-15])+e[l-16]|0;for(var h=0;h<64;++h){var f=u+A0(o)+I0(o,a,c)+x0[h]+e[h]|0,d=T0(r)+k0(r,n,i)|0;u=c,c=a,a=o,o=s+f|0,s=i,i=n,n=r,r=f+d|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0};Vn.prototype._hash=function(){var t=C0.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var _h=Vn,O0=pt,L0=_h,j0=an,P0=er.Buffer,D0=new Array(64);function Zi(){this.init(),this._w=D0,j0.call(this,64,56)}O0(Zi,L0);Zi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Zi.prototype._hash=function(){var t=P0.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var $0=Zi,B0=pt,wh=an,F0=er.Buffer,nu=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],H0=new Array(160);function Wn(){this.init(),this._w=H0,wh.call(this,128,112)}B0(Wn,wh);Wn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function iu(t,e,r){return r^t&(e^r)}function su(t,e,r){return t&e|r&(t|e)}function ou(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function au(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function V0(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function W0(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function U0(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function z0(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Te(t,e){return t>>>0<e>>>0?1:0}Wn.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,u=this._hh|0,l=this._al|0,h=this._bl|0,f=this._cl|0,d=this._dl|0,y=this._el|0,m=this._fl|0,C=this._gl|0,p=this._hl|0,v=0;v<32;v+=2)e[v]=t.readInt32BE(v*4),e[v+1]=t.readInt32BE(v*4+4);for(;v<160;v+=2){var _=e[v-30],x=e[v-15*2+1],E=V0(_,x),k=W0(x,_);_=e[v-2*2],x=e[v-2*2+1];var $=U0(_,x),j=z0(x,_),T=e[v-7*2],z=e[v-7*2+1],le=e[v-16*2],Z=e[v-16*2+1],M=k+z|0,A=E+T+Te(M,k)|0;M=M+j|0,A=A+$+Te(M,j)|0,M=M+Z|0,A=A+le+Te(M,Z)|0,e[v]=A,e[v+1]=M}for(var O=0;O<160;O+=2){A=e[O],M=e[O+1];var P=su(r,n,i),B=su(l,h,f),D=ou(r,l),V=ou(l,r),Y=au(o,y),G=au(y,o),se=nu[O],de=nu[O+1],he=iu(o,a,c),Fe=iu(y,m,C),w=p+G|0,S=u+Y+Te(w,p)|0;w=w+Fe|0,S=S+he+Te(w,Fe)|0,w=w+de|0,S=S+se+Te(w,de)|0,w=w+M|0,S=S+A+Te(w,M)|0;var N=V+B|0,U=D+P+Te(N,V)|0;u=c,p=C,c=a,C=m,a=o,m=y,y=d+w|0,o=s+S+Te(y,d)|0,s=i,d=f,i=n,f=h,n=r,h=l,l=w+N|0,r=S+U+Te(l,w)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+f|0,this._dl=this._dl+d|0,this._el=this._el+y|0,this._fl=this._fl+m|0,this._gl=this._gl+C|0,this._hl=this._hl+p|0,this._ah=this._ah+r+Te(this._al,l)|0,this._bh=this._bh+n+Te(this._bl,h)|0,this._ch=this._ch+i+Te(this._cl,f)|0,this._dh=this._dh+s+Te(this._dl,d)|0,this._eh=this._eh+o+Te(this._el,y)|0,this._fh=this._fh+a+Te(this._fl,m)|0,this._gh=this._gh+c+Te(this._gl,C)|0,this._hh=this._hh+u+Te(this._hl,p)|0};Wn.prototype._hash=function(){var t=F0.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Sh=Wn,q0=pt,G0=Sh,J0=an,Q0=er.Buffer,Z0=new Array(160);function Yi(){this.init(),this._w=Z0,J0.call(this,128,112)}q0(Yi,G0);Yi.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Yi.prototype._hash=function(){var t=Q0.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var Y0=Yi,mr=bh.exports=function(e){e=e.toLowerCase();var r=mr[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};mr.sha=d0;mr.sha1=S0;mr.sha224=$0;mr.sha256=_h;mr.sha384=Y0;mr.sha512=Sh;var K0=bh.exports,H={},X0=String.prototype.replace,eb=/%20/g,Wo={RFC1738:"RFC1738",RFC3986:"RFC3986"},ec={default:Wo.RFC3986,formatters:{RFC1738:function(t){return X0.call(t,eb,"+")},RFC3986:function(t){return String(t)}},RFC1738:Wo.RFC1738,RFC3986:Wo.RFC3986},tb=ec,Uo=Object.prototype.hasOwnProperty,sr=Array.isArray,yt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),rb=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(sr(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},Eh=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},nb=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(sr(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Uo.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return sr(e)&&!sr(r)&&(i=Eh(e,n)),sr(e)&&sr(r)?(r.forEach(function(s,o){if(Uo.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,n):e.push(s)}else e[o]=s}),e):Object.keys(r).reduce(function(s,o){var a=r[o];return Uo.call(s,o)?s[o]=t(s[o],a,n):s[o]=a,s},i)},ib=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},sb=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},ob=function(e,r,n,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var u=o.charCodeAt(c);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===tb.RFC1738&&(u===40||u===41)){a+=o.charAt(c);continue}if(u<128){a=a+yt[u];continue}if(u<2048){a=a+(yt[192|u>>6]+yt[128|u&63]);continue}if(u<55296||u>=57344){a=a+(yt[224|u>>12]+yt[128|u>>6&63]+yt[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|o.charCodeAt(c)&1023),a+=yt[240|u>>18]+yt[128|u>>12&63]+yt[128|u>>6&63]+yt[128|u&63]}return a},ab=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var u=a[c],l=o[u];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(r.push({obj:o,prop:u}),n.push(l))}return rb(r),e},cb=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},ub=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},lb=function(e,r){return[].concat(e,r)},hb=function(e,r){if(sr(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},Ch={arrayToObject:Eh,assign:ib,combine:lb,compact:ab,decode:sb,encode:ob,isBuffer:ub,isRegExp:cb,maybeMap:hb,merge:nb},xh=jp,Ei=Ch,Cn=ec,fb=Object.prototype.hasOwnProperty,cu={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},Lt=Array.isArray,db=Array.prototype.push,Rh=function(t,e){db.apply(t,Lt(e)?e:[e])},pb=Date.prototype.toISOString,uu=Cn.default,Be={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ei.encode,encodeValuesOnly:!1,format:uu,formatter:Cn.formatters[uu],indices:!1,serializeDate:function(e){return pb.call(e)},skipNulls:!1,strictNullHandling:!1},bb=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},zo={},gb=function t(e,r,n,i,s,o,a,c,u,l,h,f,d,y,m,C){for(var p=e,v=C,_=0,x=!1;(v=v.get(zo))!==void 0&&!x;){var E=v.get(e);if(_+=1,typeof E<"u"){if(E===_)throw new RangeError("Cyclic object value");x=!0}typeof v.get(zo)>"u"&&(_=0)}if(typeof c=="function"?p=c(r,p):p instanceof Date?p=h(p):n==="comma"&&Lt(p)&&(p=Ei.maybeMap(p,function(P){return P instanceof Date?h(P):P})),p===null){if(s)return a&&!y?a(r,Be.encoder,m,"key",f):r;p=""}if(bb(p)||Ei.isBuffer(p)){if(a){var k=y?r:a(r,Be.encoder,m,"key",f);return[d(k)+"="+d(a(p,Be.encoder,m,"value",f))]}return[d(r)+"="+d(String(p))]}var $=[];if(typeof p>"u")return $;var j;if(n==="comma"&&Lt(p))y&&a&&(p=Ei.maybeMap(p,a)),j=[{value:p.length>0?p.join(",")||null:void 0}];else if(Lt(c))j=c;else{var T=Object.keys(p);j=u?T.sort(u):T}for(var z=i&&Lt(p)&&p.length===1?r+"[]":r,le=0;le<j.length;++le){var Z=j[le],M=typeof Z=="object"&&typeof Z.value<"u"?Z.value:p[Z];if(!(o&&M===null)){var A=Lt(p)?typeof n=="function"?n(z,Z):z:z+(l?"."+Z:"["+Z+"]");C.set(e,_);var O=xh();O.set(zo,C),Rh($,t(M,A,n,i,s,o,n==="comma"&&y&&Lt(p)?null:a,c,u,l,h,f,d,y,m,O))}}return $},vb=function(e){if(!e)return Be;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Be.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Cn.default;if(typeof e.format<"u"){if(!fb.call(Cn.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Cn.formatters[n],s=Be.filter;return(typeof e.filter=="function"||Lt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Be.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Be.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Be.charsetSentinel,delimiter:typeof e.delimiter>"u"?Be.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Be.encode,encoder:typeof e.encoder=="function"?e.encoder:Be.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Be.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Be.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Be.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Be.strictNullHandling}},yb=function(t,e){var r=t,n=vb(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Lt(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in cu?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=cu[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var l=xh(),h=0;h<i.length;++h){var f=i[h];n.skipNulls&&r[f]===null||Rh(o,gb(r[f],f,c,u,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var d=o.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""},Ur=Ch,Ta=Object.prototype.hasOwnProperty,mb=Array.isArray,Ae={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ur.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},_b=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Ih=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},wb="utf8=%26%2310003%3B",Sb="utf8=%E2%9C%93",Eb=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===Sb?u="utf-8":o[c]===wb&&(u="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var l=o[c],h=l.indexOf("]="),f=h===-1?l.indexOf("="):h+1,d,y;f===-1?(d=r.decoder(l,Ae.decoder,u,"key"),y=r.strictNullHandling?null:""):(d=r.decoder(l.slice(0,f),Ae.decoder,u,"key"),y=Ur.maybeMap(Ih(l.slice(f+1),r),function(m){return r.decoder(m,Ae.decoder,u,"value")})),y&&r.interpretNumericEntities&&u==="iso-8859-1"&&(y=_b(y)),l.indexOf("[]=")>-1&&(y=mb(y)?[y]:y),Ta.call(n,d)?n[d]=Ur.combine(n[d],y):n[d]=y}return n},Cb=function(t,e,r,n){for(var i=n?e:Ih(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!r.parseArrays&&c===""?o={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[],o[u]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},xb=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(s),u=c?s.slice(0,c.index):s,l=[];if(u){if(!n.plainObjects&&Ta.call(Object.prototype,u)&&!n.allowPrototypes)return;l.push(u)}for(var h=0;n.depth>0&&(c=a.exec(s))!==null&&h<n.depth;){if(h+=1,!n.plainObjects&&Ta.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+s.slice(c.index)+"]"),Cb(l,r,n,i)}},Rb=function(e){if(!e)return Ae;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?Ae.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Ae.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Ae.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Ae.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Ae.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ae.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Ae.comma,decoder:typeof e.decoder=="function"?e.decoder:Ae.decoder,delimiter:typeof e.delimiter=="string"||Ur.isRegExp(e.delimiter)?e.delimiter:Ae.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Ae.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Ae.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Ae.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Ae.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ae.strictNullHandling}},Ib=function(t,e){var r=Rb(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Eb(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o<s.length;++o){var a=s[o],c=xb(a,n[a],r,typeof t=="string");i=Ur.merge(i,c,r)}return r.allowSparse===!0?i:Ur.compact(i)},kb=yb,Tb=Ib,Ab=ec,Mb={formats:Ab,parse:Tb,stringify:kb},Un={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return n=>n}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function r(n){return Math.floor(n)}t.IntNumber=r,t.RegExpString=e(),function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(Un);var Nb=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(H,"__esModule",{value:!0});H.isInIFrame=H.createQrUrl=H.getFavicon=H.range=H.isBigNumber=H.ensureParsedJSONObject=H.ensureBN=H.ensureRegExpString=H.ensureIntNumber=H.ensureBuffer=H.ensureAddressString=H.ensureEvenLengthHexString=H.ensureHexString=H.isHexString=H.prepend0x=H.strip0x=H.has0xPrefix=H.hexStringFromIntNumber=H.intNumberFromHexString=H.bigIntStringFromBN=H.hexStringFromBuffer=H.hexStringToUint8Array=H.uint8ArrayToHex=H.randomBytesHex=void 0;const qt=Nb(Wi),Ob=Mb,_r=$n,it=Un,kh=/^[0-9]*$/,Th=/^[a-f0-9]*$/;function Lb(t){return Ah(crypto.getRandomValues(new Uint8Array(t)))}H.randomBytesHex=Lb;function Ah(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}H.uint8ArrayToHex=Ah;function jb(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}H.hexStringToUint8Array=jb;function Pb(t,e=!1){const r=t.toString("hex");return(0,it.HexString)(e?"0x"+r:r)}H.hexStringFromBuffer=Pb;function Db(t){return(0,it.BigIntString)(t.toString(10))}H.bigIntStringFromBN=Db;function $b(t){return(0,it.IntNumber)(new qt.default(qn(t,!1),16).toNumber())}H.intNumberFromHexString=$b;function Bb(t){return(0,it.HexString)("0x"+new qt.default(t).toString(16))}H.hexStringFromIntNumber=Bb;function tc(t){return t.startsWith("0x")||t.startsWith("0X")}H.has0xPrefix=tc;function Ki(t){return tc(t)?t.slice(2):t}H.strip0x=Ki;function Mh(t){return tc(t)?"0x"+t.slice(2):"0x"+t}H.prepend0x=Mh;function zn(t){if(typeof t!="string")return!1;const e=Ki(t).toLowerCase();return Th.test(e)}H.isHexString=zn;function Nh(t,e=!1){if(typeof t=="string"){const r=Ki(t).toLowerCase();if(Th.test(r))return(0,it.HexString)(e?"0x"+r:r)}throw _r.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}H.ensureHexString=Nh;function qn(t,e=!1){let r=Nh(t,!1);return r.length%2===1&&(r=(0,it.HexString)("0"+r)),e?(0,it.HexString)("0x"+r):r}H.ensureEvenLengthHexString=qn;function Fb(t){if(typeof t=="string"){const e=Ki(t).toLowerCase();if(zn(e)&&e.length===40)return(0,it.AddressString)(Mh(e))}throw _r.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}H.ensureAddressString=Fb;function Hb(t){if(ee.isBuffer(t))return t;if(typeof t=="string")if(zn(t)){const e=qn(t,!1);return ee.from(e,"hex")}else return ee.from(t,"utf8");throw _r.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}H.ensureBuffer=Hb;function Oh(t){if(typeof t=="number"&&Number.isInteger(t))return(0,it.IntNumber)(t);if(typeof t=="string"){if(kh.test(t))return(0,it.IntNumber)(Number(t));if(zn(t))return(0,it.IntNumber)(new qt.default(qn(t,!1),16).toNumber())}throw _r.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}H.ensureIntNumber=Oh;function Vb(t){if(t instanceof RegExp)return(0,it.RegExpString)(t.toString());throw _r.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}H.ensureRegExpString=Vb;function Wb(t){if(t!==null&&(qt.default.isBN(t)||Lh(t)))return new qt.default(t.toString(10),10);if(typeof t=="number")return new qt.default(Oh(t));if(typeof t=="string"){if(kh.test(t))return new qt.default(t,10);if(zn(t))return new qt.default(qn(t,!1),16)}throw _r.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}H.ensureBN=Wb;function Ub(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw _r.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}H.ensureParsedJSONObject=Ub;function Lh(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}H.isBigNumber=Lh;function zb(t,e){return Array.from({length:e-t},(r,n)=>t+n)}H.range=zb;function qb(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}H.getFavicon=qb;function Gb(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,Ob.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}H.createQrUrl=Gb;function Jb(){try{return window.frameElement!==null}catch{return!1}}H.isInIFrame=Jb;Object.defineProperty(on,"__esModule",{value:!0});on.Session=void 0;const lu=K0,hu=H,fu="session:id",du="session:secret",pu="session:linked";class rc{constructor(e,r,n,i){this._storage=e,this._id=r||(0,hu.randomBytesHex)(16),this._secret=n||(0,hu.randomBytesHex)(32),this._key=new lu.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(fu),n=e.getItem(pu),i=e.getItem(du);return r&&i?new rc(e,r,i,n==="1"):null}static hash(e){return new lu.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(fu,this._id),this._storage.setItem(du,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(pu,this._linked?"1":"0")}}on.Session=rc;var dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.WalletSDKRelayAbstract=dt.APP_VERSION_KEY=dt.LOCAL_STORAGE_ADDRESSES_KEY=dt.WALLET_USER_NAME_KEY=void 0;const bu=$n;dt.WALLET_USER_NAME_KEY="walletUsername";dt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";dt.APP_VERSION_KEY="AppVersion";class Qb{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw bu.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,bu.serializeError)(s,e.method);return i})}}dt.WalletSDKRelayAbstract=Qb;var Aa={exports:{}},jh=Qa.EventEmitter,qo,gu;function Zb(){if(gu)return qo;gu=1;function t(y,m){var C=Object.keys(y);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(y);m&&(p=p.filter(function(v){return Object.getOwnPropertyDescriptor(y,v).enumerable})),C.push.apply(C,p)}return C}function e(y){for(var m=1;m<arguments.length;m++){var C=arguments[m]!=null?arguments[m]:{};m%2?t(Object(C),!0).forEach(function(p){r(y,p,C[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(C)):t(Object(C)).forEach(function(p){Object.defineProperty(y,p,Object.getOwnPropertyDescriptor(C,p))})}return y}function r(y,m,C){return m=o(m),m in y?Object.defineProperty(y,m,{value:C,enumerable:!0,configurable:!0,writable:!0}):y[m]=C,y}function n(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function i(y,m){for(var C=0;C<m.length;C++){var p=m[C];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(y,o(p.key),p)}}function s(y,m,C){return m&&i(y.prototype,m),C&&i(y,C),Object.defineProperty(y,"prototype",{writable:!1}),y}function o(y){var m=a(y,"string");return typeof m=="symbol"?m:String(m)}function a(y,m){if(typeof y!="object"||y===null)return y;var C=y[Symbol.toPrimitive];if(C!==void 0){var p=C.call(y,m||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(y)}var c=Vi(),u=c.Buffer,l=ah,h=l.inspect,f=h&&h.custom||"inspect";function d(y,m,C){u.prototype.copy.call(y,m,C)}return qo=function(){function y(){n(this,y),this.head=null,this.tail=null,this.length=0}return s(y,[{key:"push",value:function(C){var p={data:C,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(C){var p={data:C,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(C){if(this.length===0)return"";for(var p=this.head,v=""+p.data;p=p.next;)v+=C+p.data;return v}},{key:"concat",value:function(C){if(this.length===0)return u.alloc(0);for(var p=u.allocUnsafe(C>>>0),v=this.head,_=0;v;)d(v.data,p,_),_+=v.data.length,v=v.next;return p}},{key:"consume",value:function(C,p){var v;return C<this.head.data.length?(v=this.head.data.slice(0,C),this.head.data=this.head.data.slice(C)):C===this.head.data.length?v=this.shift():v=p?this._getString(C):this._getBuffer(C),v}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(C){var p=this.head,v=1,_=p.data;for(C-=_.length;p=p.next;){var x=p.data,E=C>x.length?x.length:C;if(E===x.length?_+=x:_+=x.slice(0,C),C-=E,C===0){E===x.length?(++v,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=x.slice(E));break}++v}return this.length-=v,_}},{key:"_getBuffer",value:function(C){var p=u.allocUnsafe(C),v=this.head,_=1;for(v.data.copy(p),C-=v.data.length;v=v.next;){var x=v.data,E=C>x.length?x.length:C;if(x.copy(p,p.length-C,0,E),C-=E,C===0){E===x.length?(++_,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=x.slice(E));break}++_}return this.length-=_,p}},{key:f,value:function(C,p){return h(this,e(e({},p),{},{depth:0,customInspect:!1}))}}]),y}(),qo}function Yb(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ue.nextTick(Ma,this,t)):ue.nextTick(Ma,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?ue.nextTick(Ci,r):(r._writableState.errorEmitted=!0,ue.nextTick(vu,r,s)):ue.nextTick(vu,r,s):e?(ue.nextTick(Ci,r),e(s)):ue.nextTick(Ci,r)}),this)}function vu(t,e){Ma(t,e),Ci(t)}function Ci(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Kb(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ma(t,e){t.emit("error",e)}function Xb(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var Ph={destroy:Yb,undestroy:Kb,errorOrDestroy:Xb},wr={};function eg(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Dh={};function ot(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){eg(o,s);function o(a,c,u){return s.call(this,n(a,c,u))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,Dh[t]=i}function yu(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function tg(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function rg(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function ng(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}ot("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);ot("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&tg(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(rg(t," argument"))i="The ".concat(t," ").concat(n," ").concat(yu(e,"type"));else{var s=ng(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(yu(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);ot("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ot("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});ot("ERR_STREAM_PREMATURE_CLOSE","Premature close");ot("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});ot("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ot("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ot("ERR_STREAM_WRITE_AFTER_END","write after end");ot("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ot("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);ot("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");wr.codes=Dh;var ig=wr.codes.ERR_INVALID_OPT_VALUE;function sg(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function og(t,e,r,n){var i=sg(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new ig(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var $h={getHighWaterMark:og},ag=cg;function cg(t,e){if(Go("noDeprecation"))return t;var r=!1;function n(){if(!r){if(Go("throwDeprecation"))throw new Error(e);Go("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function Go(t){try{if(!F.localStorage)return!1}catch{return!1}var e=F.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var Jo,mu;function Bh(){if(mu)return Jo;mu=1,Jo=j;function t(w){var S=this;this.next=null,this.entry=null,this.finish=function(){Fe(S,w)}}var e;j.WritableState=k;var r={deprecate:ag},n=jh,i=Vi().Buffer,s=(typeof F<"u"?F:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(w){return i.from(w)}function a(w){return i.isBuffer(w)||w instanceof s}var c=Ph,u=$h,l=u.getHighWaterMark,h=wr.codes,f=h.ERR_INVALID_ARG_TYPE,d=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,C=h.ERR_STREAM_DESTROYED,p=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,x=c.errorOrDestroy;pt(j,n);function E(){}function k(w,S,N){e=e||zr(),w=w||{},typeof N!="boolean"&&(N=S instanceof e),this.objectMode=!!w.objectMode,N&&(this.objectMode=this.objectMode||!!w.writableObjectMode),this.highWaterMark=l(this,w,"writableHighWaterMark",N),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=w.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=w.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(re){P(S,re)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=w.emitClose!==!1,this.autoDestroy=!!w.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}k.prototype.getBuffer=function(){for(var S=this.bufferedRequest,N=[];S;)N.push(S),S=S.next;return N},function(){try{Object.defineProperty(k.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var $;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?($=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(S){return $.call(this,S)?!0:this!==j?!1:S&&S._writableState instanceof k}})):$=function(S){return S instanceof this};function j(w){e=e||zr();var S=this instanceof e;if(!S&&!$.call(j,this))return new j(w);this._writableState=new k(w,this,S),this.writable=!0,w&&(typeof w.write=="function"&&(this._write=w.write),typeof w.writev=="function"&&(this._writev=w.writev),typeof w.destroy=="function"&&(this._destroy=w.destroy),typeof w.final=="function"&&(this._final=w.final)),n.call(this)}j.prototype.pipe=function(){x(this,new m)};function T(w,S){var N=new v;x(w,N),ue.nextTick(S,N)}function z(w,S,N,U){var re;return N===null?re=new p:typeof N!="string"&&!S.objectMode&&(re=new f("chunk",["string","Buffer"],N)),re?(x(w,re),ue.nextTick(U,re),!1):!0}j.prototype.write=function(w,S,N){var U=this._writableState,re=!1,b=!U.objectMode&&a(w);return b&&!i.isBuffer(w)&&(w=o(w)),typeof S=="function"&&(N=S,S=null),b?S="buffer":S||(S=U.defaultEncoding),typeof N!="function"&&(N=E),U.ending?T(this,N):(b||z(this,U,w,N))&&(U.pendingcb++,re=Z(this,U,b,w,S,N)),re},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){var w=this._writableState;w.corked&&(w.corked--,!w.writing&&!w.corked&&!w.bufferProcessing&&w.bufferedRequest&&V(this,w))},j.prototype.setDefaultEncoding=function(S){if(typeof S=="string"&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new _(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function le(w,S,N){return!w.objectMode&&w.decodeStrings!==!1&&typeof S=="string"&&(S=i.from(S,N)),S}Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Z(w,S,N,U,re,b){if(!N){var g=le(S,U,re);U!==g&&(N=!0,re="buffer",U=g)}var I=S.objectMode?1:U.length;S.length+=I;var L=S.length<S.highWaterMark;if(L||(S.needDrain=!0),S.writing||S.corked){var ve=S.lastBufferedRequest;S.lastBufferedRequest={chunk:U,encoding:re,isBuf:N,callback:b,next:null},ve?ve.next=S.lastBufferedRequest:S.bufferedRequest=S.lastBufferedRequest,S.bufferedRequestCount+=1}else M(w,S,!1,I,U,re,b);return L}function M(w,S,N,U,re,b,g){S.writelen=U,S.writecb=g,S.writing=!0,S.sync=!0,S.destroyed?S.onwrite(new C("write")):N?w._writev(re,S.onwrite):w._write(re,b,S.onwrite),S.sync=!1}function A(w,S,N,U,re){--S.pendingcb,N?(ue.nextTick(re,U),ue.nextTick(de,w,S),w._writableState.errorEmitted=!0,x(w,U)):(re(U),w._writableState.errorEmitted=!0,x(w,U),de(w,S))}function O(w){w.writing=!1,w.writecb=null,w.length-=w.writelen,w.writelen=0}function P(w,S){var N=w._writableState,U=N.sync,re=N.writecb;if(typeof re!="function")throw new y;if(O(N),S)A(w,N,U,S,re);else{var b=Y(N)||w.destroyed;!b&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&V(w,N),U?ue.nextTick(B,w,N,b,re):B(w,N,b,re)}}function B(w,S,N,U){N||D(w,S),S.pendingcb--,U(),de(w,S)}function D(w,S){S.length===0&&S.needDrain&&(S.needDrain=!1,w.emit("drain"))}function V(w,S){S.bufferProcessing=!0;var N=S.bufferedRequest;if(w._writev&&N&&N.next){var U=S.bufferedRequestCount,re=new Array(U),b=S.corkedRequestsFree;b.entry=N;for(var g=0,I=!0;N;)re[g]=N,N.isBuf||(I=!1),N=N.next,g+=1;re.allBuffers=I,M(w,S,!0,S.length,re,"",b.finish),S.pendingcb++,S.lastBufferedRequest=null,b.next?(S.corkedRequestsFree=b.next,b.next=null):S.corkedRequestsFree=new t(S),S.bufferedRequestCount=0}else{for(;N;){var L=N.chunk,ve=N.encoding,K=N.callback,fe=S.objectMode?1:L.length;if(M(w,S,!1,fe,L,ve,K),N=N.next,S.bufferedRequestCount--,S.writing)break}N===null&&(S.lastBufferedRequest=null)}S.bufferedRequest=N,S.bufferProcessing=!1}j.prototype._write=function(w,S,N){N(new d("_write()"))},j.prototype._writev=null,j.prototype.end=function(w,S,N){var U=this._writableState;return typeof w=="function"?(N=w,w=null,S=null):typeof S=="function"&&(N=S,S=null),w!=null&&this.write(w,S),U.corked&&(U.corked=1,this.uncork()),U.ending||he(this,U,N),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Y(w){return w.ending&&w.length===0&&w.bufferedRequest===null&&!w.finished&&!w.writing}function G(w,S){w._final(function(N){S.pendingcb--,N&&x(w,N),S.prefinished=!0,w.emit("prefinish"),de(w,S)})}function se(w,S){!S.prefinished&&!S.finalCalled&&(typeof w._final=="function"&&!S.destroyed?(S.pendingcb++,S.finalCalled=!0,ue.nextTick(G,w,S)):(S.prefinished=!0,w.emit("prefinish")))}function de(w,S){var N=Y(S);if(N&&(se(w,S),S.pendingcb===0&&(S.finished=!0,w.emit("finish"),S.autoDestroy))){var U=w._readableState;(!U||U.autoDestroy&&U.endEmitted)&&w.destroy()}return N}function he(w,S,N){S.ending=!0,de(w,S),N&&(S.finished?ue.nextTick(N):w.once("finish",N)),S.ended=!0,w.writable=!1}function Fe(w,S,N){var U=w.entry;for(w.entry=null;U;){var re=U.callback;S.pendingcb--,re(N),U=U.next}S.corkedRequestsFree.next=w}return Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(S){this._writableState&&(this._writableState.destroyed=S)}}),j.prototype.destroy=c.destroy,j.prototype._undestroy=c.undestroy,j.prototype._destroy=function(w,S){S(w)},Jo}var Qo,_u;function zr(){if(_u)return Qo;_u=1;var t=Object.keys||function(u){var l=[];for(var h in u)l.push(h);return l};Qo=o;var e=Hh(),r=Bh();pt(o,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(u){if(!(this instanceof o))return new o(u);e.call(this,u),r.call(this,u),this.allowHalfOpen=!0,u&&(u.readable===!1&&(this.readable=!1),u.writable===!1&&(this.writable=!1),u.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||ue.nextTick(c,this)}function c(u){u.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(l){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=l,this._writableState.destroyed=l)}}),Qo}var Zo={},wu;function Su(){if(wu)return Zo;wu=1;var t=er.Buffer,e=t.isEncoding||function(p){switch(p=""+p,p&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(p){if(!p)return"utf8";for(var v;;)switch(p){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return p;default:if(v)return;p=(""+p).toLowerCase(),v=!0}}function n(p){var v=r(p);if(typeof v!="string"&&(t.isEncoding===e||!e(p)))throw new Error("Unknown encoding: "+p);return v||p}Zo.StringDecoder=i;function i(p){this.encoding=n(p);var v;switch(this.encoding){case"utf16le":this.text=h,this.end=f,v=4;break;case"utf8":this.fillLast=c,v=4;break;case"base64":this.text=d,this.end=y,v=3;break;default:this.write=m,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(v)}i.prototype.write=function(p){if(p.length===0)return"";var v,_;if(this.lastNeed){if(v=this.fillLast(p),v===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<p.length?v?v+this.text(p,_):this.text(p,_):v||""},i.prototype.end=l,i.prototype.text=u,i.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length};function s(p){return p<=127?0:p>>5===6?2:p>>4===14?3:p>>3===30?4:p>>6===2?-1:-2}function o(p,v,_){var x=v.length-1;if(x<_)return 0;var E=s(v[x]);return E>=0?(E>0&&(p.lastNeed=E-1),E):--x<_||E===-2?0:(E=s(v[x]),E>=0?(E>0&&(p.lastNeed=E-2),E):--x<_||E===-2?0:(E=s(v[x]),E>=0?(E>0&&(E===2?E=0:p.lastNeed=E-3),E):0))}function a(p,v,_){if((v[0]&192)!==128)return p.lastNeed=0,"�";if(p.lastNeed>1&&v.length>1){if((v[1]&192)!==128)return p.lastNeed=1,"�";if(p.lastNeed>2&&v.length>2&&(v[2]&192)!==128)return p.lastNeed=2,"�"}}function c(p){var v=this.lastTotal-this.lastNeed,_=a(this,p);if(_!==void 0)return _;if(this.lastNeed<=p.length)return p.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,v,0,p.length),this.lastNeed-=p.length}function u(p,v){var _=o(this,p,v);if(!this.lastNeed)return p.toString("utf8",v);this.lastTotal=_;var x=p.length-(_-this.lastNeed);return p.copy(this.lastChar,0,x),p.toString("utf8",v,x)}function l(p){var v=p&&p.length?this.write(p):"";return this.lastNeed?v+"�":v}function h(p,v){if((p.length-v)%2===0){var _=p.toString("utf16le",v);if(_){var x=_.charCodeAt(_.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",v,p.length-1)}function f(p){var v=p&&p.length?this.write(p):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,_)}return v}function d(p,v){var _=(p.length-v)%3;return _===0?p.toString("base64",v):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",v,p.length-_))}function y(p){var v=p&&p.length?this.write(p):"";return this.lastNeed?v+this.lastChar.toString("base64",0,3-this.lastNeed):v}function m(p){return p.toString(this.encoding)}function C(p){return p&&p.length?this.write(p):""}return Zo}var Eu=wr.codes.ERR_STREAM_PREMATURE_CLOSE;function ug(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function lg(){}function hg(t){return t.setHeader&&typeof t.abort=="function"}function Fh(t,e,r){if(typeof e=="function")return Fh(t,null,e);e||(e={}),r=ug(r||lg);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){i=!1,o=!0,n||r.call(t)},c=t._readableState&&t._readableState.endEmitted,u=function(){n=!1,c=!0,i||r.call(t)},l=function(y){r.call(t,y)},h=function(){var y;if(n&&!c)return(!t._readableState||!t._readableState.ended)&&(y=new Eu),r.call(t,y);if(i&&!o)return(!t._writableState||!t._writableState.ended)&&(y=new Eu),r.call(t,y)},f=function(){t.req.on("finish",a)};return hg(t)?(t.on("complete",a),t.on("abort",h),t.req?f():t.on("request",f)):i&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",u),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",h),function(){t.removeListener("complete",a),t.removeListener("abort",h),t.removeListener("request",f),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",u),t.removeListener("error",l),t.removeListener("close",h)}}var nc=Fh,Yo,Cu;function fg(){if(Cu)return Yo;Cu=1;var t;function e(_,x,E){return x=r(x),x in _?Object.defineProperty(_,x,{value:E,enumerable:!0,configurable:!0,writable:!0}):_[x]=E,_}function r(_){var x=n(_,"string");return typeof x=="symbol"?x:String(x)}function n(_,x){if(typeof _!="object"||_===null)return _;var E=_[Symbol.toPrimitive];if(E!==void 0){var k=E.call(_,x||"default");if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(_)}var i=nc,s=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),h=Symbol("stream");function f(_,x){return{value:_,done:x}}function d(_){var x=_[s];if(x!==null){var E=_[h].read();E!==null&&(_[u]=null,_[s]=null,_[o]=null,x(f(E,!1)))}}function y(_){ue.nextTick(d,_)}function m(_,x){return function(E,k){_.then(function(){if(x[c]){E(f(void 0,!0));return}x[l](E,k)},k)}}var C=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((t={get stream(){return this[h]},next:function(){var x=this,E=this[a];if(E!==null)return Promise.reject(E);if(this[c])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise(function(T,z){ue.nextTick(function(){x[a]?z(x[a]):T(f(void 0,!0))})});var k=this[u],$;if(k)$=new Promise(m(k,this));else{var j=this[h].read();if(j!==null)return Promise.resolve(f(j,!1));$=new Promise(this[l])}return this[u]=$,$}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var x=this;return new Promise(function(E,k){x[h].destroy(null,function($){if($){k($);return}E(f(void 0,!0))})})}),t),C),v=function(x){var E,k=Object.create(p,(E={},e(E,h,{value:x,writable:!0}),e(E,s,{value:null,writable:!0}),e(E,o,{value:null,writable:!0}),e(E,a,{value:null,writable:!0}),e(E,c,{value:x._readableState.endEmitted,writable:!0}),e(E,l,{value:function(j,T){var z=k[h].read();z?(k[u]=null,k[s]=null,k[o]=null,j(f(z,!1))):(k[s]=j,k[o]=T)},writable:!0}),E));return k[u]=null,i(x,function($){if($&&$.code!=="ERR_STREAM_PREMATURE_CLOSE"){var j=k[o];j!==null&&(k[u]=null,k[s]=null,k[o]=null,j($)),k[a]=$;return}var T=k[s];T!==null&&(k[u]=null,k[s]=null,k[o]=null,T(f(void 0,!0))),k[c]=!0}),x.on("readable",y.bind(null,k)),k};return Yo=v,Yo}var Ko,xu;function dg(){return xu||(xu=1,Ko=function(){throw new Error("Readable.from is not available in the browser")}),Ko}var Xo,Ru;function Hh(){if(Ru)return Xo;Ru=1,Xo=T;var t;T.ReadableState=j,Qa.EventEmitter;var e=function(g,I){return g.listeners(I).length},r=jh,n=Vi().Buffer,i=(typeof F<"u"?F:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(b){return n.from(b)}function o(b){return n.isBuffer(b)||b instanceof i}var a=ah,c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var u=Zb(),l=Ph,h=$h,f=h.getHighWaterMark,d=wr.codes,y=d.ERR_INVALID_ARG_TYPE,m=d.ERR_STREAM_PUSH_AFTER_EOF,C=d.ERR_METHOD_NOT_IMPLEMENTED,p=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,v,_,x;pt(T,r);var E=l.errorOrDestroy,k=["error","close","destroy","pause","resume"];function $(b,g,I){if(typeof b.prependListener=="function")return b.prependListener(g,I);!b._events||!b._events[g]?b.on(g,I):Array.isArray(b._events[g])?b._events[g].unshift(I):b._events[g]=[I,b._events[g]]}function j(b,g,I){t=t||zr(),b=b||{},typeof I!="boolean"&&(I=g instanceof t),this.objectMode=!!b.objectMode,I&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=f(this,b,"readableHighWaterMark",I),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=b.emitClose!==!1,this.autoDestroy=!!b.autoDestroy,this.destroyed=!1,this.defaultEncoding=b.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(v||(v=Su().StringDecoder),this.decoder=new v(b.encoding),this.encoding=b.encoding)}function T(b){if(t=t||zr(),!(this instanceof T))return new T(b);var g=this instanceof t;this._readableState=new j(b,this,g),this.readable=!0,b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy)),r.call(this)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(g){this._readableState&&(this._readableState.destroyed=g)}}),T.prototype.destroy=l.destroy,T.prototype._undestroy=l.undestroy,T.prototype._destroy=function(b,g){g(b)},T.prototype.push=function(b,g){var I=this._readableState,L;return I.objectMode?L=!0:typeof b=="string"&&(g=g||I.defaultEncoding,g!==I.encoding&&(b=n.from(b,g),g=""),L=!0),z(this,b,g,!1,L)},T.prototype.unshift=function(b){return z(this,b,null,!0,!1)};function z(b,g,I,L,ve){c("readableAddChunk",g);var K=b._readableState;if(g===null)K.reading=!1,P(b,K);else{var fe;if(ve||(fe=Z(K,g)),fe)E(b,fe);else if(K.objectMode||g&&g.length>0)if(typeof g!="string"&&!K.objectMode&&Object.getPrototypeOf(g)!==n.prototype&&(g=s(g)),L)K.endEmitted?E(b,new p):le(b,K,g,!0);else if(K.ended)E(b,new m);else{if(K.destroyed)return!1;K.reading=!1,K.decoder&&!I?(g=K.decoder.write(g),K.objectMode||g.length!==0?le(b,K,g,!1):V(b,K)):le(b,K,g,!1)}else L||(K.reading=!1,V(b,K))}return!K.ended&&(K.length<K.highWaterMark||K.length===0)}function le(b,g,I,L){g.flowing&&g.length===0&&!g.sync?(g.awaitDrain=0,b.emit("data",I)):(g.length+=g.objectMode?1:I.length,L?g.buffer.unshift(I):g.buffer.push(I),g.needReadable&&B(b)),V(b,g)}function Z(b,g){var I;return!o(g)&&typeof g!="string"&&g!==void 0&&!b.objectMode&&(I=new y("chunk",["string","Buffer","Uint8Array"],g)),I}T.prototype.isPaused=function(){return this._readableState.flowing===!1},T.prototype.setEncoding=function(b){v||(v=Su().StringDecoder);var g=new v(b);this._readableState.decoder=g,this._readableState.encoding=this._readableState.decoder.encoding;for(var I=this._readableState.buffer.head,L="";I!==null;)L+=g.write(I.data),I=I.next;return this._readableState.buffer.clear(),L!==""&&this._readableState.buffer.push(L),this._readableState.length=L.length,this};var M=1073741824;function A(b){return b>=M?b=M:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function O(b,g){return b<=0||g.length===0&&g.ended?0:g.objectMode?1:b!==b?g.flowing&&g.length?g.buffer.head.data.length:g.length:(b>g.highWaterMark&&(g.highWaterMark=A(b)),b<=g.length?b:g.ended?g.length:(g.needReadable=!0,0))}T.prototype.read=function(b){c("read",b),b=parseInt(b,10);var g=this._readableState,I=b;if(b!==0&&(g.emittedReadable=!1),b===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return c("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?N(this):B(this),null;if(b=O(b,g),b===0&&g.ended)return g.length===0&&N(this),null;var L=g.needReadable;c("need readable",L),(g.length===0||g.length-b<g.highWaterMark)&&(L=!0,c("length less than watermark",L)),g.ended||g.reading?(L=!1,c("reading or ended",L)):L&&(c("do read"),g.reading=!0,g.sync=!0,g.length===0&&(g.needReadable=!0),this._read(g.highWaterMark),g.sync=!1,g.reading||(b=O(I,g)));var ve;return b>0?ve=S(b,g):ve=null,ve===null?(g.needReadable=g.length<=g.highWaterMark,b=0):(g.length-=b,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),I!==b&&g.ended&&N(this)),ve!==null&&this.emit("data",ve),ve};function P(b,g){if(c("onEofChunk"),!g.ended){if(g.decoder){var I=g.decoder.end();I&&I.length&&(g.buffer.push(I),g.length+=g.objectMode?1:I.length)}g.ended=!0,g.sync?B(b):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,D(b)))}}function B(b){var g=b._readableState;c("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(c("emitReadable",g.flowing),g.emittedReadable=!0,ue.nextTick(D,b))}function D(b){var g=b._readableState;c("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(b.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,w(b)}function V(b,g){g.readingMore||(g.readingMore=!0,ue.nextTick(Y,b,g))}function Y(b,g){for(;!g.reading&&!g.ended&&(g.length<g.highWaterMark||g.flowing&&g.length===0);){var I=g.length;if(c("maybeReadMore read 0"),b.read(0),I===g.length)break}g.readingMore=!1}T.prototype._read=function(b){E(this,new C("_read()"))},T.prototype.pipe=function(b,g){var I=this,L=this._readableState;switch(L.pipesCount){case 0:L.pipes=b;break;case 1:L.pipes=[L.pipes,b];break;default:L.pipes.push(b);break}L.pipesCount+=1,c("pipe count=%d opts=%j",L.pipesCount,g);var ve=(!g||g.end!==!1)&&b!==ue.stdout&&b!==ue.stderr,K=ve?At:Vt;L.endEmitted?ue.nextTick(K):I.once("end",K),b.on("unpipe",fe);function fe(Mt,vt){c("onunpipe"),Mt===I&&vt&&vt.hasUnpiped===!1&&(vt.hasUnpiped=!0,li())}function At(){c("onend"),b.end()}var tr=G(I);b.on("drain",tr);var gn=!1;function li(){c("cleanup"),b.removeListener("close",Ir),b.removeListener("finish",kr),b.removeListener("drain",tr),b.removeListener("error",Rr),b.removeListener("unpipe",fe),I.removeListener("end",At),I.removeListener("end",Vt),I.removeListener("data",vn),gn=!0,L.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&tr()}I.on("data",vn);function vn(Mt){c("ondata");var vt=b.write(Mt);c("dest.write",vt),vt===!1&&((L.pipesCount===1&&L.pipes===b||L.pipesCount>1&&re(L.pipes,b)!==-1)&&!gn&&(c("false write response, pause",L.awaitDrain),L.awaitDrain++),I.pause())}function Rr(Mt){c("onerror",Mt),Vt(),b.removeListener("error",Rr),e(b,"error")===0&&E(b,Mt)}$(b,"error",Rr);function Ir(){b.removeListener("finish",kr),Vt()}b.once("close",Ir);function kr(){c("onfinish"),b.removeListener("close",Ir),Vt()}b.once("finish",kr);function Vt(){c("unpipe"),I.unpipe(b)}return b.emit("pipe",I),L.flowing||(c("pipe resume"),I.resume()),b};function G(b){return function(){var I=b._readableState;c("pipeOnDrain",I.awaitDrain),I.awaitDrain&&I.awaitDrain--,I.awaitDrain===0&&e(b,"data")&&(I.flowing=!0,w(b))}}T.prototype.unpipe=function(b){var g=this._readableState,I={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return b&&b!==g.pipes?this:(b||(b=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,b&&b.emit("unpipe",this,I),this);if(!b){var L=g.pipes,ve=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var K=0;K<ve;K++)L[K].emit("unpipe",this,{hasUnpiped:!1});return this}var fe=re(g.pipes,b);return fe===-1?this:(g.pipes.splice(fe,1),g.pipesCount-=1,g.pipesCount===1&&(g.pipes=g.pipes[0]),b.emit("unpipe",this,I),this)},T.prototype.on=function(b,g){var I=r.prototype.on.call(this,b,g),L=this._readableState;return b==="data"?(L.readableListening=this.listenerCount("readable")>0,L.flowing!==!1&&this.resume()):b==="readable"&&!L.endEmitted&&!L.readableListening&&(L.readableListening=L.needReadable=!0,L.flowing=!1,L.emittedReadable=!1,c("on readable",L.length,L.reading),L.length?B(this):L.reading||ue.nextTick(de,this)),I},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(b,g){var I=r.prototype.removeListener.call(this,b,g);return b==="readable"&&ue.nextTick(se,this),I},T.prototype.removeAllListeners=function(b){var g=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&ue.nextTick(se,this),g};function se(b){var g=b._readableState;g.readableListening=b.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:b.listenerCount("data")>0&&b.resume()}function de(b){c("readable nexttick read 0"),b.read(0)}T.prototype.resume=function(){var b=this._readableState;return b.flowing||(c("resume"),b.flowing=!b.readableListening,he(this,b)),b.paused=!1,this};function he(b,g){g.resumeScheduled||(g.resumeScheduled=!0,ue.nextTick(Fe,b,g))}function Fe(b,g){c("resume",g.reading),g.reading||b.read(0),g.resumeScheduled=!1,b.emit("resume"),w(b),g.flowing&&!g.reading&&b.read(0)}T.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function w(b){var g=b._readableState;for(c("flow",g.flowing);g.flowing&&b.read()!==null;);}T.prototype.wrap=function(b){var g=this,I=this._readableState,L=!1;b.on("end",function(){if(c("wrapped end"),I.decoder&&!I.ended){var fe=I.decoder.end();fe&&fe.length&&g.push(fe)}g.push(null)}),b.on("data",function(fe){if(c("wrapped data"),I.decoder&&(fe=I.decoder.write(fe)),!(I.objectMode&&fe==null)&&!(!I.objectMode&&(!fe||!fe.length))){var At=g.push(fe);At||(L=!0,b.pause())}});for(var ve in b)this[ve]===void 0&&typeof b[ve]=="function"&&(this[ve]=function(At){return function(){return b[At].apply(b,arguments)}}(ve));for(var K=0;K<k.length;K++)b.on(k[K],this.emit.bind(this,k[K]));return this._read=function(fe){c("wrapped _read",fe),L&&(L=!1,b.resume())},this},typeof Symbol=="function"&&(T.prototype[Symbol.asyncIterator]=function(){return _===void 0&&(_=fg()),_(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(g){this._readableState&&(this._readableState.flowing=g)}}),T._fromList=S,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function S(b,g){if(g.length===0)return null;var I;return g.objectMode?I=g.buffer.shift():!b||b>=g.length?(g.decoder?I=g.buffer.join(""):g.buffer.length===1?I=g.buffer.first():I=g.buffer.concat(g.length),g.buffer.clear()):I=g.buffer.consume(b,g.decoder),I}function N(b){var g=b._readableState;c("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,ue.nextTick(U,g,b))}function U(b,g){if(c("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,g.readable=!1,g.emit("end"),b.autoDestroy)){var I=g._writableState;(!I||I.autoDestroy&&I.finished)&&g.destroy()}}typeof Symbol=="function"&&(T.from=function(b,g){return x===void 0&&(x=dg()),x(T,b,g)});function re(b,g){for(var I=0,L=b.length;I<L;I++)if(b[I]===g)return I;return-1}return Xo}var Vh=$t,Xi=wr.codes,pg=Xi.ERR_METHOD_NOT_IMPLEMENTED,bg=Xi.ERR_MULTIPLE_CALLBACK,gg=Xi.ERR_TRANSFORM_ALREADY_TRANSFORMING,vg=Xi.ERR_TRANSFORM_WITH_LENGTH_0,es=zr();pt($t,es);function yg(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new bg);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function $t(t){if(!(this instanceof $t))return new $t(t);es.call(this,t),this._transformState={afterTransform:yg.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",mg)}function mg(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){Iu(t,e,r)}):Iu(this,null,null)}$t.prototype.push=function(t,e){return this._transformState.needTransform=!1,es.prototype.push.call(this,t,e)};$t.prototype._transform=function(t,e,r){r(new pg("_transform()"))};$t.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};$t.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};$t.prototype._destroy=function(t,e){es.prototype._destroy.call(this,t,function(r){e(r)})};function Iu(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new vg;if(t._transformState.transforming)throw new gg;return t.push(null)}var _g=Nn,Wh=Vh;pt(Nn,Wh);function Nn(t){if(!(this instanceof Nn))return new Nn(t);Wh.call(this,t)}Nn.prototype._transform=function(t,e,r){r(null,t)};var ea;function wg(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Uh=wr.codes,Sg=Uh.ERR_MISSING_ARGS,Eg=Uh.ERR_STREAM_DESTROYED;function ku(t){if(t)throw t}function Cg(t){return t.setHeader&&typeof t.abort=="function"}function xg(t,e,r,n){n=wg(n);var i=!1;t.on("close",function(){i=!0}),ea===void 0&&(ea=nc),ea(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,Cg(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(o||new Eg("pipe"))}}}function Tu(t){t()}function Rg(t,e){return t.pipe(e)}function Ig(t){return!t.length||typeof t[t.length-1]!="function"?ku:t.pop()}function kg(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=Ig(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Sg("streams");var i,s=e.map(function(o,a){var c=a<e.length-1,u=a>0;return xg(o,c,u,function(l){i||(i=l),l&&s.forEach(Tu),!c&&(s.forEach(Tu),n(i))})});return e.reduce(Rg)}var Tg=kg;(function(t,e){e=t.exports=Hh(),e.Stream=e,e.Readable=e,e.Writable=Bh(),e.Duplex=zr(),e.Transform=Vh,e.PassThrough=_g,e.finished=nc,e.pipeline=Tg})(Aa,Aa.exports);var zh=Aa.exports;const{Transform:Ag}=zh;var Mg=t=>class qh extends Ag{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!ee.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return ee.isBuffer(r)||(r=ee.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new qh(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Ng}=zh;var Og=t=>class Gh extends Ng{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!ee.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return ee.isBuffer(r)||(r=ee.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Gh(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Lg=Mg,jg=Og;var Pg=function(t){const e=Lg(t),r=jg(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Jh={};const Au=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Jh.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let f=l^(i<<1|s>>>31),d=h^(s<<1|i>>>31);const y=t[0]^f,m=t[1]^d,C=t[10]^f,p=t[11]^d,v=t[20]^f,_=t[21]^d,x=t[30]^f,E=t[31]^d,k=t[40]^f,$=t[41]^d;f=r^(o<<1|a>>>31),d=n^(a<<1|o>>>31);const j=t[2]^f,T=t[3]^d,z=t[12]^f,le=t[13]^d,Z=t[22]^f,M=t[23]^d,A=t[32]^f,O=t[33]^d,P=t[42]^f,B=t[43]^d;f=i^(c<<1|u>>>31),d=s^(u<<1|c>>>31);const D=t[4]^f,V=t[5]^d,Y=t[14]^f,G=t[15]^d,se=t[24]^f,de=t[25]^d,he=t[34]^f,Fe=t[35]^d,w=t[44]^f,S=t[45]^d;f=o^(l<<1|h>>>31),d=a^(h<<1|l>>>31);const N=t[6]^f,U=t[7]^d,re=t[16]^f,b=t[17]^d,g=t[26]^f,I=t[27]^d,L=t[36]^f,ve=t[37]^d,K=t[46]^f,fe=t[47]^d;f=c^(r<<1|n>>>31),d=u^(n<<1|r>>>31);const At=t[8]^f,tr=t[9]^d,gn=t[18]^f,li=t[19]^d,vn=t[28]^f,Rr=t[29]^d,Ir=t[38]^f,kr=t[39]^d,Vt=t[48]^f,Mt=t[49]^d,vt=y,Gs=m,Js=p<<4|C>>>28,Qs=C<<4|p>>>28,Zs=v<<3|_>>>29,Ys=_<<3|v>>>29,Ks=E<<9|x>>>23,Xs=x<<9|E>>>23,eo=k<<18|$>>>14,to=$<<18|k>>>14,ro=j<<1|T>>>31,no=T<<1|j>>>31,io=le<<12|z>>>20,so=z<<12|le>>>20,oo=Z<<10|M>>>22,ao=M<<10|Z>>>22,co=O<<13|A>>>19,uo=A<<13|O>>>19,lo=P<<2|B>>>30,ho=B<<2|P>>>30,fo=V<<30|D>>>2,po=D<<30|V>>>2,bo=Y<<6|G>>>26,go=G<<6|Y>>>26,vo=de<<11|se>>>21,yo=se<<11|de>>>21,mo=he<<15|Fe>>>17,_o=Fe<<15|he>>>17,wo=S<<29|w>>>3,So=w<<29|S>>>3,Eo=N<<28|U>>>4,Co=U<<28|N>>>4,xo=b<<23|re>>>9,Ro=re<<23|b>>>9,Io=g<<25|I>>>7,ko=I<<25|g>>>7,To=L<<21|ve>>>11,Ao=ve<<21|L>>>11,Mo=fe<<24|K>>>8,No=K<<24|fe>>>8,Oo=At<<27|tr>>>5,Lo=tr<<27|At>>>5,jo=gn<<20|li>>>12,Po=li<<20|gn>>>12,Do=Rr<<7|vn>>>25,$o=vn<<7|Rr>>>25,Bo=Ir<<8|kr>>>24,Fo=kr<<8|Ir>>>24,Ho=Vt<<14|Mt>>>18,Vo=Mt<<14|Vt>>>18;t[0]=vt^~io&vo,t[1]=Gs^~so&yo,t[10]=Eo^~jo&Zs,t[11]=Co^~Po&Ys,t[20]=ro^~bo&Io,t[21]=no^~go&ko,t[30]=Oo^~Js&oo,t[31]=Lo^~Qs&ao,t[40]=fo^~xo&Do,t[41]=po^~Ro&$o,t[2]=io^~vo&To,t[3]=so^~yo&Ao,t[12]=jo^~Zs&co,t[13]=Po^~Ys&uo,t[22]=bo^~Io&Bo,t[23]=go^~ko&Fo,t[32]=Js^~oo&mo,t[33]=Qs^~ao&_o,t[42]=xo^~Do&Ks,t[43]=Ro^~$o&Xs,t[4]=vo^~To&Ho,t[5]=yo^~Ao&Vo,t[14]=Zs^~co&wo,t[15]=Ys^~uo&So,t[24]=Io^~Bo&eo,t[25]=ko^~Fo&to,t[34]=oo^~mo&Mo,t[35]=ao^~_o&No,t[44]=Do^~Ks&lo,t[45]=$o^~Xs&ho,t[6]=To^~Ho&vt,t[7]=Ao^~Vo&Gs,t[16]=co^~wo&Eo,t[17]=uo^~So&Co,t[26]=Bo^~eo&ro,t[27]=Fo^~to&no,t[36]=mo^~Mo&Oo,t[37]=_o^~No&Lo,t[46]=Ks^~lo&fo,t[47]=Xs^~ho&po,t[8]=Ho^~vt&io,t[9]=Vo^~Gs&so,t[18]=wo^~Eo&jo,t[19]=So^~Co&Po,t[28]=eo^~ro&bo,t[29]=to^~no&go,t[38]=Mo^~Oo&Js,t[39]=No^~Lo&Qs,t[48]=lo^~fo&xo,t[49]=ho^~po&Ro,t[0]^=Au[e*2],t[1]^=Au[e*2+1]}};const Ai=Jh;function cn(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}cn.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};cn.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Ai.p1600(this.state),this.count=0)};cn.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&Ai.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Ai.p1600(this.state),this.count=0,this.squeezing=!0};cn.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=ee.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Ai.p1600(this.state),this.count=0);return e};cn.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var Dg=cn,$g=Pg(Dg);const Bg=$g,Fg=Wi;function Qh(t){return ee.allocUnsafe(t).fill(0)}function Zh(t,e,r){const n=Qh(e);return t=ts(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function Hg(t,e){return Zh(t,e,!0)}function ts(t){if(!ee.isBuffer(t))if(Array.isArray(t))t=ee.from(t);else if(typeof t=="string")Yh(t)?t=ee.from(Ug(Kh(t)),"hex"):t=ee.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=ee.allocUnsafe(0);else if(Fg.isBN(t))t=t.toArrayLike(ee);else if(t.toArray)t=ee.from(t.toArray());else throw new Error("invalid type");return t}function Vg(t){return t=ts(t),"0x"+t.toString("hex")}function Wg(t,e){return t=ts(t),e||(e=256),Bg("keccak"+e).update(t).digest()}function Ug(t){return t.length%2?"0"+t:t}function Yh(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Kh(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var Xh={zeros:Qh,setLength:Zh,setLengthRight:Hg,isHexString:Yh,stripHexPrefix:Kh,toBuffer:ts,bufferToHex:Vg,keccak:Wg};const pr=Xh,hr=Wi;function ef(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function $r(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Mu(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function tf(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function or(t){var e=typeof t;if(e==="string")return pr.isHexString(t)?new hr(pr.stripHexPrefix(t),16):new hr(t,10);if(e==="number")return new hr(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function St(t,e){var r,n,i,s;if(t==="address")return St("uint160",or(e));if(t==="bool")return St("uint8",e?1:0);if(t==="string")return St("bytes",new ee(e,"utf8"));if(qg(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=tf(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(St(t,e[s]));if(r==="dynamic"){var o=St("uint256",e.length);i.unshift(o)}return ee.concat(i)}else{if(t==="bytes")return e=new ee(e),i=ee.concat([St("uint256",e.length),e]),e.length%32!==0&&(i=ee.concat([i,pr.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=$r(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return pr.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=$r(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=or(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(ee,"be",32)}else if(t.startsWith("int")){if(r=$r(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=or(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(ee,"be",32)}else if(t.startsWith("ufixed")){if(r=Mu(t),n=or(e),n<0)throw new Error("Supplied ufixed is negative");return St("uint256",n.mul(new hr(2).pow(new hr(r[1]))))}else if(t.startsWith("fixed"))return r=Mu(t),St("int256",or(e).mul(new hr(2).pow(new hr(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function zg(t){return t==="string"||t==="bytes"||tf(t)==="dynamic"}function qg(t){return t.lastIndexOf("]")===t.length-1}function Gg(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=ef(t[s]),a=e[s],c=St(o,a);zg(o)?(r.push(St("uint256",i)),n.push(c),i+=c.length):r.push(c)}return ee.concat(r.concat(n))}function rf(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<t.length;s++){var o=ef(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new ee(a,"utf8"));else if(o==="bool")i.push(new ee(a?"01":"00","hex"));else if(o==="address")i.push(pr.setLength(a,20));else if(o.startsWith("bytes")){if(r=$r(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(pr.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=$r(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=or(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(ee,"be",r/8))}else if(o.startsWith("int")){if(r=$r(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=or(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(ee,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return ee.concat(i)}function Jg(t,e){return pr.keccak(rf(t,e))}var Qg={rawEncode:Gg,solidityPack:rf,soliditySHA3:Jg};const lt=Xh,xn=Qg,nf={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"]},ta={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,c,u)=>{if(r[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":lt.keccak(this.encodeData(c,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",lt.keccak(u)];if(c==="string")return typeof u=="string"&&(u=ee.from(u,"utf8")),["bytes32",lt.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const l=c.slice(0,c.lastIndexOf("[")),h=u.map(f=>o(a,l,f));return["bytes32",lt.keccak(xn.rawEncode(h.map(([f])=>f),h.map(([,f])=>f)))]}return[c,u]};for(const a of r[t]){const[c,u]=o(a.name,a.type,e[a.name]);i.push(c),s.push(u)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=lt.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=ee.from(a,"utf8")),a=lt.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=lt.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return xn.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return lt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return lt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in nf.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[ee.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),lt.keccak(ee.concat(n))}};var Zg={TYPED_MESSAGE_SCHEMA:nf,TypedDataUtils:ta,hashForSignTypedDataLegacy:function(t){return Yg(t.data)},hashForSignTypedData_v3:function(t){return ta.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return ta.hash(t.data)}};function Yg(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?lt.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return xn.soliditySHA3(["bytes32","bytes32"],[xn.soliditySHA3(new Array(t.length).fill("string"),i),xn.soliditySHA3(n,r)])}var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.filterFromParam=qr.FilterPolyfill=void 0;const Lr=Un,He=H,Kg=5*60*1e3,ar={jsonrpc:"2.0",id:0};class Xg{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,Lr.IntNumber)(1),this.provider=e}async newFilter(e){const r=sf(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,He.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,He.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,He.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,He.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,He.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(hi())}async getFilterLogs(e){const r=(0,He.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},ar),{method:"eth_getLogs",params:[Nu(n)]})):hi()}makeFilterId(){return(0,Lr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.log(`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){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return hi();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return fi();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},ar),{method:"eth_getLogs",params:[Nu(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(u=>(0,He.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const u=(0,Lr.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return hi();const n=await this.getCurrentBlockHeight();if(r>n)return fi();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,He.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Lr.IntNumber)(o))))).filter(o=>!!o),s=(0,Lr.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},ar),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(fi())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Kg);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},ar),{method:"eth_blockNumber",params:[]}));return(0,He.intNumberFromHexString)((0,He.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},ar),{method:"eth_getBlockByNumber",params:[(0,He.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,He.ensureHexString)(r.result.hash):null}}qr.FilterPolyfill=Xg;function sf(t){return{fromBlock:Ou(t.fromBlock),toBlock:Ou(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}qr.filterFromParam=sf;function Nu(t){const e={fromBlock:Lu(t.fromBlock),toBlock:Lu(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Ou(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Lr.IntNumber)(0);if((0,He.isHexString)(t))return(0,He.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Lu(t){return t==="latest"?t:(0,He.hexStringFromIntNumber)(t)}function hi(){return Object.assign(Object.assign({},ar),{error:{code:-32e3,message:"filter not found"}})}function fi(){return Object.assign(Object.assign({},ar),{result:[]})}var of={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(of);var rs={},af={},ns={},ic=ev;function ev(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const ju=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let u=1;u<arguments.length;u++)c[u-1]=arguments[u];o?(c.unshift(o),s(c)):i(c)}else o?s(o):i(a)}):n.push(function(o){if(e.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];i(a)}else i(o)}),t.apply(this,n)})};var tv=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):ju(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?ju(s,e):s}return n},Gn={},rv=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.BaseBlockTracker=void 0;const nv=rv(yr),iv=1e3,sv=(t,e)=>t+e,Pu=["sync","latest"];class ov extends nv.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*iv,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(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){Pu.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 Pu.map(e=>this.listenerCount(e)).reduce(sv)}_newPotentialLatest(e){const r=this._currentBlock;r&&Du(e)<=Du(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,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}}Gn.BaseBlockTracker=ov;function Du(t){return Number.parseInt(t,16)}var cf={},uf={},Pe={};class lf extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function av(t){return st(t)&&typeof t[Symbol.iterator]=="function"}function st(t){return typeof t=="object"&&t!=null}function $u(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function ke(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function cv(t){const{done:e,value:r}=t.next();return e?void 0:r}function uv(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${ke(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*Na(t,e,r,n){av(t)||(t=[t]);for(const i of t){const s=uv(i,e,r,n);s&&(yield s)}}function*sc(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&st(e.schema)&&st(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,a))u.explanation=r.message,c="not_valid",yield[u,void 0];for(let[u,l,h]of e.entries(t,a)){const f=sc(l,h,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):s&&(l=d[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):st(t)&&(l!==void 0||u in t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,a))u.explanation=r.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class xe{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return Na(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return Na(l,u,this,c)}:this.refiner=()=>[]}assert(e,r){return hf(e,this,r)}create(e,r){return ff(e,this,r)}is(e){return oc(e,this)}mask(e,r){return df(e,this,r)}validate(e,r={}){return un(e,this,r)}}function hf(t,e,r){const n=un(t,e,{message:r});if(n[0])throw n[0]}function ff(t,e,r){const n=un(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function df(t,e,r){const n=un(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function oc(t,e){return!un(t,e)[0]}function un(t,e,r={}){const n=sc(t,e,r),i=cv(n);return i[0]?[new lf(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function lv(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?cc(n):Jn(n)}function Ge(t,e){return new xe({type:t,schema:null,validator:e})}function hv(t,e){return new xe({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function fv(t){return new xe({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function dv(t){let e;return new xe({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function pv(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return cc(n);default:return Jn(n)}}function bv(t){const e=t instanceof xe?{...t.schema}:{...t};for(const r in e)e[r]=pf(e[r]);return Jn(e)}function gv(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return Jn(n)}function vv(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ge(t,e)}function yv(){return Ge("any",()=>!0)}function mv(t){return new xe({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${ke(e)}`}})}function _v(){return Ge("bigint",t=>typeof t=="bigint")}function wv(){return Ge("boolean",t=>typeof t=="boolean")}function Sv(){return Ge("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${ke(t)}`)}function Ev(t){const e={},r=t.map(n=>ke(n)).join();for(const n of t)e[n]=n;return new xe({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${ke(n)}`}})}function Cv(){return Ge("func",t=>typeof t=="function"||`Expected a function, but received: ${ke(t)}`)}function xv(t){return Ge("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${ke(e)}`)}function Rv(){return Ge("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${ke(t)}`)}function Iv(t){return new xe({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function kv(t){const e=ke(t),r=typeof t;return new xe({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${ke(n)}`}})}function Tv(t,e){return new xe({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${ke(r)}`}})}function ac(){return Ge("never",()=>!1)}function Av(t){return new xe({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function Mv(){return Ge("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${ke(t)}`)}function Jn(t){const e=t?Object.keys(t):[],r=ac();return new xe({type:"object",schema:t||null,*entries(n){if(t&&st(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return st(n)||`Expected an object, but received: ${ke(n)}`},coercer(n){return st(n)?{...n}:n}})}function pf(t){return new xe({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Nv(t,e){return new xe({type:"record",schema:null,*entries(r){if(st(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return st(r)||`Expected an object, but received: ${ke(r)}`}})}function Ov(){return Ge("regexp",t=>t instanceof RegExp)}function Lv(t){return new xe({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${ke(e)}`}})}function bf(){return Ge("string",t=>typeof t=="string"||`Expected a string, but received: ${ke(t)}`)}function jv(t){const e=ac();return new xe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${ke(r)}`}})}function cc(t){const e=Object.keys(t);return new xe({type:"type",schema:t,*entries(r){if(st(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return st(r)||`Expected an object, but received: ${ke(r)}`},coercer(r){return st(r)?{...r}:r}})}function Pv(t){const e=t.map(r=>r.type).join(" | ");return new xe({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=sc(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${ke(r)}`,...i]}})}function gf(){return Ge("unknown",()=>!0)}function uc(t,e,r){return new xe({...t,coercer:(n,i)=>oc(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function Dv(t,e,r={}){return uc(t,gf(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&$u(n)&&$u(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function $v(t){return uc(t,bf(),e=>e.trim())}function Bv(t){return Sr(t,"empty",e=>{const r=vf(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function vf(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Fv(t,e,r={}){const{exclusive:n}=r;return Sr(t,"max",i=>n?i<e:i<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Hv(t,e,r={}){const{exclusive:n}=r;return Sr(t,"min",i=>n?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Vv(t){return Sr(t,"nonempty",e=>vf(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function Wv(t,e){return Sr(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function Uv(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Sr(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Sr(t,e,r){return new xe({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=Na(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const zv=Object.freeze(Object.defineProperty({__proto__:null,Struct:xe,StructError:lf,any:yv,array:mv,assert:hf,assign:lv,bigint:_v,boolean:wv,coerce:uc,create:ff,date:Sv,defaulted:Dv,define:Ge,deprecated:hv,dynamic:fv,empty:Bv,enums:Ev,func:Cv,instance:xv,integer:Rv,intersection:Iv,is:oc,lazy:dv,literal:kv,map:Tv,mask:df,max:Fv,min:Hv,never:ac,nonempty:Vv,nullable:Av,number:Mv,object:Jn,omit:pv,optional:pf,partial:bv,pattern:Wv,pick:gv,record:Nv,refine:Sr,regexp:Ov,set:Lv,size:Uv,string:bf,struct:vv,trimmed:$v,tuple:jv,type:cc,union:Pv,unknown:gf,validate:un},Symbol.toStringTag,{value:"Module"})),Er=nn(zv);Object.defineProperty(Pe,"__esModule",{value:!0});Pe.assertExhaustive=Pe.assertStruct=Pe.assert=Pe.AssertionError=void 0;const qv=Er;function Gv(t){return typeof t=="object"&&t!==null&&"message"in t}function Jv(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function Qv(t){const e=Gv(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function yf(t,e){return Jv(t)?new t({message:e}):t({message:e})}class lc extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}Pe.AssertionError=lc;function Zv(t,e="Assertion failed.",r=lc){if(!t)throw e instanceof Error?e:yf(r,e)}Pe.assert=Zv;function Yv(t,e,r="Assertion failed",n=lc){try{(0,qv.assert)(t,e)}catch(i){throw yf(n,`${r}: ${Qv(i)}.`)}}Pe.assertStruct=Yv;function Kv(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}Pe.assertExhaustive=Kv;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.base64=void 0;const Xv=Er,ey=Pe,ty=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,ey.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Xv.pattern)(t,a)};Qn.base64=ty;var oe={},Zn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Er,r=Pe;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=n;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=a;function c(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=c})(Zn);Object.defineProperty(oe,"__esModule",{value:!0});oe.createDataView=oe.concatBytes=oe.valueToBytes=oe.stringToBytes=oe.numberToBytes=oe.signedBigIntToBytes=oe.bigIntToBytes=oe.hexToBytes=oe.bytesToString=oe.bytesToNumber=oe.bytesToSignedBigInt=oe.bytesToBigInt=oe.bytesToHex=oe.assertIsBytes=oe.isBytes=void 0;const Qe=Pe,Oa=Zn,Bu=48,Fu=58,Hu=87;function ry(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const ny=ry();function hc(t){return t instanceof Uint8Array}oe.isBytes=hc;function ln(t){(0,Qe.assert)(hc(t),"Value must be a Uint8Array.")}oe.assertIsBytes=ln;function mf(t){if(ln(t),t.length===0)return"0x";const e=ny(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,Oa.add0x)(r.join(""))}oe.bytesToHex=mf;function _f(t){ln(t);const e=mf(t);return BigInt(e)}oe.bytesToBigInt=_f;function iy(t){ln(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(t.length*8,e)}oe.bytesToSignedBigInt=iy;function sy(t){ln(t);const e=_f(t);return(0,Qe.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}oe.bytesToNumber=sy;function oy(t){return ln(t),new TextDecoder().decode(t)}oe.bytesToString=oy;function is(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,Oa.assertIsHexString)(t);const r=(0,Oa.remove0x)(t).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const o=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),c=o-(o<Fu?Bu:Hu),u=a-(a<Fu?Bu:Hu);i[s]=c*16+u}return i}oe.hexToBytes=is;function wf(t){(0,Qe.assert)(typeof t=="bigint","Value must be a bigint."),(0,Qe.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return is(e)}oe.bigIntToBytes=wf;function ay(t,e){(0,Qe.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function cy(t,e){(0,Qe.assert)(typeof t=="bigint","Value must be a bigint."),(0,Qe.assert)(typeof e=="number","Byte length must be a number."),(0,Qe.assert)(e>0,"Byte length must be greater than 0."),(0,Qe.assert)(ay(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}oe.signedBigIntToBytes=cy;function Sf(t){(0,Qe.assert)(typeof t=="number","Value must be a number."),(0,Qe.assert)(t>=0,"Value must be a non-negative number."),(0,Qe.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return is(e)}oe.numberToBytes=Sf;function Ef(t){return(0,Qe.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}oe.stringToBytes=Ef;function Cf(t){if(typeof t=="bigint")return wf(t);if(typeof t=="number")return Sf(t);if(typeof t=="string")return t.startsWith("0x")?is(t):Ef(t);if(hc(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}oe.valueToBytes=Cf;function uy(t){const e=new Array(t.length);let r=0;for(let i=0;i<t.length;i++){const s=Cf(t[i]);e[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n}oe.concatBytes=uy;function ly(t){if(typeof ee<"u"&&t instanceof ee){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}oe.createDataView=ly;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.ChecksumStruct=void 0;const Vu=Er,hy=Qn;ss.ChecksumStruct=(0,Vu.size)((0,hy.base64)((0,Vu.string)(),{paddingRequired:!0}),44,44);var xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.createHex=xt.createBytes=xt.createBigInt=xt.createNumber=void 0;const _e=Er,fy=Pe,xf=oe,os=Zn,Rf=(0,_e.union)([(0,_e.number)(),(0,_e.bigint)(),(0,_e.string)(),os.StrictHexStruct]),dy=(0,_e.coerce)((0,_e.number)(),Rf,Number),py=(0,_e.coerce)((0,_e.bigint)(),Rf,BigInt);(0,_e.union)([os.StrictHexStruct,(0,_e.instance)(Uint8Array)]);const by=(0,_e.coerce)((0,_e.instance)(Uint8Array),(0,_e.union)([os.StrictHexStruct]),xf.hexToBytes),gy=(0,_e.coerce)(os.StrictHexStruct,(0,_e.instance)(Uint8Array),xf.bytesToHex);function vy(t){try{const e=(0,_e.create)(t,dy);return(0,fy.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof _e.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}xt.createNumber=vy;function yy(t){try{return(0,_e.create)(t,py)}catch(e){throw e instanceof _e.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}xt.createBigInt=yy;function my(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,_e.create)(t,by)}catch(e){throw e instanceof _e.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}xt.createBytes=my;function _y(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,_e.create)(t,gy)}catch(e){throw e instanceof _e.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}xt.createHex=_y;var Gr={},If=F&&F.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ve=F&&F.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ct,mt;Object.defineProperty(Gr,"__esModule",{value:!0});Gr.FrozenSet=Gr.FrozenMap=void 0;class fc{constructor(e){ct.set(this,void 0),If(this,ct,new Map(e),"f"),Object.freeze(this)}get size(){return Ve(this,ct,"f").size}[(ct=new WeakMap,Symbol.iterator)](){return Ve(this,ct,"f")[Symbol.iterator]()}entries(){return Ve(this,ct,"f").entries()}forEach(e,r){return Ve(this,ct,"f").forEach((n,i,s)=>e.call(r,n,i,this))}get(e){return Ve(this,ct,"f").get(e)}has(e){return Ve(this,ct,"f").has(e)}keys(){return Ve(this,ct,"f").keys()}values(){return Ve(this,ct,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}Gr.FrozenMap=fc;class dc{constructor(e){mt.set(this,void 0),If(this,mt,new Set(e),"f"),Object.freeze(this)}get size(){return Ve(this,mt,"f").size}[(mt=new WeakMap,Symbol.iterator)](){return Ve(this,mt,"f")[Symbol.iterator]()}entries(){return Ve(this,mt,"f").entries()}forEach(e,r){return Ve(this,mt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Ve(this,mt,"f").has(e)}keys(){return Ve(this,mt,"f").keys()}values(){return Ve(this,mt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}Gr.FrozenSet=dc;Object.freeze(fc);Object.freeze(fc.prototype);Object.freeze(dc);Object.freeze(dc.prototype);var kf={},pc={};(function(t){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;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function r(u){return u==null}t.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=n;const i=(u,l)=>Object.hasOwnProperty.call(u,l);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let l=u;for(;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(u)===l}catch{return!1}}t.isPlainObject=s;function o(u){return u.charCodeAt(0)<=127}t.isASCII=o;function a(u){var l;return u.split("").reduce((f,d)=>o(d)?f+1:f+2,0)+((l=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&l!==void 0?l:[]).length}t.calculateStringSize=a;function c(u){return u.toString().length}t.calculateNumberSize=c})(pc);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Er,r=Pe,n=pc;t.JsonStruct=(0,e.define)("Json",E=>{const[k]=x(E,!0);return k?!0:"Expected a valid JSON-serializable value"});function i(E){return(0,e.is)(E,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(E){return(0,e.is)(E,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(E,k){(0,r.assertStruct)(E,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",k)}t.assertIsJsonRpcNotification=o;function a(E){return(0,e.is)(E,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(E,k){(0,r.assertStruct)(E,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",k)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function u(E){return(0,e.is)(E,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=u;function l(E,k){(0,r.assertStruct)(E,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",k)}t.assertIsPendingJsonRpcResponse=l;function h(E){return(0,e.is)(E,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=h;function f(E,k){(0,r.assertStruct)(E,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",k)}t.assertIsJsonRpcResponse=f;function d(E){return(0,e.is)(E,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=d;function y(E,k){(0,r.assertStruct)(E,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",k)}t.assertIsJsonRpcSuccess=y;function m(E){return(0,e.is)(E,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=m;function C(E,k){(0,r.assertStruct)(E,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",k)}t.assertIsJsonRpcFailure=C;function p(E){return(0,e.is)(E,t.JsonRpcErrorStruct)}t.isJsonRpcError=p;function v(E,k){(0,r.assertStruct)(E,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",k)}t.assertIsJsonRpcError=v;function _(E){const{permitEmptyString:k,permitFractions:$,permitNull:j}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},E);return z=>!!(typeof z=="number"&&($||Number.isInteger(z))||typeof z=="string"&&(k||z.length>0)||j&&z===null)}t.getJsonRpcIdValidator=_;function x(E,k=!1){const $=new Set;function j(T,z){if(T===void 0)return[!1,0];if(T===null)return[!0,z?0:n.JsonSize.Null];const le=typeof T;try{if(le==="function")return[!1,0];if(le==="string"||T instanceof String)return[!0,z?0:(0,n.calculateStringSize)(T)+n.JsonSize.Quote*2];if(le==="boolean"||T instanceof Boolean)return z?[!0,0]:[!0,T==!0?n.JsonSize.True:n.JsonSize.False];if(le==="number"||T instanceof Number)return z?[!0,0]:[!0,(0,n.calculateNumberSize)(T)];if(T instanceof Date)return z?[!0,0]:[!0,isNaN(T.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(T)&&!Array.isArray(T))return[!1,0];if($.has(T))return[!1,0];$.add(T);try{return[!0,Object.entries(T).reduce((Z,[M,A],O,P)=>{let[B,D]=j(A,z);if(!B)throw new Error("JSON validation did not pass. Validation process stopped.");if($.delete(T),z)return 0;const V=Array.isArray(T)?0:M.length+n.JsonSize.Comma+n.JsonSize.Colon*2,Y=O<P.length-1?n.JsonSize.Comma:0;return Z+V+D+Y},z?0:n.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return j(E,k)}t.validateJsonAndGetSize=x})(kf);var Jr={},La={exports:{}},ra,Wu;function wy(){if(Wu)return ra;Wu=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;ra=function(l,h){h=h||{};var f=typeof l;if(f==="string"&&l.length>0)return o(l);if(f==="number"&&isFinite(l))return h.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(h){var f=parseFloat(h[1]),d=(h[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*n;case"hours":case"hour":case"hrs":case"hr":case"h":return f*r;case"minutes":case"minute":case"mins":case"min":case"m":return f*e;case"seconds":case"second":case"secs":case"sec":case"s":return f*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var h=Math.abs(l);return h>=n?Math.round(l/n)+"d":h>=r?Math.round(l/r)+"h":h>=e?Math.round(l/e)+"m":h>=t?Math.round(l/t)+"s":l+"ms"}function c(l){var h=Math.abs(l);return h>=n?u(l,h,n,"day"):h>=r?u(l,h,r,"hour"):h>=e?u(l,h,e,"minute"):h>=t?u(l,h,t,"second"):l+" ms"}function u(l,h,f,d){var y=h>=f*1.5;return Math.round(l/f)+" "+d+(y?"s":"")}return ra}function Sy(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=wy(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let h=0;for(let f=0;f<l.length;f++)h=(h<<5)-h+l.charCodeAt(f),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(l){let h,f=null,d,y;function m(...C){if(!m.enabled)return;const p=m,v=Number(new Date),_=v-(h||v);p.diff=_,p.prev=h,p.curr=v,h=v,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let x=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(k,$)=>{if(k==="%%")return"%";x++;const j=r.formatters[$];if(typeof j=="function"){const T=C[x];k=j.call(p,T),C.splice(x,1),x--}return k}),r.formatArgs.call(p,C),(p.log||r.log).apply(p,C)}return m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(d!==r.namespaces&&(d=r.namespaces,y=r.enabled(l)),y),set:C=>{f=C}}),typeof r.init=="function"&&r.init(m),m}function n(l,h){const f=r(this.namespace+(typeof h>"u"?":":h)+l);return f.log=this.log,f}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let h;const f=(typeof l=="string"?l:"").split(/[\s,]+/),d=f.length;for(h=0;h<d;h++)f[h]&&(l=f[h].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function s(){const l=[...r.names.map(a),...r.skips.map(a).map(h=>"-"+h)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let h,f;for(h=0,f=r.skips.length;h<f;h++)if(r.skips[h].test(l))return!1;for(h=0,f=r.names.length;h<f;h++)if(r.names[h].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Ey=Sy;(function(t,e){e.formatArgs=n,e.save=i,e.load=s,e.useColors=r,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!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`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let l=0,h=0;c[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(l++,f==="%c"&&(h=l))}),c.splice(h,0,u)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof ue<"u"&&"env"in ue&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Ey(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(La,La.exports);var Cy=La.exports,xy=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.createModuleLogger=Jr.createProjectLogger=void 0;const Ry=xy(Cy),Iy=(0,Ry.default)("metamask");function ky(t){return Iy.extend(t)}Jr.createProjectLogger=ky;function Ty(t,e){return t.extend(e)}Jr.createModuleLogger=Ty;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.hexToBigInt=Rt.hexToNumber=Rt.bigIntToHex=Rt.numberToHex=void 0;const Br=Pe,On=Zn,Ay=t=>((0,Br.assert)(typeof t=="number","Value must be a number."),(0,Br.assert)(t>=0,"Value must be a non-negative number."),(0,Br.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,On.add0x)(t.toString(16)));Rt.numberToHex=Ay;const My=t=>((0,Br.assert)(typeof t=="bigint","Value must be a bigint."),(0,Br.assert)(t>=0,"Value must be a non-negative bigint."),(0,On.add0x)(t.toString(16)));Rt.bigIntToHex=My;const Ny=t=>{(0,On.assertIsHexString)(t);const e=parseInt(t,16);return(0,Br.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};Rt.hexToNumber=Ny;const Oy=t=>((0,On.assertIsHexString)(t),BigInt((0,On.add0x)(t)));Rt.hexToBigInt=Oy;var Tf={};Object.defineProperty(Tf,"__esModule",{value:!0});var Af={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(Af);var Mf={},ja={exports:{}};const Ly="2.0.0",Nf=256,jy=Number.MAX_SAFE_INTEGER||9007199254740991,Py=16,Dy=Nf-6,$y=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var as={MAX_LENGTH:Nf,MAX_SAFE_COMPONENT_LENGTH:Py,MAX_SAFE_BUILD_LENGTH:Dy,MAX_SAFE_INTEGER:jy,RELEASE_TYPES:$y,SEMVER_SPEC_VERSION:Ly,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const By=typeof ue=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var cs=By;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n}=as,i=cs;e=t.exports={};const s=e.re=[],o=e.safeRe=[],a=e.src=[],c=e.t={};let u=0;const l="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",r],[l,n]],f=y=>{for(const[m,C]of h)y=y.split(`${m}*`).join(`${m}{0,${C}}`).split(`${m}+`).join(`${m}{1,${C}}`);return y},d=(y,m,C)=>{const p=f(m),v=u++;i(y,v,m),c[y]=v,a[v]=m,s[v]=new RegExp(m,C?"g":void 0),o[v]=new RegExp(p,C?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),d("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${l}+`),d("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`),d("FULL",`^${a[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`),d("LOOSE",`^${a[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`),d("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),d("COERCERTL",a[c.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",d("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",d("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ja,ja.exports);var Yn=ja.exports;const Fy=Object.freeze({loose:!0}),Hy=Object.freeze({}),Vy=t=>t?typeof t!="object"?Fy:t:Hy;var bc=Vy;const Uu=/^[0-9]+$/,Of=(t,e)=>{const r=Uu.test(t),n=Uu.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Wy=(t,e)=>Of(e,t);var Lf={compareIdentifiers:Of,rcompareIdentifiers:Wy};const di=cs,{MAX_LENGTH:zu,MAX_SAFE_INTEGER:pi}=as,{safeRe:qu,t:Gu}=Yn,Uy=bc,{compareIdentifiers:Tr}=Lf;let zy=class wt{constructor(e,r){if(r=Uy(r),e instanceof wt){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>zu)throw new TypeError(`version is longer than ${zu} characters`);di("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?qu[Gu.LOOSE]:qu[Gu.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>pi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pi||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<pi)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(di("SemVer.compare",this.version,this.options,e),!(e instanceof wt)){if(typeof e=="string"&&e===this.version)return 0;e=new wt(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof wt||(e=new wt(e,this.options)),Tr(this.major,e.major)||Tr(this.minor,e.minor)||Tr(this.patch,e.patch)}comparePre(e){if(e instanceof wt||(e=new wt(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 r=0;do{const n=this.prerelease[r],i=e.prerelease[r];if(di("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Tr(n,i)}while(++r)}compareBuild(e){e instanceof wt||(e=new wt(e,this.options));let r=0;do{const n=this.build[r],i=e.build[r];if(di("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Tr(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Tr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var ze=zy;const Ju=ze,qy=(t,e,r=!1)=>{if(t instanceof Ju)return t;try{return new Ju(t,e)}catch(n){if(!r)return null;throw n}};var hn=qy;const Gy=hn,Jy=(t,e)=>{const r=Gy(t,e);return r?r.version:null};var Qy=Jy;const Zy=hn,Yy=(t,e)=>{const r=Zy(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var Ky=Yy;const Qu=ze,Xy=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Qu(t instanceof Qu?t.version:t,r).inc(e,n,i).version}catch{return null}};var e1=Xy;const Zu=hn,t1=(t,e)=>{const r=Zu(t,null,!0),n=Zu(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};var r1=t1;const n1=ze,i1=(t,e)=>new n1(t,e).major;var s1=i1;const o1=ze,a1=(t,e)=>new o1(t,e).minor;var c1=a1;const u1=ze,l1=(t,e)=>new u1(t,e).patch;var h1=l1;const f1=hn,d1=(t,e)=>{const r=f1(t,e);return r&&r.prerelease.length?r.prerelease:null};var p1=d1;const Yu=ze,b1=(t,e,r)=>new Yu(t,r).compare(new Yu(e,r));var bt=b1;const g1=bt,v1=(t,e,r)=>g1(e,t,r);var y1=v1;const m1=bt,_1=(t,e)=>m1(t,e,!0);var w1=_1;const Ku=ze,S1=(t,e,r)=>{const n=new Ku(t,r),i=new Ku(e,r);return n.compare(i)||n.compareBuild(i)};var gc=S1;const E1=gc,C1=(t,e)=>t.sort((r,n)=>E1(r,n,e));var x1=C1;const R1=gc,I1=(t,e)=>t.sort((r,n)=>R1(n,r,e));var k1=I1;const T1=bt,A1=(t,e,r)=>T1(t,e,r)>0;var us=A1;const M1=bt,N1=(t,e,r)=>M1(t,e,r)<0;var vc=N1;const O1=bt,L1=(t,e,r)=>O1(t,e,r)===0;var jf=L1;const j1=bt,P1=(t,e,r)=>j1(t,e,r)!==0;var Pf=P1;const D1=bt,$1=(t,e,r)=>D1(t,e,r)>=0;var yc=$1;const B1=bt,F1=(t,e,r)=>B1(t,e,r)<=0;var mc=F1;const H1=jf,V1=Pf,W1=us,U1=yc,z1=vc,q1=mc,G1=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return H1(t,r,n);case"!=":return V1(t,r,n);case">":return W1(t,r,n);case">=":return U1(t,r,n);case"<":return z1(t,r,n);case"<=":return q1(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Df=G1;const J1=ze,Q1=hn,{safeRe:bi,t:gi}=Yn,Z1=(t,e)=>{if(t instanceof J1)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(bi[gi.COERCE]);else{let n;for(;(n=bi[gi.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),bi[gi.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;bi[gi.COERCERTL].lastIndex=-1}return r===null?null:Q1(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var Y1=Z1,na,Xu;function K1(){return Xu||(Xu=1,na=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),na}var X1=ae;ae.Node=br;ae.create=ae;function ae(t){var e=this;if(e instanceof ae||(e=new ae),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}ae.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};ae.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};ae.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};ae.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)tm(this,arguments[t]);return this.length};ae.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)rm(this,arguments[t]);return this.length};ae.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};ae.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};ae.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};ae.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};ae.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};ae.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};ae.prototype.map=function(t,e){e=e||this;for(var r=new ae,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};ae.prototype.mapReverse=function(t,e){e=e||this;for(var r=new ae,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};ae.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};ae.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};ae.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};ae.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};ae.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new ae;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(;i!==null&&n<e;n++,i=i.next)r.push(i.value);return r};ae.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new ae;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};ae.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(var s=[],n=0;i&&n<e;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=em(this,i,r[n]);return s};ae.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function em(t,e,r){var n=e===t.head?new br(r,null,e,t):new br(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function tm(t,e){t.tail=new br(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function rm(t,e){t.head=new br(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function br(t,e,r,n){if(!(this instanceof br))return new br(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{K1()(ae)}catch{}const nm=X1,cr=Symbol("max"),jt=Symbol("length"),Ar=Symbol("lengthCalculator"),Rn=Symbol("allowStale"),fr=Symbol("maxAge"),Nt=Symbol("dispose"),el=Symbol("noDisposeOnSet"),Me=Symbol("lruList"),ht=Symbol("cache"),$f=Symbol("updateAgeOnGet"),ia=()=>1;class im{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[cr]=e.max||1/0;const r=e.length||ia;if(this[Ar]=typeof r!="function"?ia:r,this[Rn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[fr]=e.maxAge||0,this[Nt]=e.dispose,this[el]=e.noDisposeOnSet||!1,this[$f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[cr]=e||1/0,mn(this)}get max(){return this[cr]}set allowStale(e){this[Rn]=!!e}get allowStale(){return this[Rn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[fr]=e,mn(this)}get maxAge(){return this[fr]}set lengthCalculator(e){typeof e!="function"&&(e=ia),e!==this[Ar]&&(this[Ar]=e,this[jt]=0,this[Me].forEach(r=>{r.length=this[Ar](r.value,r.key),this[jt]+=r.length})),mn(this)}get lengthCalculator(){return this[Ar]}get length(){return this[jt]}get itemCount(){return this[Me].length}rforEach(e,r){r=r||this;for(let n=this[Me].tail;n!==null;){const i=n.prev;tl(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[Me].head;n!==null;){const i=n.next;tl(this,e,n,r),n=i}}keys(){return this[Me].toArray().map(e=>e.key)}values(){return this[Me].toArray().map(e=>e.value)}reset(){this[Nt]&&this[Me]&&this[Me].length&&this[Me].forEach(e=>this[Nt](e.key,e.value)),this[ht]=new Map,this[Me]=new nm,this[jt]=0}dump(){return this[Me].map(e=>Mi(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Me]}set(e,r,n){if(n=n||this[fr],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Ar](r,e);if(this[ht].has(e)){if(s>this[cr])return Fr(this,this[ht].get(e)),!1;const c=this[ht].get(e).value;return this[Nt]&&(this[el]||this[Nt](e,c.value)),c.now=i,c.maxAge=n,c.value=r,this[jt]+=s-c.length,c.length=s,this.get(e),mn(this),!0}const o=new sm(e,r,s,i,n);return o.length>this[cr]?(this[Nt]&&this[Nt](e,r),!1):(this[jt]+=o.length,this[Me].unshift(o),this[ht].set(e,this[Me].head),mn(this),!0)}has(e){if(!this[ht].has(e))return!1;const r=this[ht].get(e).value;return!Mi(this,r)}get(e){return sa(this,e,!0)}peek(e){return sa(this,e,!1)}pop(){const e=this[Me].tail;return e?(Fr(this,e),e.value):null}del(e){Fr(this,this[ht].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[ht].forEach((e,r)=>sa(this,r,!1))}}const sa=(t,e,r)=>{const n=t[ht].get(e);if(n){const i=n.value;if(Mi(t,i)){if(Fr(t,n),!t[Rn])return}else r&&(t[$f]&&(n.value.now=Date.now()),t[Me].unshiftNode(n));return i.value}},Mi=(t,e)=>{if(!e||!e.maxAge&&!t[fr])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[fr]&&r>t[fr]},mn=t=>{if(t[jt]>t[cr])for(let e=t[Me].tail;t[jt]>t[cr]&&e!==null;){const r=e.prev;Fr(t,e),e=r}},Fr=(t,e)=>{if(e){const r=e.value;t[Nt]&&t[Nt](r.key,r.value),t[jt]-=r.length,t[ht].delete(r.key),t[Me].removeNode(e)}};class sm{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const tl=(t,e,r,n)=>{let i=r.value;Mi(t,i)&&(Fr(t,r),t[Rn]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var om=im,oa,rl;function gt(){if(rl)return oa;rl=1;class t{constructor(A,O){if(O=n(O),A instanceof t)return A.loose===!!O.loose&&A.includePrerelease===!!O.includePrerelease?A:new t(A.raw,O);if(A instanceof i)return this.raw=A.value,this.set=[[A]],this.format(),this;if(this.options=O,this.loose=!!O.loose,this.includePrerelease=!!O.includePrerelease,this.raw=A.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(P=>this.parseRange(P)).filter(P=>P.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const P=this.set[0];if(this.set=this.set.filter(B=>!y(B[0])),this.set.length===0)this.set=[P];else if(this.set.length>1){for(const B of this.set)if(B.length===1&&m(B[0])){this.set=[B];break}}}this.format()}format(){return this.range=this.set.map(A=>A.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(A){const P=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+A,B=r.get(P);if(B)return B;const D=this.options.loose,V=D?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];A=A.replace(V,le(this.options.includePrerelease)),s("hyphen replace",A),A=A.replace(a[c.COMPARATORTRIM],u),s("comparator trim",A),A=A.replace(a[c.TILDETRIM],l),s("tilde trim",A),A=A.replace(a[c.CARETTRIM],h),s("caret trim",A);let Y=A.split(" ").map(he=>p(he,this.options)).join(" ").split(/\s+/).map(he=>z(he,this.options));D&&(Y=Y.filter(he=>(s("loose invalid filter",he,this.options),!!he.match(a[c.COMPARATORLOOSE])))),s("range list",Y);const G=new Map,se=Y.map(he=>new i(he,this.options));for(const he of se){if(y(he))return[he];G.set(he.value,he)}G.size>1&&G.has("")&&G.delete("");const de=[...G.values()];return r.set(P,de),de}intersects(A,O){if(!(A instanceof t))throw new TypeError("a Range is required");return this.set.some(P=>C(P,O)&&A.set.some(B=>C(B,O)&&P.every(D=>B.every(V=>D.intersects(V,O)))))}test(A){if(!A)return!1;if(typeof A=="string")try{A=new o(A,this.options)}catch{return!1}for(let O=0;O<this.set.length;O++)if(Z(this.set[O],A,this.options))return!0;return!1}}oa=t;const e=om,r=new e({max:1e3}),n=bc,i=ls(),s=cs,o=ze,{safeRe:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=Yn,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=as,y=M=>M.value==="<0.0.0-0",m=M=>M.value==="",C=(M,A)=>{let O=!0;const P=M.slice();let B=P.pop();for(;O&&P.length;)O=P.every(D=>B.intersects(D,A)),B=P.pop();return O},p=(M,A)=>(s("comp",M,A),M=E(M,A),s("caret",M),M=_(M,A),s("tildes",M),M=$(M,A),s("xrange",M),M=T(M,A),s("stars",M),M),v=M=>!M||M.toLowerCase()==="x"||M==="*",_=(M,A)=>M.trim().split(/\s+/).map(O=>x(O,A)).join(" "),x=(M,A)=>{const O=A.loose?a[c.TILDELOOSE]:a[c.TILDE];return M.replace(O,(P,B,D,V,Y)=>{s("tilde",M,P,B,D,V,Y);let G;return v(B)?G="":v(D)?G=`>=${B}.0.0 <${+B+1}.0.0-0`:v(V)?G=`>=${B}.${D}.0 <${B}.${+D+1}.0-0`:Y?(s("replaceTilde pr",Y),G=`>=${B}.${D}.${V}-${Y} <${B}.${+D+1}.0-0`):G=`>=${B}.${D}.${V} <${B}.${+D+1}.0-0`,s("tilde return",G),G})},E=(M,A)=>M.trim().split(/\s+/).map(O=>k(O,A)).join(" "),k=(M,A)=>{s("caret",M,A);const O=A.loose?a[c.CARETLOOSE]:a[c.CARET],P=A.includePrerelease?"-0":"";return M.replace(O,(B,D,V,Y,G)=>{s("caret",M,B,D,V,Y,G);let se;return v(D)?se="":v(V)?se=`>=${D}.0.0${P} <${+D+1}.0.0-0`:v(Y)?D==="0"?se=`>=${D}.${V}.0${P} <${D}.${+V+1}.0-0`:se=`>=${D}.${V}.0${P} <${+D+1}.0.0-0`:G?(s("replaceCaret pr",G),D==="0"?V==="0"?se=`>=${D}.${V}.${Y}-${G} <${D}.${V}.${+Y+1}-0`:se=`>=${D}.${V}.${Y}-${G} <${D}.${+V+1}.0-0`:se=`>=${D}.${V}.${Y}-${G} <${+D+1}.0.0-0`):(s("no pr"),D==="0"?V==="0"?se=`>=${D}.${V}.${Y}${P} <${D}.${V}.${+Y+1}-0`:se=`>=${D}.${V}.${Y}${P} <${D}.${+V+1}.0-0`:se=`>=${D}.${V}.${Y} <${+D+1}.0.0-0`),s("caret return",se),se})},$=(M,A)=>(s("replaceXRanges",M,A),M.split(/\s+/).map(O=>j(O,A)).join(" ")),j=(M,A)=>{M=M.trim();const O=A.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return M.replace(O,(P,B,D,V,Y,G)=>{s("xRange",M,P,B,D,V,Y,G);const se=v(D),de=se||v(V),he=de||v(Y),Fe=he;return B==="="&&Fe&&(B=""),G=A.includePrerelease?"-0":"",se?B===">"||B==="<"?P="<0.0.0-0":P="*":B&&Fe?(de&&(V=0),Y=0,B===">"?(B=">=",de?(D=+D+1,V=0,Y=0):(V=+V+1,Y=0)):B==="<="&&(B="<",de?D=+D+1:V=+V+1),B==="<"&&(G="-0"),P=`${B+D}.${V}.${Y}${G}`):de?P=`>=${D}.0.0${G} <${+D+1}.0.0-0`:he&&(P=`>=${D}.${V}.0${G} <${D}.${+V+1}.0-0`),s("xRange return",P),P})},T=(M,A)=>(s("replaceStars",M,A),M.trim().replace(a[c.STAR],"")),z=(M,A)=>(s("replaceGTE0",M,A),M.trim().replace(a[A.includePrerelease?c.GTE0PRE:c.GTE0],"")),le=M=>(A,O,P,B,D,V,Y,G,se,de,he,Fe,w)=>(v(P)?O="":v(B)?O=`>=${P}.0.0${M?"-0":""}`:v(D)?O=`>=${P}.${B}.0${M?"-0":""}`:V?O=`>=${O}`:O=`>=${O}${M?"-0":""}`,v(se)?G="":v(de)?G=`<${+se+1}.0.0-0`:v(he)?G=`<${se}.${+de+1}.0-0`:Fe?G=`<=${se}.${de}.${he}-${Fe}`:M?G=`<${se}.${de}.${+he+1}-0`:G=`<=${G}`,`${O} ${G}`.trim()),Z=(M,A,O)=>{for(let P=0;P<M.length;P++)if(!M[P].test(A))return!1;if(A.prerelease.length&&!O.includePrerelease){for(let P=0;P<M.length;P++)if(s(M[P].semver),M[P].semver!==i.ANY&&M[P].semver.prerelease.length>0){const B=M[P].semver;if(B.major===A.major&&B.minor===A.minor&&B.patch===A.patch)return!0}return!1}return!0};return oa}var aa,nl;function ls(){if(nl)return aa;nl=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,h){if(h=r(h),l instanceof e){if(l.loose===!!h.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,h),this.options=h,this.loose=!!h.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const h=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],f=l.match(h);if(!f)throw new TypeError(`Invalid comparator: ${l}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,h){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,h).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,h).test(l.semver):(h=r(h),h.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,h)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,h)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}aa=e;const r=bc,{safeRe:n,t:i}=Yn,s=Df,o=cs,a=ze,c=gt();return aa}const am=gt(),cm=(t,e,r)=>{try{e=new am(e,r)}catch{return!1}return e.test(t)};var hs=cm;const um=gt(),lm=(t,e)=>new um(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var hm=lm;const fm=ze,dm=gt(),pm=(t,e,r)=>{let n=null,i=null,s=null;try{s=new dm(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new fm(n,r))}),n};var bm=pm;const gm=ze,vm=gt(),ym=(t,e,r)=>{let n=null,i=null,s=null;try{s=new vm(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new gm(n,r))}),n};var mm=ym;const ca=ze,_m=gt(),il=us,wm=(t,e)=>{t=new _m(t,e);let r=new ca("0.0.0");if(t.test(r)||(r=new ca("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){const i=t.set[n];let s=null;i.forEach(o=>{const a=new ca(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||il(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||il(r,s))&&(r=s)}return r&&t.test(r)?r:null};var Sm=wm;const Em=gt(),Cm=(t,e)=>{try{return new Em(t,e).range||"*"}catch{return null}};var xm=Cm;const Rm=ze,Bf=ls(),{ANY:Im}=Bf,km=gt(),Tm=hs,sl=us,ol=vc,Am=mc,Mm=yc,Nm=(t,e,r,n)=>{t=new Rm(t,n),e=new km(e,n);let i,s,o,a,c;switch(r){case">":i=sl,s=Am,o=ol,a=">",c=">=";break;case"<":i=ol,s=Mm,o=sl,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Tm(t,e,n))return!1;for(let u=0;u<e.set.length;++u){const l=e.set[u];let h=null,f=null;if(l.forEach(d=>{d.semver===Im&&(d=new Bf(">=0.0.0")),h=h||d,f=f||d,i(d.semver,h.semver,n)?h=d:o(d.semver,f.semver,n)&&(f=d)}),h.operator===a||h.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&o(t,f.semver))return!1}return!0};var _c=Nm;const Om=_c,Lm=(t,e,r)=>Om(t,e,">",r);var jm=Lm;const Pm=_c,Dm=(t,e,r)=>Pm(t,e,"<",r);var $m=Dm;const al=gt(),Bm=(t,e,r)=>(t=new al(t,r),e=new al(e,r),t.intersects(e,r));var Fm=Bm;const Hm=hs,Vm=bt;var Wm=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((l,h)=>Vm(l,h,r));for(const l of o)Hm(l,e,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[l,h]of n)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e};const cl=gt(),wc=ls(),{ANY:ua}=wc,_n=hs,Sc=bt,Um=(t,e,r={})=>{if(t===e)return!0;t=new cl(t,r),e=new cl(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=qm(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},zm=[new wc(">=0.0.0-0")],ul=[new wc(">=0.0.0")],qm=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===ua){if(e.length===1&&e[0].semver===ua)return!0;r.includePrerelease?t=zm:t=ul}if(e.length===1&&e[0].semver===ua){if(r.includePrerelease)return!0;e=ul}const n=new Set;let i,s;for(const d of t)d.operator===">"||d.operator===">="?i=ll(i,d,r):d.operator==="<"||d.operator==="<="?s=hl(s,d,r):n.add(d.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Sc(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const d of n){if(i&&!_n(d,String(i),r)||s&&!_n(d,String(s),r))return null;for(const y of e)if(!_n(d,String(y),r))return!1;return!0}let a,c,u,l,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const d of e){if(l=l||d.operator===">"||d.operator===">=",u=u||d.operator==="<"||d.operator==="<=",i){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=ll(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!_n(i.semver,String(d),r))return!1}if(s){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator==="<"||d.operator==="<="){if(c=hl(s,d,r),c===d&&c!==s)return!1}else if(s.operator==="<="&&!_n(s.semver,String(d),r))return!1}if(!d.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||f||h)},ll=(t,e,r)=>{if(!t)return e;const n=Sc(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},hl=(t,e,r)=>{if(!t)return e;const n=Sc(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var Gm=Um;const la=Yn,fl=as,Jm=ze,dl=Lf,Qm=hn,Zm=Qy,Ym=Ky,Km=e1,Xm=r1,e_=s1,t_=c1,r_=h1,n_=p1,i_=bt,s_=y1,o_=w1,a_=gc,c_=x1,u_=k1,l_=us,h_=vc,f_=jf,d_=Pf,p_=yc,b_=mc,g_=Df,v_=Y1,y_=ls(),m_=gt(),__=hs,w_=hm,S_=bm,E_=mm,C_=Sm,x_=xm,R_=_c,I_=jm,k_=$m,T_=Fm,A_=Wm,M_=Gm;var N_={parse:Qm,valid:Zm,clean:Ym,inc:Km,diff:Xm,major:e_,minor:t_,patch:r_,prerelease:n_,compare:i_,rcompare:s_,compareLoose:o_,compareBuild:a_,sort:c_,rsort:u_,gt:l_,lt:h_,eq:f_,neq:d_,gte:p_,lte:b_,cmp:g_,coerce:v_,Comparator:y_,Range:m_,satisfies:__,toComparators:w_,maxSatisfying:S_,minSatisfying:E_,minVersion:C_,validRange:x_,outside:R_,gtr:I_,ltr:k_,intersects:T_,simplifyRange:A_,subset:M_,SemVer:Jm,re:la.re,src:la.src,tokens:la.t,SEMVER_SPEC_VERSION:fl.SEMVER_SPEC_VERSION,RELEASE_TYPES:fl.RELEASE_TYPES,compareIdentifiers:dl.compareIdentifiers,rcompareIdentifiers:dl.rcompareIdentifiers};(function(t){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;const e=N_,r=Er,n=Pe;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",h=>(0,e.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",h=>(0,e.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function i(h){return(0,r.is)(h,t.VersionStruct)}t.isValidSemVerVersion=i;function s(h){return(0,r.is)(h,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(h){(0,n.assertStruct)(h,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(h){(0,n.assertStruct)(h,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(h,f){return(0,e.gt)(h,f)}t.gtVersion=c;function u(h,f){return(0,e.gtr)(h,f)}t.gtRange=u;function l(h,f){return(0,e.satisfies)(h,f,{includePrerelease:!0})}t.satisfiesVersionRange=l})(Mf);(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Pe,t),r(Qn,t),r(oe,t),r(ss,t),r(xt,t),r(Gr,t),r(Zn,t),r(kf,t),r(Jr,t),r(pc,t),r(Rt,t),r(Tf,t),r(Af,t),r(Mf,t)})(uf);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=uf;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(cf);var Ff=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ns,"__esModule",{value:!0});ns.PollingBlockTracker=void 0;const O_=Ff(ic),L_=Ff(tv),j_=Gn,pl=cf,bl=(0,pl.createModuleLogger)(pl.projectLogger,"polling-block-tracker"),P_=(0,O_.default)(),D_=1e3;class $_ extends j_.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*D_,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=gl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
2
+ ${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=gl(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:P_(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),bl("Making request",e);const r=await(0,L_.default)(n=>this._provider.sendAsync(e,n))();if(bl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
3
+ ${r.error.message}`);return r.result}}ns.PollingBlockTracker=$_;function gl(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var fs={},B_=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fs,"__esModule",{value:!0});fs.SubscribeBlockTracker=void 0;const F_=B_(ic),H_=Gn,V_=(0,F_.default)();class W_ extends H_.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:V_(),method:e,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}fs.SubscribeBlockTracker=W_;var Hf={};Object.defineProperty(Hf,"__esModule",{value:!0});(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(ns,t),r(fs,t),r(Hf,t)})(af);var Ec={},ds={},Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getUniqueId=void 0;const Vf=4294967295;let ha=Math.floor(Math.random()*Vf);function U_(){return ha=(ha+1)%Vf,ha}Kn.getUniqueId=U_;Object.defineProperty(ds,"__esModule",{value:!0});ds.createIdRemapMiddleware=void 0;const z_=Kn;function q_(){return(t,e,r,n)=>{const i=t.id,s=z_.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}ds.createIdRemapMiddleware=q_;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.createAsyncMiddleware=void 0;function G_(t){return async(e,r,n,i)=>{let s;const o=new Promise(l=>{s=l});let a=null,c=!1;const u=async()=>{c=!0,n(l=>{a=l,s()}),await o};try{await t(e,r,u),c?(await o,a(null)):i(null)}catch(l){a?a(l):i(l)}}}ps.createAsyncMiddleware=G_;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.createScaffoldMiddleware=void 0;function J_(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}bs.createScaffoldMiddleware=J_;var Xn={},Q_=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.JsonRpcEngine=void 0;const Z_=Q_(yr),Xe=Ya;class Ot extends Z_.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,o,a]=await Ot._runAllMiddleware(e,r,this._middleware);return o?(await Ot._runReturnHandlers(a),i(s)):n(async c=>{try{await Ot._runReturnHandlers(a)}catch(u){return c(u)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const o=new Xe.EthereumRpcError(Xe.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new Xe.EthereumRpcError(Xe.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(o,{id:e.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Xe.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await Ot._runAllMiddleware(e,r,this._middleware);if(Ot._checkForCompletion(e,r,i),await Ot._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await Ot._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=c=>{const u=c||r.error;u&&(r.error=Xe.serializeError(u)),s([u,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new Xe.EthereumRpcError(Xe.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
4
+ ${fa(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{n(e,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new Xe.EthereumRpcError(Xe.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
5
+ ${fa(e)}`,{request:e});if(!n)throw new Xe.EthereumRpcError(Xe.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
6
+ ${fa(e)}`,{request:e})}}Xn.JsonRpcEngine=Ot;function fa(t){return JSON.stringify(t,null,2)}var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.mergeMiddleware=void 0;const Y_=Xn;function K_(t){const e=new Y_.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}gs.mergeMiddleware=K_;(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(ds,t),r(ps,t),r(bs,t),r(Kn,t),r(Xn,t),r(gs,t)})(Ec);var Wf={},Cc={},Pa=function(t,e){return Pa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Pa(t,e)};function Uf(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Pa(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Ni=function(){return Ni=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Ni.apply(this,arguments)};function zf(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function qf(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Gf(t,e){return function(r,n){e(r,n,t)}}function X_(t,e,r,n,i,s){function o(p){if(p!==void 0&&typeof p!="function")throw new TypeError("Function expected");return p}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?n.static?t:t.prototype:null,l=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h,f=!1,d=r.length-1;d>=0;d--){var y={};for(var m in n)y[m]=m==="access"?{}:n[m];for(var m in n.access)y.access[m]=n.access[m];y.addInitializer=function(p){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(p||null))};var C=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[c],y);if(a==="accessor"){if(C===void 0)continue;if(C===null||typeof C!="object")throw new TypeError("Object expected");(h=o(C.get))&&(l.get=h),(h=o(C.set))&&(l.set=h),(h=o(C.init))&&i.unshift(h)}else(h=o(C))&&(a==="field"?i.unshift(h):l[c]=h)}u&&Object.defineProperty(u,n.name,l),f=!0}function ew(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function tw(t){return typeof t=="symbol"?t:"".concat(t)}function rw(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function Jf(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Qf(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{u(n.next(l))}catch(h){o(h)}}function c(l){try{u(n.throw(l))}catch(h){o(h)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((n=n.apply(t,e||[])).next())})}function Zf(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(l){u=[6,l],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var vs=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function Yf(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vs(e,t,r)}function Oi(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function xc(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Kf(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(xc(arguments[e]));return t}function Xf(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function ed(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function Qr(t){return this instanceof Qr?(this.v=t,this):new Qr(t)}function td(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){n[f]&&(i[f]=function(d){return new Promise(function(y,m){s.push([f,d,y,m])>1||a(f,d)})})}function a(f,d){try{c(n[f](d))}catch(y){h(s[0][3],y)}}function c(f){f.value instanceof Qr?Promise.resolve(f.value.v).then(u,l):h(s[0][2],f)}function u(f){a("next",f)}function l(f){a("throw",f)}function h(f,d){f(d),s.shift(),s.length&&a(s[0][0],s[0][1])}}function rd(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Qr(t[i](o)),done:!1}:s?s(o):o}:s}}function nd(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Oi=="function"?Oi(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function id(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var nw=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function sd(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&vs(e,t,r);return nw(e,t),e}function od(t){return t&&t.__esModule?t:{default:t}}function ad(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function cd(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function ud(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ld(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var iw=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function hd(t){function e(n){t.error=t.hasError?new iw(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const sw={__extends:Uf,__assign:Ni,__rest:zf,__decorate:qf,__param:Gf,__metadata:Jf,__awaiter:Qf,__generator:Zf,__createBinding:vs,__exportStar:Yf,__values:Oi,__read:xc,__spread:Kf,__spreadArrays:Xf,__spreadArray:ed,__await:Qr,__asyncGenerator:td,__asyncDelegator:rd,__asyncValues:nd,__makeTemplateObject:id,__importStar:sd,__importDefault:od,__classPrivateFieldGet:ad,__classPrivateFieldSet:cd,__classPrivateFieldIn:ud,__addDisposableResource:ld,__disposeResources:hd},ow=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:ld,get __assign(){return Ni},__asyncDelegator:rd,__asyncGenerator:td,__asyncValues:nd,__await:Qr,__awaiter:Qf,__classPrivateFieldGet:ad,__classPrivateFieldIn:ud,__classPrivateFieldSet:cd,__createBinding:vs,__decorate:qf,__disposeResources:hd,__esDecorate:X_,__exportStar:Yf,__extends:Uf,__generator:Zf,__importDefault:od,__importStar:sd,__makeTemplateObject:id,__metadata:Jf,__param:Gf,__propKey:tw,__read:xc,__rest:zf,__runInitializers:ew,__setFunctionName:rw,__spread:Kf,__spreadArray:ed,__spreadArrays:Xf,__values:Oi,default:sw},Symbol.toStringTag,{value:"Module"})),Rc=nn(ow);var ys={};Object.defineProperty(ys,"__esModule",{value:!0});var vl=Rc,aw=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return vl.__awaiter(this,void 0,void 0,function(){var r,n,i;return vl.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();ys.default=aw;Object.defineProperty(Cc,"__esModule",{value:!0});var yl=Rc,cw=ys,uw=function(){function t(){this._semaphore=new cw.default(1)}return t.prototype.acquire=function(){return yl.__awaiter(this,void 0,void 0,function(){var e,r;return yl.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();Cc.default=uw;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.withTimeout=void 0;var vi=Rc;function lw(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return vi.__awaiter(n,void 0,void 0,function(){var o,a,c;return vi.__generator(this,function(u){switch(u.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},e),[4,t.acquire()];case 1:return a=u.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return vi.__awaiter(this,void 0,void 0,function(){var s,o;return vi.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}ms.withTimeout=lw;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=Cc;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=ys;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=ms;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Wf);var hw=dw,fw=Object.prototype.hasOwnProperty;function dw(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)fw.call(r,n)&&(t[n]=r[n])}return t}const pw=hw,bw=ic();var gw=J;function J(t){const e=this;e.currentProvider=t}J.prototype.getBalance=ei(2,"eth_getBalance");J.prototype.getCode=ei(2,"eth_getCode");J.prototype.getTransactionCount=ei(2,"eth_getTransactionCount");J.prototype.getStorageAt=ei(3,"eth_getStorageAt");J.prototype.call=ei(2,"eth_call");J.prototype.protocolVersion=ne("eth_protocolVersion");J.prototype.syncing=ne("eth_syncing");J.prototype.coinbase=ne("eth_coinbase");J.prototype.mining=ne("eth_mining");J.prototype.hashrate=ne("eth_hashrate");J.prototype.gasPrice=ne("eth_gasPrice");J.prototype.accounts=ne("eth_accounts");J.prototype.blockNumber=ne("eth_blockNumber");J.prototype.getBlockTransactionCountByHash=ne("eth_getBlockTransactionCountByHash");J.prototype.getBlockTransactionCountByNumber=ne("eth_getBlockTransactionCountByNumber");J.prototype.getUncleCountByBlockHash=ne("eth_getUncleCountByBlockHash");J.prototype.getUncleCountByBlockNumber=ne("eth_getUncleCountByBlockNumber");J.prototype.sign=ne("eth_sign");J.prototype.sendTransaction=ne("eth_sendTransaction");J.prototype.sendRawTransaction=ne("eth_sendRawTransaction");J.prototype.estimateGas=ne("eth_estimateGas");J.prototype.getBlockByHash=ne("eth_getBlockByHash");J.prototype.getBlockByNumber=ne("eth_getBlockByNumber");J.prototype.getTransactionByHash=ne("eth_getTransactionByHash");J.prototype.getTransactionByBlockHashAndIndex=ne("eth_getTransactionByBlockHashAndIndex");J.prototype.getTransactionByBlockNumberAndIndex=ne("eth_getTransactionByBlockNumberAndIndex");J.prototype.getTransactionReceipt=ne("eth_getTransactionReceipt");J.prototype.getUncleByBlockHashAndIndex=ne("eth_getUncleByBlockHashAndIndex");J.prototype.getUncleByBlockNumberAndIndex=ne("eth_getUncleByBlockNumberAndIndex");J.prototype.getCompilers=ne("eth_getCompilers");J.prototype.compileLLL=ne("eth_compileLLL");J.prototype.compileSolidity=ne("eth_compileSolidity");J.prototype.compileSerpent=ne("eth_compileSerpent");J.prototype.newFilter=ne("eth_newFilter");J.prototype.newBlockFilter=ne("eth_newBlockFilter");J.prototype.newPendingTransactionFilter=ne("eth_newPendingTransactionFilter");J.prototype.uninstallFilter=ne("eth_uninstallFilter");J.prototype.getFilterChanges=ne("eth_getFilterChanges");J.prototype.getFilterLogs=ne("eth_getFilterLogs");J.prototype.getLogs=ne("eth_getLogs");J.prototype.getWork=ne("eth_getWork");J.prototype.submitWork=ne("eth_submitWork");J.prototype.submitHashrate=ne("eth_submitHashrate");J.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(vw(t),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return e(n);e(null,i.result)})};function ne(t){return function(){const e=this;var r=[].slice.call(arguments),n=r.pop();e.sendAsync({method:t,params:r},n)}}function ei(t,e){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<t&&n.push("latest"),r.sendAsync({method:e,params:n},i)}}function vw(t){return pw({id:bw(),jsonrpc:"2.0",params:[]},t)}const ml=(t,e,r,n)=>function(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?a(u):(u.shift(),o(u)):o(u)}):e.errorFirst?i.push((u,l)=>{u?a(u):o(l)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},_l=new WeakMap;var yw=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(o,a)=>{let c=_l.get(o);if(c||(c={},_l.set(o,c)),a in c)return c[a];const u=y=>typeof y=="string"||typeof a=="symbol"?a===y:y.test(a),l=Reflect.getOwnPropertyDescriptor(o,a),h=l===void 0||l.writable||l.configurable,d=(e.include?e.include.some(u):!e.exclude.some(u))&&h;return c[a]=d,d},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const u=i.get(o);if(u)return Reflect.apply(u,a,c);const l=e.excludeMain?o:ml(o,e,s,o);return i.set(o,l),Reflect.apply(l,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const u=i.get(c);if(u)return u;if(typeof c=="function"){const l=ml(c,e,s,o);return i.set(c,l),l}return c}});return s};const mw=yr.default;let _w=class extends mw{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Ic=_w;const ww=Ic;let Sw=class extends ww{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var Ew=Sw,ti={minBlockRef:Cw,maxBlockRef:xw,sortBlockRefs:kc,bnToHex:Rw,blockRefIsNumber:Iw,hexToInt:Li,incrementHexInt:kw,intToHex:fd,unsafeRandomBytes:Tw};function Cw(...t){return kc(t)[0]}function xw(...t){const e=kc(t);return e[e.length-1]}function kc(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:Li(e)-Li(r))}function Rw(t){return"0x"+t.toString(16)}function Iw(t){return t&&!["earliest","latest","pending"].includes(t)}function Li(t){return t==null?t:Number.parseInt(t,16)}function kw(t){if(t==null)return t;const e=Li(t);return fd(e+1)}function fd(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function Tw(t){let e="0x";for(let r=0;r<t;r++)e+=wl(),e+=wl();return e}function wl(){return Math.floor(Math.random()*16).toString(16)}const Aw=gw,Mw=yw,Nw=Ew,{bnToHex:hR,hexToInt:yi,incrementHexInt:Ow,minBlockRef:Lw,blockRefIsNumber:jw}=ti;let Pw=class extends Nw{constructor({provider:e,params:r}){super(),this.type="log",this.ethQuery=new Aw(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=Lw(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=Ow(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await Mw(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(yi(this.params.fromBlock)>=yi(e.blockNumber)||jw(this.params.toBlock)&&yi(this.params.toBlock)<=yi(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(l=>l.toLowerCase()),a.includes(o))})}};var Dw=Pw,Tc=$w;async function $w({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Sl(e),s=Sl(r)-n+1,o=Array(s).fill().map((c,u)=>n+u).map(Bw);return await Promise.all(o.map(c=>Hw(t,"eth_getBlockByNumber",[c,!1])))}function Sl(t){return t==null?t:Number.parseInt(t,16)}function Bw(t){return t==null?t:"0x"+t.toString(16)}function Fw(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function Hw(t,e,r){for(let n=0;n<3;n++)try{return await Fw(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}const Vw=Ic,Ww=Tc,{incrementHexInt:Uw}=ti;let zw=class extends Vw{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=Uw(e),o=(await Ww({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var qw=zw;const Gw=Ic,Jw=Tc,{incrementHexInt:Qw}=ti;let Zw=class extends Gw{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=Qw(e),i=await Jw({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Yw=Zw;const Kw=Wf.Mutex,{createAsyncMiddleware:Xw,createScaffoldMiddleware:e2}=Ec,t2=Dw,r2=qw,n2=Yw,{intToHex:dd,hexToInt:da}=ti;var i2=s2;function s2({blockTracker:t,provider:e}){let r=0,n={};const i=new Kw,s=o2({mutex:i}),o=e2({eth_newFilter:s(pa(c)),eth_newBlockFilter:s(pa(u)),eth_newPendingTransactionFilter:s(pa(l)),eth_uninstallFilter:s(xi(d)),eth_getFilterChanges:s(xi(h)),eth_getFilterLogs:s(xi(f))}),a=async({oldBlock:v,newBlock:_})=>{if(n.length===0)return;const x=await i.acquire();try{await Promise.all(Mr(n).map(async E=>{try{await E.update({oldBlock:v,newBlock:_})}catch(k){console.error(k)}}))}catch(E){console.error(E)}x()};return o.newLogFilter=c,o.newBlockFilter=u,o.newPendingTransactionFilter=l,o.uninstallFilter=d,o.getFilterChanges=h,o.getFilterLogs=f,o.destroy=()=>{C()},o;async function c(v){const _=new t2({provider:e,params:v});return await y(_),_}async function u(){const v=new r2({provider:e});return await y(v),v}async function l(){const v=new n2({provider:e});return await y(v),v}async function h(v){const _=da(v),x=n[_];if(!x)throw new Error(`No filter for index "${_}"`);return x.getChangesAndClear()}async function f(v){const _=da(v),x=n[_];if(!x)throw new Error(`No filter for index "${_}"`);let E=[];return x.type==="log"&&(E=x.getAllResults()),E}async function d(v){const _=da(v),E=!!n[_];return E&&await m(_),E}async function y(v){const _=Mr(n).length,x=await t.getLatestBlock();await v.initialize({currentBlock:x}),r++,n[r]=v,v.id=r,v.idHex=dd(r);const E=Mr(n).length;return p({prevFilterCount:_,newFilterCount:E}),r}async function m(v){const _=Mr(n).length;delete n[v];const x=Mr(n).length;p({prevFilterCount:_,newFilterCount:x})}async function C(){const v=Mr(n).length;n={},p({prevFilterCount:v,newFilterCount:0})}function p({prevFilterCount:v,newFilterCount:_}){if(v===0&&_>0){t.on("sync",a);return}if(v>0&&_===0){t.removeListener("sync",a);return}}}function pa(t){return xi(async(...e)=>{const r=await t(...e);return dd(r.id)})}function xi(t){return Xw(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function o2({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function Mr(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const a2=yr.default,{createAsyncMiddleware:El,createScaffoldMiddleware:c2}=Ec,u2=i2,{unsafeRandomBytes:l2,incrementHexInt:h2}=ti,f2=Tc;var d2=p2;function p2({blockTracker:t,provider:e}){const r={},n=u2({blockTracker:t,provider:e});let i=!1;const s=new a2,o=c2({eth_subscribe:El(a),eth_unsubscribe:El(c)});return o.destroy=l,{events:s,middleware:o};async function a(h,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const d=h.params[0],y=l2(16);let m;switch(d){case"newHeads":m=C({subId:y});break;case"logs":const v=h.params[1],_=await n.newLogFilter(v);m=p({subId:y,filter:_});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${d}"`)}r[y]=m,f.result=y;return;function C({subId:v}){const _={type:d,destroy:async()=>{t.removeListener("sync",_.update)},update:async({oldBlock:x,newBlock:E})=>{const k=E,$=h2(x);(await f2({provider:e,fromBlock:$,toBlock:k})).map(b2).filter(z=>z!==null).forEach(z=>{u(v,z)})}};return t.on("sync",_.update),_}function p({subId:v,filter:_}){return _.on("update",E=>u(v,E)),{type:d,destroy:async()=>await n.uninstallFilter(_.idHex)}}}async function c(h,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const d=h.params[0],y=r[d];if(!y){f.result=!1;return}delete r[d],await y.destroy(),f.result=!0}function u(h,f){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:h,result:f}})}function l(){s.removeAllListeners();for(const h in r)r[h].destroy(),delete r[h];i=!0}}function b2(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(rs,"__esModule",{value:!0});rs.SubscriptionManager=void 0;const g2=af,v2=d2,Cl=()=>{};class y2{constructor(e){const r=new g2.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=v2({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,Cl,Cl),r}destroy(){this.subscriptionMiddleware.destroy()}}rs.SubscriptionManager=y2;var Ac=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.CoinbaseWalletProvider=void 0;const m2=Ac(yr),_2=Ac(Wi),ba=sn,pe=$n,xl=on,Rl=dt,ga=Ji,w2=ge,X=H,va=Ac(Zg),S2=qr,ce=of,E2=rs,Il="DefaultChainId",kl="DefaultJsonRpcUrl";class C2 extends m2.default{constructor(e){var r,n;super(),this._filterPolyfill=new S2.FilterPolyfill(this),this._subscriptionManager=new E2.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=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const i=this.getChainId(),s=(0,X.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,X.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="defaultChainChanged"||a.data.data.action==="dappChainSwitched"){const u=a.data.data.chainId,l=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(l,Number(u))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,X.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(e=this._storage.getItem(kl))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(kl,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(Il,r.toString(10)),((0,X.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,r,n,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,r,n,i,s,o){var a,c;if((0,X.ensureIntNumber)(e)===this.getChainId())return!1;const u=await this.initializeRelay(),l=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!l&&await u.requestEthereumAccounts().promise;const h=await u.addEthereumChain(e.toString(),r,s,n,i,o).promise;return((a=h.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,w2.isErrorResponse)(n)&&n.errorCode)throw n.errorCode===pe.standardErrorCodes.provider.unsupportedChain?pe.standardErrors.provider.unsupportedChain(e):pe.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode});const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(ba.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?xl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this.send(ce.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,pe.serializeError)(i,e)})}catch(n){throw(0,pe.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,pe.serializeError)(n,e)})}catch(n){return Promise.reject((0,pe.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,pe.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,pe.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw pe.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw pe.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw pe.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var r;const i=await(await this.initializeRelay()).scanQRCode((0,X.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,pe.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",ga.Web3Method.scanQRCode);return i.result}async genericRequest(e,r){var n;const s=await(await this.initializeRelay()).genericRequest(e,r).promise;if(typeof s.result!="string")throw(0,pe.serializeError)((n=s.errorMessage)!==null&&n!==void 0?n:"result was not a string",ga.Web3Method.generic);return s.result}async selectProvider(e){var r;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,pe.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",ga.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,X.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!r||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ce.JSONRPCMethod.eth_accounts:return this._eth_accounts();case ce.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case ce.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case ce.JSONRPCMethod.net_version:return this._net_version();case ce.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ce.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case ce.JSONRPCMethod.eth_sign:return this._eth_sign(n);case ce.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case ce.JSONRPCMethod.personal_sign:return this._personal_sign(n);case ce.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case ce.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case ce.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case ce.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case ce.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case ce.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case ce.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case ce.JSONRPCMethod.eth_signTypedData_v4:case ce.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case ce.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case ce.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case ce.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case ce.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ce.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case ce.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case ce.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case ce.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case ce.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case ce.JSONRPCMethod.eth_subscribe:case ce.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,X.ensureAddressString)(e);return this._addresses.map(i=>(0,X.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(ba.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,X.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,X.ensureAddressString)(e.to):null,i=e.value!=null?(0,X.ensureBN)(e.value):new _2.default(0),s=e.data?(0,X.ensureBuffer)(e.data):ee.alloc(0),o=e.nonce!=null?(0,X.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,X.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,X.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,X.ensureBN)(e.maxPriorityFeePerGas):null,l=e.gas!=null?(0,X.ensureBN)(e.gas):null,h=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLimit:l,chainId:h}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw pe.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw pe.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?pe.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,X.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Il);if(!e)return(0,X.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,X.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(ba.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?xl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?pe.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?pe.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,X.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?pe.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,X.ensureParsedJSONObject)(e[0]),n=(0,X.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=va.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=va.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=va.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const o=e[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw pe.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw pe.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw pe.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw pe.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw pe.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw pe.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}Wr.CoinbaseWalletProvider=C2;var _s={},ws={},ri,Q,pd,bd,ur,Tl,gd,Da,vd,Hr={},yd=[],x2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ss=Array.isArray;function Pt(t,e){for(var r in e)t[r]=e[r];return t}function md(t){var e=t.parentNode;e&&e.removeChild(t)}function $a(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ri.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return In(t,o,n,i,null)}function In(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++pd};return i==null&&Q.vnode!=null&&Q.vnode(s),s}function R2(){return{current:null}}function ni(t){return t.children}function kn(t,e){this.props=t,this.context=e}function Ln(t,e){if(e==null)return t.__?Ln(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Ln(t):null}function _d(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return _d(t)}}function Ba(t){(!t.__d&&(t.__d=!0)&&ur.push(t)&&!ji.__r++||Tl!==Q.debounceRendering)&&((Tl=Q.debounceRendering)||gd)(ji)}function ji(){var t,e,r,n,i,s,o,a,c;for(ur.sort(Da);t=ur.shift();)t.__d&&(e=ur.length,n=void 0,i=void 0,s=void 0,a=(o=(r=t).__v).__e,(c=r.__P)&&(n=[],i=[],(s=Pt({},o)).__v=o.__v+1,Mc(c,o,s,r.__n,c.ownerSVGElement!==void 0,o.__h!=null?[a]:null,n,a??Ln(o),o.__h,i),xd(n,o,i),o.__e!=a&&_d(o)),ur.length>e&&ur.sort(Da));ji.__r=0}function wd(t,e,r,n,i,s,o,a,c,u,l){var h,f,d,y,m,C,p,v,_,x=0,E=n&&n.__k||yd,k=E.length,$=k,j=e.length;for(r.__k=[],h=0;h<j;h++)(y=r.__k[h]=(y=e[h])==null||typeof y=="boolean"||typeof y=="function"?null:typeof y=="string"||typeof y=="number"||typeof y=="bigint"?In(null,y,null,null,y):Ss(y)?In(ni,{children:y},null,null,null):y.__b>0?In(y.type,y.props,y.key,y.ref?y.ref:null,y.__v):y)!=null?(y.__=r,y.__b=r.__b+1,(v=I2(y,E,p=h+x,$))===-1?d=Hr:(d=E[v]||Hr,E[v]=void 0,$--),Mc(t,y,d,i,s,o,a,c,u,l),m=y.__e,(f=y.ref)&&d.ref!=f&&(d.ref&&Nc(d.ref,null,y),l.push(f,y.__c||m,y)),m!=null&&(C==null&&(C=m),(_=d===Hr||d.__v===null)?v==-1&&x--:v!==p&&(v===p+1?x++:v>p?$>j-p?x+=v-p:x--:x=v<p&&v==p-1?v-p:0),p=h+x,typeof y.type!="function"||v===p&&d.__k!==y.__k?typeof y.type=="function"||v===p&&!_?y.__d!==void 0?(c=y.__d,y.__d=void 0):c=m.nextSibling:c=Cd(t,m,c):c=Sd(y,c,t),typeof r.type=="function"&&(r.__d=c))):(d=E[h])&&d.key==null&&d.__e&&(d.__e==c&&(c=Ln(d)),Fa(d,d,!1),E[h]=null);for(r.__e=C,h=k;h--;)E[h]!=null&&(typeof r.type=="function"&&E[h].__e!=null&&E[h].__e==r.__d&&(r.__d=E[h].__e.nextSibling),Fa(E[h],E[h]))}function Sd(t,e,r){for(var n,i=t.__k,s=0;i&&s<i.length;s++)(n=i[s])&&(n.__=t,e=typeof n.type=="function"?Sd(n,e,r):Cd(r,n.__e,e));return e}function Ed(t,e){return e=e||[],t==null||typeof t=="boolean"||(Ss(t)?t.some(function(r){Ed(r,e)}):e.push(t)),e}function Cd(t,e,r){return r==null||r.parentNode!==t?t.insertBefore(e,null):e==r&&e.parentNode!=null||t.insertBefore(e,r),e.nextSibling}function I2(t,e,r,n){var i=t.key,s=t.type,o=r-1,a=r+1,c=e[r];if(c===null||c&&i==c.key&&s===c.type)return r;if(n>(c!=null?1:0))for(;o>=0||a<e.length;){if(o>=0){if((c=e[o])&&i==c.key&&s===c.type)return o;o--}if(a<e.length){if((c=e[a])&&i==c.key&&s===c.type)return a;a++}}return-1}function k2(t,e,r,n,i){var s;for(s in r)s==="children"||s==="key"||s in e||Pi(t,s,null,r[s],n);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||r[s]===e[s]||Pi(t,s,e[s],r[s],n)}function Al(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||x2.test(e)?r:r+"px"}function Pi(t,e,r,n,i){var s;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Al(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||Al(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n||t.addEventListener(e,s?Nl:Ml,s):t.removeEventListener(e,s?Nl:Ml,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,r))}}function Ml(t){return this.l[t.type+!1](Q.event?Q.event(t):t)}function Nl(t){return this.l[t.type+!0](Q.event?Q.event(t):t)}function Mc(t,e,r,n,i,s,o,a,c,u){var l,h,f,d,y,m,C,p,v,_,x,E,k,$,j,T=e.type;if(e.constructor!==void 0)return null;r.__h!=null&&(c=r.__h,a=e.__e=r.__e,e.__h=null,s=[a]),(l=Q.__b)&&l(e);e:if(typeof T=="function")try{if(p=e.props,v=(l=T.contextType)&&n[l.__c],_=l?v?v.props.value:l.__:n,r.__c?C=(h=e.__c=r.__c).__=h.__E:("prototype"in T&&T.prototype.render?e.__c=h=new T(p,_):(e.__c=h=new kn(p,_),h.constructor=T,h.render=A2),v&&v.sub(h),h.props=p,h.state||(h.state={}),h.context=_,h.__n=n,f=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),T.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Pt({},h.__s)),Pt(h.__s,T.getDerivedStateFromProps(p,h.__s))),d=h.props,y=h.state,h.__v=e,f)T.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(T.getDerivedStateFromProps==null&&p!==d&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(p,_),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(p,h.__s,_)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(h.props=p,h.state=h.__s,h.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(z){z&&(z.__=e)}),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(p,h.__s,_),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(d,y,m)})}if(h.context=_,h.props=p,h.__P=t,h.__e=!1,E=Q.__r,k=0,"prototype"in T&&T.prototype.render){for(h.state=h.__s,h.__d=!1,E&&E(e),l=h.render(h.props,h.state,h.context),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[]}else do h.__d=!1,E&&E(e),l=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++k<25);h.state=h.__s,h.getChildContext!=null&&(n=Pt(Pt({},n),h.getChildContext())),f||h.getSnapshotBeforeUpdate==null||(m=h.getSnapshotBeforeUpdate(d,y)),wd(t,Ss(j=l!=null&&l.type===ni&&l.key==null?l.props.children:l)?j:[j],e,r,n,i,s,o,a,c,u),h.base=e.__e,e.__h=null,h.__h.length&&o.push(h),C&&(h.__E=h.__=null)}catch(z){e.__v=null,(c||s!=null)&&(e.__e=a,e.__h=!!c,s[s.indexOf(a)]=null),Q.__e(z,e,r)}else s==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=T2(r.__e,e,r,n,i,s,o,c,u);(l=Q.diffed)&&l(e)}function xd(t,e,r){for(var n=0;n<r.length;n++)Nc(r[n],r[++n],r[++n]);Q.__c&&Q.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){Q.__e(s,i.__v)}})}function T2(t,e,r,n,i,s,o,a,c){var u,l,h,f=r.props,d=e.props,y=e.type,m=0;if(y==="svg"&&(i=!0),s!=null){for(;m<s.length;m++)if((u=s[m])&&"setAttribute"in u==!!y&&(y?u.localName===y:u.nodeType===3)){t=u,s[m]=null;break}}if(t==null){if(y===null)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,d.is&&d),s=null,a=!1}if(y===null)f===d||a&&t.data===d||(t.data=d);else{if(s=s&&ri.call(t.childNodes),l=(f=r.props||Hr).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!a){if(s!=null)for(f={},m=0;m<t.attributes.length;m++)f[t.attributes[m].name]=t.attributes[m].value;(h||l)&&(h&&(l&&h.__html==l.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(k2(t,d,f,i,a),h)e.__k=[];else if(wd(t,Ss(m=e.props.children)?m:[m],e,r,n,i&&y!=="foreignObject",s,o,s?s[0]:r.__k&&Ln(r,0),a,c),s!=null)for(m=s.length;m--;)s[m]!=null&&md(s[m]);a||("value"in d&&(m=d.value)!==void 0&&(m!==t.value||y==="progress"&&!m||y==="option"&&m!==f.value)&&Pi(t,"value",m,f.value,!1),"checked"in d&&(m=d.checked)!==void 0&&m!==t.checked&&Pi(t,"checked",m,f.checked,!1))}return t}function Nc(t,e,r){try{typeof t=="function"?t(e):t.current=e}catch(n){Q.__e(n,r)}}function Fa(t,e,r){var n,i;if(Q.unmount&&Q.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Nc(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){Q.__e(s,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Fa(n[i],e,r||typeof t.type!="function");r||t.__e==null||md(t.__e),t.__=t.__e=t.__d=void 0}function A2(t,e,r){return this.constructor(t,r)}function Rd(t,e,r){var n,i,s,o;Q.__&&Q.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],o=[],Mc(e,t=(!n&&r||e).__k=$a(ni,null,[t]),i||Hr,Hr,e.ownerSVGElement!==void 0,!n&&r?[r]:i?null:e.firstChild?ri.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,o),xd(s,t,o)}function Id(t,e){Rd(t,e,Id)}function M2(t,e,r){var n,i,s,o,a=Pt({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?n=e[s]:s=="ref"?i=e[s]:a[s]=e[s]===void 0&&o!==void 0?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?ri.call(arguments,2):r),In(t.type,a,n||t.key,i||t.ref,null)}function N2(t,e){var r={__c:e="__cC"+vd++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,Ba(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}ri=yd.slice,Q={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},pd=0,bd=function(t){return t!=null&&t.constructor===void 0},kn.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Pt({},this.state),typeof t=="function"&&(t=t(Pt({},r),this.props)),t&&Pt(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Ba(this))},kn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ba(this))},kn.prototype.render=ni,ur=[],gd=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Da=function(t,e){return t.__v.__b-e.__v.__b},ji.__r=0,vd=0;const O2=Object.freeze(Object.defineProperty({__proto__:null,Component:kn,Fragment:ni,cloneElement:M2,createContext:N2,createElement:$a,createRef:R2,h:$a,hydrate:Id,get isValidElement(){return bd},get options(){return Q},render:Rd,toChildArray:Ed},Symbol.toStringTag,{value:"Module"})),Ye=nn(O2);function Zr(t){return typeof t=="function"}var Ol=!1,tt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}Ol=t},get useDeprecatedSynchronousErrorHandling(){return Ol}};function jr(t){setTimeout(function(){throw t},0)}var Di={closed:!0,next:function(t){},error:function(t){if(tt.useDeprecatedSynchronousErrorHandling)throw t;jr(t)},complete:function(){}},We=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Oc(t){return t!==null&&typeof t=="object"}var L2=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
7
+ `+e.map(function(r,n){return n+1+") "+r.toString()}).join(`
8
+ `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),Tn=L2,we=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,s=r._unsubscribe,o=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(n!==null)for(var a=0;a<n.length;++a){var c=n[a];c.remove(this)}if(Zr(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(h){e=h instanceof Tn?Ll(h.errors):[h]}}if(We(o))for(var a=-1,u=o.length;++a<u;){var l=o[a];if(Oc(l))try{l.unsubscribe()}catch(f){e=e||[],f instanceof Tn?e=e.concat(Ll(f.errors)):e.push(f)}}if(e)throw new Tn(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||typeof r.unsubscribe!="function")return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;r=new t,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(i===null)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return r;var s=this._subscriptions;return s===null?this._subscriptions=[r]:s.push(r),r},t.prototype.remove=function(e){var r=this._subscriptions;if(r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();function Ll(t){return t.reduce(function(e,r){return e.concat(r instanceof Tn?r.errors:r)},[])}var $i=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),W=function(t){R(e,t);function e(r,n,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=Di;break;case 1:if(!r){s.destination=Di;break}if(typeof r=="object"){r instanceof e?(s.syncErrorThrowable=r.syncErrorThrowable,s.destination=r,r.add(s)):(s.syncErrorThrowable=!0,s.destination=new jl(s,r));break}default:s.syncErrorThrowable=!0,s.destination=new jl(s,r,n,i);break}return s}return e.prototype[$i]=function(){return this},e.create=function(r,n,i){var s=new e(r,n,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},e}(we),jl=function(t){R(e,t);function e(r,n,i,s){var o=t.call(this)||this;o._parentSubscriber=r;var a,c=o;return Zr(n)?a=n:n&&(a=n.next,i=n.error,s=n.complete,n!==Di&&(c=Object.create(n),Zr(c.unsubscribe)&&o.add(c.unsubscribe.bind(c)),c.unsubscribe=o.unsubscribe.bind(o))),o._context=c,o._next=a,o._error=i,o._complete=s,o}return e.prototype.next=function(r){if(!this.isStopped&&this._next){var n=this._parentSubscriber;!tt.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?this.__tryOrUnsub(this._next,r):this.__tryOrSetError(n,this._next,r)&&this.unsubscribe()}},e.prototype.error=function(r){if(!this.isStopped){var n=this._parentSubscriber,i=tt.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!n.syncErrorThrowable?(this.__tryOrUnsub(this._error,r),this.unsubscribe()):(this.__tryOrSetError(n,this._error,r),this.unsubscribe());else if(n.syncErrorThrowable)i?(n.syncErrorValue=r,n.syncErrorThrown=!0):jr(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;jr(r)}}},e.prototype.complete=function(){var r=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var i=function(){return r._complete.call(r._context)};!tt.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(n,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(r,n){try{r.call(this._context,n)}catch(i){if(this.unsubscribe(),tt.useDeprecatedSynchronousErrorHandling)throw i;jr(i)}},e.prototype.__tryOrSetError=function(r,n,i){if(!tt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(s){return tt.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=s,r.syncErrorThrown=!0,!0):(jr(s),!0)}return!1},e.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},e}(W);function Lc(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;n&&n instanceof W?t=n:t=null}return!0}function j2(t,e,r){if(t){if(t instanceof W)return t;if(t[$i])return t[$i]()}return!t&&!e&&!r?new W(Di):new W(t,e,r)}var fn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Yt(t){return t}function Ha(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return kd(t)}function kd(t){return t.length===0?Yt:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var te=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this.operator,s=j2(e,r,n);if(i?s.add(i.call(s,this.source)):s.add(this.source||tt.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),tt.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){tt.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=r),Lc(e)?e.error(r):console.warn(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Pl(r),new r(function(i,s){var o;o=n.subscribe(function(a){try{e(a)}catch(c){s(c),o&&o.unsubscribe()}},s,i)})},t.prototype._subscribe=function(e){var r=this.source;return r&&r.subscribe(e)},t.prototype[fn]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.length===0?this:kd(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Pl(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t}();function Pl(t){if(t||(t=tt.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var P2=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Gt=P2,Td=function(t){R(e,t);function e(r,n){var i=t.call(this)||this;return i.subject=r,i.subscriber=n,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var r=this.subject,n=r.observers;if(this.subject=null,!(!n||n.length===0||r.isStopped||r.closed)){var i=n.indexOf(this.subscriber);i!==-1&&n.splice(i,1)}}},e}(we),Ad=function(t){R(e,t);function e(r){var n=t.call(this,r)||this;return n.destination=r,n}return e}(W),Oe=function(t){R(e,t);function e(){var r=t.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype[$i]=function(){return new Ad(this)},e.prototype.lift=function(r){var n=new Dl(this,this);return n.operator=r,n},e.prototype.next=function(r){if(this.closed)throw new Gt;if(!this.isStopped)for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].next(r)},e.prototype.error=function(r){if(this.closed)throw new Gt;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].error(r);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new Gt;this.isStopped=!0;for(var r=this.observers,n=r.length,i=r.slice(),s=0;s<n;s++)i[s].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(r){if(this.closed)throw new Gt;return t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){if(this.closed)throw new Gt;return this.hasError?(r.error(this.thrownError),we.EMPTY):this.isStopped?(r.complete(),we.EMPTY):(this.observers.push(r),new Td(this,r))},e.prototype.asObservable=function(){var r=new te;return r.source=this,r},e.create=function(r,n){return new Dl(r,n)},e}(te),Dl=function(t){R(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n=this.destination;n&&n.next&&n.next(r)},e.prototype.error=function(r){var n=this.destination;n&&n.error&&this.destination.error(r)},e.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},e.prototype._subscribe=function(r){var n=this.source;return n?this.source.subscribe(r):we.EMPTY},e}(Oe);function jc(){return function(e){return e.lift(new D2(e))}}var D2=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,r){var n=this.connectable;n._refCount++;var i=new $2(e,n),s=r.subscribe(i);return i.closed||(i.connection=n.connect()),s},t}(),$2=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,s=r._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(W),Md=function(t){R(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new we,r.add(this.source.subscribe(new F2(this.getSubject(),this))),r.closed&&(this._connection=null,r=we.EMPTY)),r},e.prototype.refCount=function(){return jc()(this)},e}(te),B2=function(){var t=Md.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),F2=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._error=function(r){this._unsubscribe(),t.prototype._error.call(this,r)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},e}(Ad);function H2(t,e,r,n){return function(i){return i.lift(new V2(t,e,r,n))}}var V2=function(){function t(e,r,n,i){this.keySelector=e,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(e,r){return r.subscribe(new W2(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),W2=function(t){R(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.keySelector=n,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},e.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(n),o;if(this.elementSelector)try{o=this.elementSelector(r)}catch(u){this.error(u)}else o=r;if(!s){s=this.subjectSelector?this.subjectSelector():new Oe,i.set(n,s);var a=new Va(n,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new Va(n,s))}catch(u){this.error(u);return}this.add(c.subscribe(new U2(n,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,s){i.error(r)}),n.clear()),this.destination.error(r)},e.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},e.prototype.removeGroup=function(r){this.groups.delete(r)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(W),U2=function(t){R(e,t);function e(r,n,i){var s=t.call(this,n)||this;return s.key=r,s.group=n,s.parent=i,s}return e.prototype._next=function(r){this.complete()},e.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},e}(W),Va=function(t){R(e,t);function e(r,n,i){var s=t.call(this)||this;return s.key=r,s.groupSubject=n,s.refCountSubscription=i,s}return e.prototype._subscribe=function(r){var n=new we,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&n.add(new z2(s)),n.add(o.subscribe(r)),n},e}(te),z2=function(t){R(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,r.count++,n}return e.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},e}(we),Nd=function(t){R(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Gt;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Oe),q2=function(t){R(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(we),ii=function(t){R(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s=void 0;try{this.work(r)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},e}(q2),G2=function(t){R(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(ii),Wa=function(){function t(e,r){r===void 0&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,e).schedule(n,r)},t.now=function(){return Date.now()},t}(),si=function(t){R(e,t);function e(r,n){n===void 0&&(n=Wa.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Wa),J2=function(t){R(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(si),Od=new J2(G2),Ld=Od,Yr=new te(function(t){return t.complete()});function dn(t){return t?Q2(t):Yr}function Q2(t){return new te(function(e){return t.schedule(function(){return e.complete()})})}function Ze(t){return t&&typeof t.schedule=="function"}var jd=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function Pc(t,e){return new te(function(r){var n=new we,i=0;return n.add(e.schedule(function(){if(i===t.length){r.complete();return}r.next(t[i++]),r.closed||n.add(this.schedule())})),n})}function oi(t,e){return e?Pc(t,e):new te(jd(t))}function Es(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Ze(r)?(t.pop(),Pc(t,r)):oi(t)}function Dc(t,e){return e?new te(function(r){return e.schedule(Z2,0,{error:t,subscriber:r})}):new te(function(r){return r.error(t)})}function Z2(t){var e=t.error,r=t.subscriber;r.error(e)}var Ua;Ua||(Ua={});var Dt=function(){function t(e,r,n){this.kind=e,this.value=r,this.error=n,this.hasValue=e==="N"}return t.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},t.prototype.do=function(e,r,n){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return r&&r(this.error);case"C":return n&&n()}},t.prototype.accept=function(e,r,n){return e&&typeof e.next=="function"?this.observe(e):this.do(e,r,n)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return Es(this.value);case"E":return Dc(this.error);case"C":return dn()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return typeof e<"u"?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function Y2(t,e){return e===void 0&&(e=0),function(n){return n.lift(new K2(t,e))}}var K2=function(){function t(e,r){r===void 0&&(r=0),this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return r.subscribe(new Pd(e,this.scheduler,this.delay))},t}(),Pd=function(t){R(e,t);function e(r,n,i){i===void 0&&(i=0);var s=t.call(this,r)||this;return s.scheduler=n,s.delay=i,s}return e.dispatch=function(r){var n=r.notification,i=r.destination;n.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(r){var n=this.destination;n.add(this.scheduler.schedule(e.dispatch,this.delay,new X2(r,this.destination)))},e.prototype._next=function(r){this.scheduleMessage(Dt.createNext(r))},e.prototype._error=function(r){this.scheduleMessage(Dt.createError(r)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(Dt.createComplete()),this.unsubscribe()},e}(W),X2=function(){function t(e,r){this.notification=e,this.destination=r}return t}(),$c=function(t){R(e,t);function e(r,n,i){r===void 0&&(r=Number.POSITIVE_INFINITY),n===void 0&&(n=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=r<1?1:r,s._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return e.prototype.nextInfiniteTimeWindow=function(r){if(!this.isStopped){var n=this._events;n.push(r),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,r)},e.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new eS(this._getNow(),r)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new Gt;if(this.isStopped||this.hasError?a=we.EMPTY:(this.observers.push(r),a=new Td(this,r)),s&&r.add(r=new Pd(r,s)),n)for(var c=0;c<o&&!r.closed;c++)r.next(i[c]);else for(var c=0;c<o&&!r.closed;c++)r.next(i[c].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),a},e.prototype._getNow=function(){return(this.scheduler||Ld).now()},e.prototype._trimBufferThenGetEvents=function(){for(var r=this._getNow(),n=this._bufferSize,i=this._windowTime,s=this._events,o=s.length,a=0;a<o&&!(r-s[a].time<i);)a++;return o>n&&(a=Math.max(a,o-n)),a>0&&s.splice(0,a),s},e}(Oe),eS=function(){function t(e,r){this.time=e,this.value=r}return t}(),pn=function(t){R(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return e.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),we.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),we.EMPTY):t.prototype._subscribe.call(this,r)},e.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},e.prototype.error=function(r){this.hasCompleted||t.prototype.error.call(this,r)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Oe),tS=1,rS=function(){return Promise.resolve()}(),za={};function $l(t){return t in za?(delete za[t],!0):!1}var Bl={setImmediate:function(t){var e=tS++;return za[e]=!0,rS.then(function(){return $l(e)&&t()}),e},clearImmediate:function(t){$l(t)}},nS=function(t){R(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=Bl.setImmediate(r.flush.bind(r,null))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(Bl.clearImmediate(n),r.scheduled=void 0)},e}(ii),iS=function(t){R(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(si),Dd=new iS(nS),Ri=Dd,$d=new si(ii),Ue=$d,sS=function(t){R(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},e}(ii),oS=function(t){R(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(si),Bd=new oS(sS),aS=Bd,cS=function(t){R(e,t);function e(r,n){r===void 0&&(r=Fd),n===void 0&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,s,o;(o=n[0])&&o.delay<=i&&(n.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=n.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(si),Fd=function(t){R(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var s=t.call(this,r,n)||this;return s.scheduler=r,s.work=n,s.index=i,s.active=!0,s.index=r.index=i,s}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var s=r.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(ii);function Et(){}function uS(t){return!!t&&(t instanceof te||typeof t.lift=="function"&&typeof t.subscribe=="function")}var lS=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),Kr=lS,hS=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),ai=hS,fS=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),Hd=fS;function at(t,e){return function(n){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new dS(t,e))}}var dS=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new pS(e,this.project,this.thisArg))},t}(),pS=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.project=n,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(W);function Vd(t,e,r){if(e)if(Ze(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Vd(t,r).apply(void 0,n).pipe(at(function(s){return We(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=this,o,a={context:s,subject:o,callbackFunc:t,scheduler:r};return new te(function(c){if(r){var l={args:n,subscriber:c,params:a};return r.schedule(bS,0,l)}else{if(!o){o=new pn;var u=function(){for(var h=[],f=0;f<arguments.length;f++)h[f]=arguments[f];o.next(h.length<=1?h[0]:h),o.complete()};try{t.apply(s,n.concat([u]))}catch(h){Lc(o)?o.error(h):console.warn(h)}}return o.subscribe(c)}})}}function bS(t){var e=this,r=t.args,n=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new pn;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var f=l.length<=1?l[0]:l;e.add(a.schedule(gS,0,{value:f,subject:c}))};try{s.apply(o,r.concat([u]))}catch(l){c.error(l)}}this.add(c.subscribe(n))}function gS(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function Wd(t,e,r){if(e)if(Ze(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Wd(t,r).apply(void 0,n).pipe(at(function(s){return We(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s={subject:void 0,args:n,callbackFunc:t,scheduler:r,context:this};return new te(function(o){var a=s.context,c=s.subject;if(r)return r.schedule(vS,0,{params:s,subscriber:o,context:a});if(!c){c=s.subject=new pn;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var f=l.shift();if(f){c.error(f);return}c.next(l.length<=1?l[0]:l),c.complete()};try{t.apply(a,n.concat([u]))}catch(l){Lc(c)?c.error(l):console.warn(l)}}return c.subscribe(o)})}}function vS(t){var e=this,r=t.params,n=t.subscriber,i=t.context,s=r.callbackFunc,o=r.args,a=r.scheduler,c=r.subject;if(!c){c=r.subject=new pn;var u=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];var f=l.shift();if(f)e.add(a.schedule(Fl,0,{err:f,subject:c}));else{var d=l.length<=1?l[0]:l;e.add(a.schedule(yS,0,{value:d,subject:c}))}};try{s.apply(i,o.concat([u]))}catch(l){this.add(a.schedule(Fl,0,{err:l,subject:c}))}}this.add(c.subscribe(n))}function yS(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function Fl(t){var e=t.err,r=t.subject;r.error(e)}var Cr=function(t){R(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(n)},e.prototype.notifyError=function(r,n){this.destination.error(r)},e.prototype.notifyComplete=function(r){this.destination.complete()},e}(W),mS=function(t){R(e,t);function e(r,n,i){var s=t.call(this)||this;return s.parent=r,s.outerValue=n,s.outerIndex=i,s.index=0,s}return e.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this.index++,this)},e.prototype._error=function(r){this.parent.notifyError(r,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(W),_S=function(t){return function(e){return t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,jr),e}};function wS(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Kt=wS(),SS=function(t){return function(e){var r=t[Kt]();do{var n=void 0;try{n=r.next()}catch(i){return e.error(i),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}while(!0);return typeof r.return=="function"&&e.add(function(){r.return&&r.return()}),e}},ES=function(t){return function(e){var r=t[fn]();if(typeof r.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(e)}},Ud=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function zd(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var jn=function(t){if(t&&typeof t[fn]=="function")return ES(t);if(Ud(t))return jd(t);if(zd(t))return _S(t);if(t&&typeof t[Kt]=="function")return SS(t);var e=Oc(t)?"an invalid object":"'"+t+"'",r="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)};function Bt(t,e,r,n,i){if(i===void 0&&(i=new mS(t,r,n)),!i.closed)return e instanceof te?e.subscribe(i):jn(e)(i)}var Hl={};function CS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return Ze(t[t.length-1])&&(n=t.pop()),typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&We(t[0])&&(t=t[0]),oi(t,n).lift(new Bc(r))}var Bc=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new xS(e,this.resultSelector))},t}(),xS=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.resultSelector=n,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(r){this.values.push(Hl),this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{this.active=n,this.toRespond=n;for(var i=0;i<n;i++){var s=r[i];this.add(Bt(this,s,void 0,i))}}},e.prototype.notifyComplete=function(r){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(r,n,i){var s=this.values,o=s[i],a=this.toRespond?o===Hl?--this.toRespond:this.toRespond:0;s[i]=n,a===0&&(this.resultSelector?this._tryResultSelector(s):this.destination.next(s.slice()))},e.prototype._tryResultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Cr);function RS(t,e){return new te(function(r){var n=new we;return n.add(e.schedule(function(){var i=t[fn]();n.add(i.subscribe({next:function(s){n.add(e.schedule(function(){return r.next(s)}))},error:function(s){n.add(e.schedule(function(){return r.error(s)}))},complete:function(){n.add(e.schedule(function(){return r.complete()}))}}))})),n})}function IS(t,e){return new te(function(r){var n=new we;return n.add(e.schedule(function(){return t.then(function(i){n.add(e.schedule(function(){r.next(i),n.add(e.schedule(function(){return r.complete()}))}))},function(i){n.add(e.schedule(function(){return r.error(i)}))})})),n})}function kS(t,e){if(!t)throw new Error("Iterable cannot be null");return new te(function(r){var n=new we,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(e.schedule(function(){i=t[Kt](),n.add(e.schedule(function(){if(!r.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(c){r.error(c);return}o?r.complete():(r.next(s),this.schedule())}}))})),n})}function TS(t){return t&&typeof t[fn]=="function"}function AS(t){return t&&typeof t[Kt]=="function"}function qd(t,e){if(t!=null){if(TS(t))return RS(t,e);if(zd(t))return IS(t,e);if(Ud(t))return Pc(t,e);if(AS(t)||typeof t=="string")return kS(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function Ht(t,e){return e?qd(t,e):t instanceof te?t:new te(jn(t))}var Se=function(t){R(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,n}return e.prototype._next=function(r){this.parent.notifyNext(r)},e.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(W),Ee=function(t){R(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(W);function Ce(t,e){if(!e.closed){if(t instanceof te)return t.subscribe(e);var r;try{r=jn(t)(e)}catch(n){e.error(n)}return r}}function gr(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?function(n){return n.pipe(gr(function(i,s){return Ht(t(i,s)).pipe(at(function(o,a){return e(i,o,s,a)}))},r))}:(typeof e=="number"&&(r=e),function(n){return n.lift(new MS(t,r))})}var MS=function(){function t(e,r){r===void 0&&(r=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=r}return t.prototype.call=function(e,r){return r.subscribe(new NS(e,this.project,this.concurrent))},t}(),NS=function(t){R(e,t);function e(r,n,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,r)||this;return s.project=n,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(r){this.active<this.concurrent?this._tryNext(r):this.buffer.push(r)},e.prototype._tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.active++,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new Se(this),i=this.destination;i.add(n);var s=Ce(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(Ee),OS=gr;function Fc(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),gr(Yt,t)}function Gd(){return Fc(1)}function Pn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Gd()(Es.apply(void 0,t))}function Hc(t){return new te(function(e){var r;try{r=t()}catch(i){e.error(i);return}var n=r?Ht(r):dn();return n.subscribe(e)})}function LS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=t[0];if(We(r))return mi(r,null);if(Oc(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return mi(n.map(function(s){return r[s]}),n)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&We(t[0])?t[0]:t,mi(t,null).pipe(at(function(s){return i.apply(void 0,s)}))}return mi(t,null)}function mi(t,e){return new te(function(r){var n=t.length;if(n===0){r.complete();return}for(var i=new Array(n),s=0,o=0,a=function(u){var l=Ht(t[u]),h=!1;r.add(l.subscribe({next:function(f){h||(h=!0,o++),i[u]=f},error:function(f){return r.error(f)},complete:function(){s++,(s===n||!h)&&(o===n&&r.next(e?e.reduce(function(f,d,y){return f[d]=i[y],f},{}):i),r.complete())}}))},c=0;c<n;c++)a(c)})}function Jd(t,e,r,n){return Zr(r)&&(n=r,r=void 0),n?Jd(t,e,r).pipe(at(function(i){return We(i)?n.apply(void 0,i):n(i)})):new te(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}Qd(t,e,s,i,r)})}function Qd(t,e,r,n,i){var s;if(DS(t)){var o=t;t.addEventListener(e,r,i),s=function(){return o.removeEventListener(e,r,i)}}else if(PS(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(jS(t)){var c=t;t.addListener(e,r),s=function(){return c.removeListener(e,r)}}else if(t&&t.length)for(var u=0,l=t.length;u<l;u++)Qd(t[u],e,r,n,i);else throw new TypeError("Invalid event target");n.add(s)}function jS(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function PS(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function DS(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function Zd(t,e,r){return r?Zd(t,e).pipe(at(function(n){return We(n)?r.apply(void 0,n):r(n)})):new te(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},s;try{s=t(i)}catch(o){n.error(o);return}if(Zr(e))return function(){return e(i,s)}})}function $S(t,e,r,n,i){var s,o;if(arguments.length==1){var a=t;o=a.initialState,e=a.condition,r=a.iterate,s=a.resultSelector||Yt,i=a.scheduler}else n===void 0||Ze(n)?(o=t,s=Yt,i=n):(o=t,s=n);return new te(function(c){var u=o;if(i)return i.schedule(BS,0,{subscriber:c,iterate:r,condition:e,resultSelector:s,state:u});do{if(e){var l=void 0;try{l=e(u)}catch(f){c.error(f);return}if(!l){c.complete();break}}var h=void 0;try{h=s(u)}catch(f){c.error(f);return}if(c.next(h),c.closed)break;try{u=r(u)}catch(f){c.error(f);return}}while(!0)})}function BS(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(s){e.error(s);return}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(s){e.error(s);return}if(!n){e.complete();return}if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(s){e.error(s);return}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function FS(t,e,r){return e===void 0&&(e=Yr),r===void 0&&(r=Yr),Hc(function(){return t()?e:r})}function Xr(t){return!We(t)&&t-parseFloat(t)+1>=0}function HS(t,e){return t===void 0&&(t=0),e===void 0&&(e=Ue),(!Xr(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=Ue),new te(function(r){return r.add(e.schedule(VS,t,{subscriber:r,counter:0,period:t})),r})}function VS(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function Yd(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return Ze(i)?(n=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(r=t.pop())):typeof i=="number"&&(r=t.pop()),n===null&&t.length===1&&t[0]instanceof te?t[0]:Fc(r)(oi(t,n))}var Kd=new te(Et);function WS(){return Kd}function qa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return Yr;var r=t[0],n=t.slice(1);return t.length===1&&We(r)?qa.apply(void 0,r):new te(function(i){var s=function(){return i.add(qa.apply(void 0,n).subscribe(i))};return Ht(r).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function US(t,e){return e?new te(function(r){var n=Object.keys(t),i=new we;return i.add(e.schedule(zS,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}):new te(function(r){for(var n=Object.keys(t),i=0;i<n.length&&!r.closed;i++){var s=n[i];t.hasOwnProperty(s)&&r.next([s,t[s]])}r.complete()})}function zS(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,s=t.obj;if(!n.closed)if(r<e.length){var o=e[r];n.next([o,s[o]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:s}))}else n.complete()}function Xd(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function Xt(t,e){return function(n){return n.lift(new qS(t,e))}}var qS=function(){function t(e,r){this.predicate=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new GS(e,this.predicate,this.thisArg))},t}(),GS=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.thisArg=i,s.count=0,s}return e.prototype._next=function(r){var n;try{n=this.predicate.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}n&&this.destination.next(r)},e}(W);function JS(t,e,r){return[Xt(e,r)(new te(jn(t))),Xt(Xd(e,r))(new te(jn(t)))]}function ep(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(We(t[0]))t=t[0];else return t[0];return oi(t,void 0).lift(new QS)}var QS=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ZS(e))},t}(),ZS=function(t){R(e,t);function e(r){var n=t.call(this,r)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return e.prototype._next=function(r){this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{for(var i=0;i<n&&!this.hasFirst;i++){var s=r[i],o=Bt(this,s,void 0,i);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var s=0;s<this.subscriptions.length;s++)if(s!==i){var o=this.subscriptions[s];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(n)},e}(Cr);function YS(t,e,r){return t===void 0&&(t=0),new te(function(n){e===void 0&&(e=t,t=0);var i=0,s=t;if(r)return r.schedule(KS,0,{index:i,count:e,start:t,subscriber:n});do{if(i++>=e){n.complete();break}if(n.next(s++),n.closed)break}while(!0)})}function KS(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;if(r>=n){i.complete();return}i.next(e),!i.closed&&(t.index=r+1,t.start=e+1,this.schedule(t))}function tp(t,e,r){t===void 0&&(t=0);var n=-1;return Xr(e)?n=Number(e)<1&&1||Number(e):Ze(e)&&(r=e),Ze(r)||(r=Ue),new te(function(i){var s=Xr(t)?t:+t-r.now();return r.schedule(XS,s,{index:0,period:n,subscriber:i})})}function XS(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(r===-1)return n.complete();t.index=e+1,this.schedule(t,r)}}function eE(t,e){return new te(function(r){var n;try{n=t()}catch(a){r.error(a);return}var i;try{i=e(n)}catch(a){r.error(a);return}var s=i?Ht(i):Yr,o=s.subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function rp(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return typeof r=="function"&&t.pop(),oi(t,void 0).lift(new np(r))}var np=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new tE(e,this.resultSelector))},t}(),tE=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.resultSelector=n,s.iterators=[],s.active=0,s.resultSelector=typeof n=="function"?n:void 0,s}return e.prototype._next=function(r){var n=this.iterators;We(r)?n.push(new nE(r)):typeof r[Kt]=="function"?n.push(new rE(r[Kt]())):n.push(new iE(this.destination,this,r))},e.prototype._complete=function(){var r=this.iterators,n=r.length;if(this.unsubscribe(),n===0){this.destination.complete();return}this.active=n;for(var i=0;i<n;i++){var s=r[i];if(s.stillUnsubscribed){var o=this.destination;o.add(s.subscribe())}else this.active--}},e.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},e.prototype.checkIterators=function(){for(var r=this.iterators,n=r.length,i=this.destination,s=0;s<n;s++){var o=r[s];if(typeof o.hasValue=="function"&&!o.hasValue())return}for(var a=!1,c=[],s=0;s<n;s++){var o=r[s],u=o.next();if(o.hasCompleted()&&(a=!0),u.done){i.complete();return}c.push(u.value)}this.resultSelector?this._tryresultSelector(c):i.next(c),a&&i.complete()},e.prototype._tryresultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(W),rE=function(){function t(e){this.iterator=e,this.nextResult=e.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},t.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},t}(),nE=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[Kt]=function(){return this},t.prototype.next=function(e){var r=this.index++,n=this.array;return r<this.length?{value:n[r],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),iE=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.parent=n,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[Kt]=function(){return this},e.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},e.prototype.subscribe=function(){return Ce(this.observable,new Se(this))},e}(Ee);const sE=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:Kr,AsyncSubject:pn,BehaviorSubject:Nd,ConnectableObservable:Md,EMPTY:Yr,EmptyError:ai,GroupedObservable:Va,NEVER:Kd,Notification:Dt,get NotificationKind(){return Ua},ObjectUnsubscribedError:Gt,Observable:te,ReplaySubject:$c,Scheduler:Wa,Subject:Oe,Subscriber:W,Subscription:we,TimeoutError:Hd,UnsubscriptionError:Tn,VirtualAction:Fd,VirtualTimeScheduler:cS,animationFrame:aS,animationFrameScheduler:Bd,asap:Ri,asapScheduler:Dd,async:Ue,asyncScheduler:$d,bindCallback:Vd,bindNodeCallback:Wd,combineLatest:CS,concat:Pn,config:tt,defer:Hc,empty:dn,forkJoin:LS,from:Ht,fromEvent:Jd,fromEventPattern:Zd,generate:$S,identity:Yt,iif:FS,interval:HS,isObservable:uS,merge:Yd,never:WS,noop:Et,observable:fn,of:Es,onErrorResumeNext:qa,pairs:US,partition:JS,pipe:Ha,queue:Ld,queueScheduler:Od,race:ep,range:YS,scheduled:qd,throwError:Dc,timer:tp,using:eE,zip:rp},Symbol.toStringTag,{value:"Module"})),Cs=nn(sE);var xs={},Ft,be,ya,Vl,en=0,ip=[],Ii=[],Wl=Q.__b,Ul=Q.__r,zl=Q.diffed,ql=Q.__c,Gl=Q.unmount;function xr(t,e){Q.__h&&Q.__h(be,t,en||e),en=0;var r=be.__H||(be.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Ii}),r.__[t]}function sp(t){return en=1,op(cp,t)}function op(t,e,r){var n=xr(Ft++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):cp(void 0,e),function(a){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,a);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=be,!be.u)){var i=function(a,c,u){if(!n.__c.__H)return!0;var l=n.__c.__H.__.filter(function(f){return f.__c});if(l.every(function(f){return!f.__N}))return!s||s.call(this,a,c,u);var h=!1;return l.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(h=!0)}}),!(!h&&n.__c.props===a)&&(!s||s.call(this,a,c,u))};be.u=!0;var s=be.shouldComponentUpdate,o=be.componentWillUpdate;be.componentWillUpdate=function(a,c,u){if(this.__e){var l=s;s=void 0,i(a,c,u),s=l}o&&o.call(this,a,c,u)},be.shouldComponentUpdate=i}return n.__N||n.__}function oE(t,e){var r=xr(Ft++,3);!Q.__s&&Wc(r.__H,e)&&(r.__=t,r.i=e,be.__H.__h.push(r))}function ap(t,e){var r=xr(Ft++,4);!Q.__s&&Wc(r.__H,e)&&(r.__=t,r.i=e,be.__h.push(r))}function aE(t){return en=5,Vc(function(){return{current:t}},[])}function cE(t,e,r){en=6,ap(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Vc(t,e){var r=xr(Ft++,7);return Wc(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function uE(t,e){return en=8,Vc(function(){return t},e)}function lE(t){var e=be.context[t.__c],r=xr(Ft++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(be)),e.props.value):t.__}function hE(t,e){Q.useDebugValue&&Q.useDebugValue(e?e(t):t)}function fE(t){var e=xr(Ft++,10),r=sp();return e.__=t,be.componentDidCatch||(be.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function dE(){var t=xr(Ft++,11);if(!t.__){for(var e=be.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function pE(){for(var t;t=ip.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ki),t.__H.__h.forEach(Ga),t.__H.__h=[]}catch(e){t.__H.__h=[],Q.__e(e,t.__v)}}Q.__b=function(t){be=null,Wl&&Wl(t)},Q.__r=function(t){Ul&&Ul(t),Ft=0;var e=(be=t.__c).__H;e&&(ya===be?(e.__h=[],be.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ii,r.__N=r.i=void 0})):(e.__h.forEach(ki),e.__h.forEach(Ga),e.__h=[],Ft=0)),ya=be},Q.diffed=function(t){zl&&zl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ip.push(e)!==1&&Vl===Q.requestAnimationFrame||((Vl=Q.requestAnimationFrame)||bE)(pE)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ii&&(r.__=r.__V),r.i=void 0,r.__V=Ii})),ya=be=null},Q.__c=function(t,e){e.some(function(r){try{r.__h.forEach(ki),r.__h=r.__h.filter(function(n){return!n.__||Ga(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Q.__e(n,r.__v)}}),ql&&ql(t,e)},Q.unmount=function(t){Gl&&Gl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ki(n)}catch(i){e=i}}),r.__H=void 0,e&&Q.__e(e,r.__v))};var Jl=typeof requestAnimationFrame=="function";function bE(t){var e,r=function(){clearTimeout(n),Jl&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);Jl&&(e=requestAnimationFrame(r))}function ki(t){var e=be,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),be=e}function Ga(t){var e=be;t.__c=t.__(),be=e}function Wc(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function cp(t,e){return typeof e=="function"?e(t):e}const gE=Object.freeze(Object.defineProperty({__proto__:null,useCallback:uE,useContext:lE,useDebugValue:hE,useEffect:oE,useErrorBoundary:fE,useId:dE,useImperativeHandle:cE,useLayoutEffect:ap,useMemo:Vc,useReducer:op,useRef:aE,useState:sp},Symbol.toStringTag,{value:"Module"})),ci=nn(gE);var It={},Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.CloseIcon=void 0;const Ql=Ye;function vE(t){return(0,Ql.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ql.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"}))}Rs.CloseIcon=vE;var Uc={};Object.defineProperty(Uc,"__esModule",{value:!0});Uc.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var zc={};Object.defineProperty(zc,"__esModule",{value:!0});zc.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.QRCodeIcon=void 0;const _t=Ye;function yE(t){return(0,_t.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,_t.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,_t.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,_t.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,_t.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,_t.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,_t.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,_t.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,_t.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,_t.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}Is.QRCodeIcon=yE;var qc={};Object.defineProperty(qc,"__esModule",{value:!0});const mE=`
9
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>
11
+ <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>
12
+ <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>
13
+ </svg>
14
+ `;qc.default=mE;var Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.default=`
15
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
16
+ <circle cx="50" cy="50" r="50" fill="white"/>
17
+ <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
18
+ <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
19
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>
20
+ </svg>
21
+ `;var ks={};Object.defineProperty(ks,"__esModule",{value:!0});ks.StatusDotIcon=void 0;const Zl=Ye;function _E(t){return(0,Zl.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Zl.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}ks.StatusDotIcon=_E;var Ts={};function up(t){this.mode=Je.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):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))}up.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}};function kt(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}kt.prototype={addData:function(t){var e=new up(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=kt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=me.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var c=a*i,u=this.modules[s][a];u&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+i,o),n.lineTo(c+i,o+i),n.lineTo(c,o+i),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=me.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[n+s][i+o]=!0:this.modules[n+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=me.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=me.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s<t.length&&(c=(t[s]>>>i&1)==1);var u=me.getMask(e,n,o-a);u&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};kt.PAD0=236;kt.PAD1=17;kt.createData=function(t,e,r){for(var n=Ct.getRSBlocks(t,e),i=new lp,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),me.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(kt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(kt.PAD1,8);return kt.createBytes(i,n)};kt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var c=e[a].dataCount,u=e[a].totalCount-c;n=Math.max(n,c),i=Math.max(i,u),s[a]=new Array(c);for(var l=0;l<s[a].length;l++)s[a][l]=255&t.buffer[l+r];r+=c;var h=me.getErrorCorrectPolynomial(u),f=new Vr(s[a],h.getLength()-1),d=f.mod(h);o[a]=new Array(h.getLength()-1);for(var l=0;l<o[a].length;l++){var y=l+d.getLength()-o[a].length;o[a][l]=y>=0?d.get(y):0}}for(var m=0,l=0;l<e.length;l++)m+=e[l].totalCount;for(var C=new Array(m),p=0,l=0;l<n;l++)for(var a=0;a<e.length;a++)l<s[a].length&&(C[p++]=s[a][l]);for(var l=0;l<i;l++)for(var a=0;a<e.length;a++)l<o[a].length&&(C[p++]=o[a][l]);return C};var Je={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Jt={L:1,M:0,Q:3,H:2},Wt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},me={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(t){for(var e=t<<10;me.getBCHDigit(e)-me.getBCHDigit(me.G15)>=0;)e^=me.G15<<me.getBCHDigit(e)-me.getBCHDigit(me.G15);return(t<<10|e)^me.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;me.getBCHDigit(e)-me.getBCHDigit(me.G18)>=0;)e^=me.G18<<me.getBCHDigit(e)-me.getBCHDigit(me.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return me.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Wt.PATTERN000:return(e+r)%2==0;case Wt.PATTERN001:return e%2==0;case Wt.PATTERN010:return r%3==0;case Wt.PATTERN011:return(e+r)%3==0;case Wt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Wt.PATTERN101:return e*r%2+e*r%3==0;case Wt.PATTERN110:return(e*r%2+e*r%3)%2==0;case Wt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Vr([1],0),r=0;r<t;r++)e=e.multiply(new Vr([1,Ne.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Je.MODE_NUMBER:return 10;case Je.MODE_ALPHA_NUM:return 9;case Je.MODE_8BIT_BYTE:return 8;case Je.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Je.MODE_NUMBER:return 12;case Je.MODE_ALPHA_NUM:return 11;case Je.MODE_8BIT_BYTE:return 16;case Je.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Je.MODE_NUMBER:return 14;case Je.MODE_ALPHA_NUM:return 13;case Je.MODE_8BIT_BYTE:return 16;case Je.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||o==t.isDark(n+a,i+c)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var u=0;t.isDark(n,i)&&u++,t.isDark(n+1,i)&&u++,t.isDark(n,i+1)&&u++,t.isDark(n+1,i+1)&&u++,(u==0||u==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var l=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&l++;var h=Math.abs(100*l/e/e-50)/5;return r+=h*10,r}},Ne={glog:function(t){if(t<1)throw new Error("glog("+t+")");return Ne.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return Ne.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var je=0;je<8;je++)Ne.EXP_TABLE[je]=1<<je;for(var je=8;je<256;je++)Ne.EXP_TABLE[je]=Ne.EXP_TABLE[je-4]^Ne.EXP_TABLE[je-5]^Ne.EXP_TABLE[je-6]^Ne.EXP_TABLE[je-8];for(var je=0;je<255;je++)Ne.LOG_TABLE[Ne.EXP_TABLE[je]]=je;function Vr(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}Vr.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=Ne.gexp(Ne.glog(this.get(r))+Ne.glog(t.get(n)));return new Vr(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Ne.glog(this.get(0))-Ne.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=Ne.gexp(Ne.glog(t.get(n))+e);return new Vr(r,0).mod(t)}};function Ct(t,e){this.totalCount=t,this.dataCount=e}Ct.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]];Ct.getRSBlocks=function(t,e){var r=Ct.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var o=r[s*3+0],a=r[s*3+1],c=r[s*3+2],u=0;u<o;u++)i.push(new Ct(a,c));return i};Ct.getRsBlockTable=function(t,e){switch(e){case Jt.L:return Ct.RS_BLOCK_TABLE[(t-1)*4+0];case Jt.M:return Ct.RS_BLOCK_TABLE[(t-1)*4+1];case Jt.Q:return Ct.RS_BLOCK_TABLE[(t-1)*4+2];case Jt.H:return Ct.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function lp(){this.buffer=[],this.length=0}lp.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var ma=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function hp(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Jt.L;case"M":return Jt.M;case"Q":return Jt.Q;case"H":return Jt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,u){for(var l=i(c),h=1,f=0,d=0,y=ma.length;d<=y;d++){var m=ma[d];if(!m)throw new Error("Content too long: expected "+f+" but got "+l);switch(u){case"L":f=m[0];break;case"M":f=m[1];break;case"Q":f=m[2];break;case"H":f=m[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(l<=f)break;h++}if(h>ma.length)throw new Error("Content too long");return h}function i(c){var u=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return u.length+(u.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new kt(o,a),this.qrcode.addData(s),this.qrcode.make()}hp.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r
22
+ `:"",o=e.width,a=e.height,c=r.length,u=o/(c+2*e.padding),l=a/(c+2*e.padding),h=typeof e.join<"u"?!!e.join:!1,f=typeof e.swap<"u"?!!e.swap:!1,d=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,y=typeof e.predefined<"u"?!!e.predefined:!1,m=y?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+u+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",C=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,p="",v="",_=0;_<c;_++)for(var x=0;x<c;x++){var E=r[x][_];if(E){var k=x*u+e.padding*u,$=_*l+e.padding*l;if(f){var j=k;k=$,$=j}if(h){var T=u+k,z=l+$;k=Number.isInteger(k)?Number(k):k.toFixed(2),$=Number.isInteger($)?Number($):$.toFixed(2),T=Number.isInteger(T)?Number(T):T.toFixed(2),z=Number.isInteger(z)?Number(z):z.toFixed(2),v+="M"+k+","+$+" V"+z+" H"+T+" V"+$+" H"+k+" Z "}else y?p+=i+'<use x="'+k.toString()+'" y="'+$.toString()+'" href="#qrmodule" />'+s:p+=i+'<rect x="'+k.toString()+'" y="'+$.toString()+'" width="'+u+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}h&&(p=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+v+'" />');let le="";if(this.options.image!==void 0&&this.options.image.svg){const M=o*this.options.image.width/100,A=a*this.options.image.height/100,O=o/2-M/2,P=a/2-A/2;le+=`<svg x="${O}" y="${P}" width="${M}" height="${A}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,le+=this.options.image.svg+s,le+="</svg>"}var Z="";switch(t.container){case"svg":d&&(Z+='<?xml version="1.0" standalone="yes"?>'+s),Z+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,Z+=m+C+p,Z+=le,Z+="</svg>";break;case"svg-viewbox":d&&(Z+='<?xml version="1.0" standalone="yes"?>'+s),Z+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,Z+=m+C+p,Z+=le,Z+="</svg>";break;case"g":Z+='<g width="'+o+'" height="'+a+'">'+s,Z+=m+C+p,Z+=le,Z+="</g>";break;default:Z+=(m+C+p+le).replace(/^\s+/,"");break}return Z};var wE=hp,SE=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.QRCode=void 0;const EE=Ye,Yl=ci,CE=SE(wE),xE=t=>{const[e,r]=(0,Yl.useState)("");return(0,Yl.useEffect)(()=>{var n,i;const s=new CE.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=ee.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,EE.h)("img",{src:e,alt:"QR Code"}):null};Ts.QRCode=xE;var As={},Jc={};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var RE=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(As,"__esModule",{value:!0});As.Spinner=void 0;const _i=Ye,IE=RE(Jc),kE=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,_i.h)("div",{class:"-cbwsdk-spinner"},(0,_i.h)("style",null,IE.default),(0,_i.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,_i.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};As.Spinner=kE;var Qc={};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var bn=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(It,"__esModule",{value:!0});It.CoinbaseAppSteps=It.CoinbaseWalletSteps=It.ConnectItem=It.ConnectContent=void 0;const nt=bn(Ui),q=Ye,Kl=ci,TE=H,AE=Bn,ME=Rs,NE=bn(Uc),OE=bn(zc),fp=Is,LE=bn(qc),jE=bn(Gc),PE=ks,DE=Ts,$E=As,BE=bn(Qc),Xl={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:OE.default,steps:pp},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:NE.default,steps:bp}},FE=t=>{switch(t){case"coinbase-app":return LE.default;case"coinbase-wallet-app":default:return jE.default}},Ja=t=>t==="light"?"#FFFFFF":"#0A0B0D";function HE(t){const{theme:e}=t,[r,n]=(0,Kl.useState)("coinbase-wallet-app"),i=(0,Kl.useCallback)(u=>{n(u)},[]),s=(0,TE.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=Xl[r];if(!r)return null;const a=o.steps,c=r==="coinbase-app";return(0,q.h)("div",{"data-testid":"connect-content",class:(0,nt.default)("-cbwsdk-connect-content",e)},(0,q.h)("style",null,BE.default),(0,q.h)("div",{class:"-cbwsdk-connect-content-header"},(0,q.h)("h2",{class:(0,nt.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,q.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,q.h)(ME.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,q.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,q.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,q.h)("div",null,Object.entries(Xl).map(([u,l])=>(0,q.h)(dp,{key:u,title:l.title,description:l.description,icon:l.icon,selected:r===u,onClick:()=>i(u),theme:e}))),c&&(0,q.h)("div",{class:(0,nt.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,q.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,q.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,q.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,q.h)(DE.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:FE(r),width:25,height:25}}),(0,q.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:AE.LIB_VERSION}),(0,q.h)("input",{type:"hidden",value:s})),(0,q.h)(a,{theme:e}),!t.isConnected&&(0,q.h)("div",{"data-testid":"connecting-spinner",class:(0,nt.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,q.h)($E.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,q.h)("p",null,"Connecting...")))))}It.ConnectContent=HE;function dp({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,q.h)("div",{onClick:s,class:(0,nt.default)("-cbwsdk-connect-item",i,{selected:n})},(0,q.h)("div",null,(0,q.h)("img",{src:r,alt:t})),(0,q.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,q.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,q.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}It.ConnectItem=dp;function pp({theme:t}){return(0,q.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,q.h)("li",{class:(0,nt.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,q.h)("li",{class:(0,nt.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,q.h)("span",null,"Tap ",(0,q.h)("strong",null,"Scan")," "),(0,q.h)("span",{class:(0,nt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(fp.QRCodeIcon,{fill:Ja(t)})))))}It.CoinbaseWalletSteps=pp;function bp({theme:t}){return(0,q.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,q.h)("li",{class:(0,nt.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,q.h)("li",{class:(0,nt.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,q.h)("span",null,"Tap ",(0,q.h)("strong",null,"More")),(0,q.h)("span",{class:(0,nt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(PE.StatusDotIcon,{fill:Ja(t)})),(0,q.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,q.h)("strong",null,"Scan")),(0,q.h)("span",{class:(0,nt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(fp.QRCodeIcon,{fill:Ja(t)})))))}It.CoinbaseAppSteps=bp;var Ms={},Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.ArrowLeftIcon=void 0;const eh=Ye;function VE(t){return(0,eh.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,eh.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"}))}Ns.ArrowLeftIcon=VE;var Os={};Object.defineProperty(Os,"__esModule",{value:!0});Os.LaptopIcon=void 0;const _a=Ye;function WE(t){return(0,_a.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,_a.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,_a.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"}))}Os.LaptopIcon=WE;var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.SafeIcon=void 0;const th=Ye;function UE(t){return(0,th.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,th.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"}))}Ls.SafeIcon=UE;var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var gp=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.TryExtensionContent=void 0;const rr=gp(Ui),Re=Ye,wa=ci,zE=Ns,qE=Os,GE=Ls,JE=gp(Zc);function QE({theme:t}){const[e,r]=(0,wa.useState)(!1),n=(0,wa.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,wa.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,Re.h)("div",{class:(0,rr.default)("-cbwsdk-try-extension",t)},(0,Re.h)("style",null,JE.default),(0,Re.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Re.h)("h3",{class:(0,rr.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Re.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Re.h)("button",{class:(0,rr.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Re.h)("div",null,!e&&(0,Re.h)(zE.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,Re.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Re.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Re.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Re.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Re.h)("span",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Re.h)(qE.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Re.h)("div",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Re.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Re.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Re.h)("span",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Re.h)(GE.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Re.h)("div",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Ms.TryExtensionContent=QE;var Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var vp=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xs,"__esModule",{value:!0});xs.ConnectDialog=void 0;const Sa=vp(Ui),nr=Ye,Ea=ci,ZE=It,YE=Ms,KE=vp(Yc),XE=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,Ea.useState)(!e),[s,o]=(0,Ea.useState)(!e);(0,Ea.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,nr.h)("div",{class:(0,Sa.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,nr.h)("style",null,KE.default),(0,nr.h)("div",{class:(0,Sa.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,nr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,nr.h)("div",{class:(0,Sa.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,nr.h)(ZE.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,nr.h)(YE.TryExtensionContent,{theme:a}))))};xs.ConnectDialog=XE;Object.defineProperty(ws,"__esModule",{value:!0});ws.LinkFlow=void 0;const Ca=Ye,rh=Cs,e3=xs;class t3{constructor(e){this.extensionUI$=new rh.BehaviorSubject({}),this.subscriptions=new rh.Subscription,this.isConnected=!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,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,Ca.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||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(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,Ca.render)((0,Ca.h)(e3.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}ws.LinkFlow=t3;var yp={},Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=F&&F.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Ui),n=Ye,i=ci,s=e(Kc),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(h){switch(h){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(f){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=f.darkMode}attach(f){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",f.appendChild(this.root),this.render()}presentItem(f){const d=this.nextItemKey++;return this.items.set(d,f),this.render(),()=>{this.items.delete(d),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([f,d])=>(0,n.h)(t.SnackbarInstance,Object.assign({},d,{key:f}))))),this.root)}}t.Snackbar=c;const u=h=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},h.children));t.SnackbarContainer=u;const l=({autoExpand:h,message:f,menuItems:d,appSrc:y})=>{const[m,C]=(0,i.useState)(!0),[p,v]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const x=[window.setTimeout(()=>{C(!1)},1),window.setTimeout(()=>{v(!0)},1e4)];return()=>{x.forEach(window.clearTimeout)}});const _=()=>{v(!p)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",m&&"-cbwsdk-snackbar-instance-hidden",p&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:_},(0,n.h)("img",{src:a(y),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},f),(0,n.h)("div",{class:"-gear-container"},!p&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),d&&d.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},d.map((x,E)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:x.onClick,key:E},(0,n.h)("svg",{width:x.svgWidth,height:x.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":x.defaultFillRule,"clip-rule":x.defaultClipRule,d:x.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},x.info)))))};t.SnackbarInstance=l})(yp);var js={},Xc={};Object.defineProperty(Xc,"__esModule",{value:!0});Xc.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var r3=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(js,"__esModule",{value:!0});js.injectCssReset=void 0;const n3=r3(Xc);function i3(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(n3.default)),document.documentElement.appendChild(t)}js.injectCssReset=i3;Object.defineProperty(_s,"__esModule",{value:!0});_s.WalletSDKUI=void 0;const s3=ws,o3=yp,a3=js;class c3{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new o3.Snackbar({darkMode:e.darkMode}),this.linkFlow=new s3.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,a3.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}_s.WalletSDKUI=c3;var Ps={},Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});var Pr;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Pr||(Pr={}));function mp(t,e,r){if(!r||typeof r.value!==Pr.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Pr.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:Pr.boolTrue,writable:Pr.boolTrue}),n}}}Ds.bind=mp;Ds.default=mp;function _p(t){return function(r){return r.lift(new u3(t))}}var u3=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new l3(e,this.durationSelector))},t}(),l3=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(o){return this.destination.error(o)}var s=Ce(n,new Se(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,s=r.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(Ee);function h3(t,e){return e===void 0&&(e=Ue),_p(function(){return tp(t,e)})}function f3(t){return function(r){return r.lift(new d3(t))}}var d3=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new p3(e,this.closingNotifier))},t}(),p3=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(Ce(n,new Se(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(Ee);function b3(t,e){return e===void 0&&(e=null),function(n){return n.lift(new g3(t,e))}}var g3=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=v3:this.subscriberClass=y3}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),v3=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(W),y3=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.bufferSize=n,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(r){var n=this,i=n.bufferSize,s=n.startBufferEvery,o=n.buffers,a=n.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var u=o[c];u.push(r),u.length===i&&(o.splice(c,1),this.destination.next(u))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var s=n.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(W);function m3(t){var e=arguments.length,r=Ue;Ze(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new _3(t,n,i,r))}}var _3=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new S3(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),w3=function(){function t(){this.buffer=[]}return t}(),S3=function(t){R(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var u={subscriber:a,context:c,bufferTimeSpan:n};a.add(c.closeAction=o.schedule(nh,n,u))}else{var l={subscriber:a,context:c},h={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(wp,n,l)),a.add(o.schedule(E3,i,h))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s,o=0;o<i;o++){var a=n[o],c=a.buffer;c.push(r),c.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(r){this.contexts.length=0,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var s=n.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(nh,i,s))}},e.prototype.openContext=function(){var r=new w3;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(W);function nh(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function E3(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,s=n.openContext(),o=this;n.closed||(n.add(s.closeAction=i.schedule(wp,r,{subscriber:n,context:s})),o.schedule(t,e))}function wp(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function C3(t,e){return function(n){return n.lift(new x3(t,e))}}var x3=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new R3(e,this.openings,this.closingSelector))},t}(),R3=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(Bt(s,n)),s}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s=0;s<i;s++)n[s].buffer.push(r)},e.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,s=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],s=new we,o={buffer:i,subscription:s};n.push(o);var a=Bt(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Cr);function I3(t){return function(e){return e.lift(new k3(t))}}var k3=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new T3(e,this.closingSelector))},t}(),T3=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}r=new we,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(Ce(i,new Se(this))),this.subscribing=!1},e}(Ee);function A3(t){return function(r){var n=new M3(t),i=r.lift(n);return n.caught=i}}var M3=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new N3(e,this.selector,this.caught))},t}(),N3=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.selector=n,s.caught=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new Se(this);this.add(i);var s=Ce(n,i);s!==i&&this.add(s)}},e}(Ee);function O3(t){return function(e){return e.lift(new Bc(t))}}function L3(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&We(t[0])&&(t=t[0].slice()),function(n){return n.lift.call(Ht([n].concat(t)),new Bc(r))}}function j3(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Pn.apply(void 0,[r].concat(t)))}}function Sp(t,e){return gr(t,e,1)}function P3(t,e){return Sp(function(){return t},e)}function D3(t){return function(e){return e.lift(new $3(t,e))}}var $3=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new B3(e,this.predicate,this.source))},t}(),B3=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},e.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(W);function F3(t){return function(e){return e.lift(new H3(t))}}var H3=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new V3(e,this.durationSelector))},t}(),V3=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=Ce(n,new Se(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,r)}},e}(Ee);function W3(t,e){return e===void 0&&(e=Ue),function(r){return r.lift(new U3(t,e))}}var U3=function(){function t(e,r){this.dueTime=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new z3(e,this.dueTime,this.scheduler))},t}(),z3=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.dueTime=n,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(q3,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},e.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},e}(W);function q3(t){t.debouncedNext()}function ui(t){return t===void 0&&(t=null),function(e){return e.lift(new G3(t))}}var G3=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,r){return r.subscribe(new J3(e,this.defaultValue))},t}(),J3=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return e.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(W);function Ep(t){return t instanceof Date&&!isNaN(+t)}function Q3(t,e){e===void 0&&(e=Ue);var r=Ep(t),n=r?+t-e.now():Math.abs(t);return function(i){return i.lift(new Z3(n,e))}}var Z3=function(){function t(e,r){this.delay=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new Y3(e,this.delay,this.scheduler))},t}(),Y3=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.delay=n,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(r){for(var n=r.source,i=n.queue,s=r.scheduler,o=r.destination;i.length>0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new K3(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(Dt.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(Dt.createComplete()),this.unsubscribe()},e}(W),K3=function(){function t(e,r){this.time=e,this.notification=r}return t}();function X3(t,e){return e?function(r){return new t4(r,e).lift(new ih(t))}:function(r){return r.lift(new ih(t))}}var ih=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new e4(e,this.delayDurationSelector))},t}(),e4=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(r),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=Bt(this,r,n);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(Cr),t4=function(t){R(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new r4(r,this.source))},e}(te),r4=function(t){R(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(W);function n4(){return function(e){return e.lift(new i4)}}var i4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new s4(e))},t}(),s4=function(t){R(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(W);function o4(t,e){return function(r){return r.lift(new a4(t,e))}}var a4=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new c4(e,this.keySelector,this.flushes))},t}(),c4=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=n,s.values=new Set,i&&s.add(Ce(i,new Se(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(s){i.error(s);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(Ee);function Cp(t,e){return function(r){return r.lift(new u4(t,e))}}var u4=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new l4(e,this.compare,this.keySelector))},t}(),l4=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=i,s.hasKey=!1,typeof n=="function"&&(s.compare=n),s}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=n,this.destination.next(r))},e}(W);function h4(t,e){return Cp(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function $s(t){return t===void 0&&(t=p4),function(e){return e.lift(new f4(t))}}var f4=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new d4(e,this.errorFactory))},t}(),d4=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(W);function p4(){return new ai}function eu(t){return function(e){return t===0?dn():e.lift(new b4(t))}}var b4=function(){function t(e){if(this.total=e,this.total<0)throw new Kr}return t.prototype.call=function(e,r){return r.subscribe(new g4(e,this.total))},t}(),g4=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(W);function v4(t,e){if(t<0)throw new Kr;var r=arguments.length>=2;return function(n){return n.pipe(Xt(function(i,s){return s===t}),eu(1),r?ui(e):$s(function(){return new Kr}))}}function y4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return Pn(r,Es.apply(void 0,t))}}function m4(t,e){return function(r){return r.lift(new _4(t,e,r))}}var _4=function(){function t(e,r,n){this.predicate=e,this.thisArg=r,this.source=n}return t.prototype.call=function(e,r){return r.subscribe(new w4(e,this.predicate,this.thisArg,this.source))},t}(),w4=function(t){R(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},e.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(W);function S4(){return function(t){return t.lift(new E4)}}var E4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new C4(e))},t}(),C4=function(t){R(e,t);function e(r){var n=t.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return e.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(Ce(r,new Se(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(Ee);function xp(t,e){return e?function(r){return r.pipe(xp(function(n,i){return Ht(t(n,i)).pipe(at(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new x4(t))}}var x4=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new R4(e,this.project))},t}(),R4=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},e.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new Se(this),i=this.destination;i.add(n);var s=Ce(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(Ee);function I4(t,e,r){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new k4(t,e,r))}}var k4=function(){function t(e,r,n){this.project=e,this.concurrent=r,this.scheduler=n}return t.prototype.call=function(e,r){return r.subscribe(new T4(e,this.project,this.concurrent,this.scheduler))},t}(),T4=function(t){R(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.project=n,o.concurrent=i,o.scheduler=s,o.index=0,o.active=0,o.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.dispatch=function(r){var n=r.subscriber,i=r.result,s=r.value,o=r.index;n.subscribeToProjection(i,s,o)},e.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var s=this.project,o=s(r,i);if(!this.scheduler)this.subscribeToProjection(o,r,i);else{var a={subscriber:this,result:o,value:r,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(u){n.error(u)}}else this.buffer.push(r)},e.prototype.subscribeToProjection=function(r,n,i){this.active++;var s=this.destination;s.add(Ce(r,new Se(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this._next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(Ee);function A4(t){return function(e){return e.lift(new M4(t))}}var M4=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new N4(e,this.callback))},t}(),N4=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new we(n)),i}return e}(W);function O4(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new Rp(t,r,!1,e))}}var Rp=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new L4(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),L4=function(t){R(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,s=n.thisArg,o=this.index++;try{var a=i.call(s||this,r,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:r)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(W);function j4(t,e){return function(r){return r.lift(new Rp(t,r,!0,e))}}function P4(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Xt(function(i,s){return t(i,s,n)}):Yt,eu(1),r?ui(e):$s(function(){return new ai}))}}function D4(){return function(e){return e.lift(new $4)}}var $4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new B4(e))},t}(),B4=function(t){R(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(W);function F4(){return function(t){return t.lift(new H4)}}var H4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new V4(e))},t}(),V4=function(t){R(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(W);function Bi(t){return function(r){return t===0?dn():r.lift(new W4(t))}}var W4=function(){function t(e){if(this.total=e,this.total<0)throw new Kr}return t.prototype.call=function(e,r){return r.subscribe(new U4(e,this.total))},t}(),U4=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,s=this.count++;if(n.length<i)n.push(r);else{var o=s%i;n[o]=r}},e.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=n++%i;r.next(s[a])}r.complete()},e}(W);function z4(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Xt(function(i,s){return t(i,s,n)}):Yt,Bi(1),r?ui(e):$s(function(){return new ai}))}}function q4(t){return function(e){return e.lift(new G4(t))}}var G4=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new J4(e,this.value))},t}(),J4=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(W);function Q4(){return function(e){return e.lift(new Z4)}}var Z4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new Y4(e))},t}(),Y4=function(t){R(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(Dt.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(Dt.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(Dt.createComplete()),r.complete()},e}(W);function Fi(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new K4(t,e,r))}}var K4=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new X4(e,this.accumulator,this.seed,this.hasSeed))},t}(),X4=function(t){R(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(W);function Bs(t,e){return arguments.length>=2?function(n){return Ha(Fi(t,e),Bi(1),ui(e))(n)}:function(n){return Ha(Fi(function(i,s,o){return t(i,s,o+1)}),Bi(1))(n)}}function e5(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return Bs(e)}function t5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Yd.apply(void 0,[r].concat(t)))}}function r5(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?gr(function(){return t},e,r):(typeof e=="number"&&(r=e),gr(function(){return t},r))}function n5(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new i5(t,e,r))}}var i5=function(){function t(e,r,n){this.accumulator=e,this.seed=r,this.concurrent=n}return t.prototype.call=function(e,r){return r.subscribe(new s5(e,this.accumulator,this.seed,this.concurrent))},t}(),s5=function(t){R(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o.acc=i,o.concurrent=s,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,r,n)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(r)},e.prototype._innerSub=function(r){var n=new Se(this),i=this.destination;i.add(n);var s=Ce(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(Ee);function o5(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r<n?r:n};return Bs(e)}function vr(t,e){return function(n){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return n.lift(new a5(i,e));var s=Object.create(n,B2);return s.source=n,s.subjectFactory=i,s}}var a5=function(){function t(e,r){this.subjectFactory=e,this.selector=r}return t.prototype.call=function(e,r){var n=this.selector,i=this.subjectFactory(),s=n(i).subscribe(e);return s.add(r.subscribe(i)),s},t}();function c5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&We(t[0])&&(t=t[0]),function(r){return r.lift(new u5(t))}}var u5=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,r){return r.subscribe(new l5(e,this.nextSources))},t}(),l5=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new Se(this),i=this.destination;i.add(n);var s=Ce(r,n);s!==n&&i.add(s)}else this.destination.complete()},e}(Ee);function h5(){return function(t){return t.lift(new f5)}}var f5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new d5(e))},t}(),d5=function(t){R(e,t);function e(r){var n=t.call(this,r)||this;return n.hasPrev=!1,n}return e.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},e}(W);function p5(t,e){return function(r){return[Xt(t,e)(r),Xt(Xd(t,e))(r)]}}function b5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return at(g5(t,r))(n)}}function g5(t,e){var r=function(n){for(var i=n,s=0;s<e;s++){var o=i!=null?i[t[s]]:void 0;if(o!==void 0)i=o;else return}return i};return r}function v5(t){return t?vr(function(){return new Oe},t):vr(new Oe)}function y5(t){return function(e){return vr(new Nd(t))(e)}}function m5(){return function(t){return vr(new pn)(t)}}function _5(t,e,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,s=new $c(t,e,n);return function(o){return vr(function(){return s},i)(o)}}function w5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return t.length===1&&We(t[0])&&(t=t[0]),n.lift.call(ep.apply(void 0,[n].concat(t)))}}function S5(t){return t===void 0&&(t=-1),function(e){return t===0?dn():t<0?e.lift(new sh(-1,e)):e.lift(new sh(t-1,e))}}var sh=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new E5(e,this.count,this.source))},t}(),E5=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(W);function C5(t){return function(e){return e.lift(new x5(t))}}var x5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new R5(e,this.notifier,r))},t}(),R5=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new Oe;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=Ce(r,new Se(this))},e}(Ee);function I5(t){return t===void 0&&(t=-1),function(e){return e.lift(new k5(t,e))}}var k5=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new T5(e,this.count,this.source))},t}(),T5=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,s=n.count;if(s===0)return t.prototype.error.call(this,r);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(W);function A5(t){return function(e){return e.lift(new M5(t,e))}}var M5=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new N5(e,this.notifier,this.source))},t}(),N5=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Oe;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=Ce(i,new Se(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(Ee);function O5(t){return function(e){return e.lift(new L5(t))}}var L5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new j5(e),i=r.subscribe(n);return i.add(Ce(this.notifier,new Se(n))),i},t}(),j5=function(t){R(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(Ee);function P5(t,e){return e===void 0&&(e=Ue),function(r){return r.lift(new D5(t,e))}}var D5=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new $5(e,this.period,this.scheduler))},t}(),$5=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.period=n,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(B5,n,{subscriber:s,period:n})),s}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(W);function B5(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function F5(t,e){return function(r){return r.lift(new H5(t,e))}}var H5=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new V5(e,this.compareTo,this.comparator))},t}(),V5=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.compareTo=n,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(n.subscribe(new W5(r,s))),s}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,s=r.comparator;n.length>0&&i.length>0;){var o=n.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(u){this.destination.error(u)}c||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(W),W5=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(W);function U5(){return new Oe}function z5(){return function(t){return jc()(vr(U5)(t))}}function q5(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(G5(n))}}function G5(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,s=t.refCount,o=t.scheduler,a,c=0,u,l=!1,h=!1;return function(d){c++;var y;!a||l?(l=!1,a=new $c(r,i,o),y=a.subscribe(this),u=d.subscribe({next:function(m){a.next(m)},error:function(m){l=!0,a.error(m)},complete:function(){h=!0,u=void 0,a.complete()}}),h&&(u=void 0)):y=a.subscribe(this),this.add(function(){c--,y.unsubscribe(),y=void 0,u&&!h&&s&&c===0&&(u.unsubscribe(),u=void 0,a=void 0)})}}function J5(t){return function(e){return e.lift(new Q5(t,e))}}var Q5=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Z5(e,this.predicate,this.source))},t}(),Z5=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new ai)},e}(W);function Y5(t){return function(e){return e.lift(new K5(t))}}var K5=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new X5(e,this.total))},t}(),X5=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(W);function eC(t){return function(e){return e.lift(new tC(t))}}var tC=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new Kr}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new W(e)):r.subscribe(new rC(e,this._skipCount))},t}(),rC=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i<n)this._ring[i]=r;else{var s=i%n,o=this._ring,a=o[s];o[s]=r,this.destination.next(a)}},e}(W);function nC(t){return function(e){return e.lift(new iC(t))}}var iC=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new sC(e,this.notifier))},t}(),sC=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;i.hasValue=!1;var s=new Se(i);i.add(s),i.innerSubscription=s;var o=Ce(n,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(r){this.hasValue&&t.prototype._next.call(this,r)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(Ee);function oC(t){return function(e){return e.lift(new aC(t))}}var aC=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,r){return r.subscribe(new cC(e,this.predicate))},t}(),cC=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return e.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},e.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=!!n}catch(i){this.destination.error(i)}},e}(W);function uC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Ze(r)?(t.pop(),function(n){return Pn(t,n,r)}):function(n){return Pn(t,n)}}var lC=function(t){R(e,t);function e(r,n,i){n===void 0&&(n=0),i===void 0&&(i=Ri);var s=t.call(this)||this;return s.source=r,s.delayTime=n,s.scheduler=i,(!Xr(n)||n<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=Ri),s}return e.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=Ri),new e(r,n,i)},e.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},e.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,n,{source:i,subscriber:r})},e}(te);function hC(t,e){return e===void 0&&(e=0),function(n){return n.lift(new fC(t,e))}}var fC=function(){function t(e,r){this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return new lC(r,this.delay,this.scheduler).subscribe(e)},t}();function Dn(t,e){return typeof e=="function"?function(r){return r.pipe(Dn(function(n,i){return Ht(t(n,i)).pipe(at(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new dC(t))}}var dC=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new pC(e,this.project))},t}(),pC=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.index=0,i}return e.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this._innerSub(n)},e.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new Se(this),s=this.destination;s.add(i),this.innerSubscription=Ce(r,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(r){this.destination.next(r)},e}(Ee);function bC(){return Dn(Yt)}function gC(t,e){return e?Dn(function(){return t},e):Dn(function(){return t})}function vC(t){return function(e){return e.lift(new yC(t))}}var yC=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new mC(e),i=Ce(this.notifier,new Se(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},t}(),mC=function(t){R(e,t);function e(r){var n=t.call(this,r)||this;return n.seenValue=!1,n}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(Ee);function _C(t,e){return e===void 0&&(e=!1),function(r){return r.lift(new wC(t,e))}}var wC=function(){function t(e,r){this.predicate=e,this.inclusive=r}return t.prototype.call=function(e,r){return r.subscribe(new SC(e,this.predicate,this.inclusive))},t}(),SC=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.inclusive=i,s.index=0,s}return e.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(s){n.error(s);return}this.nextOrComplete(r,i)},e.prototype.nextOrComplete=function(r,n){var i=this.destination;n?i.next(r):(this.inclusive&&i.next(r),i.complete())},e}(W);function EC(t,e,r){return function(i){return i.lift(new CC(t,e,r))}}var CC=function(){function t(e,r,n){this.nextOrObserver=e,this.error=r,this.complete=n}return t.prototype.call=function(e,r){return r.subscribe(new xC(e,this.nextOrObserver,this.error,this.complete))},t}(),xC=function(t){R(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o._tapNext=Et,o._tapError=Et,o._tapComplete=Et,o._tapError=i||Et,o._tapComplete=s||Et,Zr(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||Et,o._tapError=n.error||Et,o._tapComplete=n.complete||Et),o}return e.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},e.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},e}(W),Ip={leading:!0,trailing:!1};function RC(t,e){return e===void 0&&(e=Ip),function(r){return r.lift(new IC(t,!!e.leading,!!e.trailing))}}var IC=function(){function t(e,r,n){this.durationSelector=e,this.leading=r,this.trailing=n}return t.prototype.call=function(e,r){return r.subscribe(new kC(e,this.durationSelector,this.leading,this.trailing))},t}(),kC=function(t){R(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.destination=r,o.durationSelector=n,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},e.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=Ce(n,new Se(this)))},e.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},e.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(Ee);function TC(t,e,r){return e===void 0&&(e=Ue),r===void 0&&(r=Ip),function(n){return n.lift(new AC(t,e,r.leading,r.trailing))}}var AC=function(){function t(e,r,n,i){this.duration=e,this.scheduler=r,this.leading=n,this.trailing=i}return t.prototype.call=function(e,r){return r.subscribe(new MC(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),MC=function(t){R(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.duration=n,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(NC,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},e}(W);function NC(t){var e=t.subscriber;e.clearThrottle()}function OC(t){return t===void 0&&(t=Ue),function(e){return Hc(function(){return e.pipe(Fi(function(r,n){var i=r.current;return{value:n,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),at(function(r){var n=r.current,i=r.last,s=r.value;return new LC(s,n-i)}))})}}var LC=function(){function t(e,r){this.value=e,this.interval=r}return t}();function kp(t,e,r){return r===void 0&&(r=Ue),function(n){var i=Ep(t),s=i?+t-r.now():Math.abs(t);return n.lift(new jC(s,i,e,r))}}var jC=function(){function t(e,r,n,i){this.waitFor=e,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new PC(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),PC=function(t){R(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.absoluteTimeout=n,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(r){var n=r.withObservable;r._unsubscribeAndRecycle(),r.add(Ce(n,new Se(r)))},e.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,r)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(Ee);function DC(t,e){return e===void 0&&(e=Ue),kp(t,Dc(new Hd),e)}function $C(t){return t===void 0&&(t=Ue),at(function(e){return new BC(e,t.now())})}var BC=function(){function t(e,r){this.value=e,this.timestamp=r}return t}();function FC(t,e,r){return r===0?[e]:(t.push(e),t)}function HC(){return Bs(FC,[])}function VC(t){return function(r){return r.lift(new WC(t))}}var WC=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,r){var n=new UC(e),i=r.subscribe(n);return i.closed||n.add(Ce(this.windowBoundaries,new Se(n))),i},t}(),UC=function(t){R(e,t);function e(r){var n=t.call(this,r)||this;return n.window=new Oe,r.next(n.window),n}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new Oe;n.next(i)},e}(Ee);function zC(t,e){return e===void 0&&(e=0),function(n){return n.lift(new qC(t,e))}}var qC=function(){function t(e,r){this.windowSize=e,this.startWindowEvery=r}return t.prototype.call=function(e,r){return r.subscribe(new GC(e,this.windowSize,this.startWindowEvery))},t}(),GC=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.destination=r,s.windowSize=n,s.startWindowEvery=i,s.windows=[new Oe],s.count=0,r.next(s.windows[0]),s}return e.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c<a&&!this.closed;c++)o[c].next(r);var u=this.count-s+1;if(u>=0&&u%n===0&&!this.closed&&o.shift().complete(),++this.count%n===0&&!this.closed){var l=new Oe;o.push(l),i.next(l)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(W);function JC(t){var e=Ue,r=null,n=Number.POSITIVE_INFINITY;return Ze(arguments[3])&&(e=arguments[3]),Ze(arguments[2])?e=arguments[2]:Xr(arguments[2])&&(n=Number(arguments[2])),Ze(arguments[1])?e=arguments[1]:Xr(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new QC(t,r,n,e))}}var QC=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new YC(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),ZC=function(t){R(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Oe),YC=function(t){R(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var u={subscriber:a,window:c,context:null},l={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(Tp,n,u)),a.add(o.schedule(XC,i,l))}else{var h={subscriber:a,window:c,windowTimeSpan:n};a.add(o.schedule(KC,n,h))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,s=0;s<i;s++){var o=n[s];o.closed||(o.next(r),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new ZC;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(W);function KC(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function XC(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=n.schedule(Tp,e,c),o.add(a.subscription),o.schedule(t,i)}function Tp(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}function ex(t,e){return function(r){return r.lift(new tx(t,e))}}var tx=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new rx(e,this.openings,this.closingSelector))},t}(),rx=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.openings=n,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=Bt(s,n,n)),s}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,s=0;s<i;s++)n[s].window.next(r)},e.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,s=-1;++s<i;){var o=n[s];o.window.error(r),o.subscription.unsubscribe()}t.prototype._error.call(this,r)},e.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(r,n,i,s,o){if(r===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(n)}catch(d){return this.error(d)}var u=new Oe,l=new we,h={window:u,subscription:l};this.contexts.push(h);var f=Bt(this,a,h);f.closed?this.closeWindow(this.contexts.length-1):(f.context=h,l.add(f)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(r))},e.prototype.notifyError=function(r){this.error(r)},e.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},e.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],s=i.window,o=i.subscription;n.splice(r,1),s.complete(),o.unsubscribe()}},e}(Cr);function nx(t){return function(r){return r.lift(new ix(t))}}var ix=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new sx(e,this.closingSelector))},t}(),sx=function(t){R(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return e.prototype.notifyNext=function(r,n,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(r){this.openWindow(r)},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new Oe;this.destination.next(i);var s;try{var o=this.closingSelector;s=o()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=Bt(this,s))},e}(Cr);function ox(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){var n;typeof t[t.length-1]=="function"&&(n=t.pop());var i=t;return r.lift(new ax(i,n))}}var ax=function(){function t(e,r){this.observables=e,this.project=r}return t.prototype.call=function(e,r){return r.subscribe(new cx(e,this.observables,this.project))},t}(),cx=function(t){R(e,t);function e(r,n,i){var s=t.call(this,r)||this;s.observables=n,s.project=i,s.toRespond=[];var o=n.length;s.values=new Array(o);for(var a=0;a<o;a++)s.toRespond.push(a);for(var a=0;a<o;a++){var c=n[a];s.add(Bt(s,c,void 0,a))}return s}return e.prototype.notifyNext=function(r,n,i){this.values[i]=n;var s=this.toRespond;if(s.length>0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Cr);function ux(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(rp.apply(void 0,[n].concat(t)))}}function lx(t){return function(e){return e.lift(new np(t))}}const hx=Object.freeze(Object.defineProperty({__proto__:null,audit:_p,auditTime:h3,buffer:f3,bufferCount:b3,bufferTime:m3,bufferToggle:C3,bufferWhen:I3,catchError:A3,combineAll:O3,combineLatest:L3,concat:j3,concatAll:Gd,concatMap:Sp,concatMapTo:P3,count:D3,debounce:F3,debounceTime:W3,defaultIfEmpty:ui,delay:Q3,delayWhen:X3,dematerialize:n4,distinct:o4,distinctUntilChanged:Cp,distinctUntilKeyChanged:h4,elementAt:v4,endWith:y4,every:m4,exhaust:S4,exhaustMap:xp,expand:I4,filter:Xt,finalize:A4,find:O4,findIndex:j4,first:P4,flatMap:OS,groupBy:H2,ignoreElements:D4,isEmpty:F4,last:z4,map:at,mapTo:q4,materialize:Q4,max:e5,merge:t5,mergeAll:Fc,mergeMap:gr,mergeMapTo:r5,mergeScan:n5,min:o5,multicast:vr,observeOn:Y2,onErrorResumeNext:c5,pairwise:h5,partition:p5,pluck:b5,publish:v5,publishBehavior:y5,publishLast:m5,publishReplay:_5,race:w5,reduce:Bs,refCount:jc,repeat:S5,repeatWhen:C5,retry:I5,retryWhen:A5,sample:O5,sampleTime:P5,scan:Fi,sequenceEqual:F5,share:z5,shareReplay:q5,single:J5,skip:Y5,skipLast:eC,skipUntil:nC,skipWhile:oC,startWith:uC,subscribeOn:hC,switchAll:bC,switchMap:Dn,switchMapTo:gC,take:eu,takeLast:Bi,takeUntil:vC,takeWhile:_C,tap:EC,throttle:RC,throttleTime:TC,throwIfEmpty:$s,timeInterval:OC,timeout:DC,timeoutWith:kp,timestamp:$C,toArray:HC,window:VC,windowCount:zC,windowTime:JC,windowToggle:ex,windowWhen:nx,withLatestFrom:ox,zip:ux,zipAll:lx},Symbol.toStringTag,{value:"Module"})),tu=nn(hx);var Fs={},rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.ClientMessagePublishEvent=rt.ClientMessageSetSessionConfig=rt.ClientMessageGetSessionConfig=rt.ClientMessageIsLinked=rt.ClientMessageHostSession=void 0;function fx(t){return Object.assign({type:"HostSession"},t)}rt.ClientMessageHostSession=fx;function dx(t){return Object.assign({type:"IsLinked"},t)}rt.ClientMessageIsLinked=dx;function px(t){return Object.assign({type:"GetSessionConfig"},t)}rt.ClientMessageGetSessionConfig=px;function bx(t){return Object.assign({type:"SetSessionConfig"},t)}rt.ClientMessageSetSessionConfig=bx;function gx(t){return Object.assign({type:"PublishEvent"},t)}rt.ClientMessagePublishEvent=gx;var Ap={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Cs,r=tu;var n;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(n=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=o.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable(o=>{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,r.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(Ap);var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.isServerMessageFail=void 0;function vx(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}Hs.isServerMessageFail=vx;Object.defineProperty(Fs,"__esModule",{value:!0});Fs.WalletSDKConnection=void 0;const ut=Cs,ie=tu,wn=on,Nr=Un,Sn=rt,En=sn,wi=Ap,xa=Hs,oh=1e4,yx=6e4;class mx{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new ut.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Nr.IntNumber)(1),this.connectedSubject=new ut.BehaviorSubject(!1),this.linkedSubject=new ut.BehaviorSubject(!1),this.sessionConfigSubject=new ut.ReplaySubject(1);const o=new wi.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,ie.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(En.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:wn.Session.hash(e)})}),(0,ie.skip)(1),(0,ie.filter)(a=>a===wi.ConnectionState.DISCONNECTED&&!this.destroyed),(0,ie.delay)(5e3),(0,ie.filter)(a=>!this.destroyed),(0,ie.flatMap)(a=>o.connect()),(0,ie.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,ie.skip)(2),(0,ie.switchMap)(a=>(0,ut.iif)(()=>a===wi.ConnectionState.CONNECTED,this.authenticate().pipe((0,ie.tap)(c=>this.sendIsLinked()),(0,ie.tap)(c=>this.sendGetSessionConfig()),(0,ie.map)(c=>!0)),(0,ut.of)(!1))),(0,ie.distinctUntilChanged)(),(0,ie.catchError)(a=>(0,ut.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,ie.skip)(1),(0,ie.switchMap)(a=>(0,ut.iif)(()=>a===wi.ConnectionState.CONNECTED,(0,ut.timer)(0,oh)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,ie.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,ie.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(En.EVENTS.LINKED,{sessionIdHash:wn.Session.hash(e),linked:u.linked,type:a.type,onlineGuests:u.onlineGuests}),this.linkedSubject.next(u.linked||u.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,ie.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(En.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:wn.Session.hash(e),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.sessionConfigSubject.next({webhookId:u.webhookId,webhookUrl:u.webhookUrl,metadata:u.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(En.EVENTS.STARTED_CONNECTING,{sessionIdHash:wn.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(En.EVENTS.DISCONNECTED,{sessionIdHash:wn.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,ie.filter)(e=>e),(0,ie.take)(1),(0,ie.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,ie.filter)(e=>e),(0,ie.take)(1),(0,ie.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,ie.filter)(e=>{if(e.type!=="Event")return!1;const r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,ie.map)(e=>e))}setSessionMetadata(e,r){const n=(0,Sn.ClientMessageSetSessionConfig)({id:(0,Nr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,ie.flatMap)(i=>this.makeRequest(n)),(0,ie.map)(i=>{if((0,xa.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){const i=(0,Sn.ClientMessagePublishEvent)({id:(0,Nr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,ie.flatMap)(s=>this.makeRequest(i)),(0,ie.map)(s=>{if((0,xa.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>oh*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,r=yx){const n=e.id;try{this.sendData(e)}catch(i){return(0,ut.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,ie.timeoutWith)(r,(0,ut.throwError)(new Error(`request ${n} timed out`))),(0,ie.filter)(i=>i.id===n),(0,ie.take)(1))}authenticate(){const e=(0,Sn.ClientMessageHostSession)({id:(0,Nr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,ie.map)(r=>{if((0,xa.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Sn.ClientMessageIsLinked)({id:(0,Nr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Sn.ClientMessageGetSessionConfig)({id:(0,Nr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}Fs.WalletSDKConnection=mx;var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.decrypt=tn.encrypt=void 0;const Hi=H;async function _x(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,Hi.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),u=new Uint8Array(a),l=new Uint8Array(c),h=new Uint8Array([...r,...u,...l]);return(0,Hi.uint8ArrayToHex)(h)}tn.encrypt=_x;function wx(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((r,n)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Hi.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,Hi.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),u=new Uint8Array([...c,...a]),l={name:"AES-GCM",iv:new Uint8Array(o)};try{const h=await window.crypto.subtle.decrypt(l,i,u),f=new TextDecoder;r(f.decode(h))}catch(h){n(h)}})()})}tn.decrypt=wx;var Vs={},Ws={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(Ws);Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Web3RequestCanceledMessage=void 0;const Sx=Ws;function Ex(t){return{type:Sx.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}Vs.Web3RequestCanceledMessage=Ex;var Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.Web3RequestMessage=void 0;const Cx=Ws;function xx(t){return Object.assign({type:Cx.RelayMessageType.WEB3_REQUEST},t)}Us.Web3RequestMessage=xx;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});rn.isWeb3ResponseMessage=rn.Web3ResponseMessage=void 0;const Mp=Ws;function Rx(t){return Object.assign({type:Mp.RelayMessageType.WEB3_RESPONSE},t)}rn.Web3ResponseMessage=Rx;function Ix(t){return t&&t.type===Mp.RelayMessageType.WEB3_RESPONSE}rn.isWeb3ResponseMessage=Ix;var kx=F&&F.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Tx=F&&F.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Np=F&&F.__decorate||function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Ax=F&&F.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kx(e,t,r);return Tx(e,t),e},Mx=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.WalletSDKRelay=void 0;const Op=Mx(Ds),ir=Cs,Ie=tu,$e=sn,Nx=Fs,Or=$n,Ox=Un,ye=H,Ut=Ax(tn),zt=on,Si=dt,Le=Ji,Lx=Vs,jx=Us,et=ge,qe=rn;class ft extends Si.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new ir.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new ir.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();if(this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=zt.Session.load(this.storage)||new zt.Session(this.storage).save(),r=new Nx.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,Ie.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,Ie.skip)(1),(0,Ie.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(Si.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const u=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log($e.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,Ie.mergeMap)(i=>Ut.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(Si.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,Ie.mergeMap)(i=>Ut.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(Si.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,Ie.mergeMap)(i=>(0,ir.zip)(Ut.decrypt(i.metadata.ChainId,e.secret),Ut.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,Ie.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,Ie.mergeMap)(i=>Ut.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),ft.accountRequestCallbackIds.size>0&&(Array.from(ft.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,qe.Web3ResponseMessage)({id:s,response:(0,et.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),ft.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,Ie.mergeMap)(i=>Ut.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Ie.timeout)(1e3),(0,Ie.catchError)(e=>(0,ir.of)(null))).subscribe(e=>{var r,n,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log($e.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log($e.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=zt.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log($e.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:zt.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new ir.Subscription;const{session:a,ui:c,connection:u}=this.subscribe();this._session=a,this.connection=u,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log($e.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:Le.Web3Method.signEthereumMessage,params:{message:(0,ye.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:Le.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,ye.hexStringFromBuffer)(e,!0),signature:(0,ye.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:Le.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ye.bigIntStringFromBN)(e.weiValue),data:(0,ye.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,ye.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:Le.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ye.bigIntStringFromBN)(e.weiValue),data:(0,ye.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,ye.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,ye.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,ye.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:Le.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,ye.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:Le.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,ye.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:Le.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,ye.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;const i=(0,jx.Web3RequestMessage)({id:e,request:r}),s=zt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log($e.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log($e.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,Lx.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new ir.Observable(s=>{Ut.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,Ie.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,ir.from)(Ut.decrypt(e.data,this.session.secret)).pipe((0,Ie.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,qe.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log($e.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log($e.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,et.isRequestEthereumAccountsResponse)(n)){ft.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),ft.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Or.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:e,response:{method:r,errorMessage:o,errorCode:i}}))}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:Le.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,ye.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(r,u=>{if(this.ui.hideRequestEthereumAccounts(),u.errorMessage)return o(new Error(u.errorMessage));s(u)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let u;try{(0,ye.isInIFrame)()&&window.top?u=window.top.location:u=window.location}catch{u=window.location}u.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(u.href)}`;return}if(this.ui.inlineAccountsResponse()){const u=l=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:r,response:(0,et.RequestEthereumAccountsResponse)(l)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Or.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}ft.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:Le.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,ye.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,l=>{if(l.errorMessage)return a(new Error(l.errorMessage));o(l)});const c=l=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:n,response:(0,et.SelectProviderResponse)(Ox.ProviderType.Unselected)}))},u=l=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:n,response:(0,et.SelectProviderResponse)(l)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:Le.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const u=(0,ye.randomBytesHex)(8),l=f=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,f),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}));const h=new Promise((f,d)=>{this.relayEventManager.callbacks.set(u,C=>{if(c==null||c(),C.errorMessage)return d(new Error(C.errorMessage));f(C)});const y=C=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:u,response:(0,et.WatchAssetReponse)(!1)}))},m=()=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:u,response:(0,et.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:m,onCancel:y,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)});return{cancel:l,promise:h}}addEthereumChain(e,r,n,i,s,o){const a={method:Le.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const u=(0,ye.randomBytesHex)(8),l=f=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,f),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((f,d)=>{this.relayEventManager.callbacks.set(u,C=>{if(c==null||c(),C.errorMessage)return d(new Error(C.errorMessage));f(C)});const y=C=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:u,response:(0,et.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},m=C=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:u,response:(0,et.AddEthereumChainResponse)({isApproved:!0,rpcUrl:C})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:y,onApprove:m,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(u,a)}),cancel:l}}switchEthereumChain(e,r){const n={method:Le.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,ye.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,h=>{if((0,et.isErrorResponse)(h)&&h.errorCode)return c(Or.standardErrors.provider.custom({code:h.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(h.errorMessage)return c(new Error(h.errorMessage));a(h)});const u=h=>{var f;if(h){const d=(f=(0,Or.getErrorCode)(h))!==null&&f!==void 0?f:Or.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,Le.Web3Method.switchEthereumChain,h instanceof Error?h:Or.standardErrors.provider.unsupportedChain(e),d)}else this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:i,response:(0,et.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},l=h=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:i,response:(0,et.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:h})}))};this.ui.switchEthereumChain({onCancel:u,onApprove:l,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return zt.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,qe.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case Le.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}ft.accountRequestCallbackIds=new Set;Np([Op.default],ft.prototype,"resetAndReload",null);Np([Op.default],ft.prototype,"handleIncomingEvent",null);Ps.WalletSDKRelay=ft;var zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.WalletSDKRelayEventManager=void 0;const Px=H;class Dx{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,Px.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}zs.WalletSDKRelayEventManager=Dx;const $x="@coinbase/wallet-sdk",Bx="3.7.1",Fx="Coinbase Wallet JavaScript SDK",Hx=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],Vx="dist/index.js",Wx="dist/index.d.ts",Ux="https://github.com/coinbase/coinbase-wallet-sdk.git",zx="Coinbase, Inc.",qx="Apache-2.0",Gx={"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},Jx={"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"6.1.0","eth-json-rpc-filters":"5.1.0","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},Qx={"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.4.0","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.76.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},Zx={node:">= 10.0.0"},Yx={name:$x,version:Bx,description:Fx,keywords:Hx,main:Vx,types:Wx,repository:Ux,author:zx,license:qx,scripts:Gx,dependencies:Jx,devDependencies:Qx,engines:Zx};Object.defineProperty(An,"__esModule",{value:!0});An.CoinbaseWalletSDK=void 0;const Kx=zi,Xx=qi,eR=Wr,tR=_s,rR=Ps,nR=zs,iR=H,sR={}.LINK_API_URL||"https://www.walletlink.org",Lp={}.SDK_VERSION||Yx.version||"unknown";class qs{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||sR;let o;if(e.uiConstructor?o=e.uiConstructor:o=u=>new tR.WalletSDKUI(u),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new Xx.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",qs.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new nR.WalletSDKRelayEventManager,this._relay=new rR.WalletSDKRelay({linkAPIUrl:s,version:Lp,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new eR.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,iR.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,Kx.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}An.CoinbaseWalletSDK=qs;qs.VERSION=Lp;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=An,r=Wr;var n=An;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Wr;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Za);const oR=Pp(Za),bR=Dp({__proto__:null,default:oR},[Za]);export{bR as i};
23
+ //# sourceMappingURL=index-808e8418.js.map