@magic-ext/web3modal-ethers5 1.0.1 → 1.0.2-canary.41a8c7c.0

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.
package/dist/extension.js CHANGED
@@ -9974,5 +9974,5 @@ ${this.value??""}</textarea
9974
9974
  `}onGoToUpdateEmail(e,r){r||pe.push("UpdateEmailWallet",{email:e})}getAuthName(e){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};Eie=pke([J("w3m-account-auth-button")],Eie);qe();ze();Ui();var kie=!1,zb=class{constructor(e){this.initPromise=void 0,this.setIsConnected=r=>{Ce.setIsConnected(r)},this.getIsConnectedState=()=>Ce.state.isConnected,this.setCaipAddress=r=>{Ce.setCaipAddress(r)},this.setBalance=(r,i)=>{Ce.setBalance(r,i)},this.setProfileName=r=>{Ce.setProfileName(r)},this.setProfileImage=r=>{Ce.setProfileImage(r)},this.resetAccount=()=>{Ce.resetAccount()},this.setCaipNetwork=r=>{Fe.setCaipNetwork(r)},this.getCaipNetwork=()=>Fe.state.caipNetwork,this.setRequestedCaipNetworks=r=>{Fe.setRequestedCaipNetworks(r)},this.getApprovedCaipNetworksData=()=>Fe.getApprovedCaipNetworksData(),this.resetNetwork=()=>{Fe.resetNetwork()},this.setConnectors=r=>{Ve.setConnectors(r)},this.addConnector=r=>{Ve.addConnector(r)},this.getConnectors=()=>Ve.getConnectors(),this.resetWcConnection=()=>{Ze.resetWcConnection()},this.fetchIdentity=r=>Mi.fetchIdentity(r),this.setAddressExplorerUrl=r=>{Ce.setAddressExplorerUrl(r)},this.setSmartAccountDeployed=r=>{Ce.setSmartAccountDeployed(r)},this.setConnectedWalletInfo=r=>{Ce.setConnectedWalletInfo(r)},this.setSmartAccountEnabledNetworks=r=>{Fe.setSmartAccountEnabledNetworks(r)},this.setPreferredAccountType=r=>{Ce.setPreferredAccountType(r)},this.getWalletConnectName=r=>Va.getNamesForAddress(r),this.resolveWalletConnectName=async r=>{let i=r.replace(ls.WC_NAME_SUFFIX,""),n=await Va.resolveName(i);return(Object.values(n?.addresses)||[])[0]?.address||!1},this.setEIP6963Enabled=r=>{We.setEIP6963Enabled(r)},this.initControllers(e),this.initOrContinue()}async open(e){await this.initOrContinue(),pt.open(e)}async close(){await this.initOrContinue(),pt.close()}setLoading(e){pt.setLoading(e)}getThemeMode(){return Oi.state.themeMode}getThemeVariables(){return Oi.state.themeVariables}setThemeMode(e){Oi.setThemeMode(e),Lv(Oi.state.themeMode)}setThemeVariables(e){Oi.setThemeVariables(e),K4(Oi.state.themeVariables)}subscribeTheme(e){return Oi.subscribe(e)}getWalletInfo(){return Ce.state.connectedWalletInfo}subscribeWalletInfo(e){return Ce.subscribeKey("connectedWalletInfo",e)}getState(){return Pl.state}subscribeState(e){return Pl.subscribe(e)}showErrorMessage(e){bt.showError(e)}showSuccessMessage(e){bt.showSuccess(e)}getEvent(){return{...Oe.state}}subscribeEvents(e){return Oe.subscribe(e)}replace(e){pe.replace(e)}redirect(e){pe.push(e)}popTransactionStack(e){pe.popTransactionStack(e)}isOpen(){return pt.state.open}isTransactionStackEmpty(){return pe.state.transactionStack.length===0}isTransactionShouldReplaceView(){return pe.state.transactionStack[pe.state.transactionStack.length-1]?.replace}async initControllers(e){if(Fe.setClient(e.networkControllerClient),Fe.setDefaultCaipNetwork(e.defaultChain),We.setProjectId(e.projectId),We.setAllWallets(e.allWallets),We.setIncludeWalletIds(e.includeWalletIds),We.setExcludeWalletIds(e.excludeWalletIds),We.setFeaturedWalletIds(e.featuredWalletIds),We.setTokens(e.tokens),We.setTermsConditionsUrl(e.termsConditionsUrl),We.setPrivacyPolicyUrl(e.privacyPolicyUrl),We.setCustomWallets(e.customWallets),We.setEnableAnalytics(e.enableAnalytics),We.setSdkVersion(e._sdkVersion),We.setOnrampEnabled(e.enableOnramp!==!1),e.metadata&&We.setMetadata(e.metadata),e.themeMode&&Oi.setThemeMode(e.themeMode),e.themeVariables&&Oi.setThemeVariables(e.themeVariables),e.disableAppend&&We.setDisableAppend(Boolean(e.disableAppend)),e.allowUnsupportedChain&&Fe.setAllowUnsupportedChain(e.allowUnsupportedChain),e.siweControllerClient){let{SIWEController:r}=await Promise.resolve().then(()=>(U0(),B0));r.setSIWEClient(e.siweControllerClient)}Ze.setClient(e.connectionControllerClient)}async initOrContinue(){return!this.initPromise&&!kie&&Te.isClient()&&(kie=!0,this.initPromise=new Promise(async e=>{await Promise.all([Promise.resolve().then(()=>(ze(),AJ)),Promise.resolve().then(()=>(Rie(),Tie))]);let r=document.createElement("w3m-modal");We.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}};qe();var OE=Dr(yhe(),1);var Ih={};qr(Ih,{BaseContract:()=>f3,BigNumber:()=>De,Contract:()=>qm,ContractFactory:()=>x5,FixedNumber:()=>In,Signer:()=>ta,VoidSigner:()=>mh,Wallet:()=>au,Wordlist:()=>wl,constants:()=>L_,errors:()=>Aa,getDefaultProvider:()=>TE,logger:()=>ime,providers:()=>RE,utils:()=>bc,version:()=>NE,wordlists:()=>zm});var Mhe=Dr(iD());var Ehe="logger/5.7.0";var Ahe=!1,Che=!1,v_={debug:1,default:2,info:2,warning:3,error:4,off:5},She=v_.default,nD=null;function Oqe(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}var Ihe=Oqe(),oD;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(oD||(oD={}));var Aa;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Aa||(Aa={}));var The="0123456789abcdef",ce=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let i=e.toLowerCase();v_[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(She>v_[i])&&console.log.apply(console,r)}debug(...e){this._log(ce.levels.DEBUG,e)}info(...e){this._log(ce.levels.INFO,e)}warn(...e){this._log(ce.levels.WARNING,e)}makeError(e,r,i){if(Che)return this.makeError("censored error",r,{});r||(r=ce.errors.UNKNOWN_ERROR),i||(i={});let n=[];Object.keys(i).forEach(c=>{let h=i[c];try{if(h instanceof Uint8Array){let g="";for(let w=0;w<h.length;w++)g+=The[h[w]>>4],g+=The[h[w]&15];n.push(c+"=Uint8Array(0x"+g+")")}else n.push(c+"="+JSON.stringify(h))}catch{n.push(c+"="+JSON.stringify(i[c].toString()))}}),n.push(`code=${r}`),n.push(`version=${this.version}`);let o=e,s="";switch(r){case Aa.NUMERIC_FAULT:{s="NUMERIC_FAULT";let c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":s+="-"+c;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case Aa.CALL_EXCEPTION:case Aa.INSUFFICIENT_FUNDS:case Aa.MISSING_NEW:case Aa.NONCE_EXPIRED:case Aa.REPLACEMENT_UNDERPRICED:case Aa.TRANSACTION_REPLACED:case Aa.UNPREDICTABLE_GAS_LIMIT:s=r;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let a=new Error(e);return a.reason=o,a.code=r,Object.keys(i).forEach(function(c){a[c]=i[c]}),a}throwError(e,r,i){throw this.makeError(e,r,i)}throwArgumentError(e,r,i){return this.throwError(e,ce.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(e,r,i,n){e||this.throwError(r,i,n)}assertArgument(e,r,i,n){e||this.throwArgumentError(r,i,n)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),Ihe&&this.throwError("platform missing String.prototype.normalize",ce.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ihe})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ce.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ce.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,i){i?i=": "+i:i="",e<r&&this.throwError("missing argument"+i,ce.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+i,ce.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ce.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",ce.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ce.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return nD||(nD=new ce(Ehe)),nD}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ce.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ahe){if(!e)return;this.globalLogger().throwError("error censorship permanent",ce.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Che=!!e,Ahe=!!r}static setLogLevel(e){let r=v_[e.toLowerCase()];if(r==null){ce.globalLogger().warn("invalid log level - "+e);return}She=r}static from(e){return new ce(e)}};ce.errors=Aa;ce.levels=oD;var Rhe="bytes/5.7.0";var Wn=new ce(Rhe);function Nhe(t){return!!t.toHexString}function qw(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return qw(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function uh(t){return Qt(t)&&!(t.length%2)||cl(t)}function khe(t){return typeof t=="number"&&t==t&&t%1===0}function cl(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!khe(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!khe(r)||r<0||r>=256)return!1}return!0}function Pe(t,e){if(e||(e={}),typeof t=="number"){Wn.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),qw(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Nhe(t)&&(t=t.toHexString()),Qt(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Wn.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let n=0;n<r.length;n+=2)i.push(parseInt(r.substring(n,n+2),16));return qw(new Uint8Array(i))}return cl(t)?qw(new Uint8Array(t)):Wn.throwArgumentError("invalid arrayify value","value",t)}function Hr(t){let e=t.map(n=>Pe(n)),r=e.reduce((n,o)=>n+o.length,0),i=new Uint8Array(r);return e.reduce((n,o)=>(i.set(o,n),n+o.length),0),qw(i)}function fc(t){let e=Pe(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function Om(t,e){t=Pe(t),t.length>e&&Wn.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),qw(r)}function Qt(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var sD="0123456789abcdef";function Ue(t,e){if(e||(e={}),typeof t=="number"){Wn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=sD[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Nhe(t))return t.toHexString();if(Qt(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Wn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(cl(t)){let r="0x";for(let i=0;i<t.length;i++){let n=t[i];r+=sD[(n&240)>>4]+sD[n&15]}return r}return Wn.throwArgumentError("invalid hexlify value","value",t)}function _s(t){if(typeof t!="string")t=Ue(t);else if(!Qt(t)||t.length%2)return null;return(t.length-2)/2}function zi(t,e,r){return typeof t!="string"?t=Ue(t):(!Qt(t)||t.length%2)&&Wn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function no(t){let e="0x";return t.forEach(r=>{e+=Ue(r).substring(2)}),e}function Cf(t){let e=aD(Ue(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function aD(t){typeof t!="string"&&(t=Ue(t)),Qt(t)||Wn.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e<t.length&&t[e]==="0";)e++;return"0x"+t.substring(e)}function Jr(t,e){for(typeof t!="string"?t=Ue(t):Qt(t)||Wn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Wn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Sf(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(uh(t)){let r=Pe(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Ue(r.slice(0,32)),e.s=Ue(r.slice(32,64))):r.length===65?(e.r=Ue(r.slice(0,32)),e.s=Ue(r.slice(32,64)),e.v=r[64]):Wn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Wn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Ue(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let n=Om(Pe(e._vs),32);e._vs=Ue(n);let o=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=o:e.recoveryParam!==o&&Wn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;let s=Ue(n);e.s==null?e.s=s:e.s!==s&&Wn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Wn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&Wn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Qt(e.r)?Wn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Jr(e.r,32),e.s==null||!Qt(e.s)?Wn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Jr(e.s,32);let r=Pe(e.s);r[0]>=128&&Wn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let i=Ue(r);e._vs&&(Qt(e._vs)||Wn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Jr(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&Wn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function i5(t){return t=Sf(t),Ue(Hr([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}var b_="bignumber/5.7.0";var n5=Mhe.default.BN,fh=new ce(b_),cD={},Phe=9007199254740991;function Dhe(t){return t!=null&&(De.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Qt(t)||typeof t=="bigint"||cl(t))}var Ohe=!1,De=class{constructor(e,r){e!==cD&&fh.throwError("cannot call constructor directly; use BigNumber.from",ce.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ca(li(this).fromTwos(e))}toTwos(e){return Ca(li(this).toTwos(e))}abs(){return this._hex[0]==="-"?De.from(this._hex.substring(1)):this}add(e){return Ca(li(this).add(li(e)))}sub(e){return Ca(li(this).sub(li(e)))}div(e){return De.from(e).isZero()&&ll("division-by-zero","div"),Ca(li(this).div(li(e)))}mul(e){return Ca(li(this).mul(li(e)))}mod(e){let r=li(e);return r.isNeg()&&ll("division-by-zero","mod"),Ca(li(this).umod(r))}pow(e){let r=li(e);return r.isNeg()&&ll("negative-power","pow"),Ca(li(this).pow(r))}and(e){let r=li(e);return(this.isNegative()||r.isNeg())&&ll("unbound-bitwise-result","and"),Ca(li(this).and(r))}or(e){let r=li(e);return(this.isNegative()||r.isNeg())&&ll("unbound-bitwise-result","or"),Ca(li(this).or(r))}xor(e){let r=li(e);return(this.isNegative()||r.isNeg())&&ll("unbound-bitwise-result","xor"),Ca(li(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&ll("negative-width","mask"),Ca(li(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ll("negative-width","shl"),Ca(li(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ll("negative-width","shr"),Ca(li(this).shrn(e))}eq(e){return li(this).eq(li(e))}lt(e){return li(this).lt(li(e))}lte(e){return li(this).lte(li(e))}gt(e){return li(this).gt(li(e))}gte(e){return li(this).gte(li(e))}isNegative(){return this._hex[0]==="-"}isZero(){return li(this).isZero()}toNumber(){try{return li(this).toNumber()}catch{ll("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return fh.throwError("this platform does not support BigInt",ce.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Ohe||(Ohe=!0,fh.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?fh.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ce.errors.UNEXPECTED_ARGUMENT,{}):fh.throwError("BigNumber.toString does not accept parameters",ce.errors.UNEXPECTED_ARGUMENT,{})),li(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof De)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new De(cD,o5(e)):e.match(/^-?[0-9]+$/)?new De(cD,o5(new n5(e))):fh.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&ll("underflow","BigNumber.from",e),(e>=Phe||e<=-Phe)&&ll("overflow","BigNumber.from",e),De.from(String(e));let r=e;if(typeof r=="bigint")return De.from(r.toString());if(cl(r))return De.from(Ue(r));if(r)if(r.toHexString){let i=r.toHexString();if(typeof i=="string")return De.from(i)}else{let i=r._hex;if(i==null&&r.type==="BigNumber"&&(i=r.hex),typeof i=="string"&&(Qt(i)||i[0]==="-"&&Qt(i.substring(1))))return De.from(i)}return fh.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function o5(t){if(typeof t!="string")return o5(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&fh.throwArgumentError("invalid hex","value",t),t=o5(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Ca(t){return De.from(o5(t))}function li(t){let e=De.from(t).toHexString();return e[0]==="-"?new n5("-"+e.substring(3),16):new n5(e.substring(2),16)}function ll(t,e,r){let i={fault:t,operation:e};return r!=null&&(i.value=r),fh.throwError(t,ce.errors.NUMERIC_FAULT,i)}function lD(t){return new n5(t,36).toString(16)}function uD(t){return new n5(t,16).toString(36)}var Js=new ce(b_),s5={},Bhe=De.from(0),Uhe=De.from(-1);function Fhe(t,e,r,i){let n={fault:e,operation:r};return i!==void 0&&(n.value=i),Js.throwError(t,ce.errors.NUMERIC_FAULT,n)}var a5="0";for(;a5.length<256;)a5+=a5;function fD(t){if(typeof t!="number")try{t=De.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+a5.substring(0,t):Js.throwArgumentError("invalid decimal size","decimals",t)}function Hw(t,e){e==null&&(e=0);let r=fD(e);t=De.from(t);let i=t.lt(Bhe);i&&(t=t.mul(Uhe));let n=t.mod(r).toString();for(;n.length<r.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];let o=t.div(r).toString();return r.length===1?t=o:t=o+"."+n,i&&(t="-"+t),t}function ul(t,e){e==null&&(e=0);let r=fD(e);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&Js.throwArgumentError("invalid decimal value","value",t);let i=t.substring(0,1)==="-";i&&(t=t.substring(1)),t==="."&&Js.throwArgumentError("missing value","value",t);let n=t.split(".");n.length>2&&Js.throwArgumentError("too many decimal points","value",t);let o=n[0],s=n[1];for(o||(o="0"),s||(s="0");s[s.length-1]==="0";)s=s.substring(0,s.length-1);for(s.length>r.length-1&&Fhe("fractional component exceeds decimals","underflow","parseFixed"),s===""&&(s="0");s.length<r.length-1;)s+="0";let a=De.from(o),c=De.from(s),h=a.mul(r).add(c);return i&&(h=h.mul(Uhe)),h}var hh=class{constructor(e,r,i,n){e!==s5&&Js.throwError("cannot use FixedFormat constructor; use FixedFormat.from",ce.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=i,this.decimals=n,this.name=(r?"":"u")+"fixed"+String(i)+"x"+String(n),this._multiplier=fD(n),Object.freeze(this)}static from(e){if(e instanceof hh)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,i=128,n=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{let o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||Js.throwArgumentError("invalid fixed format","format",e),r=o[1]!=="u",i=parseInt(o[2]),n=parseInt(o[3])}}else if(e){let o=(s,a,c)=>e[s]==null?c:(typeof e[s]!==a&&Js.throwArgumentError("invalid fixed format ("+s+" not "+a+")","format."+s,e[s]),e[s]);r=o("signed","boolean",r),i=o("width","number",i),n=o("decimals","number",n)}return i%8&&Js.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&Js.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new hh(s5,r,i,n)}},In=class{constructor(e,r,i,n){e!==s5&&Js.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ce.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Js.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);let r=ul(this._value,this.format.decimals),i=ul(e._value,e.format.decimals);return In.fromValue(r.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);let r=ul(this._value,this.format.decimals),i=ul(e._value,e.format.decimals);return In.fromValue(r.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);let r=ul(this._value,this.format.decimals),i=ul(e._value,e.format.decimals);return In.fromValue(r.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);let r=ul(this._value,this.format.decimals),i=ul(e._value,e.format.decimals);return In.fromValue(r.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){let e=this.toString().split(".");e.length===1&&e.push("0");let r=In.from(e[0],this.format),i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(r=r.subUnsafe(Lhe.toFormat(r.format))),r}ceiling(){let e=this.toString().split(".");e.length===1&&e.push("0");let r=In.from(e[0],this.format),i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(r=r.addUnsafe(Lhe.toFormat(r.format))),r}round(e){e==null&&(e=0);let r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Js.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;let i=In.from("1"+a5.substring(0,e),this.format),n=Mqe.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Js.throwArgumentError("invalid byte width","width",e);let r=De.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Jr(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return In.fromString(this._value,e)}static fromValue(e,r,i){return i==null&&r!=null&&!Dhe(r)&&(i=r,r=null),r==null&&(r=0),i==null&&(i="fixed"),In.fromString(Hw(e,r),hh.from(i))}static fromString(e,r){r==null&&(r="fixed");let i=hh.from(r),n=ul(e,i.decimals);!i.signed&&n.lt(Bhe)&&Fhe("unsigned value cannot be negative","overflow","value",e);let o=null;i.signed?o=n.toTwos(i.width).toHexString():(o=n.toHexString(),o=Jr(o,i.width/8));let s=Hw(n,i.decimals);return new In(s5,o,s,i)}static fromBytes(e,r){r==null&&(r="fixed");let i=hh.from(r);if(Pe(e).length>i.width/8)throw new Error("overflow");let n=De.from(e);i.signed&&(n=n.fromTwos(i.width));let o=n.toTwos((i.signed?0:1)+i.width).toHexString(),s=Hw(n,i.decimals);return new In(s5,o,s,i)}static from(e,r){if(typeof e=="string")return In.fromString(e,r);if(cl(e))return In.fromBytes(e,r);try{return In.fromValue(e,0,r)}catch(i){if(i.code!==ce.errors.INVALID_ARGUMENT)throw i}return Js.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}},Lhe=In.from(1),Mqe=In.from("0.5");var jhe="properties/5.7.0";var Dqe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},y_=new ce(jhe);function _e(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Rn(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Vi(t){return Dqe(this,void 0,void 0,function*(){let e=Object.keys(t).map(i=>{let n=t[i];return Promise.resolve(n).then(o=>({key:i,value:o}))});return(yield Promise.all(e)).reduce((i,n)=>(i[n.key]=n.value,i),{})})}function zw(t,e){(!t||typeof t!="object")&&y_.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||y_.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function bi(t){let e={};for(let r in t)e[r]=t[r];return e}var Lqe={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function $he(t){if(t==null||Lqe[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;let e=Object.keys(t);for(let r=0;r<e.length;r++){let i=null;try{i=t[e[r]]}catch{continue}if(!$he(i))return!1}return!0}return y_.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Bqe(t){if($he(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>Tn(e)));if(typeof t=="object"){let e={};for(let r in t){let i=t[r];i!==void 0&&_e(e,r,Tn(i))}return e}return y_.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Tn(t){return Bqe(t)}var hc=class{constructor(e){for(let r in e)this[r]=Tn(e[r])}};var If="abi/5.7.0";var mi=new ce(If),Mm={},Whe={calldata:!0,memory:!0,storage:!0},Uqe={calldata:!0,memory:!0};function x_(t,e){if(t==="bytes"||t==="string"){if(Whe[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&Uqe[e])return!0;return(Whe[e]||e==="payable")&&mi.throwArgumentError("invalid modifier","name",e),!1}function Fqe(t,e){let r=t;function i(a){mi.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function n(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let o={type:"",name:"",state:{allowType:!0}},s=o;for(let a=0;a<t.length;a++){let c=t[a];switch(c){case"(":s.state.allowType&&s.type===""?s.type="tuple":s.state.allowParams||i(a),s.state.allowType=!1,s.type=Vw(s.type),s.components=[n(s)],s=s.components[0];break;case")":delete s.state,s.name==="indexed"&&(e||i(a),s.indexed=!0,s.name=""),x_(s.type,s.name)&&(s.name=""),s.type=Vw(s.type);let h=s;s=s.parent,s||i(a),delete h.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,s.name==="indexed"&&(e||i(a),s.indexed=!0,s.name=""),x_(s.type,s.name)&&(s.name=""),s.type=Vw(s.type);let g=n(s.parent);s.parent.components.push(g),delete s.parent,s=g;break;case" ":s.state.allowType&&s.type!==""&&(s.type=Vw(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&s.name!==""&&(s.name==="indexed"?(e||i(a),s.indexed&&i(a),s.indexed=!0,s.name=""):x_(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||i(a),s.type+=c,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||i(a),s.type+=c,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=c,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=c,delete s.state.allowArray):s.state.readArray?s.type+=c:i(a)}}return s.parent&&mi.throwArgumentError("unexpected eof","param",t),delete o.state,s.name==="indexed"?(e||i(r.length-7),s.indexed&&i(r.length-7),s.indexed=!0,s.name=""):x_(s.type,s.name)&&(s.name=""),o.type=Vw(o.type),o}function __(t,e){for(let r in e)_e(t,r,e[r])}var ui=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),jqe=new RegExp(/^(.*)\[([0-9]*)\]$/),dn=class{constructor(e,r){e!==Mm&&mi.throwError("use fromString",ce.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),__(this,r);let i=this.type.match(jqe);i?__(this,{arrayLength:parseInt(i[2]||"-1"),arrayChildren:dn.fromObject({type:i[1],components:this.components}),baseType:"array"}):__(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ui.sighash),ui[e]||mi.throwArgumentError("invalid format type","format",e),e===ui.json){let i={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.components&&(i.components=this.components.map(n=>JSON.parse(n.format(e)))),JSON.stringify(i)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==ui.sighash&&(r+=this.type),r+="("+this.components.map(i=>i.format(e)).join(e===ui.full?", ":",")+")"):r+=this.type,e!==ui.sighash&&(this.indexed===!0&&(r+=" indexed"),e===ui.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?dn.fromString(e,r):dn.fromObject(e)}static fromObject(e){return dn.isParamType(e)?e:new dn(Mm,{name:e.name||null,type:Vw(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(dn.fromObject):null})}static fromString(e,r){function i(n){return dn.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components})}return i(Fqe(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}};function c5(t,e){return Wqe(t).map(r=>dn.fromString(r,e))}var Xs=class{constructor(e,r){e!==Mm&&mi.throwError("use a static from method",ce.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),__(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Xs.isFragment(e)?e:typeof e=="string"?Xs.fromString(e):Xs.fromObject(e)}static fromObject(e){if(Xs.isFragment(e))return e;switch(e.type){case"function":return As.fromObject(e);case"event":return Qs.fromObject(e);case"constructor":return Es.fromObject(e);case"error":return dc.fromObject(e);case"fallback":case"receive":return null}return mi.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Qs.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?As.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Es.fromString(e.trim()):e.split(" ")[0]==="error"?dc.fromString(e.substring(5).trim()):mi.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}},Qs=class extends Xs{format(e){if(e||(e=ui.sighash),ui[e]||mi.throwArgumentError("invalid format type","format",e),e===ui.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==ui.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===ui.full?", ":",")+") ",e!==ui.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Qs.fromString(e):Qs.fromObject(e)}static fromObject(e){if(Qs.isEventFragment(e))return e;e.type!=="event"&&mi.throwArgumentError("invalid event object","value",e);let r={name:l5(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(dn.fromObject):[],type:"event"};return new Qs(Mm,r)}static fromString(e){let r=e.match(u5);r||mi.throwArgumentError("invalid event string","value",e);let i=!1;return r[3].split(" ").forEach(n=>{switch(n.trim()){case"anonymous":i=!0;break;case"":break;default:mi.warn("unknown modifier: "+n)}}),Qs.fromObject({name:r[1].trim(),anonymous:i,inputs:c5(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}};function Hhe(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&mi.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||mi.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=De.from(r[1]),r[0]):t}function zhe(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function Vhe(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&mi.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&mi.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&mi.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&mi.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&mi.throwArgumentError("unable to determine stateMutability","value",t),e}var Es=class extends Xs{format(e){if(e||(e=ui.sighash),ui[e]||mi.throwArgumentError("invalid format type","format",e),e===ui.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});e===ui.sighash&&mi.throwError("cannot format a constructor for sighash",ce.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(i=>i.format(e)).join(e===ui.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Es.fromString(e):Es.fromObject(e)}static fromObject(e){if(Es.isConstructorFragment(e))return e;e.type!=="constructor"&&mi.throwArgumentError("invalid constructor object","value",e);let r=Vhe(e);r.constant&&mi.throwArgumentError("constructor cannot be constant","value",e);let i={name:null,type:e.type,inputs:e.inputs?e.inputs.map(dn.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?De.from(e.gas):null};return new Es(Mm,i)}static fromString(e){let r={type:"constructor"};e=Hhe(e,r);let i=e.match(u5);return(!i||i[1].trim()!=="constructor")&&mi.throwArgumentError("invalid constructor string","value",e),r.inputs=c5(i[2].trim(),!1),zhe(i[3].trim(),r),Es.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}},As=class extends Es{format(e){if(e||(e=ui.sighash),ui[e]||mi.throwArgumentError("invalid format type","format",e),e===ui.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e))),outputs:this.outputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==ui.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===ui.full?", ":",")+") ",e!==ui.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(i=>i.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?As.fromString(e):As.fromObject(e)}static fromObject(e){if(As.isFunctionFragment(e))return e;e.type!=="function"&&mi.throwArgumentError("invalid function object","value",e);let r=Vhe(e),i={type:e.type,name:l5(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(dn.fromObject):[],outputs:e.outputs?e.outputs.map(dn.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?De.from(e.gas):null};return new As(Mm,i)}static fromString(e){let r={type:"function"};e=Hhe(e,r);let i=e.split(" returns ");i.length>2&&mi.throwArgumentError("invalid function string","value",e);let n=i[0].match(u5);if(n||mi.throwArgumentError("invalid function signature","value",e),r.name=n[1].trim(),r.name&&l5(r.name),r.inputs=c5(n[2],!1),zhe(n[3].trim(),r),i.length>1){let o=i[1].match(u5);(o[1].trim()!=""||o[3].trim()!="")&&mi.throwArgumentError("unexpected tokens","value",e),r.outputs=c5(o[2],!1)}else r.outputs=[];return As.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}};function qhe(t){let e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&mi.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}var dc=class extends Xs{format(e){if(e||(e=ui.sighash),ui[e]||mi.throwArgumentError("invalid format type","format",e),e===ui.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==ui.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===ui.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?dc.fromString(e):dc.fromObject(e)}static fromObject(e){if(dc.isErrorFragment(e))return e;e.type!=="error"&&mi.throwArgumentError("invalid error object","value",e);let r={type:e.type,name:l5(e.name),inputs:e.inputs?e.inputs.map(dn.fromObject):[]};return qhe(new dc(Mm,r))}static fromString(e){let r={type:"error"},i=e.match(u5);return i||mi.throwArgumentError("invalid error signature","value",e),r.name=i[1].trim(),r.name&&l5(r.name),r.inputs=c5(i[2],!1),qhe(dc.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}};function Vw(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var $qe=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function l5(t){return(!t||!t.match($qe))&&mi.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}var u5=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Wqe(t){t=t.trim();let e=[],r="",i=0;for(let n=0;n<t.length;n++){let o=t[n];o===","&&i===0?(e.push(r),r=""):(r+=o,o==="("?i++:o===")"&&(i--,i===-1&&mi.throwArgumentError("unbalanced parenthesis","value",t)))}return r&&e.push(r),e}var hD=new ce(If);function Kw(t){let e=[],r=function(i,n){if(!!Array.isArray(n))for(let o in n){let s=i.slice();s.push(o);try{r(s,n[o])}catch(a){e.push({path:s,error:a})}}};return r([],t),e}var oo=class{constructor(e,r,i,n){this.name=e,this.type=r,this.localName=i,this.dynamic=n}_throwError(e,r){hD.throwArgumentError(e,this.localName,r)}},Dm=class{constructor(e){_e(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return no(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Hr(e._data))}writeBytes(e){let r=Pe(e),i=r.length%this.wordSize;return i&&(r=Hr([r,this._padding.slice(i)])),this._writeData(r)}_getValue(e){let r=Pe(De.from(e));return r.length>this.wordSize&&hD.throwError("value out-of-bounds",ce.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Hr([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){let e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}},Lm=class{constructor(e,r,i,n){_e(this,"_data",Pe(e)),_e(this,"wordSize",r||32),_e(this,"_coerceFunc",i),_e(this,"allowLoose",n),this._offset=0}get data(){return Ue(this._data)}get consumed(){return this._offset}static coerce(e,r){let i=e.match("^u?int([0-9]+)$");return i&&parseInt(i[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):Lm.coerce(e,r)}_peekBytes(e,r,i){let n=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&i&&this._offset+r<=this._data.length?n=r:hD.throwError("data out-of-bounds",ce.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Lm(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let i=this._peekBytes(0,e,!!r);return this._offset+=i.length,i.slice(0,e)}readValue(){return De.from(this.readBytes(this.wordSize))}};var Ghe=Dr(Khe());function zr(t){return"0x"+Ghe.default.keccak_256(Pe(t))}var A_={};qr(A_,{decode:()=>f5,encode:()=>dh});var Yhe="rlp/5.7.0";var Tf=new ce(Yhe);function Zhe(t){let e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function Jhe(t,e,r){let i=0;for(let n=0;n<r;n++)i=i*256+t[e+n];return i}function Xhe(t){if(Array.isArray(t)){let i=[];if(t.forEach(function(o){i=i.concat(Xhe(o))}),i.length<=55)return i.unshift(192+i.length),i;let n=Zhe(i.length);return n.unshift(247+n.length),n.concat(i)}uh(t)||Tf.throwArgumentError("RLP object must be BytesLike","object",t);let e=Array.prototype.slice.call(Pe(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let r=Zhe(e.length);return r.unshift(183+r.length),r.concat(e)}function dh(t){return Ue(Xhe(t))}function Qhe(t,e,r,i){let n=[];for(;r<e+1+i;){let o=ede(t,r);n.push(o.result),r+=o.consumed,r>e+1+i&&Tf.throwError("child data too short",ce.errors.BUFFER_OVERRUN,{})}return{consumed:1+i,result:n}}function ede(t,e){if(t.length===0&&Tf.throwError("data too short",ce.errors.BUFFER_OVERRUN,{}),t[e]>=248){let r=t[e]-247;e+1+r>t.length&&Tf.throwError("data short segment too short",ce.errors.BUFFER_OVERRUN,{});let i=Jhe(t,e+1,r);return e+1+r+i>t.length&&Tf.throwError("data long segment too short",ce.errors.BUFFER_OVERRUN,{}),Qhe(t,e,e+1+r,r+i)}else if(t[e]>=192){let r=t[e]-192;return e+1+r>t.length&&Tf.throwError("data array too short",ce.errors.BUFFER_OVERRUN,{}),Qhe(t,e,e+1,r)}else if(t[e]>=184){let r=t[e]-183;e+1+r>t.length&&Tf.throwError("data array too short",ce.errors.BUFFER_OVERRUN,{});let i=Jhe(t,e+1,r);e+1+r+i>t.length&&Tf.throwError("data array too short",ce.errors.BUFFER_OVERRUN,{});let n=Ue(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:n}}else if(t[e]>=128){let r=t[e]-128;e+1+r>t.length&&Tf.throwError("data too short",ce.errors.BUFFER_OVERRUN,{});let i=Ue(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:Ue(t[e])}}function f5(t){let e=Pe(t),r=ede(e,0);return r.consumed!==e.length&&Tf.throwArgumentError("invalid rlp data","data",t),r.result}var tde="address/5.7.0";var cp=new ce(tde);function rde(t){Qt(t,20)||cp.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let n=0;n<40;n++)r[n]=e[n].charCodeAt(0);let i=Pe(zr(r));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}var qqe=9007199254740991;function Hqe(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}var dD={};for(let t=0;t<10;t++)dD[String(t)]=String(t);for(let t=0;t<26;t++)dD[String.fromCharCode(65+t)]=String(10+t);var ide=Math.floor(Hqe(qqe));function nde(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(i=>dD[i]).join("");for(;e.length>=ide;){let i=e.substring(0,ide);e=parseInt(i,10)%97+e.substring(i.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Vr(t){let e=null;if(typeof t!="string"&&cp.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=rde(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&cp.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==nde(t)&&cp.throwArgumentError("bad icap checksum","address",t),e=lD(t.substring(4));e.length<40;)e="0"+e;e=rde("0x"+e)}else cp.throwArgumentError("invalid address","address",t);return e}function ode(t){try{return Vr(t),!0}catch{}return!1}function sde(t){let e=uD(Vr(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+nde("XE00"+e)+e}function Bm(t){let e=null;try{e=Vr(t.from)}catch{cp.throwArgumentError("missing from address","transaction",t)}let r=fc(Pe(De.from(t.nonce).toHexString()));return Vr(zi(zr(dh([e,r])),12))}function ade(t,e,r){return _s(e)!==32&&cp.throwArgumentError("salt must be 32 bytes","salt",e),_s(r)!==32&&cp.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Vr(zi(zr(Hr(["0xff",Vr(t),e,r])),12))}var C_=class extends oo{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Vr(r)}catch(i){this._throwError(i.message,r)}return e.writeValue(r)}decode(e){return Vr(Jr(e.readValue().toHexString(),20))}};var S_=class extends oo{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}};var Gw=new ce(If);function pD(t,e,r){let i=null;if(Array.isArray(r))i=r;else if(r&&typeof r=="object"){let c={};i=e.map(h=>{let g=h.localName;return g||Gw.throwError("cannot encode object for signature with missing names",ce.errors.INVALID_ARGUMENT,{argument:"values",coder:h,value:r}),c[g]&&Gw.throwError("cannot encode object for signature with duplicate names",ce.errors.INVALID_ARGUMENT,{argument:"values",coder:h,value:r}),c[g]=!0,r[g]})}else Gw.throwArgumentError("invalid tuple value","tuple",r);e.length!==i.length&&Gw.throwArgumentError("types/value length mismatch","tuple",r);let n=new Dm(t.wordSize),o=new Dm(t.wordSize),s=[];e.forEach((c,h)=>{let g=i[h];if(c.dynamic){let w=o.length;c.encode(o,g);let A=n.writeUpdatableValue();s.push(E=>{A(E+w)})}else c.encode(n,g)}),s.forEach(c=>{c(n.length)});let a=t.appendWriter(n);return a+=t.appendWriter(o),a}function mD(t,e){let r=[],i=t.subReader(0);e.forEach(o=>{let s=null;if(o.dynamic){let a=t.readValue(),c=i.subReader(a.toNumber());try{s=o.decode(c)}catch(h){if(h.code===ce.errors.BUFFER_OVERRUN)throw h;s=h,s.baseType=o.name,s.name=o.localName,s.type=o.type}}else try{s=o.decode(t)}catch(a){if(a.code===ce.errors.BUFFER_OVERRUN)throw a;s=a,s.baseType=o.name,s.name=o.localName,s.type=o.type}s!=null&&r.push(s)});let n=e.reduce((o,s)=>{let a=s.localName;return a&&(o[a]||(o[a]=0),o[a]++),o},{});e.forEach((o,s)=>{let a=o.localName;if(!a||n[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;let c=r[s];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let o=0;o<r.length;o++){let s=r[o];s instanceof Error&&Object.defineProperty(r,o,{enumerable:!0,get:()=>{throw s}})}return Object.freeze(r)}var I_=class extends oo{constructor(e,r,i){let n=e.type+"["+(r>=0?r:"")+"]",o=r===-1||e.dynamic;super("array",n,i,o),this.coder=e,this.length=r}defaultValue(){let e=this.coder.defaultValue(),r=[];for(let i=0;i<this.length;i++)r.push(e);return r}encode(e,r){Array.isArray(r)||this._throwError("expected array value",r);let i=this.length;i===-1&&(i=r.length,e.writeValue(r.length)),Gw.checkArgumentCount(r.length,i,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let o=0;o<r.length;o++)n.push(this.coder);return pD(e,n,r)}decode(e){let r=this.length;r===-1&&(r=e.readValue().toNumber(),r*32>e._data.length&&Gw.throwError("insufficient data length",ce.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let i=[];for(let n=0;n<r;n++)i.push(new S_(this.coder));return e.coerce(this.name,mD(e,i))}};var T_=class extends oo{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){return e.writeValue(r?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}};var h5=class extends oo{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=Pe(r);let i=e.writeValue(r.length);return i+=e.writeBytes(r),i}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}},R_=class extends h5{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,Ue(super.decode(e)))}};var k_=class extends oo{constructor(e,r){let i="bytes"+String(e);super(i,i,r,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let i=Pe(r);return i.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(i)}decode(e){return e.coerce(this.name,Ue(e.readBytes(this.size)))}};var N_=class extends oo{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}};var L_={};qr(L_,{AddressZero:()=>P_,EtherSymbol:()=>hde,HashZero:()=>Zw,MaxInt256:()=>fde,MaxUint256:()=>D_,MinInt256:()=>ude,NegativeOne:()=>O_,One:()=>M_,Two:()=>cde,WeiPerEther:()=>lde,Zero:()=>Yw});var P_="0x0000000000000000000000000000000000000000";var O_=De.from(-1),Yw=De.from(0),M_=De.from(1),cde=De.from(2),lde=De.from("1000000000000000000"),D_=De.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ude=De.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),fde=De.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Zw="0x0000000000000000000000000000000000000000000000000000000000000000";var hde="\u039E";var B_=class extends oo{constructor(e,r,i){let n=(r?"int":"uint")+e*8;super(n,n,i,!1),this.size=e,this.signed=r}defaultValue(){return 0}encode(e,r){let i=De.from(r),n=D_.mask(e.wordSize*8);if(this.signed){let o=n.mask(this.size*8-1);(i.gt(o)||i.lt(o.add(M_).mul(O_)))&&this._throwError("value out-of-bounds",r)}else(i.lt(Yw)||i.gt(n.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return i=i.toTwos(this.size*8).mask(this.size*8),this.signed&&(i=i.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(i)}decode(e){let r=e.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),e.coerce(this.name,r)}};var dde="strings/5.7.0";var pde=new ce(dde),ea;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(ea||(ea={}));var Cs;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Cs||(Cs={}));function zqe(t,e,r,i,n){return pde.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function mde(t,e,r,i,n){if(t===Cs.BAD_PREFIX||t===Cs.UNEXPECTED_CONTINUE){let o=0;for(let s=e+1;s<r.length&&r[s]>>6===2;s++)o++;return o}return t===Cs.OVERRUN?r.length-e-1:0}function Vqe(t,e,r,i,n){return t===Cs.OVERLONG?(i.push(n),0):(i.push(65533),mde(t,e,r,i,n))}var U_=Object.freeze({error:zqe,ignore:mde,replace:Vqe});function wD(t,e){e==null&&(e=U_.error),t=Pe(t);let r=[],i=0;for(;i<t.length;){let n=t[i++];if(n>>7===0){r.push(n);continue}let o=null,s=null;if((n&224)===192)o=1,s=127;else if((n&240)===224)o=2,s=2047;else if((n&248)===240)o=3,s=65535;else{(n&192)===128?i+=e(Cs.UNEXPECTED_CONTINUE,i-1,t,r):i+=e(Cs.BAD_PREFIX,i-1,t,r);continue}if(i-1+o>=t.length){i+=e(Cs.OVERRUN,i-1,t,r);continue}let a=n&(1<<8-o-1)-1;for(let c=0;c<o;c++){let h=t[i];if((h&192)!=128){i+=e(Cs.MISSING_CONTINUE,i,t,r),a=null;break}a=a<<6|h&63,i++}if(a!==null){if(a>1114111){i+=e(Cs.OUT_OF_RANGE,i-1-o,t,r,a);continue}if(a>=55296&&a<=57343){i+=e(Cs.UTF16_SURROGATE,i-1-o,t,r,a);continue}if(a<=s){i+=e(Cs.OVERLONG,i-1-o,t,r,a);continue}r.push(a)}}return r}function gi(t,e=ea.current){e!=ea.current&&(pde.checkNormalize(),t=t.normalize(e));let r=[];for(let i=0;i<t.length;i++){let n=t.charCodeAt(i);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(n&63|128);else if((n&64512)==55296){i++;let o=t.charCodeAt(i);if(i>=t.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");let s=65536+((n&1023)<<10)+(o&1023);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(n&63|128)}return Pe(r)}function gD(t){let e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function vD(t,e){return'"'+wD(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?gD(r):(r-=65536,gD((r>>10&1023)+55296)+gD((r&1023)+56320))}).join("")+'"'}function F_(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Sa(t,e){return F_(wD(t,e))}function lp(t,e=ea.current){return wD(gi(t,e))}function bD(t){let e=gi(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Ue(Hr([e,Zw]).slice(0,32))}function yD(t){let e=Pe(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return Sa(e.slice(0,r))}function Kqe(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e}function xD(t,e){e||(e=function(n){return[parseInt(n,16)]});let r=0,i={};return t.split(",").forEach(n=>{let o=n.split(":");r+=parseInt(o[0],16),i[r]=e(o[1])}),i}function gde(t){let e=0;return t.split(",").map(r=>{let i=r.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}function _D(t,e){let r=0;for(let i=0;i<e.length;i++){let n=e[i];if(r+=n.l,t>=r&&t<=r+n.h&&(t-r)%(n.d||1)===0){if(n.e&&n.e.indexOf(t-r)!==-1)continue;return n}}return null}var Gqe=gde("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Yqe="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),Zqe=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Jqe=xD("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Qqe=xD("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Xqe=xD("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",Kqe),eHe=gde("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function tHe(t){return t.reduce((e,r)=>(r.forEach(i=>{e.push(i)}),e),[])}function rHe(t){return!!_D(t,Gqe)}function iHe(t){let e=_D(t,Zqe);if(e)return[t+e.s];let r=Jqe[t];if(r)return r;let i=Qqe[t];if(i)return[t+i[0]];let n=Xqe[t];return n||null}function nHe(t){return!!_D(t,eHe)}function ED(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=lp(t);e=tHe(e.map(i=>{if(Yqe.indexOf(i)>=0)return[];if(i>=65024&&i<=65039)return[];let n=iHe(i);return n||[i]})),e=lp(F_(e),ea.NFKC),e.forEach(i=>{if(nHe(i))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(i=>{if(rHe(i))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=F_(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}var j_=class extends h5{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,gi(r))}decode(e){return Sa(super.decode(e))}};var Um=class extends oo{constructor(e,r){let i=!1,n=[];e.forEach(s=>{s.dynamic&&(i=!0),n.push(s.type)});let o="tuple("+n.join(",")+")";super("tuple",o,r,i),this.coders=e}defaultValue(){let e=[];this.coders.forEach(i=>{e.push(i.defaultValue())});let r=this.coders.reduce((i,n)=>{let o=n.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,n)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),e[o]==null&&(e[o]=e[n]))}),Object.freeze(e)}encode(e,r){return pD(e,this.coders,r)}decode(e){return e.coerce(this.name,mD(e,this.coders))}};var $_=new ce(If),oHe=new RegExp(/^bytes([0-9]*)$/),sHe=new RegExp(/^(u?int)([0-9]*)$/),Jw=class{constructor(e){_e(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new C_(e.name);case"bool":return new T_(e.name);case"string":return new j_(e.name);case"bytes":return new R_(e.name);case"array":return new I_(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Um((e.components||[]).map(i=>this._getCoder(i)),e.name);case"":return new N_(e.name)}let r=e.type.match(sHe);if(r){let i=parseInt(r[2]||"256");return(i===0||i>256||i%8!==0)&&$_.throwArgumentError("invalid "+r[1]+" bit length","param",e),new B_(i/8,r[1]==="int",e.name)}if(r=e.type.match(oHe),r){let i=parseInt(r[1]);return(i===0||i>32)&&$_.throwArgumentError("invalid bytes length","param",e),new k_(i,e.name)}return $_.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new Lm(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Dm(this._getWordSize())}getDefaultValue(e){let r=e.map(n=>this._getCoder(dn.from(n)));return new Um(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&$_.throwError("types/values length mismatch",ce.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});let i=e.map(s=>this._getCoder(dn.from(s))),n=new Um(i,"_"),o=this._getWriter();return n.encode(o,r),o.data}decode(e,r,i){let n=e.map(s=>this._getCoder(dn.from(s)));return new Um(n,"_").decode(this._getReader(Pe(r),i))}},d5=new Jw;function pc(t){return zr(gi(t))}var W_="hash/5.7.0";var AD={};qr(AD,{decode:()=>Qw,encode:()=>Xw});function Qw(t){t=atob(t);let e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Pe(e)}function Xw(t){t=Pe(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function vde(t,e){e==null&&(e=1);let r=[],i=r.forEach,n=function(o,s){i.call(o,function(a){s>0&&Array.isArray(a)?n(a,s-1):r.push(a)})};return n(t,e),r}function aHe(t){let e={};for(let r=0;r<t.length;r++){let i=t[r];e[i[0]]=i[1]}return e}function cHe(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,o=[0,1];for(let te=1;te<i;te++)o.push(n+=r());let s=r(),a=e;e+=s;let c=0,h=0;function g(){return c==0&&(h=h<<8|t[e++],c=8),h>>--c&1}let w=31,A=Math.pow(2,w),E=A>>>1,I=E>>1,k=A-1,M=0;for(let te=0;te<w;te++)M=M<<1|g();let j=[],W=0,G=A;for(;;){let te=Math.floor(((M-W+1)*n-1)/G),oe=0,Q=i;for(;Q-oe>1;){let L=oe+Q>>>1;te<o[L]?Q=L:oe=L}if(oe==0)break;j.push(oe);let N=W+Math.floor(G*o[oe]/n),U=W+Math.floor(G*o[oe+1]/n)-1;for(;((N^U)&E)==0;)M=M<<1&k|g(),N=N<<1&k,U=U<<1&k|1;for(;N&~U&I;)M=M&E|M<<1&k>>>1|g(),N=N<<1^E,U=(U^E)<<1|E|1;W=N,G=1+U-N}let Y=i-4;return j.map(te=>{switch(te-Y){case 3:return Y+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return Y+256+(t[a++]<<8|t[a++]);case 1:return Y+t[a++];default:return te-1}})}function lHe(t){let e=0;return()=>t[e++]}function bde(t){return lHe(cHe(t))}function uHe(t){return t&1?~t>>1:t>>1}function fHe(t,e){let r=Array(t);for(let i=0;i<t;i++)r[i]=1+e();return r}function wde(t,e){let r=Array(t);for(let i=0,n=-1;i<t;i++)r[i]=n+=1+e();return r}function hHe(t,e){let r=Array(t);for(let i=0,n=0;i<t;i++)r[i]=n+=uHe(e());return r}function p5(t,e){let r=wde(t(),t),i=t(),n=wde(i,t),o=fHe(i,t);for(let s=0;s<i;s++)for(let a=0;a<o[s];a++)r.push(n[s]+a);return e?r.map(s=>e[s]):r}function yde(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(pHe(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(mHe(r,t))}return aHe(vde(e))}function dHe(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function xde(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n<e;n++)hHe(t,r).forEach((o,s)=>i[s].push(o));return i}function pHe(t,e){let r=1+e(),i=e(),n=dHe(e),o=xde(n.length,1+t,e);return vde(o.map((s,a)=>{let c=s[0],h=s.slice(1);return Array(n[a]).fill(void 0).map((g,w)=>{let A=w*i;return[c+w*r,h.map(E=>E+A)]})}))}function mHe(t,e){let r=1+e();return xde(r,1+t,e).map(n=>[n[0],n.slice(1)])}function _de(t){let e=p5(t).sort((i,n)=>i-n);return r();function r(){let i=[];for(;;){let h=p5(t,e);if(h.length==0)break;i.push({set:new Set(h),node:r()})}i.sort((h,g)=>g.set.size-h.set.size);let n=t(),o=n%3;n=n/3|0;let s=!!(n&1);n>>=1;let a=n==1,c=n==2;return{branches:i,valid:o,fe0f:s,save:a,check:c}}}function Ede(){return bde(Qw("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}var q_=Ede(),gHe=new Set(p5(q_)),wHe=new Set(p5(q_)),vHe=yde(q_),bHe=_de(q_),Ade=45,Cde=95;function Sde(t){return lp(t)}function yHe(t){return t.filter(e=>e!=65039)}function Ide(t){for(let e of t.split(".")){let r=Sde(e);try{for(let i=r.lastIndexOf(Cde)-1;i>=0;i--)if(r[i]!==Cde)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(i=>i<128)&&r[2]===Ade&&r[3]===Ade)throw new Error("invalid label extension")}catch(i){throw new Error(`Invalid label "${e}": ${i.message}`)}}return t}function Tde(t){return Ide(xHe(t,yHe))}function xHe(t,e){let r=Sde(t).reverse(),i=[];for(;r.length;){let n=EHe(r);if(n){i.push(...e(n));continue}let o=r.pop();if(gHe.has(o)){i.push(o);continue}if(wHe.has(o))continue;let s=vHe[o];if(s){i.push(...s);continue}throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return Ide(_He(String.fromCodePoint(...i)))}function _He(t){return t.normalize("NFC")}function EHe(t,e){var r;let i=bHe,n,o,s=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(i=(r=i.branches.find(h=>h.set.has(c)))===null||r===void 0?void 0:r.node,!i)break;if(i.save)o=c;else if(i.check&&c===o)break;s.push(c),i.fe0f&&(s.push(65039),a>0&&t[a-1]==65039&&a--),i.valid&&(n=s.slice(),i.valid==2&&n.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return n}var AHe=new ce(W_),kde=new Uint8Array(32);kde.fill(0);function Rde(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function CD(t){let e=gi(Tde(t)),r=[];if(t.length===0)return r;let i=0;for(let n=0;n<e.length;n++)e[n]===46&&(r.push(Rde(e.slice(i,n))),i=n+1);if(i>=e.length)throw new Error("invalid ENS name; empty component");return r.push(Rde(e.slice(i))),r}function SD(t){try{return CD(t).length!==0}catch{}return!1}function up(t){typeof t!="string"&&AHe.throwArgumentError("invalid ENS name; not a string","name",t);let e=kde,r=CD(t);for(;r.length;)e=zr(Hr([e,zr(r.pop())]));return Ue(e)}function m5(t){return Ue(Hr(CD(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");let r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var Nde=`Ethereum Signed Message:
9975
9975
  `;function e3(t){return typeof t=="string"&&(t=gi(t)),zr(Hr([gi(Nde),gi(String(t.length)),t]))}var CHe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},kn=new ce(W_),Dde=new Uint8Array(32);Dde.fill(0);var SHe=De.from(-1),Lde=De.from(0),Bde=De.from(1),IHe=De.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function THe(t){let e=Pe(t),r=e.length%32;return r?no([e,Dde.slice(r)]):Ue(e)}var RHe=Jr(Bde.toHexString(),32),kHe=Jr(Lde.toHexString(),32),Pde={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ID=["name","version","chainId","verifyingContract","salt"];function Ode(t){return function(e){return typeof e!="string"&&kn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}var NHe={name:Ode("name"),version:Ode("version"),chainId:function(t){try{return De.from(t).toString()}catch{}return kn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Vr(t).toLowerCase()}catch{}return kn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{let e=Pe(t);if(e.length!==32)throw new Error("bad length");return Ue(e)}catch{}return kn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function TD(t){{let e=t.match(/^(u?)int(\d*)$/);if(e){let r=e[1]==="",i=parseInt(e[2]||"256");(i%8!==0||i>256||e[2]&&e[2]!==String(i))&&kn.throwArgumentError("invalid numeric width","type",t);let n=IHe.mask(r?i-1:i),o=r?n.add(Bde).mul(SHe):Lde;return function(s){let a=De.from(s);return(a.lt(o)||a.gt(n))&&kn.throwArgumentError(`value out-of-bounds for ${t}`,"value",s),Jr(a.toTwos(256).toHexString(),32)}}}{let e=t.match(/^bytes(\d+)$/);if(e){let r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&kn.throwArgumentError("invalid bytes width","type",t),function(i){return Pe(i).length!==r&&kn.throwArgumentError(`invalid length for ${t}`,"value",i),THe(i)}}}switch(t){case"address":return function(e){return Jr(Vr(e),32)};case"bool":return function(e){return e?RHe:kHe};case"bytes":return function(e){return zr(e)};case"string":return function(e){return pc(e)}}return null}function Mde(t,e){return`${t}(${e.map(({name:r,type:i})=>i+" "+r).join(",")})`}var Nn=class{constructor(e){_e(this,"types",Object.freeze(Tn(e))),_e(this,"_encoderCache",{}),_e(this,"_types",{});let r={},i={},n={};Object.keys(e).forEach(a=>{r[a]={},i[a]=[],n[a]={}});for(let a in e){let c={};e[a].forEach(h=>{c[h.name]&&kn.throwArgumentError(`duplicate variable name ${JSON.stringify(h.name)} in ${JSON.stringify(a)}`,"types",e),c[h.name]=!0;let g=h.type.match(/^([^\x5b]*)(\x5b|$)/)[1];g===a&&kn.throwArgumentError(`circular type reference to ${JSON.stringify(g)}`,"types",e),!TD(g)&&(i[g]||kn.throwArgumentError(`unknown type ${JSON.stringify(g)}`,"types",e),i[g].push(a),r[a][g]=!0)})}let o=Object.keys(i).filter(a=>i[a].length===0);o.length===0?kn.throwArgumentError("missing primary type","types",e):o.length>1&&kn.throwArgumentError(`ambiguous primary types or unused types: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),_e(this,"primaryType",o[0]);function s(a,c){c[a]&&kn.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(h=>{!i[h]||(s(h,c),Object.keys(c).forEach(g=>{n[g][h]=!0}))}),delete c[a]}s(this.primaryType,{});for(let a in n){let c=Object.keys(n[a]);c.sort(),this._types[a]=Mde(a,e[a])+c.map(h=>Mde(h,e[h])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{let n=TD(e);if(n)return n}let r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let n=r[1],o=this.getEncoder(n),s=parseInt(r[3]);return a=>{s>=0&&a.length!==s&&kn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(o);return this._types[n]&&(c=c.map(zr)),zr(no(c))}}let i=this.types[e];if(i){let n=pc(this._types[e]);return o=>{let s=i.map(({name:a,type:c})=>{let h=this.getEncoder(c)(o[a]);return this._types[c]?zr(h):h});return s.unshift(n),no(s)}}return kn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let r=this._types[e];return r||kn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return zr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,i){if(TD(e))return i(e,r);let n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){let s=n[1],a=parseInt(n[3]);return a>=0&&r.length!==a&&kn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(s,c,i))}let o=this.types[e];return o?o.reduce((s,{name:a,type:c})=>(s[a]=this._visit(c,r[a],i),s),{}):kn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Nn(e)}static getPrimaryType(e){return Nn.from(e).primaryType}static hashStruct(e,r,i){return Nn.from(r).hashStruct(e,i)}static hashDomain(e){let r=[];for(let i in e){let n=Pde[i];n||kn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(i)}`,"domain",e),r.push({name:i,type:n})}return r.sort((i,n)=>ID.indexOf(i.name)-ID.indexOf(n.name)),Nn.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,i){return no(["0x1901",Nn.hashDomain(e),Nn.from(r).hash(i)])}static hash(e,r,i){return zr(Nn.encode(e,r,i))}static resolveNames(e,r,i,n){return CHe(this,void 0,void 0,function*(){e=bi(e);let o={};e.verifyingContract&&!Qt(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");let s=Nn.from(r);s.visit(i,(a,c)=>(a==="address"&&!Qt(c,20)&&(o[c]="0x"),c));for(let a in o)o[a]=yield n(a);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),i=s.visit(i,(a,c)=>a==="address"&&o[c]?o[c]:c),{domain:e,value:i}})}static getPayload(e,r,i){Nn.hashDomain(e);let n={},o=[];ID.forEach(c=>{let h=e[c];h!=null&&(n[c]=NHe[c](h),o.push({name:c,type:Pde[c]}))});let s=Nn.from(r),a=bi(r);return a.EIP712Domain?kn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=o,s.encode(i),{types:a,domain:n,primaryType:s.primaryType,message:s.visit(i,(c,h)=>{if(c.match(/^bytes(\d*)/))return Ue(Pe(h));if(c.match(/^u?int/))return De.from(h).toString();switch(c){case"address":return h.toLowerCase();case"bool":return!!h;case"string":return typeof h!="string"&&kn.throwArgumentError("invalid string","value",h),h}return kn.throwArgumentError("unsupported type","type",c)})}}};var Pn=new ce(If);var t3=class extends hc{},r3=class extends hc{},RD=class extends hc{},ph=class extends hc{static isIndexed(e){return!!(e&&e._isIndexed)}},PHe={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Ude(t,e){let r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}var fp=class{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,_e(this,"fragments",r.map(i=>Xs.from(i)).filter(i=>i!=null)),_e(this,"_abiCoder",Rn(new.target,"getAbiCoder")()),_e(this,"functions",{}),_e(this,"errors",{}),_e(this,"events",{}),_e(this,"structs",{}),this.fragments.forEach(i=>{let n=null;switch(i.type){case"constructor":if(this.deploy){Pn.warn("duplicate definition - constructor");return}_e(this,"deploy",i);return;case"function":n=this.functions;break;case"event":n=this.events;break;case"error":n=this.errors;break;default:return}let o=i.format();if(n[o]){Pn.warn("duplicate definition - "+o);return}n[o]=i}),this.deploy||_e(this,"deploy",Es.from({payable:!1,type:"constructor"})),_e(this,"_isInterface",!0)}format(e){e||(e=ui.full),e===ui.sighash&&Pn.throwArgumentError("interface does not support formatting sighash","format",e);let r=this.fragments.map(i=>i.format(e));return e===ui.json?JSON.stringify(r.map(i=>JSON.parse(i))):r}static getAbiCoder(){return d5}static getAddress(e){return Vr(e)}static getSighash(e){return zi(pc(e.format()),0,4)}static getEventTopic(e){return pc(e.format())}getFunction(e){if(Qt(e)){for(let i in this.functions)if(e===this.getSighash(i))return this.functions[i];Pn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){let i=e.trim(),n=Object.keys(this.functions).filter(o=>o.split("(")[0]===i);return n.length===0?Pn.throwArgumentError("no matching function","name",i):n.length>1&&Pn.throwArgumentError("multiple matching functions","name",i),this.functions[n[0]]}let r=this.functions[As.fromString(e).format()];return r||Pn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Qt(e)){let i=e.toLowerCase();for(let n in this.events)if(i===this.getEventTopic(n))return this.events[n];Pn.throwArgumentError("no matching event","topichash",i)}if(e.indexOf("(")===-1){let i=e.trim(),n=Object.keys(this.events).filter(o=>o.split("(")[0]===i);return n.length===0?Pn.throwArgumentError("no matching event","name",i):n.length>1&&Pn.throwArgumentError("multiple matching events","name",i),this.events[n[0]]}let r=this.events[Qs.fromString(e).format()];return r||Pn.throwArgumentError("no matching event","signature",e),r}getError(e){if(Qt(e)){let i=Rn(this.constructor,"getSighash");for(let n in this.errors){let o=this.errors[n];if(e===i(o))return this.errors[n]}Pn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){let i=e.trim(),n=Object.keys(this.errors).filter(o=>o.split("(")[0]===i);return n.length===0?Pn.throwArgumentError("no matching error","name",i):n.length>1&&Pn.throwArgumentError("multiple matching errors","name",i),this.errors[n[0]]}let r=this.errors[As.fromString(e).format()];return r||Pn.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Rn(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Rn(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));let i=Pe(r);return Ue(i.slice(0,4))!==this.getSighash(e)&&Pn.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Ue(i)),this._decodeParams(e.inputs,i.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),Ue(Hr([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));let i=Pe(r);return Ue(i.slice(0,4))!==this.getSighash(e)&&Pn.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Ue(i)),this._decodeParams(e.inputs,i.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Ue(Hr([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let i=Pe(r),n=null,o="",s=null,a=null,c=null;switch(i.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,i)}catch{}break;case 4:{let h=Ue(i.slice(0,4)),g=PHe[h];if(g)s=this._abiCoder.decode(g.inputs,i.slice(4)),a=g.name,c=g.signature,g.reason&&(n=s[0]),a==="Error"?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:a==="Panic"&&(o=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{let w=this.getError(h);s=this._abiCoder.decode(w.inputs,i.slice(4)),a=w.name,c=w.format()}catch{}break}}return Pn.throwError("call revert exception"+o,ce.errors.CALL_EXCEPTION,{method:e.format(),data:Ue(r),errorArgs:s,errorName:a,errorSignature:c,reason:n})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Ue(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Pn.throwError("too many arguments for "+e.format(),ce.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let i=[];e.anonymous||i.push(this.getEventTopic(e));let n=(o,s)=>o.type==="string"?pc(s):o.type==="bytes"?zr(Ue(s)):(o.type==="bool"&&typeof s=="boolean"&&(s=s?"0x01":"0x00"),o.type.match(/^u?int/)&&(s=De.from(s).toHexString()),o.type==="address"&&this._abiCoder.encode(["address"],[s]),Jr(Ue(s),32));for(r.forEach((o,s)=>{let a=e.inputs[s];if(!a.indexed){o!=null&&Pn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,o);return}o==null?i.push(null):a.baseType==="array"||a.baseType==="tuple"?Pn.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,o):Array.isArray(o)?i.push(o.map(c=>n(a,c))):i.push(n(a,o))});i.length&&i[i.length-1]===null;)i.pop();return i}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));let i=[],n=[],o=[];return e.anonymous||i.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Pn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((s,a)=>{let c=r[a];if(s.indexed)if(s.type==="string")i.push(pc(c));else if(s.type==="bytes")i.push(zr(c));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");i.push(this._abiCoder.encode([s.type],[c]))}else n.push(s),o.push(c)}),{data:this._abiCoder.encode(n,o),topics:i}}decodeEventLog(e,r,i){if(typeof e=="string"&&(e=this.getEvent(e)),i!=null&&!e.anonymous){let A=this.getEventTopic(e);(!Qt(i[0],32)||i[0].toLowerCase()!==A)&&Pn.throwError("fragment/topic mismatch",ce.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:A,value:i[0]}),i=i.slice(1)}let n=[],o=[],s=[];e.inputs.forEach((A,E)=>{A.indexed?A.type==="string"||A.type==="bytes"||A.baseType==="tuple"||A.baseType==="array"?(n.push(dn.fromObject({type:"bytes32",name:A.name})),s.push(!0)):(n.push(A),s.push(!1)):(o.push(A),s.push(!1))});let a=i!=null?this._abiCoder.decode(n,Hr(i)):null,c=this._abiCoder.decode(o,r,!0),h=[],g=0,w=0;e.inputs.forEach((A,E)=>{if(A.indexed)if(a==null)h[E]=new ph({_isIndexed:!0,hash:null});else if(s[E])h[E]=new ph({_isIndexed:!0,hash:a[w++]});else try{h[E]=a[w++]}catch(I){h[E]=I}else try{h[E]=c[g++]}catch(I){h[E]=I}if(A.name&&h[A.name]==null){let I=h[E];I instanceof Error?Object.defineProperty(h,A.name,{enumerable:!0,get:()=>{throw Ude(`property ${JSON.stringify(A.name)}`,I)}}):h[A.name]=I}});for(let A=0;A<h.length;A++){let E=h[A];E instanceof Error&&Object.defineProperty(h,A,{enumerable:!0,get:()=>{throw Ude(`index ${A}`,E)}})}return Object.freeze(h)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new r3({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:De.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new t3({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){let r=Ue(e),i=this.getError(r.substring(0,10).toLowerCase());return i?new RD({args:this._abiCoder.decode(i.inputs,"0x"+r.substring(10)),errorFragment:i,name:i.name,signature:i.format(),sighash:this.getSighash(i)}):null}static isInterface(e){return!!(e&&e._isInterface)}};var Fde="abstract-provider/5.7.0";var OHe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},MHe=new ce(Fde),H_=class extends hc{static isForkEvent(e){return!!(e&&e._isForkEvent)}};var Ia=class{constructor(){MHe.checkAbstract(new.target,Ia),_e(this,"_isProvider",!0)}getFeeData(){return OHe(this,void 0,void 0,function*(){let{block:e,gasPrice:r}=yield Vi({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(s=>null)}),i=null,n=null,o=null;return e&&e.baseFeePerGas&&(i=e.baseFeePerGas,o=De.from("1500000000"),n=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:i,maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}};var jde="abstract-signer/5.7.0";var ru=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},fl=new ce(jde),DHe=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],LHe=[ce.errors.INSUFFICIENT_FUNDS,ce.errors.NONCE_EXPIRED,ce.errors.REPLACEMENT_UNDERPRICED],ta=class{constructor(){fl.checkAbstract(new.target,ta),_e(this,"_isSigner",!0)}getBalance(e){return ru(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return ru(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return ru(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let r=yield Vi(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return ru(this,void 0,void 0,function*(){this._checkProvider("call");let i=yield Vi(this.checkTransaction(e));return yield this.provider.call(i,r)})}sendTransaction(e){return ru(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let r=yield this.populateTransaction(e),i=yield this.signTransaction(r);return yield this.provider.sendTransaction(i)})}getChainId(){return ru(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return ru(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return ru(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return ru(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let i in e)DHe.indexOf(i)===-1&&fl.throwArgumentError("invalid transaction key: "+i,"transaction",e);let r=bi(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(i=>(i[0].toLowerCase()!==i[1].toLowerCase()&&fl.throwArgumentError("from address mismatch","transaction",e),i[0])),r}populateTransaction(e){return ru(this,void 0,void 0,function*(){let r=yield Vi(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(n=>ru(this,void 0,void 0,function*(){if(n==null)return null;let o=yield this.resolveName(n);return o==null&&fl.throwArgumentError("provided ENS name resolves to null","tx.to",n),o})),r.to.catch(n=>{}));let i=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||i)?fl.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&i&&fl.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{let n=yield this.getFeeData();if(r.type==null)if(n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){let o=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o}else r.maxFeePerGas==null&&(r.maxFeePerGas=n.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=n.maxPriorityFeePerGas);else n.gasPrice!=null?(i&&fl.throwError("network does not support EIP-1559",ce.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=n.gasPrice),r.type=0):fl.throwError("failed to get consistent fee data",ce.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=n.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=n.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(n=>{if(LHe.indexOf(n.code)>=0)throw n;return fl.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ce.errors.UNPREDICTABLE_GAS_LIMIT,{error:n,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(n=>(n[1]!==0&&n[0]!==n[1]&&fl.throwArgumentError("chainId address mismatch","transaction",e),n[0])),yield Vi(r)})}_checkProvider(e){this.provider||fl.throwError("missing provider",ce.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}},mh=class extends ta{constructor(e,r){super(),_e(this,"address",e),_e(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{fl.throwError(e,ce.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,i){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new mh(this.address,e)}};var Mr=Dr(iD()),Df=Dr(FD());function u3(t,e,r){return r={path:e,exports:{},require:function(i,n){return oVe(i,n??r.path)}},t(r,r.exports),r.exports}function oVe(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var qD=Epe;function Epe(t,e){if(!t)throw new Error(e||"Assertion failed")}Epe.equal=function(e,r,i){if(e!=r)throw new Error(i||"Assertion failed: "+e+" != "+r)};var su=u3(function(t,e){"use strict";var r=e;function i(s,a){if(Array.isArray(s))return s.slice();if(!s)return[];var c=[];if(typeof s!="string"){for(var h=0;h<s.length;h++)c[h]=s[h]|0;return c}if(a==="hex"){s=s.replace(/[^a-z0-9]+/ig,""),s.length%2!==0&&(s="0"+s);for(var h=0;h<s.length;h+=2)c.push(parseInt(s[h]+s[h+1],16))}else for(var h=0;h<s.length;h++){var g=s.charCodeAt(h),w=g>>8,A=g&255;w?c.push(w,A):c.push(A)}return c}r.toArray=i;function n(s){return s.length===1?"0"+s:s}r.zero2=n;function o(s){for(var a="",c=0;c<s.length;c++)a+=n(s[c].toString(16));return a}r.toHex=o,r.encode=function(a,c){return c==="hex"?o(a):a}}),gc=u3(function(t,e){"use strict";var r=e;r.assert=qD,r.toArray=su.toArray,r.zero2=su.zero2,r.toHex=su.toHex,r.encode=su.encode;function i(c,h,g){var w=new Array(Math.max(c.bitLength(),g)+1);w.fill(0);for(var A=1<<h+1,E=c.clone(),I=0;I<w.length;I++){var k,M=E.andln(A-1);E.isOdd()?(M>(A>>1)-1?k=(A>>1)-M:k=M,E.isubn(k)):k=0,w[I]=k,E.iushrn(1)}return w}r.getNAF=i;function n(c,h){var g=[[],[]];c=c.clone(),h=h.clone();for(var w=0,A=0,E;c.cmpn(-w)>0||h.cmpn(-A)>0;){var I=c.andln(3)+w&3,k=h.andln(3)+A&3;I===3&&(I=-1),k===3&&(k=-1);var M;(I&1)===0?M=0:(E=c.andln(7)+w&7,(E===3||E===5)&&k===2?M=-I:M=I),g[0].push(M);var j;(k&1)===0?j=0:(E=h.andln(7)+A&7,(E===3||E===5)&&I===2?j=-k:j=k),g[1].push(j),2*w===M+1&&(w=1-w),2*A===j+1&&(A=1-A),c.iushrn(1),h.iushrn(1)}return g}r.getJSF=n;function o(c,h,g){var w="_"+h;c.prototype[h]=function(){return this[w]!==void 0?this[w]:this[w]=g.call(this)}}r.cachedProperty=o;function s(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=s;function a(c){return new Mr.default(c,"hex","le")}r.intFromLE=a}),Y_=gc.getNAF,sVe=gc.getJSF,Z_=gc.assert;function pp(t,e){this.type=t,this.p=new Mr.default(e.p,16),this.red=e.prime?Mr.default.red(e.prime):Mr.default.mont(this.p),this.zero=new Mr.default(0).toRed(this.red),this.one=new Mr.default(1).toRed(this.red),this.two=new Mr.default(2).toRed(this.red),this.n=e.n&&new Mr.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var jm=pp;pp.prototype.point=function(){throw new Error("Not implemented")};pp.prototype.validate=function(){throw new Error("Not implemented")};pp.prototype._fixedNafMul=function(e,r){Z_(e.precomputed);var i=e._getDoubles(),n=Y_(r,1,this._bitLength),o=(1<<i.step+1)-(i.step%2===0?2:1);o/=3;var s=[],a,c;for(a=0;a<n.length;a+=i.step){c=0;for(var h=a+i.step-1;h>=a;h--)c=(c<<1)+n[h];s.push(c)}for(var g=this.jpoint(null,null,null),w=this.jpoint(null,null,null),A=o;A>0;A--){for(a=0;a<s.length;a++)c=s[a],c===A?w=w.mixedAdd(i.points[a]):c===-A&&(w=w.mixedAdd(i.points[a].neg()));g=g.add(w)}return g.toP()};pp.prototype._wnafMul=function(e,r){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var o=n.points,s=Y_(r,i,this._bitLength),a=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var h=0;c>=0&&s[c]===0;c--)h++;if(c>=0&&h++,a=a.dblp(h),c<0)break;var g=s[c];Z_(g!==0),e.type==="affine"?g>0?a=a.mixedAdd(o[g-1>>1]):a=a.mixedAdd(o[-g-1>>1].neg()):g>0?a=a.add(o[g-1>>1]):a=a.add(o[-g-1>>1].neg())}return e.type==="affine"?a.toP():a};pp.prototype._wnafMulAdd=function(e,r,i,n,o){var s=this._wnafT1,a=this._wnafT2,c=this._wnafT3,h=0,g,w,A;for(g=0;g<n;g++){A=r[g];var E=A._getNAFPoints(e);s[g]=E.wnd,a[g]=E.points}for(g=n-1;g>=1;g-=2){var I=g-1,k=g;if(s[I]!==1||s[k]!==1){c[I]=Y_(i[I],s[I],this._bitLength),c[k]=Y_(i[k],s[k],this._bitLength),h=Math.max(c[I].length,h),h=Math.max(c[k].length,h);continue}var M=[r[I],null,null,r[k]];r[I].y.cmp(r[k].y)===0?(M[1]=r[I].add(r[k]),M[2]=r[I].toJ().mixedAdd(r[k].neg())):r[I].y.cmp(r[k].y.redNeg())===0?(M[1]=r[I].toJ().mixedAdd(r[k]),M[2]=r[I].add(r[k].neg())):(M[1]=r[I].toJ().mixedAdd(r[k]),M[2]=r[I].toJ().mixedAdd(r[k].neg()));var j=[-3,-1,-5,-7,0,7,5,1,3],W=sVe(i[I],i[k]);for(h=Math.max(W[0].length,h),c[I]=new Array(h),c[k]=new Array(h),w=0;w<h;w++){var G=W[0][w]|0,Y=W[1][w]|0;c[I][w]=j[(G+1)*3+(Y+1)],c[k][w]=0,a[I]=M}}var te=this.jpoint(null,null,null),oe=this._wnafT4;for(g=h;g>=0;g--){for(var Q=0;g>=0;){var N=!0;for(w=0;w<n;w++)oe[w]=c[w][g]|0,oe[w]!==0&&(N=!1);if(!N)break;Q++,g--}if(g>=0&&Q++,te=te.dblp(Q),g<0)break;for(w=0;w<n;w++){var U=oe[w];U!==0&&(U>0?A=a[w][U-1>>1]:U<0&&(A=a[w][-U-1>>1].neg()),A.type==="affine"?te=te.mixedAdd(A):te=te.add(A))}}for(g=0;g<n;g++)a[g]=null;return o?te:te.toP()};function dl(t,e){this.curve=t,this.type=e,this.precomputed=null}pp.BasePoint=dl;dl.prototype.eq=function(){throw new Error("Not implemented")};dl.prototype.validate=function(){return this.curve.validate(this)};pp.prototype.decodePoint=function(e,r){e=gc.toArray(e,r);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?Z_(e[e.length-1]%2===0):e[0]===7&&Z_(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return n}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")};dl.prototype.encodeCompressed=function(e){return this.encode(e,!0)};dl.prototype._encode=function(e){var r=this.curve.p.byteLength(),i=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",r))};dl.prototype.encode=function(e,r){return gc.encode(this._encode(r),e)};dl.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};dl.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};dl.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,o=0;o<r;o+=e){for(var s=0;s<e;s++)n=n.dbl();i.push(n)}return{step:e,points:i}};dl.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],i=(1<<e)-1,n=i===1?null:this.dbl(),o=1;o<i;o++)r[o]=r[o-1].add(n);return{wnd:e,points:r}};dl.prototype._getBeta=function(){return null};dl.prototype.dblp=function(e){for(var r=this,i=0;i<e;i++)r=r.dbl();return r};var HD=u3(function(t){typeof Object.create=="function"?t.exports=function(r,i){i&&(r.super_=i,r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,i){if(i){r.super_=i;var n=function(){};n.prototype=i.prototype,r.prototype=new n,r.prototype.constructor=r}}}),aVe=gc.assert;function pl(t){jm.call(this,"short",t),this.a=new Mr.default(t.a,16).toRed(this.red),this.b=new Mr.default(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}HD(pl,jm);var cVe=pl;pl.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(e.beta)r=new Mr.default(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(e.lambda)i=new Mr.default(e.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?i=o[0]:(i=o[1],aVe(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var s;return e.basis?s=e.basis.map(function(a){return{a:new Mr.default(a.a,16),b:new Mr.default(a.b,16)}}):s=this._getEndoBasis(i),{beta:r,lambda:i,basis:s}}};pl.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:Mr.default.mont(e),i=new Mr.default(2).toRed(r).redInvm(),n=i.redNeg(),o=new Mr.default(3).toRed(r).redNeg().redSqrt().redMul(i),s=n.redAdd(o).fromRed(),a=n.redSub(o).fromRed();return[s,a]};pl.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),o=new Mr.default(1),s=new Mr.default(0),a=new Mr.default(0),c=new Mr.default(1),h,g,w,A,E,I,k,M=0,j,W;i.cmpn(0)!==0;){var G=n.div(i);j=n.sub(G.mul(i)),W=a.sub(G.mul(o));var Y=c.sub(G.mul(s));if(!w&&j.cmp(r)<0)h=k.neg(),g=o,w=j.neg(),A=W;else if(w&&++M===2)break;k=j,n=i,i=j,a=o,o=W,c=s,s=Y}E=j.neg(),I=W;var te=w.sqr().add(A.sqr()),oe=E.sqr().add(I.sqr());return oe.cmp(te)>=0&&(E=h,I=g),w.negative&&(w=w.neg(),A=A.neg()),E.negative&&(E=E.neg(),I=I.neg()),[{a:w,b:A},{a:E,b:I}]};pl.prototype._endoSplit=function(e){var r=this.endo.basis,i=r[0],n=r[1],o=n.b.mul(e).divRound(this.n),s=i.b.neg().mul(e).divRound(this.n),a=o.mul(i.a),c=s.mul(n.a),h=o.mul(i.b),g=s.mul(n.b),w=e.sub(a).sub(c),A=h.add(g).neg();return{k1:w,k2:A}};pl.prototype.pointFromX=function(e,r){e=new Mr.default(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var o=n.fromRed().isOdd();return(r&&!o||!r&&o)&&(n=n.redNeg()),this.point(e,n)};pl.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,i=e.y,n=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(o).cmpn(0)===0};pl.prototype._endoWnafMulAdd=function(e,r,i){for(var n=this._endoWnafT1,o=this._endoWnafT2,s=0;s<e.length;s++){var a=this._endoSplit(r[s]),c=e[s],h=c._getBeta();a.k1.negative&&(a.k1.ineg(),c=c.neg(!0)),a.k2.negative&&(a.k2.ineg(),h=h.neg(!0)),n[s*2]=c,n[s*2+1]=h,o[s*2]=a.k1,o[s*2+1]=a.k2}for(var g=this._wnafMulAdd(1,n,o,s*2,i),w=0;w<s*2;w++)n[w]=null,o[w]=null;return g};function Lo(t,e,r,i){jm.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Mr.default(e,16),this.y=new Mr.default(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}HD(Lo,jm.BasePoint);pl.prototype.point=function(e,r,i){return new Lo(this,e,r,i)};pl.prototype.pointFromJSON=function(e,r){return Lo.fromJSON(this,e,r)};Lo.prototype._getBeta=function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(o){return i.point(o.x.redMul(i.endo.beta),o.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return r}};Lo.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Lo.fromJSON=function(e,r,i){typeof r=="string"&&(r=JSON.parse(r));var n=e.point(r[0],r[1],i);if(!r[2])return n;function o(a){return e.point(a[0],a[1],i)}var s=r[2];return n.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[n].concat(s.doubles.points.map(o))},naf:s.naf&&{wnd:s.naf.wnd,points:[n].concat(s.naf.points.map(o))}},n};Lo.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Lo.prototype.isInfinity=function(){return this.inf};Lo.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};Lo.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),o=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),s=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)};Lo.prototype.getX=function(){return this.x.fromRed()};Lo.prototype.getY=function(){return this.y.fromRed()};Lo.prototype.mul=function(e){return e=new Mr.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Lo.prototype.mulAdd=function(e,r,i){var n=[this,r],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)};Lo.prototype.jmulAdd=function(e,r,i){var n=[this,r],o=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)};Lo.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Lo.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(o){return o.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r};Lo.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ns(t,e,r,i){jm.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Mr.default(0)):(this.x=new Mr.default(e,16),this.y=new Mr.default(r,16),this.z=new Mr.default(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}HD(ns,jm.BasePoint);pl.prototype.jpoint=function(e,r,i){return new ns(this,e,r,i)};ns.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(i,n)};ns.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ns.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),o=e.x.redMul(i),s=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(i.redMul(this.z)),c=n.redSub(o),h=s.redSub(a);if(c.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=c.redSqr(),w=g.redMul(c),A=n.redMul(g),E=h.redSqr().redIAdd(w).redISub(A).redISub(A),I=h.redMul(A.redISub(E)).redISub(s.redMul(w)),k=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(E,I,k)};ns.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=e.x.redMul(r),o=this.y,s=e.y.redMul(r).redMul(this.z),a=i.redSub(n),c=o.redSub(s);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),g=h.redMul(a),w=i.redMul(h),A=c.redSqr().redIAdd(g).redISub(w).redISub(w),E=c.redMul(w.redISub(A)).redISub(o.redMul(g)),I=this.z.redMul(a);return this.curve.jpoint(A,E,I)};ns.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r<e;r++)i=i.dbl();return i}var n=this.curve.a,o=this.curve.tinv,s=this.x,a=this.y,c=this.z,h=c.redSqr().redSqr(),g=a.redAdd(a);for(r=0;r<e;r++){var w=s.redSqr(),A=g.redSqr(),E=A.redSqr(),I=w.redAdd(w).redIAdd(w).redIAdd(n.redMul(h)),k=s.redMul(A),M=I.redSqr().redISub(k.redAdd(k)),j=k.redISub(M),W=I.redMul(j);W=W.redIAdd(W).redISub(E);var G=g.redMul(c);r+1<e&&(h=h.redMul(E)),s=M,c=G,g=W}return this.curve.jpoint(s,g.redMul(o),c)};ns.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ns.prototype._zeroDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(s);a=a.redIAdd(a);var c=n.redAdd(n).redIAdd(n),h=c.redSqr().redISub(a).redISub(a),g=s.redIAdd(s);g=g.redIAdd(g),g=g.redIAdd(g),e=h,r=c.redMul(a.redISub(h)).redISub(g),i=this.y.redAdd(this.y)}else{var w=this.x.redSqr(),A=this.y.redSqr(),E=A.redSqr(),I=this.x.redAdd(A).redSqr().redISub(w).redISub(E);I=I.redIAdd(I);var k=w.redAdd(w).redIAdd(w),M=k.redSqr(),j=E.redIAdd(E);j=j.redIAdd(j),j=j.redIAdd(j),e=M.redISub(I).redISub(I),r=k.redMul(I.redISub(e)).redISub(j),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,r,i)};ns.prototype._threeDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),s=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(s);a=a.redIAdd(a);var c=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),h=c.redSqr().redISub(a).redISub(a);e=h;var g=s.redIAdd(s);g=g.redIAdd(g),g=g.redIAdd(g),r=c.redMul(a.redISub(h)).redISub(g),i=this.y.redAdd(this.y)}else{var w=this.z.redSqr(),A=this.y.redSqr(),E=this.x.redMul(A),I=this.x.redSub(w).redMul(this.x.redAdd(w));I=I.redAdd(I).redIAdd(I);var k=E.redIAdd(E);k=k.redIAdd(k);var M=k.redAdd(k);e=I.redSqr().redISub(M),i=this.y.redAdd(this.z).redSqr().redISub(A).redISub(w);var j=A.redSqr();j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j),r=I.redMul(k.redISub(e)).redISub(j)}return this.curve.jpoint(e,r,i)};ns.prototype._dbl=function(){var e=this.curve.a,r=this.x,i=this.y,n=this.z,o=n.redSqr().redSqr(),s=r.redSqr(),a=i.redSqr(),c=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(o)),h=r.redAdd(r);h=h.redIAdd(h);var g=h.redMul(a),w=c.redSqr().redISub(g.redAdd(g)),A=g.redISub(w),E=a.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var I=c.redMul(A).redISub(E),k=i.redAdd(i).redMul(n);return this.curve.jpoint(w,I,k)};ns.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr(),n=r.redSqr(),o=e.redAdd(e).redIAdd(e),s=o.redSqr(),a=this.x.redAdd(r).redSqr().redISub(e).redISub(n);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(s);var c=a.redSqr(),h=n.redIAdd(n);h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var g=o.redIAdd(a).redSqr().redISub(s).redISub(c).redISub(h),w=r.redMul(g);w=w.redIAdd(w),w=w.redIAdd(w);var A=this.x.redMul(c).redISub(w);A=A.redIAdd(A),A=A.redIAdd(A);var E=this.y.redMul(g.redMul(h.redISub(g)).redISub(a.redMul(c)));E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var I=this.z.redAdd(a).redSqr().redISub(i).redISub(c);return this.curve.jpoint(A,E,I)};ns.prototype.mul=function(e,r){return e=new Mr.default(e,r),this.curve._wnafMul(this,e)};ns.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var n=r.redMul(this.z),o=i.redMul(e.z);return this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)===0};ns.prototype.eqXToP=function(e){var r=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(i)===0)return!0;for(var n=e.clone(),o=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(o),this.x.cmp(i)===0)return!0}};ns.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};ns.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var K_=u3(function(t,e){"use strict";var r=e;r.base=jm,r.short=cVe,r.mont=null,r.edwards=null}),G_=u3(function(t,e){"use strict";var r=e,i=gc.assert;function n(a){a.type==="short"?this.curve=new K_.short(a):a.type==="edwards"?this.curve=new K_.edwards(a):this.curve=new K_.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=n;function o(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var h=new n(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:h}),h}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Df.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Df.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Df.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Df.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Df.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Df.default.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Df.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Df.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function dp(t){if(!(this instanceof dp))return new dp(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=su.toArray(t.entropy,t.entropyEnc||"hex"),r=su.toArray(t.nonce,t.nonceEnc||"hex"),i=su.toArray(t.pers,t.persEnc||"hex");qD(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var Ape=dp;dp.prototype._init=function(e,r,i){var n=e.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656};dp.prototype._hmac=function(){return new Df.default.hmac(this.hash,this.K)};dp.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};dp.prototype.reseed=function(e,r,i,n){typeof r!="string"&&(n=i,i=r,r=null),e=su.toArray(e,r),i=su.toArray(i,n),qD(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1};dp.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=su.toArray(i,n||"hex"),this._update(i));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(i),this._reseed++,su.encode(s,r)};var WD=gc.assert;function Ss(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var zD=Ss;Ss.fromPublic=function(e,r,i){return r instanceof Ss?r:new Ss(e,{pub:r,pubEnc:i})};Ss.fromPrivate=function(e,r,i){return r instanceof Ss?r:new Ss(e,{priv:r,privEnc:i})};Ss.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Ss.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Ss.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Ss.prototype._importPrivate=function(e,r){this.priv=new Mr.default(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Ss.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?WD(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&WD(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Ss.prototype.derive=function(e){return e.validate()||WD(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Ss.prototype.sign=function(e,r,i){return this.ec.sign(e,this,r,i)};Ss.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};Ss.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var lVe=gc.assert;function J_(t,e){if(t instanceof J_)return t;this._importDER(t,e)||(lVe(t.r&&t.s,"Signature without r or s"),this.r=new Mr.default(t.r,16),this.s=new Mr.default(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Q_=J_;function uVe(){this.place=0}function jD(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,o=0,s=e.place;o<i;o++,s++)n<<=8,n|=t[s],n>>>=0;return n<=127?!1:(e.place=s,n)}function _pe(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}J_.prototype._importDER=function(e,r){e=gc.toArray(e,r);var i=new uVe;if(e[i.place++]!==48)return!1;var n=jD(e,i);if(n===!1||n+i.place!==e.length||e[i.place++]!==2)return!1;var o=jD(e,i);if(o===!1)return!1;var s=e.slice(i.place,o+i.place);if(i.place+=o,e[i.place++]!==2)return!1;var a=jD(e,i);if(a===!1||e.length!==a+i.place)return!1;var c=e.slice(i.place,a+i.place);if(s[0]===0)if(s[1]&128)s=s.slice(1);else return!1;if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;return this.r=new Mr.default(s),this.s=new Mr.default(c),this.recoveryParam=null,!0};function $D(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}J_.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=_pe(r),i=_pe(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];$D(n,r.length),n=n.concat(r),n.push(2),$D(n,i.length);var o=n.concat(i),s=[48];return $D(s,o.length),s=s.concat(o),gc.encode(s,e)};var fVe=function(){throw new Error("unsupported")},Cpe=gc.assert;function hl(t){if(!(this instanceof hl))return new hl(t);typeof t=="string"&&(Cpe(Object.prototype.hasOwnProperty.call(G_,t),"Unknown curve "+t),t=G_[t]),t instanceof G_.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var hVe=hl;hl.prototype.keyPair=function(e){return new zD(this,e)};hl.prototype.keyFromPrivate=function(e,r){return zD.fromPrivate(this,e,r)};hl.prototype.keyFromPublic=function(e,r){return zD.fromPublic(this,e,r)};hl.prototype.genKeyPair=function(e){e||(e={});for(var r=new Ape({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||fVe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new Mr.default(2));;){var o=new Mr.default(r.generate(i));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}};hl.prototype._truncateToN=function(e,r){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};hl.prototype.sign=function(e,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),e=this._truncateToN(new Mr.default(e,16));for(var o=this.n.byteLength(),s=r.getPrivate().toArray("be",o),a=e.toArray("be",o),c=new Ape({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),h=this.n.sub(new Mr.default(1)),g=0;;g++){var w=n.k?n.k(g):new Mr.default(c.generate(this.n.byteLength()));if(w=this._truncateToN(w,!0),!(w.cmpn(1)<=0||w.cmp(h)>=0)){var A=this.g.mul(w);if(!A.isInfinity()){var E=A.getX(),I=E.umod(this.n);if(I.cmpn(0)!==0){var k=w.invm(this.n).mul(I.mul(r.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var M=(A.getY().isOdd()?1:0)|(E.cmp(I)!==0?2:0);return n.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),M^=1),new Q_({r:I,s:k,recoveryParam:M})}}}}}};hl.prototype.verify=function(e,r,i,n){e=this._truncateToN(new Mr.default(e,16)),i=this.keyFromPublic(i,n),r=new Q_(r,"hex");var o=r.r,s=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a=s.invm(this.n),c=a.mul(e).umod(this.n),h=a.mul(o).umod(this.n),g;return this.curve._maxwellTrick?(g=this.g.jmulAdd(c,i.getPublic(),h),g.isInfinity()?!1:g.eqXToP(o)):(g=this.g.mulAdd(c,i.getPublic(),h),g.isInfinity()?!1:g.getX().umod(this.n).cmp(o)===0)};hl.prototype.recoverPubKey=function(t,e,r,i){Cpe((3&r)===r,"The recovery param is more than two bits"),e=new Q_(e,i);var n=this.n,o=new Mr.default(t),s=e.r,a=e.s,c=r&1,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?s=this.curve.pointFromX(s.add(this.curve.n),c):s=this.curve.pointFromX(s,c);var g=e.r.invm(n),w=n.sub(o).mul(g).umod(n),A=a.mul(g).umod(n);return this.g.mulAdd(w,s,A)};hl.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new Q_(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch{continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var dVe=u3(function(t,e){"use strict";var r=e;r.version="6.5.4",r.utils=gc,r.rand=function(){throw new Error("unsupported")},r.curve=K_,r.curves=G_,r.ec=hVe,r.eddsa=null}),Spe=dVe.ec;var Ipe="signing-key/5.7.0";var KD=new ce(Ipe),VD=null;function Lf(){return VD||(VD=new Spe("secp256k1")),VD}var ml=class{constructor(e){_e(this,"curve","secp256k1"),_e(this,"privateKey",Ue(e)),_s(this.privateKey)!==32&&KD.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=Lf().keyFromPrivate(Pe(this.privateKey));_e(this,"publicKey","0x"+r.getPublic(!1,"hex")),_e(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),_e(this,"_isSigningKey",!0)}_addPoint(e){let r=Lf().keyFromPublic(Pe(this.publicKey)),i=Lf().keyFromPublic(Pe(e));return"0x"+r.pub.add(i.pub).encodeCompressed("hex")}signDigest(e){let r=Lf().keyFromPrivate(Pe(this.privateKey)),i=Pe(e);i.length!==32&&KD.throwArgumentError("bad digest length","digest",e);let n=r.sign(i,{canonical:!0});return Sf({recoveryParam:n.recoveryParam,r:Jr("0x"+n.r.toString(16),32),s:Jr("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let r=Lf().keyFromPrivate(Pe(this.privateKey)),i=Lf().keyFromPublic(Pe(v5(e)));return Jr("0x"+r.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function X_(t,e){let r=Sf(e),i={r:Pe(r.r),s:Pe(r.s)};return"0x"+Lf().recoverPubKey(Pe(t),i,r.recoveryParam).encode("hex",!1)}function v5(t,e){let r=Pe(t);if(r.length===32){let i=new ml(r);return e?"0x"+Lf().keyFromPrivate(r).getPublic(!0,"hex"):i.publicKey}else{if(r.length===33)return e?Ue(r):"0x"+Lf().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Lf().keyFromPublic(r).getPublic(!0,"hex"):Ue(r)}return KD.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Tpe="transactions/5.7.0";var Ts=new ce(Tpe),eE;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(eE||(eE={}));function YD(t){return t==="0x"?null:Vr(t)}function Is(t){return t==="0x"?Yw:De.from(t)}var pVe=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],mVe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function gl(t){let e=v5(t);return Vr(zi(zr(zi(e,1)),12))}function $m(t,e){return gl(X_(Pe(t),e))}function wc(t,e){let r=fc(De.from(t).toHexString());return r.length>32&&Ts.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function GD(t,e){return{address:Vr(t),storageKeys:(e||[]).map((r,i)=>(_s(r)!==32&&Ts.throwArgumentError("invalid access list storageKey",`accessList[${t}:${i}]`,r),r.toLowerCase()))}}function vc(t){if(Array.isArray(t))return t.map((r,i)=>Array.isArray(r)?(r.length>2&&Ts.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${i}]`,r),GD(r[0],r[1])):GD(r.address,r.storageKeys));let e=Object.keys(t).map(r=>{let i=t[r].reduce((n,o)=>(n[o]=!0,n),{});return GD(r,Object.keys(i).sort())});return e.sort((r,i)=>r.address.localeCompare(i.address)),e}function Rpe(t){return vc(t).map(e=>[e.address,e.storageKeys])}function kpe(t,e){if(t.gasPrice!=null){let i=De.from(t.gasPrice),n=De.from(t.maxFeePerGas||0);i.eq(n)||Ts.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:i,maxFeePerGas:n})}let r=[wc(t.chainId||0,"chainId"),wc(t.nonce||0,"nonce"),wc(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),wc(t.maxFeePerGas||0,"maxFeePerGas"),wc(t.gasLimit||0,"gasLimit"),t.to!=null?Vr(t.to):"0x",wc(t.value||0,"value"),t.data||"0x",Rpe(t.accessList||[])];if(e){let i=Sf(e);r.push(wc(i.recoveryParam,"recoveryParam")),r.push(fc(i.r)),r.push(fc(i.s))}return no(["0x02",dh(r)])}function Npe(t,e){let r=[wc(t.chainId||0,"chainId"),wc(t.nonce||0,"nonce"),wc(t.gasPrice||0,"gasPrice"),wc(t.gasLimit||0,"gasLimit"),t.to!=null?Vr(t.to):"0x",wc(t.value||0,"value"),t.data||"0x",Rpe(t.accessList||[])];if(e){let i=Sf(e);r.push(wc(i.recoveryParam,"recoveryParam")),r.push(fc(i.r)),r.push(fc(i.s))}return no(["0x01",dh(r)])}function gVe(t,e){zw(t,mVe);let r=[];pVe.forEach(function(s){let a=t[s.name]||[],c={};s.numeric&&(c.hexPad="left"),a=Pe(Ue(a,c)),s.length&&a.length!==s.length&&a.length>0&&Ts.throwArgumentError("invalid length for "+s.name,"transaction:"+s.name,a),s.maxLength&&(a=fc(a),a.length>s.maxLength&&Ts.throwArgumentError("invalid length for "+s.name,"transaction:"+s.name,a)),r.push(Ue(a))});let i=0;if(t.chainId!=null?(i=t.chainId,typeof i!="number"&&Ts.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!uh(e)&&e.v>28&&(i=Math.floor((e.v-35)/2)),i!==0&&(r.push(Ue(i)),r.push("0x"),r.push("0x")),!e)return dh(r);let n=Sf(e),o=27+n.recoveryParam;return i!==0?(r.pop(),r.pop(),r.pop(),o+=i*2+8,n.v>28&&n.v!==o&&Ts.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):n.v!==o&&Ts.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(Ue(o)),r.push(fc(Pe(n.r))),r.push(fc(Pe(n.s))),dh(r)}function b5(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Ts.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),gVe(t,e);switch(t.type){case 1:return Npe(t,e);case 2:return kpe(t,e);default:break}return Ts.throwError(`unsupported transaction type: ${t.type}`,ce.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function Ppe(t,e,r){try{let i=Is(e[0]).toNumber();if(i!==0&&i!==1)throw new Error("bad recid");t.v=i}catch{Ts.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Jr(e[1],32),t.s=Jr(e[2],32);try{let i=zr(r(t));t.from=$m(i,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function wVe(t){let e=f5(t.slice(1));e.length!==9&&e.length!==12&&Ts.throwArgumentError("invalid component count for transaction type: 2","payload",Ue(t));let r=Is(e[2]),i=Is(e[3]),n={type:2,chainId:Is(e[0]).toNumber(),nonce:Is(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:i,gasPrice:null,gasLimit:Is(e[4]),to:YD(e[5]),value:Is(e[6]),data:e[7],accessList:vc(e[8])};return e.length===9||(n.hash=zr(t),Ppe(n,e.slice(9),kpe)),n}function vVe(t){let e=f5(t.slice(1));e.length!==8&&e.length!==11&&Ts.throwArgumentError("invalid component count for transaction type: 1","payload",Ue(t));let r={type:1,chainId:Is(e[0]).toNumber(),nonce:Is(e[1]).toNumber(),gasPrice:Is(e[2]),gasLimit:Is(e[3]),to:YD(e[4]),value:Is(e[5]),data:e[6],accessList:vc(e[7])};return e.length===8||(r.hash=zr(t),Ppe(r,e.slice(8),Npe)),r}function bVe(t){let e=f5(t);e.length!==9&&e.length!==6&&Ts.throwArgumentError("invalid raw transaction","rawTransaction",t);let r={nonce:Is(e[0]).toNumber(),gasPrice:Is(e[1]),gasLimit:Is(e[2]),to:YD(e[3]),value:Is(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=De.from(e[6]).toNumber()}catch{return r}if(r.r=Jr(e[7],32),r.s=Jr(e[8],32),De.from(r.r).isZero()&&De.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27,n=e.slice(0,6);r.chainId!==0&&(n.push(Ue(r.chainId)),n.push("0x"),n.push("0x"),i-=r.chainId*2+8);let o=zr(dh(n));try{r.from=$m(o,{r:Ue(r.r),s:Ue(r.s),recoveryParam:i})}catch{}r.hash=zr(t)}return r.type=null,r}function tE(t){let e=Pe(t);if(e[0]>127)return bVe(e);switch(e[0]){case 1:return vVe(e);case 2:return wVe(e);default:break}return Ts.throwError(`unsupported transaction type: ${e[0]}`,ce.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}var Ope="contracts/5.7.0";var mp=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},Qi=new ce(Ope),yVe={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function rE(t,e){return mp(this,void 0,void 0,function*(){let r=yield e;typeof r!="string"&&Qi.throwArgumentError("invalid address or ENS name","name",r);try{return Vr(r)}catch{}t||Qi.throwError("a provider or signer is needed to resolve ENS names",ce.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});let i=yield t.resolveName(r);return i==null&&Qi.throwArgumentError("resolver or addr is not configured for ENS name","name",r),i})}function y5(t,e,r){return mp(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((i,n)=>y5(t,Array.isArray(e)?e[n]:e[i.name],i))):r.type==="address"?yield rE(t,e):r.type==="tuple"?yield y5(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(i=>y5(t,i,r.arrayChildren))):Promise.reject(Qi.makeError("invalid value for array",ce.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function oE(t,e,r){return mp(this,void 0,void 0,function*(){let i={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(i=bi(r.pop())),Qi.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?i.from?i.from=Vi({override:rE(t.signer,i.from),signer:t.signer.getAddress()}).then(h=>mp(this,void 0,void 0,function*(){return Vr(h.signer)!==h.override&&Qi.throwError("Contract with a Signer cannot override from",ce.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),h.override})):i.from=t.signer.getAddress():i.from&&(i.from=rE(t.provider,i.from));let n=yield Vi({args:y5(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:Vi(i)||{}}),o=t.interface.encodeFunctionData(e,n.args),s={data:o,to:n.address},a=n.overrides;if(a.nonce!=null&&(s.nonce=De.from(a.nonce).toNumber()),a.gasLimit!=null&&(s.gasLimit=De.from(a.gasLimit)),a.gasPrice!=null&&(s.gasPrice=De.from(a.gasPrice)),a.maxFeePerGas!=null&&(s.maxFeePerGas=De.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=De.from(a.maxPriorityFeePerGas)),a.from!=null&&(s.from=a.from),a.type!=null&&(s.type=a.type),a.accessList!=null&&(s.accessList=vc(a.accessList)),s.gasLimit==null&&e.gas!=null){let h=21e3,g=Pe(o);for(let w=0;w<g.length;w++)h+=4,g[w]&&(h+=64);s.gasLimit=De.from(e.gas).add(h)}if(a.value){let h=De.from(a.value);!h.isZero()&&!e.payable&&Qi.throwError("non-payable method cannot override value",ce.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:i.value}),s.value=h}a.customData&&(s.customData=bi(a.customData)),a.ccipReadEnabled&&(s.ccipReadEnabled=!!a.ccipReadEnabled),delete i.nonce,delete i.gasLimit,delete i.gasPrice,delete i.from,delete i.value,delete i.type,delete i.accessList,delete i.maxFeePerGas,delete i.maxPriorityFeePerGas,delete i.customData,delete i.ccipReadEnabled;let c=Object.keys(i).filter(h=>i[h]!=null);return c.length&&Qi.throwError(`cannot override ${c.map(h=>JSON.stringify(h)).join(",")}`,ce.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),s})}function xVe(t,e){return function(...r){return oE(t,e,r)}}function _Ve(t,e){let r=t.signer||t.provider;return function(...i){return mp(this,void 0,void 0,function*(){r||Qi.throwError("estimate require a provider or signer",ce.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});let n=yield oE(t,e,i);return yield r.estimateGas(n)})}}function Dpe(t,e){let r=e.wait.bind(e);e.wait=i=>r(i).then(n=>(n.events=n.logs.map(o=>{let s=Tn(o),a=null;try{a=t.interface.parseLog(o)}catch{}return a&&(s.args=a.args,s.decode=(c,h)=>t.interface.decodeEventLog(a.eventFragment,c,h),s.event=a.name,s.eventSignature=a.signature),s.removeListener=()=>t.provider,s.getBlock=()=>t.provider.getBlock(n.blockHash),s.getTransaction=()=>t.provider.getTransaction(n.transactionHash),s.getTransactionReceipt=()=>Promise.resolve(n),s}),n))}function Lpe(t,e,r){let i=t.signer||t.provider;return function(...n){return mp(this,void 0,void 0,function*(){let o;if(n.length===e.inputs.length+1&&typeof n[n.length-1]=="object"){let c=bi(n.pop());c.blockTag!=null&&(o=yield c.blockTag),delete c.blockTag,n.push(c)}t.deployTransaction!=null&&(yield t._deployed(o));let s=yield oE(t,e,n),a=yield i.call(s,o);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===ce.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=n,c.transaction=s),c}})}}function EVe(t,e){return function(...r){return mp(this,void 0,void 0,function*(){t.signer||Qi.throwError("sending a transaction requires a signer",ce.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());let i=yield oE(t,e,r),n=yield t.signer.sendTransaction(i);return Dpe(t,n),n})}}function Mpe(t,e,r){return e.constant?Lpe(t,e,r):EVe(t,e)}function Bpe(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}var Wm=class{constructor(e,r){_e(this,"tag",e),_e(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(i=>r||i.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){let r=this.listenerCount();return this._listeners=this._listeners.filter(i=>{let n=e.slice();return setTimeout(()=>{i.listener.apply(this,n)},0),!i.once}),r}prepareEvent(e){}getEmit(e){return[e]}},ZD=class extends Wm{constructor(){super("error",null)}},iE=class extends Wm{constructor(e,r,i,n){let o={address:e},s=r.getEventTopic(i);n?(s!==n[0]&&Qi.throwArgumentError("topic mismatch","topics",n),o.topics=n.slice()):o.topics=[s],super(Bpe(o),o),_e(this,"address",e),_e(this,"interface",r),_e(this,"fragment",i)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,i)=>this.interface.decodeEventLog(this.fragment,r,i);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){let r=Kw(e.args);if(r.length)throw r[0].error;let i=(e.args||[]).slice();return i.push(e),i}},nE=class extends Wm{constructor(e,r){super("*",{address:e}),_e(this,"address",e),_e(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{let r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(i,n)=>this.interface.decodeEventLog(r.eventFragment,i,n),e.args=r.args}catch{}}},f3=class{constructor(e,r,i){_e(this,"interface",Rn(new.target,"getInterface")(r)),i==null?(_e(this,"provider",null),_e(this,"signer",null)):ta.isSigner(i)?(_e(this,"provider",i.provider||null),_e(this,"signer",i)):Ia.isProvider(i)?(_e(this,"provider",i),_e(this,"signer",null)):Qi.throwArgumentError("invalid signer or provider","signerOrProvider",i),_e(this,"callStatic",{}),_e(this,"estimateGas",{}),_e(this,"functions",{}),_e(this,"populateTransaction",{}),_e(this,"filters",{});{let s={};Object.keys(this.interface.events).forEach(a=>{let c=this.interface.events[a];_e(this.filters,a,(...h)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,h)})),s[c.name]||(s[c.name]=[]),s[c.name].push(a)}),Object.keys(s).forEach(a=>{let c=s[a];c.length===1?_e(this.filters,a,this.filters[c[0]]):Qi.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(_e(this,"_runningEvents",{}),_e(this,"_wrappedEmits",{}),e==null&&Qi.throwArgumentError("invalid contract address or ENS name","addressOrName",e),_e(this,"address",e),this.provider)_e(this,"resolvedAddress",rE(this.provider,e));else try{_e(this,"resolvedAddress",Promise.resolve(Vr(e)))}catch{Qi.throwError("provider is required to use ENS name as contract address",ce.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(s=>{});let n={},o={};Object.keys(this.interface.functions).forEach(s=>{let a=this.interface.functions[s];if(o[s]){Qi.warn(`Duplicate ABI entry for ${JSON.stringify(s)}`);return}o[s]=!0;{let c=a.name;n[`%${c}`]||(n[`%${c}`]=[]),n[`%${c}`].push(s)}this[s]==null&&_e(this,s,Mpe(this,a,!0)),this.functions[s]==null&&_e(this.functions,s,Mpe(this,a,!1)),this.callStatic[s]==null&&_e(this.callStatic,s,Lpe(this,a,!0)),this.populateTransaction[s]==null&&_e(this.populateTransaction,s,xVe(this,a)),this.estimateGas[s]==null&&_e(this.estimateGas,s,_Ve(this,a))}),Object.keys(n).forEach(s=>{let a=n[s];if(a.length>1)return;s=s.substring(1);let c=a[0];try{this[s]==null&&_e(this,s,this[c])}catch{}this.functions[s]==null&&_e(this.functions,s,this.functions[c]),this.callStatic[s]==null&&_e(this.callStatic,s,this.callStatic[c]),this.populateTransaction[s]==null&&_e(this.populateTransaction,s,this.populateTransaction[c]),this.estimateGas[s]==null&&_e(this.estimateGas,s,this.estimateGas[c])})}static getContractAddress(e){return Bm(e)}static getInterface(e){return fp.isInterface(e)?e:new fp(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&Qi.throwError("contract not deployed",ce.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Qi.throwError("sending a transactions require a signer",ce.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});let r=bi(e||{});return["from","to"].forEach(function(i){r[i]!=null&&Qi.throwError("cannot override "+i,ce.errors.UNSUPPORTED_OPERATION,{operation:i})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new mh(e,this.provider));let r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&_e(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return ph.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new ZD);if(e==="event")return this._normalizeRunningEvent(new Wm("event",null));if(e==="*")return this._normalizeRunningEvent(new nE(this.address,this.interface));let r=this.interface.getEvent(e);return this._normalizeRunningEvent(new iE(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{let i=e.topics[0];if(typeof i!="string")throw new Error("invalid topic");let n=this.interface.getEvent(i);return this._normalizeRunningEvent(new iE(this.address,this.interface,n,e.topics))}catch{}let r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Wm(Bpe(r),r))}return this._normalizeRunningEvent(new nE(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];let r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,i){let n=Tn(r);return n.removeListener=()=>{!i||(e.removeListener(i),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(r.blockHash),n.getTransaction=()=>this.provider.getTransaction(r.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(n),n}_addEventListener(e,r,i){if(this.provider||Qi.throwError("events require a provider or a signer with a provider",ce.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,i),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){let n=o=>{let s=this._wrapEvent(e,o,r);if(s.decodeError==null)try{let a=e.getEmit(s);this.emit(e.filter,...a)}catch(a){s.decodeError=a.error}e.filter!=null&&this.emit("event",s),s.decodeError!=null&&this.emit("error",s.decodeError,s)};this._wrappedEmits[e.tag]=n,e.filter!=null&&this.provider.on(e.filter,n)}}queryFilter(e,r,i){let n=this._getRunningEvent(e),o=bi(n.filter);return typeof r=="string"&&Qt(r,32)?(i!=null&&Qi.throwArgumentError("cannot specify toBlock with blockhash","toBlock",i),o.blockHash=r):(o.fromBlock=r??0,o.toBlock=i??"latest"),this.provider.getLogs(o).then(s=>s.map(a=>this._wrapEvent(n,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;let i=this._getRunningEvent(e),n=i.run(r)>0;return this._checkRunningEvents(i),n}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,i)=>r+this._runningEvents[i].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){let r=[];for(let i in this._runningEvents)this._runningEvents[i].listeners().forEach(n=>{r.push(n)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(let i in this._runningEvents){let n=this._runningEvents[i];n.removeAllListeners(),this._checkRunningEvents(n)}return this}let r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;let i=this._getRunningEvent(e);return i.removeListener(r),this._checkRunningEvents(i),this}removeListener(e,r){return this.off(e,r)}},qm=class extends f3{},x5=class{constructor(e,r,i){let n=null;typeof r=="string"?n=r:cl(r)?n=Ue(r):r&&typeof r.object=="string"?n=r.object:n="!",n.substring(0,2)!=="0x"&&(n="0x"+n),(!Qt(n)||n.length%2)&&Qi.throwArgumentError("invalid bytecode","bytecode",r),i&&!ta.isSigner(i)&&Qi.throwArgumentError("invalid signer","signer",i),_e(this,"bytecode",n),_e(this,"interface",Rn(new.target,"getInterface")(e)),_e(this,"signer",i||null)}getDeployTransaction(...e){let r={};if(e.length===this.interface.deploy.inputs.length+1&&typeof e[e.length-1]=="object"){r=bi(e.pop());for(let i in r)if(!yVe[i])throw new Error("unknown transaction override "+i)}return["data","from","to"].forEach(i=>{r[i]!=null&&Qi.throwError("cannot override "+i,ce.errors.UNSUPPORTED_OPERATION,{operation:i})}),r.value&&!De.from(r.value).isZero()&&!this.interface.deploy.payable&&Qi.throwError("non-payable constructor cannot override value",ce.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:r.value}),Qi.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),r.data=Ue(Hr([this.bytecode,this.interface.encodeDeploy(e)])),r}deploy(...e){return mp(this,void 0,void 0,function*(){let r={};e.length===this.interface.deploy.inputs.length+1&&(r=e.pop()),Qi.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");let i=yield y5(this.signer,e,this.interface.deploy.inputs);i.push(r);let n=this.getDeployTransaction(...i),o=yield this.signer.sendTransaction(n),s=Rn(this.constructor,"getContractAddress")(o),a=Rn(this.constructor,"getContract")(s,this.interface,this.signer);return Dpe(a,o),_e(a,"deployTransaction",o),a})}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,r){e==null&&Qi.throwError("missing compiler output",ce.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),typeof e=="string"&&(e=JSON.parse(e));let i=e.abi,n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(i,n,r)}static getInterface(e){return qm.getInterface(e)}static getContractAddress(e){return Bm(e)}static getContract(e,r,i){return new qm(e,r,i)}};var sE=class{constructor(e){_e(this,"alphabet",e),_e(this,"base",e.length),_e(this,"_alphabetMap",{}),_e(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=Pe(e);if(r.length===0)return"";let i=[0];for(let o=0;o<r.length;++o){let s=r[o];for(let a=0;a<i.length;++a)s+=i[a]<<8,i[a]=s%this.base,s=s/this.base|0;for(;s>0;)i.push(s%this.base),s=s/this.base|0}let n="";for(let o=0;r[o]===0&&o<r.length-1;++o)n+=this._leader;for(let o=i.length-1;o>=0;--o)n+=this.alphabet[i[o]];return n}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let i=0;i<e.length;i++){let n=this._alphabetMap[e[i]];if(n===void 0)throw new Error("Non-base"+this.base+" character");let o=n;for(let s=0;s<r.length;++s)o+=r[s]*this.base,r[s]=o&255,o>>=8;for(;o>0;)r.push(o&255),o>>=8}for(let i=0;e[i]===this._leader&&i<e.length-1;++i)r.push(0);return Pe(new Uint8Array(r.reverse()))}},TGt=new sE("abcdefghijklmnopqrstuvwxyz234567"),bh=new sE("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var h3=Dr(FD());var Bf;(function(t){t.sha256="sha256",t.sha512="sha512"})(Bf||(Bf={}));var Upe="sha2/5.7.0";var AVe=new ce(Upe);function _5(t){return"0x"+h3.default.ripemd160().update(Pe(t)).digest("hex")}function Ra(t){return"0x"+h3.default.sha256().update(Pe(t)).digest("hex")}function JD(t){return"0x"+h3.default.sha512().update(Pe(t)).digest("hex")}function yh(t,e,r){return Bf[t]||AVe.throwError("unsupported algorithm "+t,ce.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+h3.default.hmac(h3.default[t],Pe(e)).update(Pe(r)).digest("hex")}function Hm(t,e,r,i,n){t=Pe(t),e=Pe(e);let o,s=1,a=new Uint8Array(i),c=new Uint8Array(e.length+4);c.set(e);let h,g;for(let w=1;w<=s;w++){c[e.length]=w>>24&255,c[e.length+1]=w>>16&255,c[e.length+2]=w>>8&255,c[e.length+3]=w&255;let A=Pe(yh(n,t,c));o||(o=A.length,g=new Uint8Array(o),s=Math.ceil(i/o),h=i-(s-1)*o),g.set(A);for(let k=1;k<r;k++){A=Pe(yh(n,t,A));for(let M=0;M<o;M++)g[M]^=A[M]}let E=(w-1)*o,I=w===s?h:o;a.set(Pe(g).slice(0,I),E)}return Ue(a)}var Fpe="wordlists/5.7.0";var CVe=!1,jpe=new ce(Fpe),wl=class{constructor(e){jpe.checkAbstract(new.target,wl),_e(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){let r=[];for(let i=0;i<2048;i++){let n=e.getWord(i);if(i!==e.getWordIndex(n))return"0x";r.push(n)}return pc(r.join(`
9976
9976
  `)+`
9977
- `)}static register(e,r){if(r||(r=e.locale),CVe)try{let i=window;i._ethers&&i._ethers.wordlists&&(i._ethers.wordlists[r]||_e(i._ethers.wordlists,r,e))}catch{}}};var SVe="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",E5=null;function $pe(t){if(E5==null&&(E5=SVe.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),wl.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw E5=null,new Error("BIP39 Wordlist for en (English) FAILED")}var QD=class extends wl{constructor(){super("en")}getWord(e){return $pe(this),E5[e]}getWordIndex(e){return $pe(this),E5.indexOf(e)}},XD=new QD;wl.register(XD);var zm={en:XD};var Wpe="hdnode/5.7.0";var A5=new ce(Wpe),IVe=De.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),TVe=gi("Bitcoin seed"),p3=2147483648;function Hpe(t){return(1<<t)-1<<8-t}function RVe(t){return(1<<t)-1}function aE(t){return Jr(Ue(t),32)}function qpe(t){return bh.encode(Hr([t,zi(Ra(Ra(t)),0,4)]))}function eL(t){if(t==null)return zm.en;if(typeof t=="string"){let e=zm[t];return e==null&&A5.throwArgumentError("unknown locale","wordlist",t),e}return t}var d3={},xh="m/44'/60'/0'/0/0",Bo=class{constructor(e,r,i,n,o,s,a,c){if(e!==d3)throw new Error("HDNode constructor cannot be called directly");if(r){let h=new ml(r);_e(this,"privateKey",h.privateKey),_e(this,"publicKey",h.compressedPublicKey)}else _e(this,"privateKey",null),_e(this,"publicKey",Ue(i));_e(this,"parentFingerprint",n),_e(this,"fingerprint",zi(_5(Ra(this.publicKey)),0,4)),_e(this,"address",gl(this.publicKey)),_e(this,"chainCode",o),_e(this,"index",s),_e(this,"depth",a),c==null?(_e(this,"mnemonic",null),_e(this,"path",null)):typeof c=="string"?(_e(this,"mnemonic",null),_e(this,"path",c)):(_e(this,"mnemonic",c),_e(this,"path",c.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return qpe(Hr([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",Ue(this.depth),this.parentFingerprint,Jr(Ue(this.index),4),this.chainCode,this.privateKey!=null?Hr(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Bo(d3,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~p3));let i=new Uint8Array(37);if(e&p3){if(!this.privateKey)throw new Error("cannot derive child of neutered node");i.set(Pe(this.privateKey),1),r&&(r+="'")}else i.set(Pe(this.publicKey));for(let w=24;w>=0;w-=8)i[33+(w>>3)]=e>>24-w&255;let n=Pe(yh(Bf.sha512,this.chainCode,i)),o=n.slice(0,32),s=n.slice(32),a=null,c=null;this.privateKey?a=aE(De.from(o).add(this.privateKey).mod(IVe)):c=new ml(Ue(o))._addPoint(this.publicKey);let h=r,g=this.mnemonic;return g&&(h=Object.freeze({phrase:g.phrase,path:r,locale:g.locale||"en"})),new Bo(d3,a,c,this.fingerprint,aE(s),e,this.depth+1,h)}derivePath(e){let r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let i=this;for(let n=0;n<r.length;n++){let o=r[n];if(o.match(/^[0-9]+'$/)){let s=parseInt(o.substring(0,o.length-1));if(s>=p3)throw new Error("invalid path index - "+o);i=i._derive(p3+s)}else if(o.match(/^[0-9]+$/)){let s=parseInt(o);if(s>=p3)throw new Error("invalid path index - "+o);i=i._derive(s)}else throw new Error("invalid path component - "+o)}return i}static _fromSeed(e,r){let i=Pe(e);if(i.length<16||i.length>64)throw new Error("invalid seed");let n=Pe(yh(Bf.sha512,TVe,i));return new Bo(d3,aE(n.slice(0,32)),null,"0x00000000",aE(n.slice(32)),0,0,r)}static fromMnemonic(e,r,i){return i=eL(i),e=Vm(m3(e,i),i),Bo._fromSeed(tL(e,r),{phrase:e,path:"m",locale:i.locale})}static fromSeed(e){return Bo._fromSeed(e,null)}static fromExtendedKey(e){let r=bh.decode(e);(r.length!==82||qpe(r.slice(0,78))!==e)&&A5.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let i=r[4],n=Ue(r.slice(5,9)),o=parseInt(Ue(r.slice(9,13)).substring(2),16),s=Ue(r.slice(13,45)),a=r.slice(45,78);switch(Ue(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Bo(d3,null,Ue(a),n,s,o,i,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new Bo(d3,Ue(a.slice(1)),null,n,s,o,i,null)}return A5.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function tL(t,e){e||(e="");let r=gi("mnemonic"+e,ea.NFKD);return Hm(gi(t,ea.NFKD),r,2048,64,"sha512")}function m3(t,e){e=eL(e),A5.checkNormalize();let r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");let i=Pe(new Uint8Array(Math.ceil(11*r.length/8))),n=0;for(let h=0;h<r.length;h++){let g=e.getWordIndex(r[h].normalize("NFKD"));if(g===-1)throw new Error("invalid mnemonic");for(let w=0;w<11;w++)g&1<<10-w&&(i[n>>3]|=1<<7-n%8),n++}let o=32*r.length/3,s=r.length/3,a=Hpe(s);if((Pe(Ra(i.slice(0,o/8)))[0]&a)!==(i[i.length-1]&a))throw new Error("invalid checksum");return Ue(i.slice(0,o/8))}function Vm(t,e){if(e=eL(e),t=Pe(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");let r=[0],i=11;for(let s=0;s<t.length;s++)i>8?(r[r.length-1]<<=8,r[r.length-1]|=t[s],i-=8):(r[r.length-1]<<=i,r[r.length-1]|=t[s]>>8-i,r.push(t[s]&RVe(8-i)),i+=3);let n=t.length/4,o=Pe(Ra(t))[0]&Hpe(n);return r[r.length-1]<<=n,r[r.length-1]|=o>>8-n,e.join(r.map(s=>e.getWord(s)))}function zpe(t,e){try{return m3(t,e),!0}catch{}return!1}function Vpe(t){return(typeof t!="number"||t<0||t>=p3||t%1)&&A5.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}var Kpe="random/5.7.0";var rL=new ce(Kpe);function kVe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var Gpe=kVe(),cE=Gpe.crypto||Gpe.msCrypto;(!cE||!cE.getRandomValues)&&(rL.warn("WARNING: Missing strong random number source"),cE={getRandomValues:function(t){return rL.throwError("no secure random source avaialble",ce.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Uf(t){(t<=0||t>1024||t%1||t!=t)&&rL.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return cE.getRandomValues(e),Pe(e)}function C5(t){t=t.slice();for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1)),i=t[e];t[e]=t[r],t[r]=i}return t}var oL=Dr(nL());var lE="json-wallets/5.7.0";function _h(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Pe(t)}function g3(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function S5(t){return typeof t=="string"?gi(t,ea.NFKC):Pe(t)}function On(t,e){let r=t,i=e.toLowerCase().split("/");for(let n=0;n<i.length;n++){let o=null;for(let s in r)if(s.toLowerCase()===i[n]){o=r[s];break}if(o===null)return null;r=o}return r}function Zpe(t){let e=Pe(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=Ue(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}var NVe=new ce(lE),sL=class extends hc{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}};function aL(t,e){let r=JSON.parse(t);e=S5(e);let i=Vr(On(r,"ethaddr")),n=_h(On(r,"encseed"));(!n||n.length%16!==0)&&NVe.throwArgumentError("invalid encseed","json",t);let o=Pe(Hm(e,e,2e3,32,"sha256")).slice(0,16),s=n.slice(0,16),a=n.slice(16),c=new oL.default.ModeOfOperation.cbc(o,s),h=oL.default.padding.pkcs7.strip(Pe(c.decrypt(a))),g="";for(let E=0;E<h.length;E++)g+=String.fromCharCode(h[E]);let w=gi(g),A=zr(w);return new sL({_isCrowdsaleAccount:!0,address:i,privateKey:A})}function uE(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function fE(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}function cL(t){if(uE(t))try{return Vr(JSON.parse(t).ethaddr)}catch{return null}if(fE(t))try{return Vr(JSON.parse(t).address)}catch{return null}return null}var Eh=Dr(nL()),hE=Dr(Qpe());var PVe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},uL=new ce(lE);function Xpe(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}var fL=class extends hc{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}};function OVe(t,e,r){if(On(t,"crypto/cipher")==="aes-128-ctr"){let n=_h(On(t,"crypto/cipherparams/iv")),o=new Eh.default.Counter(n),s=new Eh.default.ModeOfOperation.ctr(e,o);return Pe(s.decrypt(r))}return null}function e1e(t,e){let r=_h(On(t,"crypto/ciphertext"));if(Ue(zr(Hr([e.slice(16,32),r]))).substring(2)!==On(t,"crypto/mac").toLowerCase())throw new Error("invalid password");let n=OVe(t,e.slice(0,16),r);n||uL.throwError("unsupported cipher",ce.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});let o=e.slice(32,64),s=gl(n);if(t.address){let c=t.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),Vr(c)!==s)throw new Error("address mismatch")}let a={_isKeystoreAccount:!0,address:s,privateKey:Ue(n)};if(On(t,"x-ethers/version")==="0.1"){let c=_h(On(t,"x-ethers/mnemonicCiphertext")),h=_h(On(t,"x-ethers/mnemonicCounter")),g=new Eh.default.Counter(h),w=new Eh.default.ModeOfOperation.ctr(o,g),A=On(t,"x-ethers/path")||xh,E=On(t,"x-ethers/locale")||"en",I=Pe(w.decrypt(c));try{let k=Vm(I,E),M=Bo.fromMnemonic(k,null,E).derivePath(A);if(M.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=M.mnemonic}catch(k){if(k.code!==ce.errors.INVALID_ARGUMENT||k.argument!=="wordlist")throw k}}return new fL(a)}function t1e(t,e,r,i,n){return Pe(Hm(t,e,r,i,n))}function MVe(t,e,r,i,n){return Promise.resolve(t1e(t,e,r,i,n))}function r1e(t,e,r,i,n){let o=S5(e),s=On(t,"crypto/kdf");if(s&&typeof s=="string"){let a=function(c,h){return uL.throwArgumentError("invalid key-derivation function parameters",c,h)};if(s.toLowerCase()==="scrypt"){let c=_h(On(t,"crypto/kdfparams/salt")),h=parseInt(On(t,"crypto/kdfparams/n")),g=parseInt(On(t,"crypto/kdfparams/r")),w=parseInt(On(t,"crypto/kdfparams/p"));(!h||!g||!w)&&a("kdf",s),(h&h-1)!==0&&a("N",h);let A=parseInt(On(t,"crypto/kdfparams/dklen"));return A!==32&&a("dklen",A),i(o,c,h,g,w,64,n)}else if(s.toLowerCase()==="pbkdf2"){let c=_h(On(t,"crypto/kdfparams/salt")),h=null,g=On(t,"crypto/kdfparams/prf");g==="hmac-sha256"?h="sha256":g==="hmac-sha512"?h="sha512":a("prf",g);let w=parseInt(On(t,"crypto/kdfparams/c")),A=parseInt(On(t,"crypto/kdfparams/dklen"));return A!==32&&a("dklen",A),r(o,c,w,A,h)}}return uL.throwArgumentError("unsupported key-derivation function","kdf",s)}function i1e(t,e){let r=JSON.parse(t),i=r1e(r,e,t1e,hE.default.syncScrypt);return e1e(r,i)}function n1e(t,e,r){return PVe(this,void 0,void 0,function*(){let i=JSON.parse(t),n=yield r1e(i,e,MVe,hE.default.scrypt,r);return e1e(i,n)})}function hL(t,e,r,i){try{if(Vr(t.address)!==gl(t.privateKey))throw new Error("address/privateKey mismatch");if(Xpe(t)){let M=t.mnemonic;if(Bo.fromMnemonic(M.phrase,null,M.locale).derivePath(M.path||xh).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(M){return Promise.reject(M)}typeof r=="function"&&!i&&(i=r,r={}),r||(r={});let n=Pe(t.privateKey),o=S5(e),s=null,a=null,c=null;if(Xpe(t)){let M=t.mnemonic;s=Pe(m3(M.phrase,M.locale||"en")),a=M.path||xh,c=M.locale||"en"}let h=r.client;h||(h="ethers.js");let g=null;r.salt?g=Pe(r.salt):g=Uf(32);let w=null;if(r.iv){if(w=Pe(r.iv),w.length!==16)throw new Error("invalid iv")}else w=Uf(16);let A=null;if(r.uuid){if(A=Pe(r.uuid),A.length!==16)throw new Error("invalid uuid")}else A=Uf(16);let E=1<<17,I=8,k=1;return r.scrypt&&(r.scrypt.N&&(E=r.scrypt.N),r.scrypt.r&&(I=r.scrypt.r),r.scrypt.p&&(k=r.scrypt.p)),hE.default.scrypt(o,g,E,I,k,64,i).then(M=>{M=Pe(M);let j=M.slice(0,16),W=M.slice(16,32),G=M.slice(32,64),Y=new Eh.default.Counter(w),te=new Eh.default.ModeOfOperation.ctr(j,Y),oe=Pe(te.encrypt(n)),Q=zr(Hr([W,oe])),N={address:t.address.substring(2).toLowerCase(),id:Zpe(A),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ue(w).substring(2)},ciphertext:Ue(oe).substring(2),kdf:"scrypt",kdfparams:{salt:Ue(g).substring(2),n:E,dklen:32,p:k,r:I},mac:Q.substring(2)}};if(s){let U=Uf(16),L=new Eh.default.Counter(U),F=new Eh.default.ModeOfOperation.ctr(G,L),q=Pe(F.encrypt(s)),u=new Date,f=u.getUTCFullYear()+"-"+g3(u.getUTCMonth()+1,2)+"-"+g3(u.getUTCDate(),2)+"T"+g3(u.getUTCHours(),2)+"-"+g3(u.getUTCMinutes(),2)+"-"+g3(u.getUTCSeconds(),2)+".0Z";N["x-ethers"]={client:h,gethFilename:"UTC--"+f+"--"+N.address,mnemonicCounter:Ue(U).substring(2),mnemonicCiphertext:Ue(q).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(N)})}function o1e(t,e,r){if(uE(t)){r&&r(0);let i=aL(t,e);return r&&r(1),Promise.resolve(i)}return fE(t)?n1e(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function s1e(t,e){if(uE(t))return aL(t,e);if(fE(t))return i1e(t,e);throw new Error("invalid JSON wallet")}var a1e="wallet/5.7.0";var c1e=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},w3=new ce(a1e);function DVe(t){return t!=null&&Qt(t.privateKey,32)&&t.address!=null}function LVe(t){let e=t.mnemonic;return e&&e.phrase}var au=class extends ta{constructor(e,r){if(super(),DVe(e)){let i=new ml(e.privateKey);if(_e(this,"_signingKey",()=>i),_e(this,"address",gl(this.publicKey)),this.address!==Vr(e.address)&&w3.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),LVe(e)){let n=e.mnemonic;_e(this,"_mnemonic",()=>({phrase:n.phrase,path:n.path||xh,locale:n.locale||"en"}));let o=this.mnemonic,s=Bo.fromMnemonic(o.phrase,null,o.locale).derivePath(o.path);gl(s.privateKey)!==this.address&&w3.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else _e(this,"_mnemonic",()=>null)}else{if(ml.isSigningKey(e))e.curve!=="secp256k1"&&w3.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),_e(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);let i=new ml(e);_e(this,"_signingKey",()=>i)}_e(this,"_mnemonic",()=>null),_e(this,"address",gl(this.publicKey))}r&&!Ia.isProvider(r)&&w3.throwArgumentError("invalid provider","provider",r),_e(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new au(this,e)}signTransaction(e){return Vi(e).then(r=>{r.from!=null&&(Vr(r.from)!==this.address&&w3.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);let i=this._signingKey().signDigest(zr(b5(r)));return b5(r,i)})}signMessage(e){return c1e(this,void 0,void 0,function*(){return i5(this._signingKey().signDigest(e3(e)))})}_signTypedData(e,r,i){return c1e(this,void 0,void 0,function*(){let n=yield Nn.resolveNames(e,r,i,o=>(this.provider==null&&w3.throwError("cannot resolve ENS names without a provider",ce.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:o}),this.provider.resolveName(o)));return i5(this._signingKey().signDigest(Nn.hash(n.domain,r,n.value)))})}encrypt(e,r,i){if(typeof r=="function"&&!i&&(i=r,r={}),i&&typeof i!="function")throw new Error("invalid callback");return r||(r={}),hL(this,e,r,i)}static createRandom(e){let r=Uf(16);e||(e={}),e.extraEntropy&&(r=Pe(zi(zr(Hr([r,e.extraEntropy])),0,16)));let i=Vm(r,e.locale);return au.fromMnemonic(i,e.path,e.locale)}static fromEncryptedJson(e,r,i){return o1e(e,r,i).then(n=>new au(n))}static fromEncryptedJsonSync(e,r){return new au(s1e(e,r))}static fromMnemonic(e,r,i){return r||(r=xh),new au(Bo.fromMnemonic(e,null,i).derivePath(r))}};function l1e(t,e){return $m(e3(t),e)}function u1e(t,e,r,i){return $m(Nn.hash(t,e,r),i)}var RE={};qr(RE,{AlchemyProvider:()=>E3,AlchemyWebSocketProvider:()=>B5,AnkrProvider:()=>U5,BaseProvider:()=>jf,CloudflareProvider:()=>F5,EtherscanProvider:()=>j5,FallbackProvider:()=>W5,Formatter:()=>Tt,InfuraProvider:()=>C3,InfuraWebSocketProvider:()=>H5,IpcProvider:()=>CL,JsonRpcBatchProvider:()=>IE,JsonRpcProvider:()=>ka,JsonRpcSigner:()=>x3,NodesmithProvider:()=>z5,PocketProvider:()=>V5,Provider:()=>Ia,Resolver:()=>y3,StaticJsonRpcProvider:()=>L5,UrlJsonRpcProvider:()=>Uo,Web3Provider:()=>K5,WebSocketProvider:()=>Sh,getDefaultProvider:()=>TE,getNetwork:()=>I5,isCommunityResourcable:()=>mL,isCommunityResource:()=>k5,showThrottleMessage:()=>Ff});var f1e="networks/5.7.1";var h1e=new ce(f1e);function BVe(t){return t&&typeof t.renetwork=="function"}function Ah(t){let e=function(r,i){i==null&&(i={});let n=[];if(r.InfuraProvider&&i.infura!=="-")try{n.push(new r.InfuraProvider(t,i.infura))}catch{}if(r.EtherscanProvider&&i.etherscan!=="-")try{n.push(new r.EtherscanProvider(t,i.etherscan))}catch{}if(r.AlchemyProvider&&i.alchemy!=="-")try{n.push(new r.AlchemyProvider(t,i.alchemy))}catch{}if(r.PocketProvider&&i.pocket!=="-"){let o=["goerli","ropsten","rinkeby","sepolia"];try{let s=new r.PocketProvider(t,i.pocket);s.network&&o.indexOf(s.network.name)===-1&&n.push(s)}catch{}}if(r.CloudflareProvider&&i.cloudflare!=="-")try{n.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&i.ankr!=="-")try{let o=["ropsten"],s=new r.AnkrProvider(t,i.ankr);s.network&&o.indexOf(s.network.name)===-1&&n.push(s)}catch{}if(n.length===0)return null;if(r.FallbackProvider){let o=1;return i.quorum!=null?o=i.quorum:t==="homestead"&&(o=2),new r.FallbackProvider(n,o)}return n[0]};return e.renetwork=function(r){return Ah(r)},e}function pE(t,e){let r=function(i,n){return i.JsonRpcProvider?new i.JsonRpcProvider(t,e):null};return r.renetwork=function(i){return pE(t,i)},r}var d1e={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Ah("homestead")},p1e={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Ah("ropsten")},m1e={chainId:63,name:"classicMordor",_defaultProvider:pE("https://www.ethercluster.com/mordor","classicMordor")},dE={unspecified:{chainId:0,name:"unspecified"},homestead:d1e,mainnet:d1e,morden:{chainId:2,name:"morden"},ropsten:p1e,testnet:p1e,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Ah("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Ah("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Ah("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Ah("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:pE("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:m1e,classicTestnet:m1e,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:pE("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Ah("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Ah("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function I5(t){if(t==null)return null;if(typeof t=="number"){for(let i in dE){let n=dE[i];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){let i=dE[t];return i==null?null:{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress,_defaultProvider:i._defaultProvider||null}}let e=dE[t.name];if(!e)return typeof t.chainId!="number"&&h1e.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&h1e.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(BVe(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}var g1e="web/5.7.1";var UVe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})};function w1e(t,e){return UVe(this,void 0,void 0,function*(){e==null&&(e={});let r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){let s=e.fetchOptions;s.mode&&(r.mode=s.mode),s.cache&&(r.cache=s.cache),s.credentials&&(r.credentials=s.credentials),s.redirect&&(r.redirect=s.redirect),s.referrer&&(r.referrer=s.referrer)}let i=yield fetch(t,r),n=yield i.arrayBuffer(),o={};return i.headers.forEach?i.headers.forEach((s,a)=>{o[a.toLowerCase()]=s}):i.headers.keys().forEach(s=>{o[s.toLowerCase()]=i.headers.get(s)}),{headers:o,statusCode:i.status,statusMessage:i.statusText,body:Pe(new Uint8Array(n))}})}var FVe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},cu=new ce(g1e);function v1e(t){return new Promise(e=>{setTimeout(e,t)})}function gp(t,e){if(t==null)return null;if(typeof t=="string")return t;if(uh(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Sa(t)}catch{}return Ue(t)}return t}function jVe(t){return gi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function dL(t,e,r){let i=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;cu.assertArgument(i>0&&i%1===0,"invalid connection throttle limit","connection.throttleLimit",i);let n=typeof t=="object"?t.throttleCallback:null,o=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;cu.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);let s=typeof t=="object"?!!t.errorPassThrough:!1,a={},c=null,h={method:"GET"},g=!1,w=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&cu.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(w=t.timeout),t.headers)for(let j in t.headers)a[j.toLowerCase()]={key:j,value:String(t.headers[j])},["if-none-match","if-modified-since"].indexOf(j.toLowerCase())>=0&&(g=!0);if(h.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&cu.throwError("basic authentication requires a secure https url",ce.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});let j=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+Xw(gi(j))}}t.skipFetchSetup!=null&&(h.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(h.fetchOptions=bi(t.fetchOptions))}let A=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),E=c?c.match(A):null;if(E)try{let j={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]||"text/plain"},body:E[2]?Qw(E[3]):jVe(E[3])},W=j.body;return r&&(W=r(j.body,j)),Promise.resolve(W)}catch(j){cu.throwError("processing response error",ce.errors.SERVER_ERROR,{body:gp(E[1],E[2]),error:j,requestBody:null,requestMethod:"GET",url:c})}e&&(h.method="POST",h.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));let I={};Object.keys(a).forEach(j=>{let W=a[j];I[W.key]=W.value}),h.headers=I;let k=function(){let j=null;return{promise:new Promise(function(Y,te){w&&(j=setTimeout(()=>{j!=null&&(j=null,te(cu.makeError("timeout",ce.errors.TIMEOUT,{requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,timeout:w,url:c})))},w))}),cancel:function(){j!=null&&(clearTimeout(j),j=null)}}}(),M=function(){return FVe(this,void 0,void 0,function*(){for(let j=0;j<i;j++){let W=null;try{if(W=yield w1e(c,h),j<i){if(W.statusCode===301||W.statusCode===302){let Y=W.headers.location||"";if(h.method==="GET"&&Y.match(/^https:/)){c=W.headers.location;continue}}else if(W.statusCode===429){let Y=!0;if(n&&(Y=yield n(j,c)),Y){let te=0,oe=W.headers["retry-after"];typeof oe=="string"&&oe.match(/^[1-9][0-9]*$/)?te=parseInt(oe)*1e3:te=o*parseInt(String(Math.random()*Math.pow(2,j))),yield v1e(te);continue}}}}catch(Y){W=Y.response,W==null&&(k.cancel(),cu.throwError("missing response",ce.errors.SERVER_ERROR,{requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,serverError:Y,url:c}))}let G=W.body;if(g&&W.statusCode===304?G=null:!s&&(W.statusCode<200||W.statusCode>=300)&&(k.cancel(),cu.throwError("bad response",ce.errors.SERVER_ERROR,{status:W.statusCode,headers:W.headers,body:gp(G,W.headers?W.headers["content-type"]:null),requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,url:c})),r)try{let Y=yield r(G,W);return k.cancel(),Y}catch(Y){if(Y.throttleRetry&&j<i){let te=!0;if(n&&(te=yield n(j,c)),te){let oe=o*parseInt(String(Math.random()*Math.pow(2,j)));yield v1e(oe);continue}}k.cancel(),cu.throwError("processing response error",ce.errors.SERVER_ERROR,{body:gp(G,W.headers?W.headers["content-type"]:null),error:Y,requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,url:c})}return k.cancel(),G}return cu.throwError("failed response",ce.errors.SERVER_ERROR,{requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,url:c})})}();return Promise.race([k.promise,M])}function lu(t,e,r){let i=(o,s)=>{let a=null;if(o!=null)try{a=JSON.parse(Sa(o))}catch(c){cu.throwError("invalid JSON",ce.errors.SERVER_ERROR,{body:o,error:c})}return r&&(a=r(a,s)),a},n=null;if(e!=null){n=gi(e);let o=typeof t=="string"?{url:t}:bi(t);o.headers?Object.keys(o.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(o.headers=bi(o.headers),o.headers["content-type"]="application/json"):o.headers={"content-type":"application/json"},t=o}return dL(t,n,i)}function uu(t,e){return e||(e={}),e=bi(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,i){let n=null,o=!1,s=()=>o?!1:(o=!0,n&&clearTimeout(n),!0);e.timeout&&(n=setTimeout(()=>{s()&&i(new Error("timeout"))},e.timeout));let a=e.retryLimit,c=0;function h(){return t().then(function(g){if(g!==void 0)s()&&r(g);else if(e.oncePoll)e.oncePoll.once("poll",h);else if(e.onceBlock)e.onceBlock.once("block",h);else if(!o){if(c++,c>a){s()&&i(new Error("retry limit reached"));return}let w=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));w<e.floor&&(w=e.floor),w>e.ceiling&&(w=e.ceiling),setTimeout(h,w)}return null},function(g){s()&&i(g)})}h()})}var bL=Dr(_1e());var ki="providers/5.7.2";var R5=new ce(ki),Tt=class{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let e={},r=this.address.bind(this),i=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),s=this.hash.bind(this),a=this.hex.bind(this),c=this.number.bind(this),h=this.type.bind(this),g=w=>this.data(w,!0);return e.transaction={hash:s,type:h,accessList:Tt.allowNull(this.accessList.bind(this),null),blockHash:Tt.allowNull(s,null),blockNumber:Tt.allowNull(c,null),transactionIndex:Tt.allowNull(c,null),confirmations:Tt.allowNull(c,null),from:r,gasPrice:Tt.allowNull(i),maxPriorityFeePerGas:Tt.allowNull(i),maxFeePerGas:Tt.allowNull(i),gasLimit:i,to:Tt.allowNull(r,null),value:i,nonce:c,data:o,r:Tt.allowNull(this.uint256),s:Tt.allowNull(this.uint256),v:Tt.allowNull(c),creates:Tt.allowNull(r,null),raw:Tt.allowNull(o)},e.transactionRequest={from:Tt.allowNull(r),nonce:Tt.allowNull(c),gasLimit:Tt.allowNull(i),gasPrice:Tt.allowNull(i),maxPriorityFeePerGas:Tt.allowNull(i),maxFeePerGas:Tt.allowNull(i),to:Tt.allowNull(r),value:Tt.allowNull(i),data:Tt.allowNull(g),type:Tt.allowNull(c),accessList:Tt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:r,topics:Tt.arrayOf(s),data:o,logIndex:c,blockHash:s},e.receipt={to:Tt.allowNull(this.address,null),from:Tt.allowNull(this.address,null),contractAddress:Tt.allowNull(r,null),transactionIndex:c,root:Tt.allowNull(a),gasUsed:i,logsBloom:Tt.allowNull(o),blockHash:s,transactionHash:s,logs:Tt.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:Tt.allowNull(c,null),cumulativeGasUsed:i,effectiveGasPrice:Tt.allowNull(i),status:Tt.allowNull(c),type:h},e.block={hash:Tt.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:Tt.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:Tt.allowNull(r),extraData:o,transactions:Tt.allowNull(Tt.arrayOf(s)),baseFeePerGas:Tt.allowNull(i)},e.blockWithTransactions=bi(e.block),e.blockWithTransactions.transactions=Tt.allowNull(Tt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Tt.allowNull(n,void 0),toBlock:Tt.allowNull(n,void 0),blockHash:Tt.allowNull(s,void 0),address:Tt.allowNull(r,void 0),topics:Tt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Tt.allowNull(c),blockHash:Tt.allowNull(s),transactionIndex:c,removed:Tt.allowNull(this.boolean.bind(this)),address:r,data:Tt.allowFalsish(o,"0x"),topics:Tt.arrayOf(s),transactionHash:s,logIndex:c},e}accessList(e){return vc(e||[])}number(e){return e==="0x"?0:De.from(e).toNumber()}type(e){return e==="0x"||e==null?0:De.from(e).toNumber()}bigNumber(e){return De.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Qt(e))?e.toLowerCase():R5.throwArgumentError("invalid hash","value",e)}data(e,r){let i=this.hex(e,r);if(i.length%2!==0)throw new Error("invalid data; odd-length - "+e);return i}address(e){return Vr(e)}callAddress(e){if(!Qt(e,32))return null;let r=Vr(zi(e,12));return r===P_?null:r}contractAddress(e){return Bm(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Qt(e))return Cf(e);throw new Error("invalid blockTag")}hash(e,r){let i=this.hex(e,r);return _s(i)!==32?R5.throwArgumentError("invalid hash","value",e):i}difficulty(e){if(e==null)return null;let r=De.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Qt(e))throw new Error("invalid uint256");return Jr(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);let i=e._difficulty!=null?e._difficulty:e.difficulty,n=Tt.check(r,e);return n._difficulty=i==null?null:De.from(i),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Tt.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&De.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);let r=Tt.check(this.formats.transaction,e);if(e.chainId!=null){let i=e.chainId;Qt(i)&&(i=De.from(i).toNumber()),r.chainId=i}else{let i=e.networkId;i==null&&r.v==null&&(i=e.chainId),Qt(i)&&(i=De.from(i).toNumber()),typeof i!="number"&&r.v!=null&&(i=(r.v-35)/2,i<0&&(i=0),i=parseInt(i)),typeof i!="number"&&(i=0),r.chainId=i}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return tE(e)}receiptLog(e){return Tt.check(this.formats.receiptLog,e)}receipt(e){let r=Tt.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){let i=De.from(r.root).toNumber();i===0||i===1?(r.status!=null&&r.status!==i&&R5.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=i,delete r.root):R5.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&R5.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return Tt.check(this.formats.filter,e)}filterLog(e){return Tt.check(this.formats.filterLog,e)}static check(e,r){let i={};for(let n in e)try{let o=e[n](r[n]);o!==void 0&&(i[n]=o)}catch(o){throw o.checkKey=n,o.checkValue=r[n],o}return i}static allowNull(e,r){return function(i){return i==null?r:e(i)}}static allowFalsish(e,r){return function(i){return i?e(i):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");let i=[];return r.forEach(function(n){i.push(e(n))}),i}}};function mL(t){return t&&typeof t.isCommunityResource=="function"}function k5(t){return mL(t)&&t.isCommunityResource()}var E1e=!1;function Ff(){E1e||(E1e=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Cr=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},Qr=new ce(ki),GVe=10;function A1e(t){return t==null?"null":(_s(t)!==32&&Qr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function C1e(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){let r={};e.forEach(n=>{r[A1e(n)]=!0});let i=Object.keys(r);return i.sort(),i.join("|")}else return A1e(e)}).join("&")}function YVe(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];let r=e.split("|").map(i=>i==="null"?null:i);return r.length===1?r[0]:r})}function b3(t){if(typeof t=="string"){if(t=t.toLowerCase(),_s(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+C1e(t);if(H_.isForkEvent(t))throw Qr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+C1e(t.topics||[])}throw new Error("invalid event - "+t)}function N5(){return new Date().getTime()}function S1e(t){return new Promise(e=>{setTimeout(e,t)})}var ZVe=["block","network","pending","poll"],yL=class{constructor(e,r,i){_e(this,"tag",e),_e(this,"listener",r),_e(this,"once",i),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){let e=this.tag.split(":");if(e[0]!=="filter")return null;let r=e[1],i=YVe(e[2]),n={};return i.length>0&&(n.topics=i),r&&r!=="*"&&(n.address=r),n}pollable(){return this.tag.indexOf(":")>=0||ZVe.indexOf(this.tag)>=0}},JVe={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function gL(t){return Jr(De.from(t).toHexString(),32)}function I1e(t){return bh.encode(Hr([t,zi(Ra(Ra(t)),0,4)]))}var k1e=new RegExp("^(ipfs)://(.*)$","i"),T1e=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),k1e,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function vE(t,e){try{return Sa(P5(t,e))}catch{}return null}function P5(t,e){if(t==="0x")return null;let r=De.from(zi(t,e,e+32)).toNumber(),i=De.from(zi(t,r,r+32)).toNumber();return zi(t,r+32,r+32+i)}function wL(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Qr.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function R1e(t){let e=Pe(t);if(e.length>32)throw new Error("internal; should not happen");let r=new Uint8Array(32);return r.set(e,32-e.length),r}function QVe(t){if(t.length%32===0)return t;let e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function N1e(t){let e=[],r=0;for(let i=0;i<t.length;i++)e.push(null),r+=32;for(let i=0;i<t.length;i++){let n=Pe(t[i]);e[i]=R1e(r),e.push(R1e(n.length)),e.push(QVe(n)),r+=32+Math.ceil(n.length/32)*32}return no(e)}var y3=class{constructor(e,r,i,n){_e(this,"provider",e),_e(this,"name",i),_e(this,"address",e.formatter.address(r)),_e(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>De.from(e).eq(1)).catch(e=>{if(e.code===ce.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Cr(this,void 0,void 0,function*(){let i={to:this.address,ccipReadEnabled:!0,data:no([e,up(this.name),r||"0x"])},n=!1;(yield this.supportsWildcard())&&(n=!0,i.data=no(["0x9061b923",N1e([m5(this.name),i.data])]));try{let o=yield this.provider.call(i);return Pe(o).length%32===4&&Qr.throwError("resolver threw error",ce.errors.CALL_EXCEPTION,{transaction:i,data:o}),n&&(o=P5(o,0)),o}catch(o){if(o.code===ce.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(e,r){return Cr(this,void 0,void 0,function*(){let i=yield this._fetch(e,r);return i!=null?P5(i,0):null})}_getAddress(e,r){let i=JVe[String(e)];if(i==null&&Qr.throwError(`unsupported coin type: ${e}`,ce.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),i.ilk==="eth")return this.provider.formatter.address(r);let n=Pe(r);if(i.p2pkh!=null){let o=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){let s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return I1e(Hr([[i.p2pkh],"0x"+o[2]]))}}if(i.p2sh!=null){let o=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){let s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return I1e(Hr([[i.p2sh],"0x"+o[2]]))}}if(i.prefix!=null){let o=n[1],s=n[0];if(s===0?o!==20&&o!==32&&(s=-1):s=-1,s>=0&&n.length===2+o&&o>=1&&o<=75){let a=bL.default.toWords(n.slice(2));return a.unshift(s),bL.default.encode(i.prefix,a)}}return null}getAddress(e){return Cr(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{let n=yield this._fetch("0x3b3b57de");return n==="0x"||n===Zw?null:this.provider.formatter.callAddress(n)}catch(n){if(n.code===ce.errors.CALL_EXCEPTION)return null;throw n}let r=yield this._fetchBytes("0xf1cb7e06",gL(e));if(r==null||r==="0x")return null;let i=this._getAddress(e,r);return i==null&&Qr.throwError("invalid or unsupported coin data",ce.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),i})}getAvatar(){return Cr(this,void 0,void 0,function*(){let e=[{type:"name",content:this.name}];try{let r=yield this.getText("avatar");if(r==null)return null;for(let i=0;i<T1e.length;i++){let n=r.match(T1e[i]);if(n==null)continue;let o=n[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:r}),{linkage:e,url:r};case"data":return e.push({type:"data",content:r}),{linkage:e,url:r};case"ipfs":return e.push({type:"ipfs",content:r}),{linkage:e,url:wL(r)};case"erc721":case"erc1155":{let s=o==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:r});let a=this._resolvedAddress||(yield this.getAddress()),c=(n[2]||"").split("/");if(c.length!==2)return null;let h=yield this.provider.formatter.address(c[0]),g=Jr(De.from(c[1]).toHexString(),32);if(o==="erc721"){let k=this.provider.formatter.callAddress(yield this.provider.call({to:h,data:no(["0x6352211e",g])}));if(a!==k)return null;e.push({type:"owner",content:k})}else if(o==="erc1155"){let k=De.from(yield this.provider.call({to:h,data:no(["0x00fdd58e",Jr(a,32),g])}));if(k.isZero())return null;e.push({type:"balance",content:k.toString()})}let w={to:this.provider.formatter.address(c[0]),data:no([s,g])},A=vE(yield this.provider.call(w),0);if(A==null)return null;e.push({type:"metadata-url-base",content:A}),o==="erc1155"&&(A=A.replace("{id}",g.substring(2)),e.push({type:"metadata-url-expanded",content:A})),A.match(/^ipfs:/i)&&(A=wL(A)),e.push({type:"metadata-url",content:A});let E=yield lu(A);if(!E)return null;e.push({type:"metadata",content:JSON.stringify(E)});let I=E.image;if(typeof I!="string")return null;if(!I.match(/^(https:\/\/|data:)/i)){if(I.match(k1e)==null)return null;e.push({type:"url-ipfs",content:I}),I=wL(I)}return e.push({type:"url",content:I}),{linkage:e,url:I}}}}}catch{}return null})}getContentHash(){return Cr(this,void 0,void 0,function*(){let e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;let r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){let s=parseInt(r[3],16);if(r[4].length===s*2)return"ipfs://"+bh.encode("0x"+r[1])}let i=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(i){let s=parseInt(i[3],16);if(i[4].length===s*2)return"ipns://"+bh.encode("0x"+i[1])}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===32*2)return"bzz://"+n[1];let o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&o[1].length===34*2){let s={"=":"","+":"-","/":"_"},a=Xw("0x"+o[1]).replace(/[=+\/]/g,c=>s[c]);return"sia://"+a}return Qr.throwError("invalid or unsupported content hash data",ce.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Cr(this,void 0,void 0,function*(){let r=gi(e);r=Hr([gL(64),gL(r.length),r]),r.length%32!==0&&(r=Hr([r,Jr("0x",32-e.length%32)]));let i=yield this._fetchBytes("0x59d1d43c",Ue(r));return i==null||i==="0x"?null:Sa(i)})}},vL=null,XVe=1,jf=class extends Ia{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),_e(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{let r=Rn(new.target,"getNetwork")(e);r?(_e(this,"_network",r),this.emit("network",r,null)):Qr.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Cr(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Qr.throwError("no network detected",ce.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:_e(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return uu(()=>this._ready().then(e=>e,e=>{if(!(e.code===ce.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return vL==null&&(vL=new Tt),vL}static getNetwork(e){return I5(e??"homestead")}ccipReadFetch(e,r,i){return Cr(this,void 0,void 0,function*(){if(this.disableCcipRead||i.length===0)return null;let n=e.to.toLowerCase(),o=r.toLowerCase(),s=[];for(let a=0;a<i.length;a++){let c=i[a],h=c.replace("{sender}",n).replace("{data}",o),g=c.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:n}),w=yield lu({url:h,errorPassThrough:!0},g,(E,I)=>(E.status=I.statusCode,E));if(w.data)return w.data;let A=w.message||"unknown error";if(w.status>=400&&w.status<500)return Qr.throwError(`response not found during CCIP fetch: ${A}`,ce.errors.SERVER_ERROR,{url:c,errorMessage:A});s.push(A)}return Qr.throwError(`error encountered during CCIP fetch: ${s.map(a=>JSON.stringify(a)).join(", ")}`,ce.errors.SERVER_ERROR,{urls:i,errorMessages:s})})}_getInternalBlockNumber(e){return Cr(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){let n=this._internalBlockNumber;try{let o=yield n;if(N5()-o.respTime<=e)return o.blockNumber;break}catch{if(this._internalBlockNumber===n)break}}let r=N5(),i=Vi({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(n=>null,n=>n)}).then(({blockNumber:n,networkError:o})=>{if(o)throw this._internalBlockNumber===i&&(this._internalBlockNumber=null),o;let s=N5();return n=De.from(n).toNumber(),n<this._maxInternalBlockNumber&&(n=this._maxInternalBlockNumber),this._maxInternalBlockNumber=n,this._setFastBlockNumber(n),{blockNumber:n,reqTime:r,respTime:s}});return this._internalBlockNumber=i,i.catch(n=>{this._internalBlockNumber===i&&(this._internalBlockNumber=null)}),(yield i).blockNumber})}poll(){return Cr(this,void 0,void 0,function*(){let e=XVe++,r=[],i=null;try{i=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){this.emit("error",n);return}if(this._setFastBlockNumber(i),this.emit("poll",e,i),i===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=i-1),Math.abs(this._emitted.block-i)>1e3)Qr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${i})`),this.emit("error",Qr.makeError("network block skew detected",ce.errors.NETWORK_ERROR,{blockNumber:i,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",i);else for(let n=this._emitted.block+1;n<=i;n++)this.emit("block",n);this._emitted.block!==i&&(this._emitted.block=i,Object.keys(this._emitted).forEach(n=>{if(n==="block")return;let o=this._emitted[n];o!=="pending"&&i-o>12&&delete this._emitted[n]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=i-1),this._events.forEach(n=>{switch(n.type){case"tx":{let o=n.hash,s=this.getTransactionReceipt(o).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+o]=a.blockNumber,this.emit(o,a)),null)).catch(a=>{this.emit("error",a)});r.push(s);break}case"filter":{if(!n._inflight){n._inflight=!0,n._lastBlockNumber===-2&&(n._lastBlockNumber=i-1);let o=n.filter;o.fromBlock=n._lastBlockNumber+1,o.toBlock=i;let s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);let a=this.getLogs(o).then(c=>{n._inflight=!1,c.length!==0&&c.forEach(h=>{h.blockNumber>n._lastBlockNumber&&(n._lastBlockNumber=h.blockNumber),this._emitted["b:"+h.blockHash]=h.blockNumber,this._emitted["t:"+h.transactionHash]=h.blockNumber,this.emit(o,h)})}).catch(c=>{this.emit("error",c),n._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=i,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(n=>{this.emit("error",n)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Cr(this,void 0,void 0,function*(){return Qr.throwError("provider does not support network detection",ce.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Cr(this,void 0,void 0,function*(){let e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield S1e(0),this._network;let i=Qr.makeError("underlying network changed",ce.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",i),i}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let e=N5();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=N5(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,i){return Cr(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,i||0,null)})}_waitForTransaction(e,r,i,n){return Cr(this,void 0,void 0,function*(){let o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=r?o:new Promise((s,a)=>{let c=[],h=!1,g=function(){return h?!0:(h=!0,c.forEach(A=>{A()}),!1)},w=A=>{A.confirmations<r||g()||s(A)};if(this.on(e,w),c.push(()=>{this.removeListener(e,w)}),n){let A=n.startBlock,E=null,I=k=>Cr(this,void 0,void 0,function*(){h||(yield S1e(1e3),this.getTransactionCount(n.from).then(M=>Cr(this,void 0,void 0,function*(){if(!h){if(M<=n.nonce)A=k;else{{let j=yield this.getTransaction(e);if(j&&j.blockNumber!=null)return}for(E==null&&(E=A-3,E<n.startBlock&&(E=n.startBlock));E<=k;){if(h)return;let j=yield this.getBlockWithTransactions(E);for(let W=0;W<j.transactions.length;W++){let G=j.transactions[W];if(G.hash===e)return;if(G.from===n.from&&G.nonce===n.nonce){if(h)return;let Y=yield this.waitForTransaction(G.hash,r);if(g())return;let te="replaced";G.data===n.data&&G.to===n.to&&G.value.eq(n.value)?te="repriced":G.data==="0x"&&G.from===G.to&&G.value.isZero()&&(te="cancelled"),a(Qr.makeError("transaction was replaced",ce.errors.TRANSACTION_REPLACED,{cancelled:te==="replaced"||te==="cancelled",reason:te,replacement:this._wrapTransaction(G),hash:e,receipt:Y}));return}}E++}}h||this.once("block",I)}}),M=>{h||this.once("block",I)}))});if(h)return;this.once("block",I),c.push(()=>{this.removeListener("block",I)})}if(typeof i=="number"&&i>0){let A=setTimeout(()=>{g()||a(Qr.makeError("timeout exceeded",ce.errors.TIMEOUT,{timeout:i}))},i);A.unref&&A.unref(),c.push(()=>{clearTimeout(A)})}})})}getBlockNumber(){return Cr(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield this.perform("getGasPrice",{});try{return De.from(e)}catch(r){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),n=yield this.perform("getBalance",i);try{return De.from(n)}catch(o){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getBalance",params:i,result:n,error:o})}})}getTransactionCount(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),n=yield this.perform("getTransactionCount",i);try{return De.from(n).toNumber()}catch(o){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getTransactionCount",params:i,result:n,error:o})}})}getCode(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),n=yield this.perform("getCode",i);try{return Ue(n)}catch(o){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getCode",params:i,result:n,error:o})}})}getStorageAt(e,r,i){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(i),position:Promise.resolve(r).then(s=>Cf(s))}),o=yield this.perform("getStorageAt",n);try{return Ue(o)}catch(s){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:s})}})}_wrapTransaction(e,r,i){if(r!=null&&_s(r)!==32)throw new Error("invalid response - sendTransaction");let n=e;return r!=null&&e.hash!==r&&Qr.throwError("Transaction hash mismatch from Provider.sendTransaction.",ce.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),n.wait=(o,s)=>Cr(this,void 0,void 0,function*(){o==null&&(o=1),s==null&&(s=0);let a;o!==0&&i!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:i});let c=yield this._waitForTransaction(e.hash,o,s,a);return c==null&&o===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&Qr.throwError("transaction failed",ce.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),n}sendTransaction(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield Promise.resolve(e).then(o=>Ue(o)),i=this.formatter.transaction(e);i.confirmations==null&&(i.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let o=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(i,o,n)}catch(o){throw o.transaction=i,o.transactionHash=i.hash,o}})}_getTransactionRequest(e){return Cr(this,void 0,void 0,function*(){let r=yield e,i={};return["from","to"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o?this._getAddress(o):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o?De.from(o):null))}),["type"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o??null))}),r.accessList&&(i.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o?Ue(o):null))}),this.formatter.transactionRequest(yield Vi(i))})}_getFilter(e){return Cr(this,void 0,void 0,function*(){e=yield e;let r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(i=>{e[i]!=null&&(r[i]=e[i])}),["fromBlock","toBlock"].forEach(i=>{e[i]!=null&&(r[i]=this._getBlockTag(e[i]))}),this.formatter.filter(yield Vi(r))})}_call(e,r,i){return Cr(this,void 0,void 0,function*(){i>=GVe&&Qr.throwError("CCIP read exceeded maximum redirections",ce.errors.SERVER_ERROR,{redirects:i,transaction:e});let n=e.to,o=yield this.perform("call",{transaction:e,blockTag:r});if(i>=0&&r==="latest"&&n!=null&&o.substring(0,10)==="0x556f1830"&&_s(o)%32===4)try{let s=zi(o,4),a=zi(s,0,32);De.from(a).eq(n)||Qr.throwError("CCIP Read sender did not match",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});let c=[],h=De.from(zi(s,32,64)).toNumber(),g=De.from(zi(s,h,h+32)).toNumber(),w=zi(s,h+32);for(let j=0;j<g;j++){let W=vE(w,j*32);W==null&&Qr.throwError("CCIP Read contained corrupt URL string",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),c.push(W)}let A=P5(s,64);De.from(zi(s,100,128)).isZero()||Qr.throwError("CCIP Read callback selector included junk",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});let E=zi(s,96,100),I=P5(s,128),k=yield this.ccipReadFetch(e,A,c);k==null&&Qr.throwError("CCIP Read disabled or provided no URLs",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});let M={to:n,data:no([E,N1e([k,I])])};return this._call(M,r,i+1)}catch(s){if(s.code===ce.errors.SERVER_ERROR)throw s}try{return Ue(o)}catch(s){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:r},result:o,error:s})}})}call(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(r),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(i.transaction,i.blockTag,i.ccipReadEnabled?0:-1)})}estimateGas(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield Vi({transaction:this._getTransactionRequest(e)}),i=yield this.perform("estimateGas",r);try{return De.from(i)}catch(n){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:i,error:n})}})}_getAddress(e){return Cr(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&Qr.throwArgumentError("invalid address or ENS name","name",e);let r=yield this.resolveName(e);return r==null&&Qr.throwError("ENS name not configured",ce.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),r})}_getBlock(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let i=-128,n={includeTransactions:!!r};if(Qt(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),Qt(n.blockTag)&&(i=parseInt(n.blockTag.substring(2),16))}catch{Qr.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return uu(()=>Cr(this,void 0,void 0,function*(){let o=yield this.perform("getBlock",n);if(o==null)return n.blockHash!=null&&this._emitted["b:"+n.blockHash]==null||n.blockTag!=null&&i>this._emitted.block?null:void 0;if(r){let s=null;for(let c=0;c<o.transactions.length;c++){let h=o.transactions[c];if(h.blockNumber==null)h.confirmations=0;else if(h.confirmations==null){s==null&&(s=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let g=s-h.blockNumber+1;g<=0&&(g=1),h.confirmations=g}}let a=this.formatter.blockWithTransactions(o);return a.transactions=a.transactions.map(c=>this._wrapTransaction(c)),a}return this.formatter.block(o)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r={transactionHash:this.formatter.hash(e,!0)};return uu(()=>Cr(this,void 0,void 0,function*(){let i=yield this.perform("getTransaction",r);if(i==null)return this._emitted["t:"+e]==null?null:void 0;let n=this.formatter.transactionResponse(i);if(n.blockNumber==null)n.confirmations=0;else if(n.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;s<=0&&(s=1),n.confirmations=s}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r={transactionHash:this.formatter.hash(e,!0)};return uu(()=>Cr(this,void 0,void 0,function*(){let i=yield this.perform("getTransactionReceipt",r);if(i==null)return this._emitted["t:"+e]==null?null:void 0;if(i.blockHash==null)return;let n=this.formatter.receipt(i);if(n.blockNumber==null)n.confirmations=0;else if(n.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;s<=0&&(s=1),n.confirmations=s}return n}),{oncePoll:this})})}getLogs(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield Vi({filter:this._getFilter(e)}),i=yield this.perform("getLogs",r);return i.forEach(n=>{n.removed==null&&(n.removed=!1)}),Tt.arrayOf(this.formatter.filterLog.bind(this.formatter))(i)})}getEtherPrice(){return Cr(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Cr(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Qr.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Cr(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;let i=yield this._getResolver(r,"getResolver");if(i!=null){let n=new y3(this,i,e);return r!==e&&!(yield n.supportsWildcard())?null:n}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Cr(this,void 0,void 0,function*(){r==null&&(r="ENS");let i=yield this.getNetwork();i.ensAddress||Qr.throwError("network does not support ENS",ce.errors.UNSUPPORTED_OPERATION,{operation:r,network:i.name});try{let n=yield this.call({to:i.ensAddress,data:"0x0178b8bf"+up(e).substring(2)});return this.formatter.callAddress(n)}catch{}return null})}resolveName(e){return Cr(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(i){if(Qt(e))throw i}typeof e!="string"&&Qr.throwArgumentError("invalid ENS name","name",e);let r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Cr(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);let r=e.substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(r,"lookupAddress");if(i==null)return null;let n=vE(yield this.call({to:i,data:"0x691f3431"+up(r).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n})}getAvatar(e){return Cr(this,void 0,void 0,function*(){let r=null;if(Qt(e)){let o=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(o,"getAvatar");if(!s)return null;r=new y3(this,s,o);try{let a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ce.errors.CALL_EXCEPTION)throw a}try{let a=vE(yield this.call({to:s,data:"0x691f3431"+up(o).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ce.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;let i=yield r.getAvatar();return i==null?null:i.url})}perform(e,r){return Qr.throwError(e+" not implemented",ce.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,i){let n=new yL(b3(e),r,i);return this._events.push(n),this._startEvent(n),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let i=!1,n=[],o=b3(e);return this._events=this._events.filter(s=>s.tag!==o?!0:(setTimeout(()=>{s.listener.apply(this,r)},0),i=!0,s.once?(n.push(s),!1):!0)),n.forEach(s=>{this._stopEvent(s)}),i}listenerCount(e){if(!e)return this._events.length;let r=b3(e);return this._events.filter(i=>i.tag===r).length}listeners(e){if(e==null)return this._events.map(i=>i.listener);let r=b3(e);return this._events.filter(i=>i.tag===r).map(i=>i.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);let i=[],n=!1,o=b3(e);return this._events=this._events.filter(s=>s.tag!==o||s.listener!=r||n?!0:(n=!0,i.push(s),!1)),i.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{let i=b3(e);this._events=this._events.filter(n=>n.tag!==i?!0:(r.push(n),!1))}return r.forEach(i=>{this._stopEvent(i)}),this}};var Ch=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},so=new ce(ki),eKe=["call","estimateGas"];function M5(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){let r=Qt(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(let r in t){let i=M5(t[r],e);if(i)return i}return null}if(typeof t=="string")try{return M5(JSON.parse(t),e)}catch{}return null}function O1e(t,e,r){let i=r.transaction||r.signedTransaction;if(t==="call"){let o=M5(e,!0);if(o)return o.data;so.throwError("missing revert data in call exception; Transaction reverted without a reason string",ce.errors.CALL_EXCEPTION,{data:"0x",transaction:i,error:e})}if(t==="estimateGas"){let o=M5(e.body,!1);o==null&&(o=M5(e,!1)),o&&so.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ce.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:t,transaction:i,error:e})}let n=e.message;throw e.code===ce.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText),n=(n||"").toLowerCase(),n.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&so.throwError("insufficient funds for intrinsic transaction cost",ce.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:i}),n.match(/nonce (is )?too low/i)&&so.throwError("nonce has already been used",ce.errors.NONCE_EXPIRED,{error:e,method:t,transaction:i}),n.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&so.throwError("replacement fee too low",ce.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:i}),n.match(/only replay-protected/i)&&so.throwError("legacy pre-eip-155 transactions not supported",ce.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:i}),eKe.indexOf(t)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&so.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ce.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:i}),e}function P1e(t){return new Promise(function(e){setTimeout(e,t)})}function tKe(t){if(t.error){let e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function O5(t){return t&&t.toLowerCase()}var xL={},x3=class extends ta{constructor(e,r,i){if(super(),e!==xL)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");_e(this,"provider",r),i==null&&(i=0),typeof i=="string"?(_e(this,"_address",this.provider.formatter.address(i)),_e(this,"_index",null)):typeof i=="number"?(_e(this,"_index",i),_e(this,"_address",null)):so.throwArgumentError("invalid address or index","addressOrIndex",i)}connect(e){return so.throwError("cannot alter JSON-RPC Signer connection",ce.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new _L(xL,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&so.throwError("unknown account #"+this._index,ce.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=bi(e);let r=this.getAddress().then(i=>(i&&(i=i.toLowerCase()),i));if(e.gasLimit==null){let i=bi(e);i.from=r,e.gasLimit=this.provider.estimateGas(i)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(i=>Ch(this,void 0,void 0,function*(){if(i==null)return null;let n=yield this.provider.resolveName(i);return n==null&&so.throwArgumentError("provided ENS name resolves to null","tx.to",i),n}))),Vi({tx:Vi(e),sender:r}).then(({tx:i,sender:n})=>{i.from!=null?i.from.toLowerCase()!==n&&so.throwArgumentError("from address mismatch","transaction",e):i.from=n;let o=this.provider.constructor.hexlifyTransaction(i,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&so.throwError("user rejected transaction",ce.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:i}),O1e("sendTransaction",s,o)))})}signTransaction(e){return so.throwError("signing transactions is unsupported",ce.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Ch(this,void 0,void 0,function*(){let r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),i=yield this.sendUncheckedTransaction(e);try{return yield uu(()=>Ch(this,void 0,void 0,function*(){let n=yield this.provider.getTransaction(i);if(n!==null)return this.provider._wrapTransaction(n,i,r)}),{oncePoll:this.provider})}catch(n){throw n.transactionHash=i,n}})}signMessage(e){return Ch(this,void 0,void 0,function*(){let r=typeof e=="string"?gi(e):e,i=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Ue(r),i.toLowerCase()])}catch(n){throw typeof n.message=="string"&&n.message.match(/user denied/i)&&so.throwError("user rejected signing",ce.errors.ACTION_REJECTED,{action:"signMessage",from:i,messageData:e}),n}})}_legacySignMessage(e){return Ch(this,void 0,void 0,function*(){let r=typeof e=="string"?gi(e):e,i=yield this.getAddress();try{return yield this.provider.send("eth_sign",[i.toLowerCase(),Ue(r)])}catch(n){throw typeof n.message=="string"&&n.message.match(/user denied/i)&&so.throwError("user rejected signing",ce.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:i,messageData:e}),n}})}_signTypedData(e,r,i){return Ch(this,void 0,void 0,function*(){let n=yield Nn.resolveNames(e,r,i,s=>this.provider.resolveName(s)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Nn.getPayload(n.domain,r,n.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&so.throwError("user rejected signing",ce.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:r,value:n.value}}),s}})}unlock(e){return Ch(this,void 0,void 0,function*(){let r=this.provider,i=yield this.getAddress();return r.send("personal_unlockAccount",[i.toLowerCase(),e,null])})}},_L=class extends x3{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:i=>this.provider.waitForTransaction(r,i)}))}},rKe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},ka=class extends jf{constructor(e,r){let i=r;i==null&&(i=new Promise((n,o)=>{setTimeout(()=>{this.detectNetwork().then(s=>{n(s)},s=>{o(s)})},0)})),super(i),e||(e=Rn(this.constructor,"defaultUrl")()),typeof e=="string"?_e(this,"connection",Object.freeze({url:e})):_e(this,"connection",Object.freeze(bi(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Ch(this,void 0,void 0,function*(){yield P1e(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){let r=Rn(this.constructor,"getNetwork");try{return r(De.from(e).toNumber())}catch(i){return so.throwError("could not detect network",ce.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:i})}}return so.throwError("could not detect network",ce.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new x3(xL,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){let i={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Tn(i),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];let o=lu(this.connection,JSON.stringify(i),tKe).then(s=>(this.emit("debug",{action:"response",request:i,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:i,provider:this}),s});return n&&(this._cache[e]=o,setTimeout(()=>{this._cache[e]=null},0)),o}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[O5(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[O5(r.address),r.blockTag]];case"getCode":return["eth_getCode",[O5(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[O5(r.address),Jr(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":{let i=Rn(this.constructor,"hexlifyTransaction");return["eth_call",[i(r.transaction,{from:!0}),r.blockTag]]}case"estimateGas":{let i=Rn(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[i(r.transaction,{from:!0})]]}case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=O5(r.filter.address)),["eth_getLogs",[r.filter]];default:break}return null}perform(e,r){return Ch(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){let n=r.transaction;if(n&&n.type!=null&&De.from(n.type).isZero()&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){let o=yield this.getFeeData();o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(r=bi(r),r.transaction=bi(n),delete r.transaction.type)}}let i=this.prepareRequest(e,r);i==null&&so.throwError(e+" not implemented",ce.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(i[0],i[1])}catch(n){return O1e(e,n,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;let e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(i){function n(){e.send("eth_getFilterChanges",[i]).then(function(o){if(e._pendingFilter!=r)return null;let s=Promise.resolve();return o.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),s.then(function(){return P1e(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[i]);return}return setTimeout(function(){n()},0),null}).catch(o=>{})}return n(),i}).catch(i=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){let i=bi(rKe);if(r)for(let o in r)r[o]&&(i[o]=!0);zw(e,i);let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(o){if(e[o]==null)return;let s=Cf(De.from(e[o]));o==="gasLimit"&&(o="gas"),n[o]=s}),["from","to","data"].forEach(function(o){e[o]!=null&&(n[o]=Ue(e[o]))}),e.accessList&&(n.accessList=vc(e.accessList)),n}};var _3=null;try{if(_3=WebSocket,_3==null)throw new Error("inject please")}catch{let e=new ce(ki);_3=function(){e.throwError("WebSockets not supported in this environment",ce.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var EL=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},bE=new ce(ki),iKe=1,Sh=class extends ka{constructor(e,r){r==="any"&&bE.throwError("WebSocketProvider does not support 'any' network yet",ce.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof e=="string"?super(e,r):super("_websocket",r),this._pollingInterval=-1,this._wsReady=!1,typeof e=="string"?_e(this,"_websocket",new _3(this.connection.url)):_e(this,"_websocket",e),_e(this,"_requests",{}),_e(this,"_subs",{}),_e(this,"_subIds",{}),_e(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(n=>{this.websocket.send(this._requests[n].payload)})},this.websocket.onmessage=n=>{let o=n.data,s=JSON.parse(o);if(s.id!=null){let a=String(s.id),c=this._requests[a];if(delete this._requests[a],s.result!==void 0)c.callback(null,s.result),this.emit("debug",{action:"response",request:JSON.parse(c.payload),response:s.result,provider:this});else{let h=null;s.error?(h=new Error(s.error.message||"unknown error"),_e(h,"code",s.error.code||null),_e(h,"response",o)):h=new Error("unknown error"),c.callback(h,void 0),this.emit("debug",{action:"response",error:h,request:JSON.parse(c.payload),provider:this})}}else if(s.method==="eth_subscription"){let a=this._subs[s.params.subscription];a&&a.processFunc(s.params.result)}else console.warn("this should not happen")};let i=setInterval(()=>{this.emit("poll")},1e3);i.unref&&i.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){bE.throwError("cannot reset events block on WebSocketProvider",ce.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){bE.throwError("cannot set polling interval on WebSocketProvider",ce.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return EL(this,void 0,void 0,function*(){return null})}set polling(e){!e||bE.throwError("cannot set polling on WebSocketProvider",ce.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,r){let i=iKe++;return new Promise((n,o)=>{function s(c,h){return c?o(c):n(h)}let a=JSON.stringify({method:e,params:r,id:i,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(i)]={callback:s,payload:a},this._wsReady&&this.websocket.send(a)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,r,i){return EL(this,void 0,void 0,function*(){let n=this._subIds[e];n==null&&(n=Promise.all(r).then(s=>this.send("eth_subscribe",s)),this._subIds[e]=n);let o=yield n;this._subs[o]={tag:e,processFunc:i}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],r=>{let i=De.from(r.number).toNumber();this._emitted.block=i,this.emit("block",i)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(e.filter,this.formatter.filterLog(r))});break;case"tx":{let r=i=>{let n=i.hash;this.getTransactionReceipt(n).then(o=>{!o||this.emit(n,o)})};r(e),this._subscribe("tx",["newHeads"],i=>{this._events.filter(n=>n.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}}_stopEvent(e){let r=e.tag;if(e.type==="tx"){if(this._events.filter(n=>n.type==="tx").length)return;r="tx"}else if(this.listenerCount(e.event))return;let i=this._subIds[r];!i||(delete this._subIds[r],i.then(n=>{!this._subs[n]||(delete this._subs[n],this.send("eth_unsubscribe",[n]))}))}destroy(){return EL(this,void 0,void 0,function*(){this.websocket.readyState===_3.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}};var nKe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},D5=new ce(ki),L5=class extends ka{detectNetwork(){let e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return nKe(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||D5.throwError("no network detected",ce.errors.UNKNOWN_ERROR,{}),this._network==null&&(_e(this,"_network",r),this.emit("network",r,null))),r})}},Uo=class extends L5{constructor(e,r){D5.checkAbstract(new.target,Uo),e=Rn(new.target,"getNetwork")(e),r=Rn(new.target,"getApiKey")(r);let i=Rn(new.target,"getUrl")(e,r);super(i,e),typeof r=="string"?_e(this,"apiKey",r):r!=null&&Object.keys(r).forEach(n=>{_e(this,n,r[n])})}_startPending(){D5.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return D5.throwError("API provider does not support signing",ce.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,r){return D5.throwError("not implemented; sub-classes must override getUrl",ce.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}};var M1e=new ce(ki),yE="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",B5=class extends Sh{constructor(e,r){let i=new E3(e,r),n=i.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(n,i.network),_e(this,"apiKey",i.apiKey)}isCommunityResource(){return this.apiKey===yE}},E3=class extends Uo{static getWebSocketProvider(e,r){return new B5(e,r)}static getApiKey(e){return e==null?yE:(e&&typeof e!="string"&&M1e.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,r){let i=null;switch(e.name){case"homestead":i="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":i="eth-goerli.g.alchemy.com/v2/";break;case"matic":i="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":i="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":i="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":i="arb-goerli.g.alchemy.com/v2/";break;case"optimism":i="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":i="opt-goerli.g.alchemy.com/v2/";break;default:M1e.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+i+r,throttleCallback:(n,o)=>(r===yE&&Ff(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===yE}};var oKe=new ce(ki),xE="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function sKe(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return oKe.throwArgumentError("unsupported network","name",t)}var U5=class extends Uo{isCommunityResource(){return this.apiKey===xE}static getApiKey(e){return e??xE}static getUrl(e,r){r==null&&(r=xE);let i={allowGzip:!0,url:"https://"+sKe(e.name)+r,throttleCallback:(n,o)=>(r.apiKey===xE&&Ff(),Promise.resolve(!0))};return r.projectSecret!=null&&(i.user="",i.password=r.projectSecret),i}};var aKe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},D1e=new ce(ki),F5=class extends Uo{static getApiKey(e){return e!=null&&D1e.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,r){let i=null;switch(e.name){case"homestead":i="https://cloudflare-eth.com/";break;default:D1e.throwArgumentError("unsupported network","network",arguments[0])}return i}perform(e,r){let i=Object.create(null,{perform:{get:()=>super.perform}});return aKe(this,void 0,void 0,function*(){return e==="getBlockNumber"?(yield i.perform.call(this,"getBlock",{blockTag:"latest"})).number:i.perform.call(this,e,r)})}};var _E=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},wp=new ce(ki);function L1e(t){let e={};for(let r in t){if(t[r]==null)continue;let i=t[r];r==="type"&&i===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?i=Cf(Ue(i)):r==="accessList"?i="["+vc(i).map(n=>`{address:"${n.address}",storageKeys:["${n.storageKeys.join('","')}"]}`).join(",")+"]":i=Ue(i),e[r]=i)}return e}function cKe(t){if(t.status==0&&(t.message==="No records found"||t.message==="No transactions found"))return t.result;if(t.status!=1||typeof t.message!="string"||!t.message.match(/^OK/)){let e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function B1e(t){if(t&&t.status==0&&t.message=="NOTOK"&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){let e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if(t.jsonrpc!="2.0"){let e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){let e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function U1e(t){if(t==="pending")throw new Error("pending not supported");return t==="latest"?t:parseInt(t.substring(2),16)}function AL(t,e,r){if(t==="call"&&e.code===ce.errors.SERVER_ERROR){let n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){let o=n.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),Qt(o))return o;wp.throwError("missing revert data in call exception",ce.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let i=e.message;throw e.code===ce.errors.SERVER_ERROR&&(e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText)),i=(i||"").toLowerCase(),i.match(/insufficient funds/)&&wp.throwError("insufficient funds for intrinsic transaction cost",ce.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&wp.throwError("nonce has already been used",ce.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/another transaction with same nonce/)&&wp.throwError("replacement fee too low",ce.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/execution failed due to an exception|execution reverted/)&&wp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ce.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}var j5=class extends jf{constructor(e,r){super(e),_e(this,"baseUrl",this.getBaseUrl()),_e(this,"apiKey",r||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";default:}return wp.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,r){let i=Object.keys(r).reduce((o,s)=>{let a=r[s];return a!=null&&(o+=`&${s}=${a}`),o},""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${i}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}fetch(e,r,i){return _E(this,void 0,void 0,function*(){let n=i?this.getPostUrl():this.getUrl(e,r),o=i?this.getPostData(e,r):null,s=e==="proxy"?B1e:cKe;this.emit("debug",{action:"request",request:n,provider:this});let a={url:n,throttleSlotInterval:1e3,throttleCallback:(g,w)=>(this.isCommunityResource()&&Ff(),Promise.resolve(!0))},c=null;o&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},c=Object.keys(o).map(g=>`${g}=${o[g]}`).join("&"));let h=yield lu(a,c,s||B1e);return this.emit("debug",{action:"response",request:n,response:Tn(h),provider:this}),h})}detectNetwork(){return _E(this,void 0,void 0,function*(){return this.network})}perform(e,r){let i=Object.create(null,{perform:{get:()=>super.perform}});return _E(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(n=>AL("sendTransaction",n,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");let n=L1e(r.transaction);n.module="proxy",n.action="eth_call";try{return yield this.fetch("proxy",n,!0)}catch(o){return AL("call",o,r.transaction)}}case"estimateGas":{let n=L1e(r.transaction);n.module="proxy",n.action="eth_estimateGas";try{return yield this.fetch("proxy",n,!0)}catch(o){return AL("estimateGas",o,r.transaction)}}case"getLogs":{let n={action:"getLogs"};if(r.filter.fromBlock&&(n.fromBlock=U1e(r.filter.fromBlock)),r.filter.toBlock&&(n.toBlock=U1e(r.filter.toBlock)),r.filter.address&&(n.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&wp.throwError("unsupported topic count",ce.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){let a=r.filter.topics[0];(typeof a!="string"||a.length!==66)&&wp.throwError("unsupported topic format",ce.errors.UNSUPPORTED_OPERATION,{topic0:a}),n.topic0=a}let o=yield this.fetch("logs",n),s={};for(let a=0;a<o.length;a++){let c=o[a];if(c.blockHash==null){if(s[c.blockNumber]==null){let h=yield this.getBlock(c.blockNumber);h&&(s[c.blockNumber]=h.hash)}c.blockHash=s[c.blockNumber]}}return o}case"getEtherPrice":return this.network.name!=="homestead"?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd);default:break}return i.perform.call(this,e,r)})}getHistory(e,r,i){return _E(this,void 0,void 0,function*(){let n={action:"txlist",address:yield this.resolveName(e),startblock:r??0,endblock:i??99999999,sort:"asc"};return(yield this.fetch("account",n)).map(s=>{["contractAddress","to"].forEach(function(c){s[c]==""&&delete s[c]}),s.creates==null&&s.contractAddress!=null&&(s.creates=s.contractAddress);let a=this.formatter.transactionResponse(s);return s.timeStamp&&(a.timestamp=parseInt(s.timeStamp)),a})})}isCommunityResource(){return this.apiKey==null}};var CE=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},Km=new ce(ki);function EE(){return new Date().getTime()}function F1e(t){let e=null;for(let r=0;r<t.length;r++){let i=t[r];if(i==null)return null;e?e.name===i.name&&e.chainId===i.chainId&&(e.ensAddress===i.ensAddress||e.ensAddress==null&&i.ensAddress==null)||Km.throwArgumentError("provider mismatch","networks",t):e=i}return e}function j1e(t,e){t=t.slice().sort();let r=Math.floor(t.length/2);if(t.length%2)return t[r];let i=t[r-1],n=t[r];return e!=null&&Math.abs(i-n)>e?null:(i+n)/2}function A3(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(De.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>A3(e)));if(typeof t=="object"){let e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let i=t[r];return typeof i=="function"?i="[function]":i=A3(i),JSON.stringify(r)+":"+i}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}var lKe=1;function $1e(t){let e=null,r=null,i=new Promise(s=>{e=function(){r&&(clearTimeout(r),r=null),s()},r=setTimeout(e,t)}),n=s=>(i=i.then(s),i);function o(){return i}return{cancel:e,getPromise:o,wait:n}}var uKe=[ce.errors.CALL_EXCEPTION,ce.errors.INSUFFICIENT_FUNDS,ce.errors.NONCE_EXPIRED,ce.errors.REPLACEMENT_UNDERPRICED,ce.errors.UNPREDICTABLE_GAS_LIMIT],fKe=["address","args","errorArgs","errorSignature","method","transaction"];function AE(t,e){let r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function hKe(t,e){return function(r){let i={};r.forEach(o=>{let s=t(o.result);i[s]||(i[s]={count:0,result:o.result}),i[s].count++});let n=Object.keys(i);for(let o=0;o<n.length;o++){let s=i[n[o]];if(s.count>=e)return s.result}}}function dKe(t,e,r){let i=A3;switch(e){case"getBlockNumber":return function(n){let o=n.map(a=>a.result),s=j1e(n.map(a=>a.result),2);if(s!=null)return s=Math.ceil(s),o.indexOf(s+1)>=0&&s++,s>=t._highestBlockNumber&&(t._highestBlockNumber=s),t._highestBlockNumber};case"getGasPrice":return function(n){let o=n.map(s=>s.result);return o.sort(),o[Math.floor(o.length/2)]};case"getEtherPrice":return function(n){return j1e(n.map(o=>o.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":i=function(n){return n==null?null:(n=bi(n),n.confirmations=-1,A3(n))};break;case"getBlock":r.includeTransactions?i=function(n){return n==null?null:(n=bi(n),n.transactions=n.transactions.map(o=>(o=bi(o),o.confirmations=-1,o)),A3(n))}:i=function(n){return n==null?null:A3(n)};break;default:throw new Error("unknown method: "+e)}return hKe(i,t.quorum)}function $5(t,e){return CE(this,void 0,void 0,function*(){let r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:uu(()=>new Promise((i,n)=>{setTimeout(function(){return r.blockNumber>=e?i(r):t.cancelled?i(null):i(void 0)},0)}),{oncePoll:r})})}function pKe(t,e,r,i){return CE(this,void 0,void 0,function*(){let n=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return n[r]();case"getEtherPrice":if(n.getEtherPrice)return n.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),n[r](i.address,i.blockTag||"latest");case"getStorageAt":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),n.getStorageAt(i.address,i.position,i.blockTag||"latest");case"getBlock":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),n[i.includeTransactions?"getBlockWithTransactions":"getBlock"](i.blockTag||i.blockHash);case"call":case"estimateGas":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),r==="call"&&i.blockTag?n[r](i.transaction,i.blockTag):n[r](i.transaction);case"getTransaction":case"getTransactionReceipt":return n[r](i.transactionHash);case"getLogs":{let o=i.filter;return(o.fromBlock&&Qt(o.fromBlock)||o.toBlock&&Qt(o.toBlock))&&(n=yield $5(t,e)),n.getLogs(o)}}return Km.throwError("unknown method error",ce.errors.UNKNOWN_ERROR,{method:r,params:i})})}var W5=class extends jf{constructor(e,r){e.length===0&&Km.throwArgumentError("missing providers","providers",e);let i=e.map((s,a)=>{if(Ia.isProvider(s)){let g=k5(s)?2e3:750;return Object.freeze({provider:s,weight:1,stallTimeout:g,priority:1})}let c=bi(s);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=k5(s)?2e3:750),c.weight==null&&(c.weight=1);let h=c.weight;return(h%1||h>512||h<1)&&Km.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,h),Object.freeze(c)}),n=i.reduce((s,a)=>s+a.weight,0);r==null?r=n/2:r>n&&Km.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let o=F1e(i.map(s=>s.provider.network));o==null&&(o=new Promise((s,a)=>{setTimeout(()=>{this.detectNetwork().then(s,a)},0)})),super(o),_e(this,"providerConfigs",Object.freeze(i)),_e(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return CE(this,void 0,void 0,function*(){let e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return F1e(e)})}perform(e,r){return CE(this,void 0,void 0,function*(){if(e==="sendTransaction"){let c=yield Promise.all(this.providerConfigs.map(h=>h.provider.sendTransaction(r.signedTransaction).then(g=>g.hash,g=>g)));for(let h=0;h<c.length;h++){let g=c[h];if(typeof g=="string")return g}throw c[0]}this._highestBlockNumber===-1&&e!=="getBlockNumber"&&(yield this.getBlockNumber());let i=dKe(this,e,r),n=C5(this.providerConfigs.map(bi));n.sort((c,h)=>c.priority-h.priority);let o=this._highestBlockNumber,s=0,a=!0;for(;;){let c=EE(),h=n.filter(E=>E.runner&&c-E.start<E.stallTimeout).reduce((E,I)=>E+I.weight,0);for(;h<this.quorum&&s<n.length;){let E=n[s++],I=lKe++;E.start=EE(),E.staller=$1e(E.stallTimeout),E.staller.wait(()=>{E.staller=null}),E.runner=pKe(E,o,e,r).then(k=>{E.done=!0,E.result=k,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:I,backend:AE(E,EE()),request:{method:e,params:Tn(r)},provider:this})},k=>{E.done=!0,E.error=k,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:I,backend:AE(E,EE()),request:{method:e,params:Tn(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:I,backend:AE(E,null),request:{method:e,params:Tn(r)},provider:this}),h+=E.weight}let g=[];n.forEach(E=>{E.done||!E.runner||(g.push(E.runner),E.staller&&g.push(E.staller.getPromise()))}),g.length&&(yield Promise.race(g));let w=n.filter(E=>E.done&&E.error==null);if(w.length>=this.quorum){let E=i(w);if(E!==void 0)return n.forEach(I=>{I.staller&&I.staller.cancel(),I.cancelled=!0}),E;a||(yield $1e(100).getPromise()),a=!1}let A=n.reduce((E,I)=>{if(!I.done||I.error==null)return E;let k=I.error.code;return uKe.indexOf(k)>=0&&(E[k]||(E[k]={error:I.error,weight:0}),E[k].weight+=I.weight),E},{});if(Object.keys(A).forEach(E=>{let I=A[E];if(I.weight<this.quorum)return;n.forEach(j=>{j.staller&&j.staller.cancel(),j.cancelled=!0});let k=I.error,M={};fKe.forEach(j=>{k[j]!=null&&(M[j]=k[j])}),Km.throwError(k.reason||k.message,E,M)}),n.filter(E=>!E.done).length===0)break}return n.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),Km.throwError("failed to meet quorum",ce.errors.SERVER_ERROR,{method:e,params:r,results:n.map(c=>AE(c)),provider:this})})}};var CL=null;var SE=new ce(ki),q5="84842078b09946638c03157f83405213",H5=class extends Sh{constructor(e,r){let i=new C3(e,r),n=i.connection;n.password&&SE.throwError("INFURA WebSocket project secrets unsupported",ce.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});let o=n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,e),_e(this,"apiKey",i.projectId),_e(this,"projectId",i.projectId),_e(this,"projectSecret",i.projectSecret)}isCommunityResource(){return this.projectId===q5}},C3=class extends Uo{static getWebSocketProvider(e,r){return new H5(e,r)}static getApiKey(e){let r={apiKey:q5,projectId:q5,projectSecret:null};return e==null||(typeof e=="string"?r.projectId=e:e.projectSecret!=null?(SE.assertArgument(typeof e.projectId=="string","projectSecret requires a projectId","projectId",e.projectId),SE.assertArgument(typeof e.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),r.projectId=e.projectId,r.projectSecret=e.projectSecret):e.projectId&&(r.projectId=e.projectId),r.apiKey=r.projectId),r}static getUrl(e,r){let i=null;switch(e?e.name:"unknown"){case"homestead":i="mainnet.infura.io";break;case"goerli":i="goerli.infura.io";break;case"sepolia":i="sepolia.infura.io";break;case"matic":i="polygon-mainnet.infura.io";break;case"maticmum":i="polygon-mumbai.infura.io";break;case"optimism":i="optimism-mainnet.infura.io";break;case"optimism-goerli":i="optimism-goerli.infura.io";break;case"arbitrum":i="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":i="arbitrum-goerli.infura.io";break;default:SE.throwError("unsupported network",ce.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n={allowGzip:!0,url:"https://"+i+"/v3/"+r.projectId,throttleCallback:(o,s)=>(r.projectId===q5&&Ff(),Promise.resolve(!0))};return r.projectSecret!=null&&(n.user="",n.password=r.projectSecret),n}isCommunityResource(){return this.projectId===q5}};var IE=class extends ka{send(e,r){let i={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);let n={request:i,resolve:null,reject:null},o=new Promise((s,a)=>{n.resolve=s,n.reject=a});return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{let s=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;let a=s.map(c=>c.request);return this.emit("debug",{action:"requestBatch",request:Tn(a),provider:this}),lu(this.connection,JSON.stringify(a)).then(c=>{this.emit("debug",{action:"response",request:a,response:c,provider:this}),s.forEach((h,g)=>{let w=c[g];if(w.error){let A=new Error(w.error.message);A.code=w.error.code,A.data=w.error.data,h.reject(A)}else h.resolve(w.result)})},c=>{this.emit("debug",{action:"response",error:c,request:a,provider:this}),s.forEach(h=>{h.reject(c)})})},10)),o}};var SL=new ce(ki),mKe="ETHERS_JS_SHARED",z5=class extends Uo{static getApiKey(e){return e&&typeof e!="string"&&SL.throwArgumentError("invalid apiKey","apiKey",e),e||mKe}static getUrl(e,r){SL.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let i=null;switch(e.name){case"homestead":i="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":i="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":i="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":i="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":i="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:SL.throwArgumentError("unsupported network","network",arguments[0])}return i+"?apiKey="+r}};var W1e=new ce(ki),q1e="62e1ad51b37b8e00394bda3b",V5=class extends Uo{static getApiKey(e){let r={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return e==null?r.applicationId=q1e:typeof e=="string"?r.applicationId=e:e.applicationSecretKey!=null?(r.applicationId=e.applicationId,r.applicationSecretKey=e.applicationSecretKey):e.applicationId?r.applicationId=e.applicationId:W1e.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),r}static getUrl(e,r){let i=null;switch(e?e.name:"unknown"){case"goerli":i="eth-goerli.gateway.pokt.network";break;case"homestead":i="eth-mainnet.gateway.pokt.network";break;case"kovan":i="poa-kovan.gateway.pokt.network";break;case"matic":i="poly-mainnet.gateway.pokt.network";break;case"maticmum":i="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":i="eth-rinkeby.gateway.pokt.network";break;case"ropsten":i="eth-ropsten.gateway.pokt.network";break;default:W1e.throwError("unsupported network",ce.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n=`https://${i}/v1/lb/${r.applicationId}`,o={headers:{},url:n};return r.applicationSecretKey!=null&&(o.user="",o.password=r.applicationSecretKey),o}isCommunityResource(){return this.applicationId===q1e}};var H1e=new ce(ki),gKe=1;function z1e(t,e){let r="Web3LegacyFetcher";return function(i,n){let o={method:i,params:n,id:gKe++,jsonrpc:"2.0"};return new Promise((s,a)=>{this.emit("debug",{action:"request",fetcher:r,request:Tn(o),provider:this}),e(o,(c,h)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:o,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:h,provider:this}),h.error){let g=new Error(h.error.message);return g.code=h.error.code,g.data=h.error.data,a(g)}s(h.result)})})}}function wKe(t){return function(e,r){r==null&&(r=[]);let i={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Tn(i),provider:this}),t.request(i).then(n=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:n,provider:this}),n),n=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:n,provider:this}),n})}}var K5=class extends ka{constructor(e,r){e==null&&H1e.throwArgumentError("missing provider","provider",e);let i=null,n=null,o=null;typeof e=="function"?(i="unknown:",n=e):(i=e.host||e.path||"",!i&&e.isMetaMask&&(i="metamask"),o=e,e.request?(i===""&&(i="eip-1193:"),n=wKe(e)):e.sendAsync?n=z1e(e,e.sendAsync.bind(e)):e.send?n=z1e(e,e.send.bind(e)):H1e.throwArgumentError("unsupported provider","provider",e),i||(i="unknown:")),super(i,r),_e(this,"jsonRpcFetchFunc",n),_e(this,"provider",o)}send(e,r){return this.jsonRpcFetchFunc(e,r)}};var V1e=new ce(ki);function TE(t,e){if(t==null&&(t="homestead"),typeof t=="string"){let i=t.match(/^(ws|http)s?:/i);if(i)switch(i[1].toLowerCase()){case"http":case"https":return new ka(t);case"ws":case"wss":return new Sh(t);default:V1e.throwArgumentError("unsupported URL scheme","network",t)}}let r=I5(t);return(!r||!r._defaultProvider)&&V1e.throwError("unsupported getDefaultProvider network",ce.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:W5,AlchemyProvider:E3,AnkrProvider:U5,CloudflareProvider:F5,EtherscanProvider:j5,InfuraProvider:C3,JsonRpcProvider:ka,NodesmithProvider:z5,PocketProvider:V5,Web3Provider:K5,IpcProvider:null},e)}var bc={};qr(bc,{AbiCoder:()=>Jw,ConstructorFragment:()=>Es,ErrorFragment:()=>dc,EventFragment:()=>Qs,FormatTypes:()=>ui,Fragment:()=>Xs,FunctionFragment:()=>As,HDNode:()=>Bo,Indexed:()=>ph,Interface:()=>fp,LogDescription:()=>t3,Logger:()=>ce,ParamType:()=>dn,RLP:()=>A_,SigningKey:()=>ml,SupportedAlgorithm:()=>Bf,TransactionDescription:()=>r3,TransactionTypes:()=>eE,UnicodeNormalizationForm:()=>ea,Utf8ErrorFuncs:()=>U_,Utf8ErrorReason:()=>Cs,_TypedDataEncoder:()=>Nn,_fetchData:()=>dL,_toEscapedUtf8String:()=>vD,accessListify:()=>vc,arrayify:()=>Pe,base58:()=>bh,base64:()=>AD,checkProperties:()=>zw,checkResultErrors:()=>Kw,commify:()=>eme,computeAddress:()=>gl,computeHmac:()=>yh,computePublicKey:()=>v5,concat:()=>Hr,deepCopy:()=>Tn,defaultAbiCoder:()=>d5,defaultPath:()=>xh,defineReadOnly:()=>_e,dnsEncode:()=>m5,entropyToMnemonic:()=>Vm,fetchJson:()=>lu,formatBytes32String:()=>bD,formatEther:()=>tme,formatUnits:()=>IL,getAccountPath:()=>Vpe,getAddress:()=>Vr,getContractAddress:()=>Bm,getCreate2Address:()=>ade,getIcapAddress:()=>sde,getJsonWalletAddress:()=>cL,getStatic:()=>Rn,hashMessage:()=>e3,hexConcat:()=>no,hexDataLength:()=>_s,hexDataSlice:()=>zi,hexStripZeros:()=>aD,hexValue:()=>Cf,hexZeroPad:()=>Jr,hexlify:()=>Ue,id:()=>pc,isAddress:()=>ode,isBytes:()=>cl,isBytesLike:()=>uh,isHexString:()=>Qt,isValidMnemonic:()=>zpe,isValidName:()=>SD,joinSignature:()=>i5,keccak256:()=>zr,mnemonicToEntropy:()=>m3,mnemonicToSeed:()=>tL,namehash:()=>up,nameprep:()=>ED,parseBytes32String:()=>yD,parseEther:()=>rme,parseTransaction:()=>tE,parseUnits:()=>TL,poll:()=>uu,randomBytes:()=>Uf,recoverAddress:()=>$m,recoverPublicKey:()=>X_,resolveProperties:()=>Vi,ripemd160:()=>_5,serializeTransaction:()=>b5,sha256:()=>Ra,sha512:()=>JD,shallowCopy:()=>bi,shuffled:()=>C5,solidityKeccak256:()=>Y1e,solidityPack:()=>kE,soliditySha256:()=>Z1e,splitSignature:()=>Sf,stripZeros:()=>fc,toUtf8Bytes:()=>gi,toUtf8CodePoints:()=>lp,toUtf8String:()=>Sa,verifyMessage:()=>l1e,verifyTypedData:()=>u1e,zeroPad:()=>Om});var K1e="solidity/5.7.0";var vKe=new RegExp("^bytes([0-9]+)$"),bKe=new RegExp("^(u?int)([0-9]*)$"),yKe=new RegExp("^(.*)\\[([0-9]*)\\]$"),xKe="0000000000000000000000000000000000000000000000000000000000000000",S3=new ce(K1e);function G1e(t,e,r){switch(t){case"address":return r?Om(e,32):Pe(e);case"string":return gi(e);case"bytes":return Pe(e);case"bool":return e=e?"0x01":"0x00",r?Om(e,32):Pe(e)}let i=t.match(bKe);if(i){let n=parseInt(i[2]||"256");return(i[2]&&String(n)!==i[2]||n%8!==0||n===0||n>256)&&S3.throwArgumentError("invalid number type","type",t),r&&(n=256),e=De.from(e).toTwos(n),Om(e,n/8)}if(i=t.match(vKe),i){let n=parseInt(i[1]);return(String(n)!==i[1]||n===0||n>32)&&S3.throwArgumentError("invalid bytes type","type",t),Pe(e).byteLength!==n&&S3.throwArgumentError(`invalid value for ${t}`,"value",e),r?Pe((e+xKe).substring(0,66)):e}if(i=t.match(yKe),i&&Array.isArray(e)){let n=i[1];parseInt(i[2]||String(e.length))!=e.length&&S3.throwArgumentError(`invalid array length for ${t}`,"value",e);let s=[];return e.forEach(function(a){s.push(G1e(n,a,!0))}),Hr(s)}return S3.throwArgumentError("invalid type","type",t)}function kE(t,e){t.length!=e.length&&S3.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);let r=[];return t.forEach(function(i,n){r.push(G1e(i,e[n]))}),Ue(Hr(r))}function Y1e(t,e){return zr(kE(t,e))}function Z1e(t,e){return Ra(kE(t,e))}var J1e="units/5.7.0";var Q1e=new ce(J1e),X1e=["wei","kwei","mwei","gwei","szabo","finney","ether"];function eme(t){let e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&Q1e.throwArgumentError("invalid value","value",t);let r=e[0],i="";for(r.substring(0,1)==="-"&&(i="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let n="";for(e.length===2&&(n="."+(e[1]||"0"));n.length>2&&n[n.length-1]==="0";)n=n.substring(0,n.length-1);let o=[];for(;r.length;)if(r.length<=3){o.unshift(r);break}else{let s=r.length-3;o.unshift(r.substring(s)),r=r.substring(0,s)}return i+o.join(",")+n}function IL(t,e){if(typeof e=="string"){let r=X1e.indexOf(e);r!==-1&&(e=3*r)}return Hw(t,e??18)}function TL(t,e){if(typeof t!="string"&&Q1e.throwArgumentError("value must be a string","value",t),typeof e=="string"){let r=X1e.indexOf(e);r!==-1&&(e=3*r)}return ul(t,e??18)}function tme(t){return IL(t,18)}function rme(t){return TL(t,18)}var NE="ethers/5.7.2";var ime=new ce(NE);try{let t=window;t._ethers==null&&(t._ethers=Ih)}catch{}var Ni={WALLET_ID:"@w3m/wallet_id",ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3};var Fo={getCaipDefaultChain(t){if(!!t)return{id:`${Je.EIP155}:${t.chainId}`,name:t.name,imageId:po.EIP155NetworkImageIds[t.chainId]}},hexStringToNumber(t){let e=t.startsWith("0x")?t.slice(2):t;return parseInt(e,16)},numberToHexString(t){return`0x${t.toString(16)}`},async getUserInfo(t){let[e,r]=await Promise.all([Fo.getAddress(t),Fo.getChainId(t)]);return{chainId:r,address:e}},async getChainId(t){let e=await t.request({method:"eth_chainId"});return Number(e)},async getAddress(t){let[e]=await t.request({method:"eth_accounts"});return e},async addEthereumChain(t,e){await t.request({method:"wallet_addEthereumChain",params:[{chainId:Fo.numberToHexString(e.chainId),rpcUrls:[e.rpcUrl],chainName:e.name,nativeCurrency:{name:e.currency,decimals:18,symbol:e.currency},blockExplorerUrls:[e.explorerUrl],iconUrls:[po.EIP155NetworkImageIds[e.chainId]]}]})}};cs();mn();var ao=er({provider:void 0,providerType:void 0,address:void 0,chainId:void 0,status:"reconnecting",isConnected:!1}),ht={state:ao,subscribeKey(t,e){return wi(ao,t,e)},subscribe(t){return jr(ao,()=>t(ao))},setProvider(t){t&&(ao.provider=Yo(t))},setProviderType(t){ao.providerType=t},setAddress(t){ao.address=t},setPreferredAccountType(t){ao.preferredAccountType=t},setChainId(t){ao.chainId=t},setStatus(t){ao.status=t},setIsConnected(t){ao.isConnected=t},setError(t){ao.error=t},reset(){ao.provider=void 0,ao.address=void 0,ao.chainId=void 0,ao.providerType=void 0,ao.status="disconnected",ao.isConnected=!1,ao.error=void 0,ao.preferredAccountType=void 0}};Ui();var PE=class extends zb{constructor(e){let{ethersConfig:r,siweConfig:i,chains:n,defaultChain:o,tokens:s,chainImages:a,_sdkVersion:c,...h}=e;if(!r)throw new Error("web3modal:constructor - ethersConfig is undefined");if(!h.projectId)throw new Error("web3modal:constructor - projectId is undefined");let g={switchCaipNetwork:async A=>{let E=Il.caipNetworkIdToNumber(A?.id);if(E)try{ht.setError(void 0),await this.switchNetwork(E)}catch(I){throw ht.setError(I),new Error("networkControllerClient:switchCaipNetwork - unable to switch chain")}},getApprovedCaipNetworksData:async()=>new Promise(async A=>{if(localStorage.getItem(Ni.WALLET_ID)?.includes(Je.WALLET_CONNECT_CONNECTOR_ID)){let I=await this.getWalletConnectProvider();if(!I)throw new Error("networkControllerClient:getApprovedCaipNetworks - provider is undefined");let k=I.signer?.session?.namespaces,M=k?.[Je.EIP155]?.methods,j=k?.[Je.EIP155]?.chains,W={supportsAllNetworks:M?.includes(Je.ADD_CHAIN_METHOD)??!1,approvedCaipNetworkIds:j};A(W)}else A({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})},w={connectWalletConnect:async A=>{let E=await this.getWalletConnectProvider();if(!E)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(E.on("display_uri",I=>{A(I)}),i?.options?.enabled){let{SIWEController:I,getDidChainId:k,getDidAddress:M}=await Promise.resolve().then(()=>(U0(),B0)),W=(await E.authenticate({nonce:await i.getNonce(),methods:OE.OPTIONAL_METHODS,...await i.getMessageParams()}))?.auths?.[0];if(W){let{p:G,s:Y}=W,te=k(G.iss),oe=M(G.iss);oe&&te&&I.setSession({address:oe,chainId:parseInt(te,10)});try{let Q=E.signer.client.formatAuthMessage({request:G,iss:G.iss});await I.verifyMessage({message:Q,signature:Y.s,cacao:W})}catch(Q){throw console.error("Error verifying message",Q),await E.disconnect().catch(console.error),await I.signOut().catch(console.error),Q}}}else await E.connect();await this.setWalletConnectProvider()},connectExternal:async({id:A,info:E,provider:I})=>{if(A===Je.INJECTED_CONNECTOR_ID){let k=r.injected;if(!k)throw new Error("connectionControllerClient:connectInjected - provider is undefined");try{ht.setError(void 0),await k.request({method:"eth_requestAccounts"}),this.setInjectedProvider(r)}catch(M){ht.setError(M)}}else if(A===Je.EIP6963_CONNECTOR_ID&&E&&I){try{ht.setError(void 0),await I.request({method:"eth_requestAccounts"})}catch(k){ht.setError(k)}this.setEIP6963Provider(I,E.name)}else if(A===Je.COINBASE_SDK_CONNECTOR_ID){let k=r.coinbase;if(!k)throw new Error("connectionControllerClient:connectCoinbase - connector is undefined");try{ht.setError(void 0),await k.request({method:"eth_requestAccounts"}),this.setCoinbaseProvider(r)}catch(M){throw ht.setError(M),new Error(M.message)}}},checkInstalled:A=>A?r.injected&&!window?.ethereum?!1:A.some(E=>Boolean(window.ethereum?.[String(E)])):Boolean(window.ethereum),disconnect:async()=>{let A=ht.state.provider,E=ht.state.providerType;if(localStorage.removeItem(Ni.WALLET_ID),ht.reset(),i?.options?.signOutOnDisconnect){let{SIWEController:I}=await Promise.resolve().then(()=>(U0(),B0));await I.signOut()}E===Je.WALLET_CONNECT_CONNECTOR_ID?await A.disconnect():A&&A.emit("disconnect")},signMessage:async A=>{let E=ht.state.provider;if(!E)throw new Error("connectionControllerClient:signMessage - provider is undefined");let I=bc.isHexString(A)?A:bc.hexlify(bc.toUtf8Bytes(A));return await E.request({method:"personal_sign",params:[I,this.getAddress()]})},parseUnits:(A,E)=>Ih.utils.parseUnits(A,E).toBigInt(),formatUnits:(A,E)=>Ih.utils.formatUnits(A,E),sendTransaction:async A=>{let E=ht.state.provider,I=ht.state.address;if(!E)throw new Error("connectionControllerClient:sendTransaction - provider is undefined");if(!I)throw new Error("connectionControllerClient:sendTransaction - address is undefined");let k={to:A.to,value:A.value,gasLimit:A.gas,gasPrice:A.gasPrice,data:A.data,type:0};return(await(await new Ih.providers.Web3Provider(E).getSigner().sendTransaction(k)).wait())?.blockHash||null}};super({networkControllerClient:g,connectionControllerClient:w,siweControllerClient:i,defaultChain:Fo.getCaipDefaultChain(o),tokens:mT.getCaipTokens(s),_sdkVersion:c??`html-ethers5-${Je.VERSION}`,...h}),this.hasSyncedConnectedAccount=!1,this.EIP6963Providers=[],this.options=void 0,this.options=e,this.metadata=r.metadata,this.projectId=h.projectId,this.chains=n,this.createProvider(),ht.subscribeKey("address",()=>{this.syncAccount()}),ht.subscribeKey("chainId",()=>{this.syncNetwork(a)}),this.syncRequestedNetworks(n,a),this.syncConnectors(r),r.injected&&this.checkActiveInjectedProvider(r),r.coinbase&&this.checkActiveCoinbaseProvider(r),typeof window<"u"&&(this.listenConnectors(!0),this.checkActive6963Provider()),this.setEIP6963Enabled(r.EIP6963)}getState(){let e=super.getState();return{...e,selectedNetworkId:Il.caipNetworkIdToNumber(e.selectedNetworkId)}}subscribeState(e){return super.subscribeState(r=>e({...r,selectedNetworkId:Il.caipNetworkIdToNumber(r.selectedNetworkId)}))}setAddress(e){let r=e?bc.getAddress(e):void 0;ht.setAddress(r)}getAddress(){let{address:e}=ht.state;return e&&bc.getAddress(e)}getError(){return ht.state.error}getChainId(){return ht.state.chainId}getStatus(){return ht.state.status}getIsConnected(){return ht.state.isConnected}getWalletProvider(){return ht.state.provider}getWalletProviderType(){return ht.state.providerType}subscribeProvider(e){return ht.subscribe(e)}async disconnect(){let{provider:e,providerType:r}=ht.state;localStorage.removeItem(Ni.WALLET_ID),ht.reset(),r==="injected"||r==="eip6963"?e?.emit("disconnect"):await e.disconnect()}createProvider(){return!this.walletConnectProviderInitPromise&&typeof window<"u"&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider()),this.walletConnectProviderInitPromise}async initWalletConnectProvider(){let e={projectId:this.projectId,showQrModal:!1,rpcMap:this.chains?this.chains.reduce((r,i)=>(r[i.chainId]=i.rpcUrl,r),{}):{},optionalChains:[...this.chains.map(r=>r.chainId)],metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]}};this.walletConnectProvider=await OE.default.init(e),await this.checkActiveWalletConnectProvider()}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{ht.setError(void 0),await this.createProvider()}catch(e){ht.setError(e)}return this.walletConnectProvider}syncRequestedNetworks(e,r){let i=e?.map(n=>({id:`${Je.EIP155}:${n.chainId}`,name:n.name,imageId:po.EIP155NetworkImageIds[n.chainId],imageUrl:r?.[n.chainId]}));this.setRequestedCaipNetworks(i??[])}async checkActiveWalletConnectProvider(){let e=await this.getWalletConnectProvider(),r=localStorage.getItem(Ni.WALLET_ID);e&&r===Je.WALLET_CONNECT_CONNECTOR_ID&&await this.setWalletConnectProvider();let i=ht.state.isConnected;ht.setStatus(i?"connected":"disconnected")}checkActiveInjectedProvider(e){let r=e.injected,i=localStorage.getItem(Ni.WALLET_ID);r&&i===Je.INJECTED_CONNECTOR_ID&&(this.setInjectedProvider(e),this.watchInjected(e))}checkActiveCoinbaseProvider(e){let r=e.coinbase,i=localStorage.getItem(Ni.WALLET_ID);r&&i===Je.COINBASE_SDK_CONNECTOR_ID&&(r._addresses&&r._addresses?.length>0?(this.setCoinbaseProvider(e),this.watchCoinbase(e)):(localStorage.removeItem(Ni.WALLET_ID),ht.reset()))}checkActive6963Provider(){let e=window?.localStorage.getItem(Ni.WALLET_ID);if(e){let r=this.EIP6963Providers.find(i=>i.info.name===e);r&&this.setEIP6963Provider(r.provider,r.info.name)}}async setWalletConnectProvider(){window?.localStorage.setItem(Ni.WALLET_ID,Je.WALLET_CONNECT_CONNECTOR_ID);let e=await this.getWalletConnectProvider();e&&(ht.setChainId(e.chainId),ht.setProviderType("walletConnect"),ht.setProvider(e),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(e.accounts?.[0]),this.watchWalletConnect())}async setEIP6963Provider(e,r){if(window?.localStorage.setItem(Ni.WALLET_ID,r),e){let{address:i,chainId:n}=await Fo.getUserInfo(e);i&&n&&(ht.setChainId(n),ht.setProviderType("eip6963"),ht.setProvider(e),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(i),this.watchEIP6963(e))}}async setInjectedProvider(e){window?.localStorage.setItem(Ni.WALLET_ID,Je.INJECTED_CONNECTOR_ID);let r=e.injected;if(r){let{address:i,chainId:n}=await Fo.getUserInfo(r);i&&n&&(ht.setChainId(n),ht.setProviderType("injected"),ht.setProvider(e.injected),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(i),this.watchCoinbase(e))}}async setCoinbaseProvider(e){window?.localStorage.setItem(Ni.WALLET_ID,Je.COINBASE_SDK_CONNECTOR_ID);let r=e.coinbase;if(r){let{address:i,chainId:n}=await Fo.getUserInfo(r);i&&n&&(ht.setChainId(n),ht.setProviderType("coinbaseWalletSDK"),ht.setProvider(e.coinbase),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(i),this.watchCoinbase(e))}}async watchWalletConnect(){let e=await this.getWalletConnectProvider();function r(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),e?.removeListener("disconnect",r),e?.removeListener("accountsChanged",n),e?.removeListener("chainChanged",i)}function i(o){if(o){let s=Fo.hexStringToNumber(o);ht.setChainId(s)}}let n=async o=>{o.length>0&&await this.setWalletConnectProvider()};e&&(e.on("disconnect",r),e.on("accountsChanged",n),e.on("chainChanged",i))}watchInjected(e){let r=e.injected;function i(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),r?.removeListener("disconnect",i),r?.removeListener("accountsChanged",n),r?.removeListener("chainChanged",o)}function n(s){let a=s?.[0];a?ht.setAddress(bc.getAddress(a)):(localStorage.removeItem(Ni.WALLET_ID),ht.reset())}function o(s){if(s){let a=typeof s=="string"?Fo.hexStringToNumber(s):Number(s);ht.setChainId(a)}}r&&(r.on("disconnect",i),r.on("accountsChanged",n),r.on("chainChanged",o))}watchEIP6963(e){function r(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),e.removeListener("disconnect",r),e.removeListener("accountsChanged",i),e.removeListener("chainChanged",n)}function i(o){let s=o?.[0];s?ht.setAddress(bc.getAddress(s)):(localStorage.removeItem(Ni.WALLET_ID),ht.reset())}function n(o){if(o){let s=typeof o=="string"?Fo.hexStringToNumber(o):Number(o);ht.setChainId(s)}}e.on("disconnect",r),e.on("accountsChanged",i),e.on("chainChanged",n)}watchCoinbase(e){let r=e.coinbase,i=localStorage.getItem(Ni.WALLET_ID);function n(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),r?.removeListener("disconnect",n),r?.removeListener("accountsChanged",o),r?.removeListener("chainChanged",s)}function o(a){a.length===0?(localStorage.removeItem(Ni.WALLET_ID),ht.reset()):ht.setAddress(a[0])}function s(a){if(a&&i===Je.COINBASE_SDK_CONNECTOR_ID){let c=Number(a);ht.setChainId(c)}}r&&(r.on("disconnect",n),r.on("accountsChanged",o),r.on("chainChanged",s))}async syncAccount(){let e=ht.state.address,r=ht.state.chainId,i=ht.state.isConnected;if(this.resetAccount(),i&&e&&r){let n=`${Je.EIP155}:${r}:${e}`;this.setIsConnected(i),this.setCaipAddress(n),this.syncConnectedWalletInfo(),await Promise.all([this.syncProfile(e),this.syncBalance(e),this.getApprovedCaipNetworksData()]),this.hasSyncedConnectedAccount=!0}else!i&&this.hasSyncedConnectedAccount&&(this.resetWcConnection(),this.resetNetwork())}async syncNetwork(e){let r=ht.state.address,i=ht.state.chainId,n=ht.state.isConnected;if(this.chains){let o=this.chains.find(s=>s.chainId===i);if(o){let s=`${Je.EIP155}:${o.chainId}`;if(this.setCaipNetwork({id:s,name:o.name,imageId:po.EIP155NetworkImageIds[o.chainId],imageUrl:e?.[o.chainId]}),n&&r){let a=`${Je.EIP155}:${i}:${r}`;if(this.setCaipAddress(a),o.explorerUrl){let c=`${o.explorerUrl}/address/${r}`;this.setAddressExplorerUrl(c)}else this.setAddressExplorerUrl(void 0);this.hasSyncedConnectedAccount&&await this.syncBalance(r)}}else n&&this.setCaipNetwork({id:`${Je.EIP155}:${i}`})}}async syncProfile(e){let r=ht.state.chainId;try{let{name:i,avatar:n}=await this.fetchIdentity({address:e});this.setProfileName(i),this.setProfileImage(n)}catch{if(r===1){let i=new Ih.providers.InfuraProvider("mainnet"),n=await i.lookupAddress(e),o=await i.getAvatar(e);n&&this.setProfileName(n),o&&this.setProfileImage(o)}else this.setProfileName(null),this.setProfileImage(null)}}async syncBalance(e){let r=ht.state.chainId;if(r&&this.chains){let i=this.chains.find(n=>n.chainId===r);if(i){let n=new Ih.providers.JsonRpcProvider(i.rpcUrl,{chainId:r,name:i.name});if(n){let o=await n.getBalance(e),s=bc.formatEther(o);this.setBalance(s,i.currency)}}}}syncConnectedWalletInfo(){let e=window?.localStorage.getItem(Ni.WALLET_ID),r=ht.state.providerType;if(r===Je.EIP6963_CONNECTOR_ID){if(e){let i=this.EIP6963Providers.find(n=>n.info.name===e);i&&this.setConnectedWalletInfo({...i.info})}}else if(r===Je.WALLET_CONNECT_CONNECTOR_ID){let i=ht.state.provider;i.session&&this.setConnectedWalletInfo({...i.session.peer.metadata,name:i.session.peer.metadata.name,icon:i.session.peer.metadata.icons?.[0]})}else e&&this.setConnectedWalletInfo({name:e})}async switchNetwork(e){let r=ht.state.provider,i=ht.state.providerType;if(this.chains){let n=this.chains.find(o=>o.chainId===e);if(i===Je.WALLET_CONNECT_CONNECTOR_ID&&n){let o=r;if(o)try{await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Fo.numberToHexString(n.chainId)}]}),ht.setChainId(e)}catch(s){if(s.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Ni.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await Fo.addEthereumChain(o,n);else throw new Error("Chain is not supported")}}else if(i===Je.EIP6963_CONNECTOR_ID&&n){let o=r;if(o)try{await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Fo.numberToHexString(n.chainId)}]}),ht.setChainId(n.chainId)}catch(s){if(s.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Ni.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await Fo.addEthereumChain(o,n);else throw new Error("Chain is not supported")}}else if(i===Je.COINBASE_SDK_CONNECTOR_ID&&n){let o=r;if(o)try{await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Fo.numberToHexString(n.chainId)}]}),ht.setChainId(n.chainId)}catch(s){(s.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Ni.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)&&await Fo.addEthereumChain(o,n)}}}}syncConnectors(e){let r=[],i=po.ConnectorTypesMap[Je.WALLET_CONNECT_CONNECTOR_ID];if(i&&r.push({id:Je.WALLET_CONNECT_CONNECTOR_ID,explorerId:po.ConnectorExplorerIds[Je.WALLET_CONNECT_CONNECTOR_ID],imageId:po.ConnectorImageIds[Je.WALLET_CONNECT_CONNECTOR_ID],imageUrl:this.options?.connectorImages?.[Je.WALLET_CONNECT_CONNECTOR_ID],name:po.ConnectorNamesMap[Je.WALLET_CONNECT_CONNECTOR_ID],type:i}),e.injected){let n=po.ConnectorTypesMap[Je.INJECTED_CONNECTOR_ID];n&&r.push({id:Je.INJECTED_CONNECTOR_ID,explorerId:po.ConnectorExplorerIds[Je.INJECTED_CONNECTOR_ID],imageId:po.ConnectorImageIds[Je.INJECTED_CONNECTOR_ID],imageUrl:this.options?.connectorImages?.[Je.INJECTED_CONNECTOR_ID],name:po.ConnectorNamesMap[Je.INJECTED_CONNECTOR_ID],type:n})}e.coinbase&&r.push({id:Je.COINBASE_SDK_CONNECTOR_ID,explorerId:po.ConnectorExplorerIds[Je.COINBASE_SDK_CONNECTOR_ID],imageId:po.ConnectorImageIds[Je.COINBASE_SDK_CONNECTOR_ID],imageUrl:this.options?.connectorImages?.[Je.COINBASE_SDK_CONNECTOR_ID],name:po.ConnectorNamesMap[Je.COINBASE_SDK_CONNECTOR_ID],type:"EXTERNAL"}),this.setConnectors(r)}eip6963EventHandler(e){if(e.detail){let{info:r,provider:i}=e.detail,n=this.getConnectors(),o=n.find(c=>c.name===r.name),a=n.find(c=>c.id===Je.COINBASE_SDK_CONNECTOR_ID)&&e.detail.info.rdns===Je.CONNECTOR_RDNS_MAP[Je.COINBASE_SDK_CONNECTOR_ID];if(!o&&!a){let c=po.ConnectorTypesMap[Je.EIP6963_CONNECTOR_ID];if(c){this.addConnector({id:Je.EIP6963_CONNECTOR_ID,type:c,imageUrl:r.icon??this.options?.connectorImages?.[Je.EIP6963_CONNECTOR_ID],name:r.name,provider:i,info:r});let h={provider:i,info:r};this.EIP6963Providers.push(h)}}}}listenConnectors(e){if(typeof window<"u"&&e){let r=this.eip6963EventHandler.bind(this);window.addEventListener(Je.EIP6963_ANNOUNCE_EVENT,r),window.dispatchEvent(new Event(Je.EIP6963_REQUEST_EVENT))}}};WS();var r3e=Dr(t3e(),1);function nU(t){let{enableEIP6963:e=!0,enableInjected:r=!0,enableCoinbase:i=!0,metadata:n}=t,o,s,a={metadata:n};function c(){if(o)return o;if(!(typeof window>"u")&&!!window.ethereum)return o=window.ethereum,o}function h(){return s||(typeof window>"u"?void 0:(s=new r3e.CoinbaseWalletSDK({appName:n.name,appLogoUrl:n.icons[0],appChainIds:t.chains?.map(w=>w.chainId)||[1,84532]}).makeWeb3Provider({options:t.coinbasePreference||"all"}),s))}return i&&(a.coinbase=h()),r&&(a.injected=c()),e&&(a.EIP6963=!0),a}function i3e(t){return new PE({...t,_sdkVersion:`html-ethers5-${Je.VERSION}`})}var ZQe=(t=>(t.MissingApiKey="MISSING_API_KEY",t.ModalNotReady="MODAL_NOT_READY",t.MalformedResponse="MALFORMED_RESPONSE",t.InvalidArgument="INVALID_ARGUMENT",t.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",t.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",t))(ZQe||{}),JQe=(t=>(t.SyncWeb3Method="SYNC_WEB3_METHOD",t.DuplicateIframe="DUPLICATE_IFRAME",t.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",t.DeprecationNotice="DEPRECATION_NOTICE",t.ProductAnnouncement="ANNOUNCEMENT",t))(JQe||{}),QQe=(t=>(t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed",t[t.UserRequestEditEmail=-10005]="UserRequestEditEmail",t[t.InactiveRecipient=-10010]="InactiveRecipient",t[t.AccessDeniedToUser=-10011]="AccessDeniedToUser",t[t.RedirectLoginComplete=-10015]="RedirectLoginComplete",t))(QQe||{}),du=(t=>(t.PROVIDER="magic_3pw_provider",t.ADDRESS="magic_3pw_address",t.CHAIN_ID="magic_3pw_chainId",t))(du||{}),G3=(t=>(t.WalletConnected="wallet_connected",t.WalletRejected="wallet_rejected",t.Web3ModalSelected="web3modal_selected",t))(G3||{}),XQe=(t=>(t.LoginWithSms="magic_auth_login_with_sms",t.LoginWithEmailOTP="magic_auth_login_with_email_otp",t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.LoginWithCredential="magic_auth_login_with_credential",t.SetAuthorizationToken="magic_auth_set_authorization_token",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email",t.UserSettings="magic_auth_settings",t.UserSettingsTestMode="magic_auth_settings_testing_mode",t.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",t.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",t.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",t.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",t.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",t.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",t.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",t.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",t.LogoutTestMode="magic_auth_logout_testing_mode",t.UpdateEmailTestMode="magic_auth_update_email_testing_mode",t.IntermediaryEvent="magic_intermediary_event",t.RequestAccounts="eth_requestAccounts",t.GetInfo="magic_get_info",t.ShowUI="magic_wallet",t.NFTPurchase="magic_nft_purchase",t.NFTCheckout="magic_nft_checkout",t.NFTTransfer="magic_nft_transfer",t.RequestUserInfoWithUI="mc_request_user_info",t.Disconnect="mc_disconnect",t.RecoverAccount="magic_auth_recover_account",t.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",t.MagicBoxHeartBeat="magic_box_heart_beat",t.AutoConnect="mc_auto_connect",t.Login="mc_login",t.EncryptV1="magic_auth_encrypt_v1",t.DecryptV1="magic_auth_decrypt_v1",t.ShowNFTs="magic_show_nfts",t.ShowOnRamp="magic_show_fiat_onramp",t.ShowSendTokensUI="magic_show_send_tokens_ui",t.ShowAddress="magic_show_address",t.ShowBalances="magic_show_balances",t.SendGaslessTransaction="eth_sendGaslessTransaction",t.RevealPK="magic_reveal_key",t.EnableMFA="magic_auth_enable_mfa_flow",t.DisableMFA="magic_auth_disable_mfa_flow",t))(XQe||{});var eXe=(t=>(t.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",t.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",t.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",t.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",t.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",t.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",t.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",t.MAGIC_PONG="MAGIC_PONG",t.MAGIC_POPUP_RESPONSE="MAGIC_POPUP_RESPONSE",t.MAGIC_POPUP_OAUTH_VERIFY_RESPONSE="MAGIC_POPUP_OAUTH_VERIFY_RESPONSE",t))(eXe||{}),tXe=(t=>(t.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",t.MAGIC_PING="MAGIC_PING",t))(tXe||{}),rXe=(t=>(t.UpdateEmail="update-email",t.MFA="mfa",t.Recovery="recovery",t))(rXe||{}),iXe=(t=>(t.Retry="retry",t))(iXe||{}),nXe=(t=>(t.EmailSent="email-sent",t.EmailNotDeliverable="email-not-deliverable",t))(nXe||{}),oXe=(t=>(t.VerifyEmailOtp="verify-email-otp",t.VerifyMFACode="verify-mfa-code",t.LostDevice="lost-device",t.VerifyRecoveryCode="verify-recovery-code",t.Cancel="cancel",t))(oXe||{}),sXe=(t=>(t.VerifySmsOtp="verify-sms-otp",t.Cancel="cancel",t.Retry="retry",t))(sXe||{}),aXe=(t=>(t.SmsOTPSent="sms-otp-sent",t.InvalidSmsOtp="invalid-sms-otp",t.ExpiredSmsOtp="expired-sms-otp",t))(aXe||{}),cXe=(t=>(t.EmailOTPSent="email-otp-sent",t.InvalidEmailOtp="invalid-email-otp",t.InvalidMfaOtp="invalid-mfa-otp",t.ExpiredEmailOtp="expired-email-otp",t.MfaSentHandle="mfa-sent-handle",t.RecoveryCodeSentHandle="recovery-code-sent-handle",t.InvalidRecoveryCode="invalid-recovery-code",t.RecoveryCodeSuccess="recovery-code-success",t))(cXe||{}),lXe=(t=>(t.Retry="device-retry",t))(lXe||{}),uXe=(t=>(t.DeviceApproved="device-approved",t.DeviceNeedsApproval="device-needs-approval",t.DeviceVerificationLinkExpired="device-verification-link-expired",t.DeviceVerificationEmailSent="device-verification-email-sent",t))(uXe||{}),fXe=(t=>(t.Retry="Recency/auth-factor-retry",t.Cancel="Recency/auth-factor-verification-cancel",t.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",t.VerifyMFACode="Recency/verify-mfa-code",t))(fXe||{}),hXe=(t=>(t.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",t.PrimaryAuthFactorVerified="Recency/auth-factor-verified",t.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",t.EmailExpired="Recency/auth-factor-verification-email-expired",t.EmailSent="Recency/auth-factor-verification-email-sent",t.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",t))(hXe||{}),dXe=(t=>(t.RetryWithNewEmail="UpdateEmail/retry-with-new-email",t.Cancel="UpdateEmail/new-email-verification-cancel",t.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",t))(dXe||{}),pXe=(t=>(t.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",t.EmailUpdated="UpdateEmail/email-updated",t.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",t.EmailExpired="UpdateEmail/new-email-verification-email-expired",t.EmailSent="UpdateEmail/new-email-verification-email-sent",t.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",t.InvalidEmail="UpdateEmail/new-email-invalid",t.EmailAlreadyExists="UpdateEmail/new-email-already-exists",t))(pXe||{}),mXe=(t=>(t.IDTokenCreated="Auth/id-token-created",t))(mXe||{}),gXe=(t=>(t.Cancel="Farcaster/cancel",t))(gXe||{}),wXe=(t=>(t.MFASecretGenerated="mfa-secret-generated",t.InvalidMFAOtp="invalid-mfa-otp",t.MFARecoveryCodes="mfa-recovery-codes",t))(wXe||{}),vXe=(t=>(t.VerifyMFACode="verify-mfa-code",t.Cancel="cancel-mfa-setup",t))(vXe||{}),bXe=(t=>(t.MFACodeRequested="mfa-code-requested",t.InvalidMFAOtp="invalid-mfa-otp",t.InvalidRecoveryCode="invalid-recovery-code",t))(bXe||{}),yXe=(t=>(t.VerifyMFACode="verify-mfa-code",t.LostDevice="lost-device",t.Cancel="cancel-mfa-disable",t))(yXe||{}),xXe=(t=>(t.Harmony="HARMONY",t))(xXe||{}),_Xe=(t=>(t.ClosedByUser="closed-by-user",t))(_Xe||{}),EXe=(t=>(t.ClosedByUser="closed-by-user-on-received",t))(EXe||{}),AXe=(t=>(t.EnterNewPhoneNumber="enter-new-phone-number",t.EnterOtpCode="enter-otp-code",t.RecoveryFactorAlreadyExists="recovery-factor-already-exists",t.MalformedPhoneNumber="malformed-phone-number",t.InvalidOtpCode="invalid-otp-code",t))(AXe||{}),CXe=(t=>(t.SendNewPhoneNumber="send-new-phone-number",t.SendOtpCode="send-otp-code",t.Cancel="cancel",t.StartEditPhoneNumber="start-edit-phone-number",t))(CXe||{}),SXe=(t=>(t.PhoneNumber="phone_number",t))(SXe||{}),IXe=(t=>(t.SmsOtpSent="sms-otp-sent",t.LoginThrottled="login-throttled",t.InvalidSmsOtp="invalid-sms-otp",t.SmsVerified="sms-verified",t.AccountRecovered="account-recovered",t.UpdateEmailRequired="update-email-required",t))(IXe||{}),TXe=(t=>(t.Cancel="cancel",t.VerifyOtp="verify-otp-code",t.ResendSms="resend-sms-otp",t.UpdateEmail="update-email",t))(TXe||{}),RXe=(t=>(t.Success="nft-checkout-success",t.Failure="nft-checkout-failure",t.Initiated="nft-checkout-initiated",t.Disconnect="disconnect",t))(RXe||{}),kXe=(t=>(t.WalletInfoFetched="Wallet/wallet-info-fetched",t))(kXe||{}),NXe=(t=>(t.CloseMagicWindow="close-magic-window",t))(NXe||{});var WA=class extends n3e.Extension.Internal{constructor({configOptions:r,modalOptions:i}){super();this.name="web3modal";this.config={};this.modal=i3e(eS(XC({},i),{themeVariables:eS(XC({},i.themeVariables||{}),{"--w3m-z-index":3e9}),ethersConfig:nU(r)}));let n=this.modal.subscribeProvider(({status:o})=>{o==="connected"&&(n(),this.setIsConnected(),this.setEip1193EventListeners()),o==="disconnected"&&n()})}setIsConnected(){localStorage.setItem(du.PROVIDER,"web3modal"),localStorage.setItem(du.ADDRESS,this.modal.getAddress()),localStorage.setItem(du.CHAIN_ID,this.modal.getChainId().toString()),this.sdk.thirdPartyWallets.isConnected=!0}initialize(){this.sdk.thirdPartyWallets.enabledWallets.web3modal=!0,this.sdk.thirdPartyWallets.isConnected=Boolean(localStorage.getItem(du.ADDRESS)),this.sdk.thirdPartyWallets.eventListeners.push({event:G3.Web3ModalSelected,callback:r=>tS(this,null,function*(){yield this.connectToWeb3modal(r)})})}setEip1193EventListeners(){WA.eventsListenerAdded||(WA.eventsListenerAdded=!0,this.modal.subscribeProvider(({address:r,chainId:i})=>!r&&localStorage.getItem(du.ADDRESS)?(this.sdk.thirdPartyWallets.resetThirdPartyWalletState(),this.sdk.rpcProvider.emit("accountsChanged",[])):r&&r!==localStorage.getItem(du.ADDRESS)?(localStorage.setItem(du.ADDRESS,r),this.sdk.rpcProvider.emit("accountsChanged",[r])):i&&i!==Number(localStorage.getItem(du.CHAIN_ID))?(localStorage.setItem(du.CHAIN_ID,i.toString()),this.sdk.rpcProvider.emit("chainChanged",i)):null))}handleUserConnected(r,i=this.modal.getAddress()){this.setIsConnected(),this.createIntermediaryEvent(G3.WalletConnected,r)(i),this.setEip1193EventListeners()}connectToWeb3modal(r){let{modal:i}=this;return this.utils.createPromiEvent(()=>tS(this,null,function*(){try{i.getIsConnected()&&(yield i.disconnect())}catch(a){console.error(a)}let o=i.subscribeProvider(({address:a,error:c})=>{c&&(console.error("Provider event error:",c),o(),this.createIntermediaryEvent(G3.WalletRejected,r)()),a&&(this.handleUserConnected(r),o())}),s=i.subscribeEvents(a=>{a.data.event==="MODAL_CLOSE"&&(s(),o(),this.createIntermediaryEvent(G3.WalletRejected,r)())});i.open()}))}},xx=WA;xx.eventsListenerAdded=!1;var PXe=xx;return En(OXe);})();
9977
+ `)}static register(e,r){if(r||(r=e.locale),CVe)try{let i=window;i._ethers&&i._ethers.wordlists&&(i._ethers.wordlists[r]||_e(i._ethers.wordlists,r,e))}catch{}}};var SVe="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",E5=null;function $pe(t){if(E5==null&&(E5=SVe.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),wl.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw E5=null,new Error("BIP39 Wordlist for en (English) FAILED")}var QD=class extends wl{constructor(){super("en")}getWord(e){return $pe(this),E5[e]}getWordIndex(e){return $pe(this),E5.indexOf(e)}},XD=new QD;wl.register(XD);var zm={en:XD};var Wpe="hdnode/5.7.0";var A5=new ce(Wpe),IVe=De.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),TVe=gi("Bitcoin seed"),p3=2147483648;function Hpe(t){return(1<<t)-1<<8-t}function RVe(t){return(1<<t)-1}function aE(t){return Jr(Ue(t),32)}function qpe(t){return bh.encode(Hr([t,zi(Ra(Ra(t)),0,4)]))}function eL(t){if(t==null)return zm.en;if(typeof t=="string"){let e=zm[t];return e==null&&A5.throwArgumentError("unknown locale","wordlist",t),e}return t}var d3={},xh="m/44'/60'/0'/0/0",Bo=class{constructor(e,r,i,n,o,s,a,c){if(e!==d3)throw new Error("HDNode constructor cannot be called directly");if(r){let h=new ml(r);_e(this,"privateKey",h.privateKey),_e(this,"publicKey",h.compressedPublicKey)}else _e(this,"privateKey",null),_e(this,"publicKey",Ue(i));_e(this,"parentFingerprint",n),_e(this,"fingerprint",zi(_5(Ra(this.publicKey)),0,4)),_e(this,"address",gl(this.publicKey)),_e(this,"chainCode",o),_e(this,"index",s),_e(this,"depth",a),c==null?(_e(this,"mnemonic",null),_e(this,"path",null)):typeof c=="string"?(_e(this,"mnemonic",null),_e(this,"path",c)):(_e(this,"mnemonic",c),_e(this,"path",c.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return qpe(Hr([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",Ue(this.depth),this.parentFingerprint,Jr(Ue(this.index),4),this.chainCode,this.privateKey!=null?Hr(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Bo(d3,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~p3));let i=new Uint8Array(37);if(e&p3){if(!this.privateKey)throw new Error("cannot derive child of neutered node");i.set(Pe(this.privateKey),1),r&&(r+="'")}else i.set(Pe(this.publicKey));for(let w=24;w>=0;w-=8)i[33+(w>>3)]=e>>24-w&255;let n=Pe(yh(Bf.sha512,this.chainCode,i)),o=n.slice(0,32),s=n.slice(32),a=null,c=null;this.privateKey?a=aE(De.from(o).add(this.privateKey).mod(IVe)):c=new ml(Ue(o))._addPoint(this.publicKey);let h=r,g=this.mnemonic;return g&&(h=Object.freeze({phrase:g.phrase,path:r,locale:g.locale||"en"})),new Bo(d3,a,c,this.fingerprint,aE(s),e,this.depth+1,h)}derivePath(e){let r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let i=this;for(let n=0;n<r.length;n++){let o=r[n];if(o.match(/^[0-9]+'$/)){let s=parseInt(o.substring(0,o.length-1));if(s>=p3)throw new Error("invalid path index - "+o);i=i._derive(p3+s)}else if(o.match(/^[0-9]+$/)){let s=parseInt(o);if(s>=p3)throw new Error("invalid path index - "+o);i=i._derive(s)}else throw new Error("invalid path component - "+o)}return i}static _fromSeed(e,r){let i=Pe(e);if(i.length<16||i.length>64)throw new Error("invalid seed");let n=Pe(yh(Bf.sha512,TVe,i));return new Bo(d3,aE(n.slice(0,32)),null,"0x00000000",aE(n.slice(32)),0,0,r)}static fromMnemonic(e,r,i){return i=eL(i),e=Vm(m3(e,i),i),Bo._fromSeed(tL(e,r),{phrase:e,path:"m",locale:i.locale})}static fromSeed(e){return Bo._fromSeed(e,null)}static fromExtendedKey(e){let r=bh.decode(e);(r.length!==82||qpe(r.slice(0,78))!==e)&&A5.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let i=r[4],n=Ue(r.slice(5,9)),o=parseInt(Ue(r.slice(9,13)).substring(2),16),s=Ue(r.slice(13,45)),a=r.slice(45,78);switch(Ue(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Bo(d3,null,Ue(a),n,s,o,i,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new Bo(d3,Ue(a.slice(1)),null,n,s,o,i,null)}return A5.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function tL(t,e){e||(e="");let r=gi("mnemonic"+e,ea.NFKD);return Hm(gi(t,ea.NFKD),r,2048,64,"sha512")}function m3(t,e){e=eL(e),A5.checkNormalize();let r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");let i=Pe(new Uint8Array(Math.ceil(11*r.length/8))),n=0;for(let h=0;h<r.length;h++){let g=e.getWordIndex(r[h].normalize("NFKD"));if(g===-1)throw new Error("invalid mnemonic");for(let w=0;w<11;w++)g&1<<10-w&&(i[n>>3]|=1<<7-n%8),n++}let o=32*r.length/3,s=r.length/3,a=Hpe(s);if((Pe(Ra(i.slice(0,o/8)))[0]&a)!==(i[i.length-1]&a))throw new Error("invalid checksum");return Ue(i.slice(0,o/8))}function Vm(t,e){if(e=eL(e),t=Pe(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");let r=[0],i=11;for(let s=0;s<t.length;s++)i>8?(r[r.length-1]<<=8,r[r.length-1]|=t[s],i-=8):(r[r.length-1]<<=i,r[r.length-1]|=t[s]>>8-i,r.push(t[s]&RVe(8-i)),i+=3);let n=t.length/4,o=Pe(Ra(t))[0]&Hpe(n);return r[r.length-1]<<=n,r[r.length-1]|=o>>8-n,e.join(r.map(s=>e.getWord(s)))}function zpe(t,e){try{return m3(t,e),!0}catch{}return!1}function Vpe(t){return(typeof t!="number"||t<0||t>=p3||t%1)&&A5.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}var Kpe="random/5.7.0";var rL=new ce(Kpe);function kVe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var Gpe=kVe(),cE=Gpe.crypto||Gpe.msCrypto;(!cE||!cE.getRandomValues)&&(rL.warn("WARNING: Missing strong random number source"),cE={getRandomValues:function(t){return rL.throwError("no secure random source avaialble",ce.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Uf(t){(t<=0||t>1024||t%1||t!=t)&&rL.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return cE.getRandomValues(e),Pe(e)}function C5(t){t=t.slice();for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1)),i=t[e];t[e]=t[r],t[r]=i}return t}var oL=Dr(nL());var lE="json-wallets/5.7.0";function _h(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Pe(t)}function g3(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function S5(t){return typeof t=="string"?gi(t,ea.NFKC):Pe(t)}function On(t,e){let r=t,i=e.toLowerCase().split("/");for(let n=0;n<i.length;n++){let o=null;for(let s in r)if(s.toLowerCase()===i[n]){o=r[s];break}if(o===null)return null;r=o}return r}function Zpe(t){let e=Pe(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=Ue(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}var NVe=new ce(lE),sL=class extends hc{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}};function aL(t,e){let r=JSON.parse(t);e=S5(e);let i=Vr(On(r,"ethaddr")),n=_h(On(r,"encseed"));(!n||n.length%16!==0)&&NVe.throwArgumentError("invalid encseed","json",t);let o=Pe(Hm(e,e,2e3,32,"sha256")).slice(0,16),s=n.slice(0,16),a=n.slice(16),c=new oL.default.ModeOfOperation.cbc(o,s),h=oL.default.padding.pkcs7.strip(Pe(c.decrypt(a))),g="";for(let E=0;E<h.length;E++)g+=String.fromCharCode(h[E]);let w=gi(g),A=zr(w);return new sL({_isCrowdsaleAccount:!0,address:i,privateKey:A})}function uE(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function fE(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}function cL(t){if(uE(t))try{return Vr(JSON.parse(t).ethaddr)}catch{return null}if(fE(t))try{return Vr(JSON.parse(t).address)}catch{return null}return null}var Eh=Dr(nL()),hE=Dr(Qpe());var PVe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},uL=new ce(lE);function Xpe(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}var fL=class extends hc{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}};function OVe(t,e,r){if(On(t,"crypto/cipher")==="aes-128-ctr"){let n=_h(On(t,"crypto/cipherparams/iv")),o=new Eh.default.Counter(n),s=new Eh.default.ModeOfOperation.ctr(e,o);return Pe(s.decrypt(r))}return null}function e1e(t,e){let r=_h(On(t,"crypto/ciphertext"));if(Ue(zr(Hr([e.slice(16,32),r]))).substring(2)!==On(t,"crypto/mac").toLowerCase())throw new Error("invalid password");let n=OVe(t,e.slice(0,16),r);n||uL.throwError("unsupported cipher",ce.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});let o=e.slice(32,64),s=gl(n);if(t.address){let c=t.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),Vr(c)!==s)throw new Error("address mismatch")}let a={_isKeystoreAccount:!0,address:s,privateKey:Ue(n)};if(On(t,"x-ethers/version")==="0.1"){let c=_h(On(t,"x-ethers/mnemonicCiphertext")),h=_h(On(t,"x-ethers/mnemonicCounter")),g=new Eh.default.Counter(h),w=new Eh.default.ModeOfOperation.ctr(o,g),A=On(t,"x-ethers/path")||xh,E=On(t,"x-ethers/locale")||"en",I=Pe(w.decrypt(c));try{let k=Vm(I,E),M=Bo.fromMnemonic(k,null,E).derivePath(A);if(M.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=M.mnemonic}catch(k){if(k.code!==ce.errors.INVALID_ARGUMENT||k.argument!=="wordlist")throw k}}return new fL(a)}function t1e(t,e,r,i,n){return Pe(Hm(t,e,r,i,n))}function MVe(t,e,r,i,n){return Promise.resolve(t1e(t,e,r,i,n))}function r1e(t,e,r,i,n){let o=S5(e),s=On(t,"crypto/kdf");if(s&&typeof s=="string"){let a=function(c,h){return uL.throwArgumentError("invalid key-derivation function parameters",c,h)};if(s.toLowerCase()==="scrypt"){let c=_h(On(t,"crypto/kdfparams/salt")),h=parseInt(On(t,"crypto/kdfparams/n")),g=parseInt(On(t,"crypto/kdfparams/r")),w=parseInt(On(t,"crypto/kdfparams/p"));(!h||!g||!w)&&a("kdf",s),(h&h-1)!==0&&a("N",h);let A=parseInt(On(t,"crypto/kdfparams/dklen"));return A!==32&&a("dklen",A),i(o,c,h,g,w,64,n)}else if(s.toLowerCase()==="pbkdf2"){let c=_h(On(t,"crypto/kdfparams/salt")),h=null,g=On(t,"crypto/kdfparams/prf");g==="hmac-sha256"?h="sha256":g==="hmac-sha512"?h="sha512":a("prf",g);let w=parseInt(On(t,"crypto/kdfparams/c")),A=parseInt(On(t,"crypto/kdfparams/dklen"));return A!==32&&a("dklen",A),r(o,c,w,A,h)}}return uL.throwArgumentError("unsupported key-derivation function","kdf",s)}function i1e(t,e){let r=JSON.parse(t),i=r1e(r,e,t1e,hE.default.syncScrypt);return e1e(r,i)}function n1e(t,e,r){return PVe(this,void 0,void 0,function*(){let i=JSON.parse(t),n=yield r1e(i,e,MVe,hE.default.scrypt,r);return e1e(i,n)})}function hL(t,e,r,i){try{if(Vr(t.address)!==gl(t.privateKey))throw new Error("address/privateKey mismatch");if(Xpe(t)){let M=t.mnemonic;if(Bo.fromMnemonic(M.phrase,null,M.locale).derivePath(M.path||xh).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(M){return Promise.reject(M)}typeof r=="function"&&!i&&(i=r,r={}),r||(r={});let n=Pe(t.privateKey),o=S5(e),s=null,a=null,c=null;if(Xpe(t)){let M=t.mnemonic;s=Pe(m3(M.phrase,M.locale||"en")),a=M.path||xh,c=M.locale||"en"}let h=r.client;h||(h="ethers.js");let g=null;r.salt?g=Pe(r.salt):g=Uf(32);let w=null;if(r.iv){if(w=Pe(r.iv),w.length!==16)throw new Error("invalid iv")}else w=Uf(16);let A=null;if(r.uuid){if(A=Pe(r.uuid),A.length!==16)throw new Error("invalid uuid")}else A=Uf(16);let E=1<<17,I=8,k=1;return r.scrypt&&(r.scrypt.N&&(E=r.scrypt.N),r.scrypt.r&&(I=r.scrypt.r),r.scrypt.p&&(k=r.scrypt.p)),hE.default.scrypt(o,g,E,I,k,64,i).then(M=>{M=Pe(M);let j=M.slice(0,16),W=M.slice(16,32),G=M.slice(32,64),Y=new Eh.default.Counter(w),te=new Eh.default.ModeOfOperation.ctr(j,Y),oe=Pe(te.encrypt(n)),Q=zr(Hr([W,oe])),N={address:t.address.substring(2).toLowerCase(),id:Zpe(A),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ue(w).substring(2)},ciphertext:Ue(oe).substring(2),kdf:"scrypt",kdfparams:{salt:Ue(g).substring(2),n:E,dklen:32,p:k,r:I},mac:Q.substring(2)}};if(s){let U=Uf(16),L=new Eh.default.Counter(U),F=new Eh.default.ModeOfOperation.ctr(G,L),q=Pe(F.encrypt(s)),u=new Date,f=u.getUTCFullYear()+"-"+g3(u.getUTCMonth()+1,2)+"-"+g3(u.getUTCDate(),2)+"T"+g3(u.getUTCHours(),2)+"-"+g3(u.getUTCMinutes(),2)+"-"+g3(u.getUTCSeconds(),2)+".0Z";N["x-ethers"]={client:h,gethFilename:"UTC--"+f+"--"+N.address,mnemonicCounter:Ue(U).substring(2),mnemonicCiphertext:Ue(q).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(N)})}function o1e(t,e,r){if(uE(t)){r&&r(0);let i=aL(t,e);return r&&r(1),Promise.resolve(i)}return fE(t)?n1e(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function s1e(t,e){if(uE(t))return aL(t,e);if(fE(t))return i1e(t,e);throw new Error("invalid JSON wallet")}var a1e="wallet/5.7.0";var c1e=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},w3=new ce(a1e);function DVe(t){return t!=null&&Qt(t.privateKey,32)&&t.address!=null}function LVe(t){let e=t.mnemonic;return e&&e.phrase}var au=class extends ta{constructor(e,r){if(super(),DVe(e)){let i=new ml(e.privateKey);if(_e(this,"_signingKey",()=>i),_e(this,"address",gl(this.publicKey)),this.address!==Vr(e.address)&&w3.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),LVe(e)){let n=e.mnemonic;_e(this,"_mnemonic",()=>({phrase:n.phrase,path:n.path||xh,locale:n.locale||"en"}));let o=this.mnemonic,s=Bo.fromMnemonic(o.phrase,null,o.locale).derivePath(o.path);gl(s.privateKey)!==this.address&&w3.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else _e(this,"_mnemonic",()=>null)}else{if(ml.isSigningKey(e))e.curve!=="secp256k1"&&w3.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),_e(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);let i=new ml(e);_e(this,"_signingKey",()=>i)}_e(this,"_mnemonic",()=>null),_e(this,"address",gl(this.publicKey))}r&&!Ia.isProvider(r)&&w3.throwArgumentError("invalid provider","provider",r),_e(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new au(this,e)}signTransaction(e){return Vi(e).then(r=>{r.from!=null&&(Vr(r.from)!==this.address&&w3.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);let i=this._signingKey().signDigest(zr(b5(r)));return b5(r,i)})}signMessage(e){return c1e(this,void 0,void 0,function*(){return i5(this._signingKey().signDigest(e3(e)))})}_signTypedData(e,r,i){return c1e(this,void 0,void 0,function*(){let n=yield Nn.resolveNames(e,r,i,o=>(this.provider==null&&w3.throwError("cannot resolve ENS names without a provider",ce.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:o}),this.provider.resolveName(o)));return i5(this._signingKey().signDigest(Nn.hash(n.domain,r,n.value)))})}encrypt(e,r,i){if(typeof r=="function"&&!i&&(i=r,r={}),i&&typeof i!="function")throw new Error("invalid callback");return r||(r={}),hL(this,e,r,i)}static createRandom(e){let r=Uf(16);e||(e={}),e.extraEntropy&&(r=Pe(zi(zr(Hr([r,e.extraEntropy])),0,16)));let i=Vm(r,e.locale);return au.fromMnemonic(i,e.path,e.locale)}static fromEncryptedJson(e,r,i){return o1e(e,r,i).then(n=>new au(n))}static fromEncryptedJsonSync(e,r){return new au(s1e(e,r))}static fromMnemonic(e,r,i){return r||(r=xh),new au(Bo.fromMnemonic(e,null,i).derivePath(r))}};function l1e(t,e){return $m(e3(t),e)}function u1e(t,e,r,i){return $m(Nn.hash(t,e,r),i)}var RE={};qr(RE,{AlchemyProvider:()=>E3,AlchemyWebSocketProvider:()=>B5,AnkrProvider:()=>U5,BaseProvider:()=>jf,CloudflareProvider:()=>F5,EtherscanProvider:()=>j5,FallbackProvider:()=>W5,Formatter:()=>Tt,InfuraProvider:()=>C3,InfuraWebSocketProvider:()=>H5,IpcProvider:()=>CL,JsonRpcBatchProvider:()=>IE,JsonRpcProvider:()=>ka,JsonRpcSigner:()=>x3,NodesmithProvider:()=>z5,PocketProvider:()=>V5,Provider:()=>Ia,Resolver:()=>y3,StaticJsonRpcProvider:()=>L5,UrlJsonRpcProvider:()=>Uo,Web3Provider:()=>K5,WebSocketProvider:()=>Sh,getDefaultProvider:()=>TE,getNetwork:()=>I5,isCommunityResourcable:()=>mL,isCommunityResource:()=>k5,showThrottleMessage:()=>Ff});var f1e="networks/5.7.1";var h1e=new ce(f1e);function BVe(t){return t&&typeof t.renetwork=="function"}function Ah(t){let e=function(r,i){i==null&&(i={});let n=[];if(r.InfuraProvider&&i.infura!=="-")try{n.push(new r.InfuraProvider(t,i.infura))}catch{}if(r.EtherscanProvider&&i.etherscan!=="-")try{n.push(new r.EtherscanProvider(t,i.etherscan))}catch{}if(r.AlchemyProvider&&i.alchemy!=="-")try{n.push(new r.AlchemyProvider(t,i.alchemy))}catch{}if(r.PocketProvider&&i.pocket!=="-"){let o=["goerli","ropsten","rinkeby","sepolia"];try{let s=new r.PocketProvider(t,i.pocket);s.network&&o.indexOf(s.network.name)===-1&&n.push(s)}catch{}}if(r.CloudflareProvider&&i.cloudflare!=="-")try{n.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&i.ankr!=="-")try{let o=["ropsten"],s=new r.AnkrProvider(t,i.ankr);s.network&&o.indexOf(s.network.name)===-1&&n.push(s)}catch{}if(n.length===0)return null;if(r.FallbackProvider){let o=1;return i.quorum!=null?o=i.quorum:t==="homestead"&&(o=2),new r.FallbackProvider(n,o)}return n[0]};return e.renetwork=function(r){return Ah(r)},e}function pE(t,e){let r=function(i,n){return i.JsonRpcProvider?new i.JsonRpcProvider(t,e):null};return r.renetwork=function(i){return pE(t,i)},r}var d1e={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Ah("homestead")},p1e={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Ah("ropsten")},m1e={chainId:63,name:"classicMordor",_defaultProvider:pE("https://www.ethercluster.com/mordor","classicMordor")},dE={unspecified:{chainId:0,name:"unspecified"},homestead:d1e,mainnet:d1e,morden:{chainId:2,name:"morden"},ropsten:p1e,testnet:p1e,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Ah("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Ah("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Ah("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Ah("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:pE("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:m1e,classicTestnet:m1e,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:pE("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Ah("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Ah("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function I5(t){if(t==null)return null;if(typeof t=="number"){for(let i in dE){let n=dE[i];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){let i=dE[t];return i==null?null:{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress,_defaultProvider:i._defaultProvider||null}}let e=dE[t.name];if(!e)return typeof t.chainId!="number"&&h1e.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&h1e.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(BVe(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}var g1e="web/5.7.1";var UVe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})};function w1e(t,e){return UVe(this,void 0,void 0,function*(){e==null&&(e={});let r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){let s=e.fetchOptions;s.mode&&(r.mode=s.mode),s.cache&&(r.cache=s.cache),s.credentials&&(r.credentials=s.credentials),s.redirect&&(r.redirect=s.redirect),s.referrer&&(r.referrer=s.referrer)}let i=yield fetch(t,r),n=yield i.arrayBuffer(),o={};return i.headers.forEach?i.headers.forEach((s,a)=>{o[a.toLowerCase()]=s}):i.headers.keys().forEach(s=>{o[s.toLowerCase()]=i.headers.get(s)}),{headers:o,statusCode:i.status,statusMessage:i.statusText,body:Pe(new Uint8Array(n))}})}var FVe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},cu=new ce(g1e);function v1e(t){return new Promise(e=>{setTimeout(e,t)})}function gp(t,e){if(t==null)return null;if(typeof t=="string")return t;if(uh(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Sa(t)}catch{}return Ue(t)}return t}function jVe(t){return gi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function dL(t,e,r){let i=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;cu.assertArgument(i>0&&i%1===0,"invalid connection throttle limit","connection.throttleLimit",i);let n=typeof t=="object"?t.throttleCallback:null,o=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;cu.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);let s=typeof t=="object"?!!t.errorPassThrough:!1,a={},c=null,h={method:"GET"},g=!1,w=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&cu.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(w=t.timeout),t.headers)for(let j in t.headers)a[j.toLowerCase()]={key:j,value:String(t.headers[j])},["if-none-match","if-modified-since"].indexOf(j.toLowerCase())>=0&&(g=!0);if(h.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&cu.throwError("basic authentication requires a secure https url",ce.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});let j=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+Xw(gi(j))}}t.skipFetchSetup!=null&&(h.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(h.fetchOptions=bi(t.fetchOptions))}let A=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),E=c?c.match(A):null;if(E)try{let j={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]||"text/plain"},body:E[2]?Qw(E[3]):jVe(E[3])},W=j.body;return r&&(W=r(j.body,j)),Promise.resolve(W)}catch(j){cu.throwError("processing response error",ce.errors.SERVER_ERROR,{body:gp(E[1],E[2]),error:j,requestBody:null,requestMethod:"GET",url:c})}e&&(h.method="POST",h.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));let I={};Object.keys(a).forEach(j=>{let W=a[j];I[W.key]=W.value}),h.headers=I;let k=function(){let j=null;return{promise:new Promise(function(Y,te){w&&(j=setTimeout(()=>{j!=null&&(j=null,te(cu.makeError("timeout",ce.errors.TIMEOUT,{requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,timeout:w,url:c})))},w))}),cancel:function(){j!=null&&(clearTimeout(j),j=null)}}}(),M=function(){return FVe(this,void 0,void 0,function*(){for(let j=0;j<i;j++){let W=null;try{if(W=yield w1e(c,h),j<i){if(W.statusCode===301||W.statusCode===302){let Y=W.headers.location||"";if(h.method==="GET"&&Y.match(/^https:/)){c=W.headers.location;continue}}else if(W.statusCode===429){let Y=!0;if(n&&(Y=yield n(j,c)),Y){let te=0,oe=W.headers["retry-after"];typeof oe=="string"&&oe.match(/^[1-9][0-9]*$/)?te=parseInt(oe)*1e3:te=o*parseInt(String(Math.random()*Math.pow(2,j))),yield v1e(te);continue}}}}catch(Y){W=Y.response,W==null&&(k.cancel(),cu.throwError("missing response",ce.errors.SERVER_ERROR,{requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,serverError:Y,url:c}))}let G=W.body;if(g&&W.statusCode===304?G=null:!s&&(W.statusCode<200||W.statusCode>=300)&&(k.cancel(),cu.throwError("bad response",ce.errors.SERVER_ERROR,{status:W.statusCode,headers:W.headers,body:gp(G,W.headers?W.headers["content-type"]:null),requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,url:c})),r)try{let Y=yield r(G,W);return k.cancel(),Y}catch(Y){if(Y.throttleRetry&&j<i){let te=!0;if(n&&(te=yield n(j,c)),te){let oe=o*parseInt(String(Math.random()*Math.pow(2,j)));yield v1e(oe);continue}}k.cancel(),cu.throwError("processing response error",ce.errors.SERVER_ERROR,{body:gp(G,W.headers?W.headers["content-type"]:null),error:Y,requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,url:c})}return k.cancel(),G}return cu.throwError("failed response",ce.errors.SERVER_ERROR,{requestBody:gp(h.body,I["content-type"]),requestMethod:h.method,url:c})})}();return Promise.race([k.promise,M])}function lu(t,e,r){let i=(o,s)=>{let a=null;if(o!=null)try{a=JSON.parse(Sa(o))}catch(c){cu.throwError("invalid JSON",ce.errors.SERVER_ERROR,{body:o,error:c})}return r&&(a=r(a,s)),a},n=null;if(e!=null){n=gi(e);let o=typeof t=="string"?{url:t}:bi(t);o.headers?Object.keys(o.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(o.headers=bi(o.headers),o.headers["content-type"]="application/json"):o.headers={"content-type":"application/json"},t=o}return dL(t,n,i)}function uu(t,e){return e||(e={}),e=bi(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,i){let n=null,o=!1,s=()=>o?!1:(o=!0,n&&clearTimeout(n),!0);e.timeout&&(n=setTimeout(()=>{s()&&i(new Error("timeout"))},e.timeout));let a=e.retryLimit,c=0;function h(){return t().then(function(g){if(g!==void 0)s()&&r(g);else if(e.oncePoll)e.oncePoll.once("poll",h);else if(e.onceBlock)e.onceBlock.once("block",h);else if(!o){if(c++,c>a){s()&&i(new Error("retry limit reached"));return}let w=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));w<e.floor&&(w=e.floor),w>e.ceiling&&(w=e.ceiling),setTimeout(h,w)}return null},function(g){s()&&i(g)})}h()})}var bL=Dr(_1e());var ki="providers/5.7.2";var R5=new ce(ki),Tt=class{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let e={},r=this.address.bind(this),i=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),s=this.hash.bind(this),a=this.hex.bind(this),c=this.number.bind(this),h=this.type.bind(this),g=w=>this.data(w,!0);return e.transaction={hash:s,type:h,accessList:Tt.allowNull(this.accessList.bind(this),null),blockHash:Tt.allowNull(s,null),blockNumber:Tt.allowNull(c,null),transactionIndex:Tt.allowNull(c,null),confirmations:Tt.allowNull(c,null),from:r,gasPrice:Tt.allowNull(i),maxPriorityFeePerGas:Tt.allowNull(i),maxFeePerGas:Tt.allowNull(i),gasLimit:i,to:Tt.allowNull(r,null),value:i,nonce:c,data:o,r:Tt.allowNull(this.uint256),s:Tt.allowNull(this.uint256),v:Tt.allowNull(c),creates:Tt.allowNull(r,null),raw:Tt.allowNull(o)},e.transactionRequest={from:Tt.allowNull(r),nonce:Tt.allowNull(c),gasLimit:Tt.allowNull(i),gasPrice:Tt.allowNull(i),maxPriorityFeePerGas:Tt.allowNull(i),maxFeePerGas:Tt.allowNull(i),to:Tt.allowNull(r),value:Tt.allowNull(i),data:Tt.allowNull(g),type:Tt.allowNull(c),accessList:Tt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:r,topics:Tt.arrayOf(s),data:o,logIndex:c,blockHash:s},e.receipt={to:Tt.allowNull(this.address,null),from:Tt.allowNull(this.address,null),contractAddress:Tt.allowNull(r,null),transactionIndex:c,root:Tt.allowNull(a),gasUsed:i,logsBloom:Tt.allowNull(o),blockHash:s,transactionHash:s,logs:Tt.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:Tt.allowNull(c,null),cumulativeGasUsed:i,effectiveGasPrice:Tt.allowNull(i),status:Tt.allowNull(c),type:h},e.block={hash:Tt.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:Tt.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:Tt.allowNull(r),extraData:o,transactions:Tt.allowNull(Tt.arrayOf(s)),baseFeePerGas:Tt.allowNull(i)},e.blockWithTransactions=bi(e.block),e.blockWithTransactions.transactions=Tt.allowNull(Tt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Tt.allowNull(n,void 0),toBlock:Tt.allowNull(n,void 0),blockHash:Tt.allowNull(s,void 0),address:Tt.allowNull(r,void 0),topics:Tt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Tt.allowNull(c),blockHash:Tt.allowNull(s),transactionIndex:c,removed:Tt.allowNull(this.boolean.bind(this)),address:r,data:Tt.allowFalsish(o,"0x"),topics:Tt.arrayOf(s),transactionHash:s,logIndex:c},e}accessList(e){return vc(e||[])}number(e){return e==="0x"?0:De.from(e).toNumber()}type(e){return e==="0x"||e==null?0:De.from(e).toNumber()}bigNumber(e){return De.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Qt(e))?e.toLowerCase():R5.throwArgumentError("invalid hash","value",e)}data(e,r){let i=this.hex(e,r);if(i.length%2!==0)throw new Error("invalid data; odd-length - "+e);return i}address(e){return Vr(e)}callAddress(e){if(!Qt(e,32))return null;let r=Vr(zi(e,12));return r===P_?null:r}contractAddress(e){return Bm(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Qt(e))return Cf(e);throw new Error("invalid blockTag")}hash(e,r){let i=this.hex(e,r);return _s(i)!==32?R5.throwArgumentError("invalid hash","value",e):i}difficulty(e){if(e==null)return null;let r=De.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Qt(e))throw new Error("invalid uint256");return Jr(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);let i=e._difficulty!=null?e._difficulty:e.difficulty,n=Tt.check(r,e);return n._difficulty=i==null?null:De.from(i),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Tt.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&De.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);let r=Tt.check(this.formats.transaction,e);if(e.chainId!=null){let i=e.chainId;Qt(i)&&(i=De.from(i).toNumber()),r.chainId=i}else{let i=e.networkId;i==null&&r.v==null&&(i=e.chainId),Qt(i)&&(i=De.from(i).toNumber()),typeof i!="number"&&r.v!=null&&(i=(r.v-35)/2,i<0&&(i=0),i=parseInt(i)),typeof i!="number"&&(i=0),r.chainId=i}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return tE(e)}receiptLog(e){return Tt.check(this.formats.receiptLog,e)}receipt(e){let r=Tt.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){let i=De.from(r.root).toNumber();i===0||i===1?(r.status!=null&&r.status!==i&&R5.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=i,delete r.root):R5.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&R5.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return Tt.check(this.formats.filter,e)}filterLog(e){return Tt.check(this.formats.filterLog,e)}static check(e,r){let i={};for(let n in e)try{let o=e[n](r[n]);o!==void 0&&(i[n]=o)}catch(o){throw o.checkKey=n,o.checkValue=r[n],o}return i}static allowNull(e,r){return function(i){return i==null?r:e(i)}}static allowFalsish(e,r){return function(i){return i?e(i):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");let i=[];return r.forEach(function(n){i.push(e(n))}),i}}};function mL(t){return t&&typeof t.isCommunityResource=="function"}function k5(t){return mL(t)&&t.isCommunityResource()}var E1e=!1;function Ff(){E1e||(E1e=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Cr=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},Qr=new ce(ki),GVe=10;function A1e(t){return t==null?"null":(_s(t)!==32&&Qr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function C1e(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){let r={};e.forEach(n=>{r[A1e(n)]=!0});let i=Object.keys(r);return i.sort(),i.join("|")}else return A1e(e)}).join("&")}function YVe(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];let r=e.split("|").map(i=>i==="null"?null:i);return r.length===1?r[0]:r})}function b3(t){if(typeof t=="string"){if(t=t.toLowerCase(),_s(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+C1e(t);if(H_.isForkEvent(t))throw Qr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+C1e(t.topics||[])}throw new Error("invalid event - "+t)}function N5(){return new Date().getTime()}function S1e(t){return new Promise(e=>{setTimeout(e,t)})}var ZVe=["block","network","pending","poll"],yL=class{constructor(e,r,i){_e(this,"tag",e),_e(this,"listener",r),_e(this,"once",i),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){let e=this.tag.split(":");if(e[0]!=="filter")return null;let r=e[1],i=YVe(e[2]),n={};return i.length>0&&(n.topics=i),r&&r!=="*"&&(n.address=r),n}pollable(){return this.tag.indexOf(":")>=0||ZVe.indexOf(this.tag)>=0}},JVe={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function gL(t){return Jr(De.from(t).toHexString(),32)}function I1e(t){return bh.encode(Hr([t,zi(Ra(Ra(t)),0,4)]))}var k1e=new RegExp("^(ipfs)://(.*)$","i"),T1e=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),k1e,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function vE(t,e){try{return Sa(P5(t,e))}catch{}return null}function P5(t,e){if(t==="0x")return null;let r=De.from(zi(t,e,e+32)).toNumber(),i=De.from(zi(t,r,r+32)).toNumber();return zi(t,r+32,r+32+i)}function wL(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Qr.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function R1e(t){let e=Pe(t);if(e.length>32)throw new Error("internal; should not happen");let r=new Uint8Array(32);return r.set(e,32-e.length),r}function QVe(t){if(t.length%32===0)return t;let e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function N1e(t){let e=[],r=0;for(let i=0;i<t.length;i++)e.push(null),r+=32;for(let i=0;i<t.length;i++){let n=Pe(t[i]);e[i]=R1e(r),e.push(R1e(n.length)),e.push(QVe(n)),r+=32+Math.ceil(n.length/32)*32}return no(e)}var y3=class{constructor(e,r,i,n){_e(this,"provider",e),_e(this,"name",i),_e(this,"address",e.formatter.address(r)),_e(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>De.from(e).eq(1)).catch(e=>{if(e.code===ce.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Cr(this,void 0,void 0,function*(){let i={to:this.address,ccipReadEnabled:!0,data:no([e,up(this.name),r||"0x"])},n=!1;(yield this.supportsWildcard())&&(n=!0,i.data=no(["0x9061b923",N1e([m5(this.name),i.data])]));try{let o=yield this.provider.call(i);return Pe(o).length%32===4&&Qr.throwError("resolver threw error",ce.errors.CALL_EXCEPTION,{transaction:i,data:o}),n&&(o=P5(o,0)),o}catch(o){if(o.code===ce.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(e,r){return Cr(this,void 0,void 0,function*(){let i=yield this._fetch(e,r);return i!=null?P5(i,0):null})}_getAddress(e,r){let i=JVe[String(e)];if(i==null&&Qr.throwError(`unsupported coin type: ${e}`,ce.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),i.ilk==="eth")return this.provider.formatter.address(r);let n=Pe(r);if(i.p2pkh!=null){let o=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){let s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return I1e(Hr([[i.p2pkh],"0x"+o[2]]))}}if(i.p2sh!=null){let o=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){let s=parseInt(o[1],16);if(o[2].length===s*2&&s>=1&&s<=75)return I1e(Hr([[i.p2sh],"0x"+o[2]]))}}if(i.prefix!=null){let o=n[1],s=n[0];if(s===0?o!==20&&o!==32&&(s=-1):s=-1,s>=0&&n.length===2+o&&o>=1&&o<=75){let a=bL.default.toWords(n.slice(2));return a.unshift(s),bL.default.encode(i.prefix,a)}}return null}getAddress(e){return Cr(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{let n=yield this._fetch("0x3b3b57de");return n==="0x"||n===Zw?null:this.provider.formatter.callAddress(n)}catch(n){if(n.code===ce.errors.CALL_EXCEPTION)return null;throw n}let r=yield this._fetchBytes("0xf1cb7e06",gL(e));if(r==null||r==="0x")return null;let i=this._getAddress(e,r);return i==null&&Qr.throwError("invalid or unsupported coin data",ce.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),i})}getAvatar(){return Cr(this,void 0,void 0,function*(){let e=[{type:"name",content:this.name}];try{let r=yield this.getText("avatar");if(r==null)return null;for(let i=0;i<T1e.length;i++){let n=r.match(T1e[i]);if(n==null)continue;let o=n[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:r}),{linkage:e,url:r};case"data":return e.push({type:"data",content:r}),{linkage:e,url:r};case"ipfs":return e.push({type:"ipfs",content:r}),{linkage:e,url:wL(r)};case"erc721":case"erc1155":{let s=o==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:r});let a=this._resolvedAddress||(yield this.getAddress()),c=(n[2]||"").split("/");if(c.length!==2)return null;let h=yield this.provider.formatter.address(c[0]),g=Jr(De.from(c[1]).toHexString(),32);if(o==="erc721"){let k=this.provider.formatter.callAddress(yield this.provider.call({to:h,data:no(["0x6352211e",g])}));if(a!==k)return null;e.push({type:"owner",content:k})}else if(o==="erc1155"){let k=De.from(yield this.provider.call({to:h,data:no(["0x00fdd58e",Jr(a,32),g])}));if(k.isZero())return null;e.push({type:"balance",content:k.toString()})}let w={to:this.provider.formatter.address(c[0]),data:no([s,g])},A=vE(yield this.provider.call(w),0);if(A==null)return null;e.push({type:"metadata-url-base",content:A}),o==="erc1155"&&(A=A.replace("{id}",g.substring(2)),e.push({type:"metadata-url-expanded",content:A})),A.match(/^ipfs:/i)&&(A=wL(A)),e.push({type:"metadata-url",content:A});let E=yield lu(A);if(!E)return null;e.push({type:"metadata",content:JSON.stringify(E)});let I=E.image;if(typeof I!="string")return null;if(!I.match(/^(https:\/\/|data:)/i)){if(I.match(k1e)==null)return null;e.push({type:"url-ipfs",content:I}),I=wL(I)}return e.push({type:"url",content:I}),{linkage:e,url:I}}}}}catch{}return null})}getContentHash(){return Cr(this,void 0,void 0,function*(){let e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;let r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){let s=parseInt(r[3],16);if(r[4].length===s*2)return"ipfs://"+bh.encode("0x"+r[1])}let i=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(i){let s=parseInt(i[3],16);if(i[4].length===s*2)return"ipns://"+bh.encode("0x"+i[1])}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===32*2)return"bzz://"+n[1];let o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&o[1].length===34*2){let s={"=":"","+":"-","/":"_"},a=Xw("0x"+o[1]).replace(/[=+\/]/g,c=>s[c]);return"sia://"+a}return Qr.throwError("invalid or unsupported content hash data",ce.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Cr(this,void 0,void 0,function*(){let r=gi(e);r=Hr([gL(64),gL(r.length),r]),r.length%32!==0&&(r=Hr([r,Jr("0x",32-e.length%32)]));let i=yield this._fetchBytes("0x59d1d43c",Ue(r));return i==null||i==="0x"?null:Sa(i)})}},vL=null,XVe=1,jf=class extends Ia{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),_e(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{let r=Rn(new.target,"getNetwork")(e);r?(_e(this,"_network",r),this.emit("network",r,null)):Qr.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Cr(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Qr.throwError("no network detected",ce.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:_e(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return uu(()=>this._ready().then(e=>e,e=>{if(!(e.code===ce.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return vL==null&&(vL=new Tt),vL}static getNetwork(e){return I5(e??"homestead")}ccipReadFetch(e,r,i){return Cr(this,void 0,void 0,function*(){if(this.disableCcipRead||i.length===0)return null;let n=e.to.toLowerCase(),o=r.toLowerCase(),s=[];for(let a=0;a<i.length;a++){let c=i[a],h=c.replace("{sender}",n).replace("{data}",o),g=c.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:n}),w=yield lu({url:h,errorPassThrough:!0},g,(E,I)=>(E.status=I.statusCode,E));if(w.data)return w.data;let A=w.message||"unknown error";if(w.status>=400&&w.status<500)return Qr.throwError(`response not found during CCIP fetch: ${A}`,ce.errors.SERVER_ERROR,{url:c,errorMessage:A});s.push(A)}return Qr.throwError(`error encountered during CCIP fetch: ${s.map(a=>JSON.stringify(a)).join(", ")}`,ce.errors.SERVER_ERROR,{urls:i,errorMessages:s})})}_getInternalBlockNumber(e){return Cr(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){let n=this._internalBlockNumber;try{let o=yield n;if(N5()-o.respTime<=e)return o.blockNumber;break}catch{if(this._internalBlockNumber===n)break}}let r=N5(),i=Vi({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(n=>null,n=>n)}).then(({blockNumber:n,networkError:o})=>{if(o)throw this._internalBlockNumber===i&&(this._internalBlockNumber=null),o;let s=N5();return n=De.from(n).toNumber(),n<this._maxInternalBlockNumber&&(n=this._maxInternalBlockNumber),this._maxInternalBlockNumber=n,this._setFastBlockNumber(n),{blockNumber:n,reqTime:r,respTime:s}});return this._internalBlockNumber=i,i.catch(n=>{this._internalBlockNumber===i&&(this._internalBlockNumber=null)}),(yield i).blockNumber})}poll(){return Cr(this,void 0,void 0,function*(){let e=XVe++,r=[],i=null;try{i=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){this.emit("error",n);return}if(this._setFastBlockNumber(i),this.emit("poll",e,i),i===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=i-1),Math.abs(this._emitted.block-i)>1e3)Qr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${i})`),this.emit("error",Qr.makeError("network block skew detected",ce.errors.NETWORK_ERROR,{blockNumber:i,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",i);else for(let n=this._emitted.block+1;n<=i;n++)this.emit("block",n);this._emitted.block!==i&&(this._emitted.block=i,Object.keys(this._emitted).forEach(n=>{if(n==="block")return;let o=this._emitted[n];o!=="pending"&&i-o>12&&delete this._emitted[n]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=i-1),this._events.forEach(n=>{switch(n.type){case"tx":{let o=n.hash,s=this.getTransactionReceipt(o).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+o]=a.blockNumber,this.emit(o,a)),null)).catch(a=>{this.emit("error",a)});r.push(s);break}case"filter":{if(!n._inflight){n._inflight=!0,n._lastBlockNumber===-2&&(n._lastBlockNumber=i-1);let o=n.filter;o.fromBlock=n._lastBlockNumber+1,o.toBlock=i;let s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);let a=this.getLogs(o).then(c=>{n._inflight=!1,c.length!==0&&c.forEach(h=>{h.blockNumber>n._lastBlockNumber&&(n._lastBlockNumber=h.blockNumber),this._emitted["b:"+h.blockHash]=h.blockNumber,this._emitted["t:"+h.transactionHash]=h.blockNumber,this.emit(o,h)})}).catch(c=>{this.emit("error",c),n._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=i,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(n=>{this.emit("error",n)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Cr(this,void 0,void 0,function*(){return Qr.throwError("provider does not support network detection",ce.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Cr(this,void 0,void 0,function*(){let e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield S1e(0),this._network;let i=Qr.makeError("underlying network changed",ce.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",i),i}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let e=N5();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=N5(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,i){return Cr(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,i||0,null)})}_waitForTransaction(e,r,i,n){return Cr(this,void 0,void 0,function*(){let o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=r?o:new Promise((s,a)=>{let c=[],h=!1,g=function(){return h?!0:(h=!0,c.forEach(A=>{A()}),!1)},w=A=>{A.confirmations<r||g()||s(A)};if(this.on(e,w),c.push(()=>{this.removeListener(e,w)}),n){let A=n.startBlock,E=null,I=k=>Cr(this,void 0,void 0,function*(){h||(yield S1e(1e3),this.getTransactionCount(n.from).then(M=>Cr(this,void 0,void 0,function*(){if(!h){if(M<=n.nonce)A=k;else{{let j=yield this.getTransaction(e);if(j&&j.blockNumber!=null)return}for(E==null&&(E=A-3,E<n.startBlock&&(E=n.startBlock));E<=k;){if(h)return;let j=yield this.getBlockWithTransactions(E);for(let W=0;W<j.transactions.length;W++){let G=j.transactions[W];if(G.hash===e)return;if(G.from===n.from&&G.nonce===n.nonce){if(h)return;let Y=yield this.waitForTransaction(G.hash,r);if(g())return;let te="replaced";G.data===n.data&&G.to===n.to&&G.value.eq(n.value)?te="repriced":G.data==="0x"&&G.from===G.to&&G.value.isZero()&&(te="cancelled"),a(Qr.makeError("transaction was replaced",ce.errors.TRANSACTION_REPLACED,{cancelled:te==="replaced"||te==="cancelled",reason:te,replacement:this._wrapTransaction(G),hash:e,receipt:Y}));return}}E++}}h||this.once("block",I)}}),M=>{h||this.once("block",I)}))});if(h)return;this.once("block",I),c.push(()=>{this.removeListener("block",I)})}if(typeof i=="number"&&i>0){let A=setTimeout(()=>{g()||a(Qr.makeError("timeout exceeded",ce.errors.TIMEOUT,{timeout:i}))},i);A.unref&&A.unref(),c.push(()=>{clearTimeout(A)})}})})}getBlockNumber(){return Cr(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield this.perform("getGasPrice",{});try{return De.from(e)}catch(r){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),n=yield this.perform("getBalance",i);try{return De.from(n)}catch(o){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getBalance",params:i,result:n,error:o})}})}getTransactionCount(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),n=yield this.perform("getTransactionCount",i);try{return De.from(n).toNumber()}catch(o){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getTransactionCount",params:i,result:n,error:o})}})}getCode(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),n=yield this.perform("getCode",i);try{return Ue(n)}catch(o){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getCode",params:i,result:n,error:o})}})}getStorageAt(e,r,i){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield Vi({address:this._getAddress(e),blockTag:this._getBlockTag(i),position:Promise.resolve(r).then(s=>Cf(s))}),o=yield this.perform("getStorageAt",n);try{return Ue(o)}catch(s){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:s})}})}_wrapTransaction(e,r,i){if(r!=null&&_s(r)!==32)throw new Error("invalid response - sendTransaction");let n=e;return r!=null&&e.hash!==r&&Qr.throwError("Transaction hash mismatch from Provider.sendTransaction.",ce.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),n.wait=(o,s)=>Cr(this,void 0,void 0,function*(){o==null&&(o=1),s==null&&(s=0);let a;o!==0&&i!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:i});let c=yield this._waitForTransaction(e.hash,o,s,a);return c==null&&o===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&Qr.throwError("transaction failed",ce.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),n}sendTransaction(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield Promise.resolve(e).then(o=>Ue(o)),i=this.formatter.transaction(e);i.confirmations==null&&(i.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let o=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(i,o,n)}catch(o){throw o.transaction=i,o.transactionHash=i.hash,o}})}_getTransactionRequest(e){return Cr(this,void 0,void 0,function*(){let r=yield e,i={};return["from","to"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o?this._getAddress(o):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o?De.from(o):null))}),["type"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o??null))}),r.accessList&&(i.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(n=>{r[n]!=null&&(i[n]=Promise.resolve(r[n]).then(o=>o?Ue(o):null))}),this.formatter.transactionRequest(yield Vi(i))})}_getFilter(e){return Cr(this,void 0,void 0,function*(){e=yield e;let r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(i=>{e[i]!=null&&(r[i]=e[i])}),["fromBlock","toBlock"].forEach(i=>{e[i]!=null&&(r[i]=this._getBlockTag(e[i]))}),this.formatter.filter(yield Vi(r))})}_call(e,r,i){return Cr(this,void 0,void 0,function*(){i>=GVe&&Qr.throwError("CCIP read exceeded maximum redirections",ce.errors.SERVER_ERROR,{redirects:i,transaction:e});let n=e.to,o=yield this.perform("call",{transaction:e,blockTag:r});if(i>=0&&r==="latest"&&n!=null&&o.substring(0,10)==="0x556f1830"&&_s(o)%32===4)try{let s=zi(o,4),a=zi(s,0,32);De.from(a).eq(n)||Qr.throwError("CCIP Read sender did not match",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});let c=[],h=De.from(zi(s,32,64)).toNumber(),g=De.from(zi(s,h,h+32)).toNumber(),w=zi(s,h+32);for(let j=0;j<g;j++){let W=vE(w,j*32);W==null&&Qr.throwError("CCIP Read contained corrupt URL string",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),c.push(W)}let A=P5(s,64);De.from(zi(s,100,128)).isZero()||Qr.throwError("CCIP Read callback selector included junk",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});let E=zi(s,96,100),I=P5(s,128),k=yield this.ccipReadFetch(e,A,c);k==null&&Qr.throwError("CCIP Read disabled or provided no URLs",ce.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});let M={to:n,data:no([E,N1e([k,I])])};return this._call(M,r,i+1)}catch(s){if(s.code===ce.errors.SERVER_ERROR)throw s}try{return Ue(o)}catch(s){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:r},result:o,error:s})}})}call(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let i=yield Vi({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(r),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(i.transaction,i.blockTag,i.ccipReadEnabled?0:-1)})}estimateGas(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield Vi({transaction:this._getTransactionRequest(e)}),i=yield this.perform("estimateGas",r);try{return De.from(i)}catch(n){return Qr.throwError("bad result from backend",ce.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:i,error:n})}})}_getAddress(e){return Cr(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&Qr.throwArgumentError("invalid address or ENS name","name",e);let r=yield this.resolveName(e);return r==null&&Qr.throwError("ENS name not configured",ce.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),r})}_getBlock(e,r){return Cr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let i=-128,n={includeTransactions:!!r};if(Qt(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),Qt(n.blockTag)&&(i=parseInt(n.blockTag.substring(2),16))}catch{Qr.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return uu(()=>Cr(this,void 0,void 0,function*(){let o=yield this.perform("getBlock",n);if(o==null)return n.blockHash!=null&&this._emitted["b:"+n.blockHash]==null||n.blockTag!=null&&i>this._emitted.block?null:void 0;if(r){let s=null;for(let c=0;c<o.transactions.length;c++){let h=o.transactions[c];if(h.blockNumber==null)h.confirmations=0;else if(h.confirmations==null){s==null&&(s=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let g=s-h.blockNumber+1;g<=0&&(g=1),h.confirmations=g}}let a=this.formatter.blockWithTransactions(o);return a.transactions=a.transactions.map(c=>this._wrapTransaction(c)),a}return this.formatter.block(o)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r={transactionHash:this.formatter.hash(e,!0)};return uu(()=>Cr(this,void 0,void 0,function*(){let i=yield this.perform("getTransaction",r);if(i==null)return this._emitted["t:"+e]==null?null:void 0;let n=this.formatter.transactionResponse(i);if(n.blockNumber==null)n.confirmations=0;else if(n.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;s<=0&&(s=1),n.confirmations=s}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r={transactionHash:this.formatter.hash(e,!0)};return uu(()=>Cr(this,void 0,void 0,function*(){let i=yield this.perform("getTransactionReceipt",r);if(i==null)return this._emitted["t:"+e]==null?null:void 0;if(i.blockHash==null)return;let n=this.formatter.receipt(i);if(n.blockNumber==null)n.confirmations=0;else if(n.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;s<=0&&(s=1),n.confirmations=s}return n}),{oncePoll:this})})}getLogs(e){return Cr(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield Vi({filter:this._getFilter(e)}),i=yield this.perform("getLogs",r);return i.forEach(n=>{n.removed==null&&(n.removed=!1)}),Tt.arrayOf(this.formatter.filterLog.bind(this.formatter))(i)})}getEtherPrice(){return Cr(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Cr(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Qr.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Cr(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;let i=yield this._getResolver(r,"getResolver");if(i!=null){let n=new y3(this,i,e);return r!==e&&!(yield n.supportsWildcard())?null:n}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Cr(this,void 0,void 0,function*(){r==null&&(r="ENS");let i=yield this.getNetwork();i.ensAddress||Qr.throwError("network does not support ENS",ce.errors.UNSUPPORTED_OPERATION,{operation:r,network:i.name});try{let n=yield this.call({to:i.ensAddress,data:"0x0178b8bf"+up(e).substring(2)});return this.formatter.callAddress(n)}catch{}return null})}resolveName(e){return Cr(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(i){if(Qt(e))throw i}typeof e!="string"&&Qr.throwArgumentError("invalid ENS name","name",e);let r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Cr(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);let r=e.substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(r,"lookupAddress");if(i==null)return null;let n=vE(yield this.call({to:i,data:"0x691f3431"+up(r).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n})}getAvatar(e){return Cr(this,void 0,void 0,function*(){let r=null;if(Qt(e)){let o=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(o,"getAvatar");if(!s)return null;r=new y3(this,s,o);try{let a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ce.errors.CALL_EXCEPTION)throw a}try{let a=vE(yield this.call({to:s,data:"0x691f3431"+up(o).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ce.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;let i=yield r.getAvatar();return i==null?null:i.url})}perform(e,r){return Qr.throwError(e+" not implemented",ce.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,i){let n=new yL(b3(e),r,i);return this._events.push(n),this._startEvent(n),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let i=!1,n=[],o=b3(e);return this._events=this._events.filter(s=>s.tag!==o?!0:(setTimeout(()=>{s.listener.apply(this,r)},0),i=!0,s.once?(n.push(s),!1):!0)),n.forEach(s=>{this._stopEvent(s)}),i}listenerCount(e){if(!e)return this._events.length;let r=b3(e);return this._events.filter(i=>i.tag===r).length}listeners(e){if(e==null)return this._events.map(i=>i.listener);let r=b3(e);return this._events.filter(i=>i.tag===r).map(i=>i.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);let i=[],n=!1,o=b3(e);return this._events=this._events.filter(s=>s.tag!==o||s.listener!=r||n?!0:(n=!0,i.push(s),!1)),i.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{let i=b3(e);this._events=this._events.filter(n=>n.tag!==i?!0:(r.push(n),!1))}return r.forEach(i=>{this._stopEvent(i)}),this}};var Ch=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},so=new ce(ki),eKe=["call","estimateGas"];function M5(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){let r=Qt(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(let r in t){let i=M5(t[r],e);if(i)return i}return null}if(typeof t=="string")try{return M5(JSON.parse(t),e)}catch{}return null}function O1e(t,e,r){let i=r.transaction||r.signedTransaction;if(t==="call"){let o=M5(e,!0);if(o)return o.data;so.throwError("missing revert data in call exception; Transaction reverted without a reason string",ce.errors.CALL_EXCEPTION,{data:"0x",transaction:i,error:e})}if(t==="estimateGas"){let o=M5(e.body,!1);o==null&&(o=M5(e,!1)),o&&so.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ce.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:t,transaction:i,error:e})}let n=e.message;throw e.code===ce.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText),n=(n||"").toLowerCase(),n.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&so.throwError("insufficient funds for intrinsic transaction cost",ce.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:i}),n.match(/nonce (is )?too low/i)&&so.throwError("nonce has already been used",ce.errors.NONCE_EXPIRED,{error:e,method:t,transaction:i}),n.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&so.throwError("replacement fee too low",ce.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:i}),n.match(/only replay-protected/i)&&so.throwError("legacy pre-eip-155 transactions not supported",ce.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:i}),eKe.indexOf(t)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&so.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ce.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:i}),e}function P1e(t){return new Promise(function(e){setTimeout(e,t)})}function tKe(t){if(t.error){let e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function O5(t){return t&&t.toLowerCase()}var xL={},x3=class extends ta{constructor(e,r,i){if(super(),e!==xL)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");_e(this,"provider",r),i==null&&(i=0),typeof i=="string"?(_e(this,"_address",this.provider.formatter.address(i)),_e(this,"_index",null)):typeof i=="number"?(_e(this,"_index",i),_e(this,"_address",null)):so.throwArgumentError("invalid address or index","addressOrIndex",i)}connect(e){return so.throwError("cannot alter JSON-RPC Signer connection",ce.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new _L(xL,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&so.throwError("unknown account #"+this._index,ce.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=bi(e);let r=this.getAddress().then(i=>(i&&(i=i.toLowerCase()),i));if(e.gasLimit==null){let i=bi(e);i.from=r,e.gasLimit=this.provider.estimateGas(i)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(i=>Ch(this,void 0,void 0,function*(){if(i==null)return null;let n=yield this.provider.resolveName(i);return n==null&&so.throwArgumentError("provided ENS name resolves to null","tx.to",i),n}))),Vi({tx:Vi(e),sender:r}).then(({tx:i,sender:n})=>{i.from!=null?i.from.toLowerCase()!==n&&so.throwArgumentError("from address mismatch","transaction",e):i.from=n;let o=this.provider.constructor.hexlifyTransaction(i,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&so.throwError("user rejected transaction",ce.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:i}),O1e("sendTransaction",s,o)))})}signTransaction(e){return so.throwError("signing transactions is unsupported",ce.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Ch(this,void 0,void 0,function*(){let r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),i=yield this.sendUncheckedTransaction(e);try{return yield uu(()=>Ch(this,void 0,void 0,function*(){let n=yield this.provider.getTransaction(i);if(n!==null)return this.provider._wrapTransaction(n,i,r)}),{oncePoll:this.provider})}catch(n){throw n.transactionHash=i,n}})}signMessage(e){return Ch(this,void 0,void 0,function*(){let r=typeof e=="string"?gi(e):e,i=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Ue(r),i.toLowerCase()])}catch(n){throw typeof n.message=="string"&&n.message.match(/user denied/i)&&so.throwError("user rejected signing",ce.errors.ACTION_REJECTED,{action:"signMessage",from:i,messageData:e}),n}})}_legacySignMessage(e){return Ch(this,void 0,void 0,function*(){let r=typeof e=="string"?gi(e):e,i=yield this.getAddress();try{return yield this.provider.send("eth_sign",[i.toLowerCase(),Ue(r)])}catch(n){throw typeof n.message=="string"&&n.message.match(/user denied/i)&&so.throwError("user rejected signing",ce.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:i,messageData:e}),n}})}_signTypedData(e,r,i){return Ch(this,void 0,void 0,function*(){let n=yield Nn.resolveNames(e,r,i,s=>this.provider.resolveName(s)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Nn.getPayload(n.domain,r,n.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&so.throwError("user rejected signing",ce.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:r,value:n.value}}),s}})}unlock(e){return Ch(this,void 0,void 0,function*(){let r=this.provider,i=yield this.getAddress();return r.send("personal_unlockAccount",[i.toLowerCase(),e,null])})}},_L=class extends x3{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:i=>this.provider.waitForTransaction(r,i)}))}},rKe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},ka=class extends jf{constructor(e,r){let i=r;i==null&&(i=new Promise((n,o)=>{setTimeout(()=>{this.detectNetwork().then(s=>{n(s)},s=>{o(s)})},0)})),super(i),e||(e=Rn(this.constructor,"defaultUrl")()),typeof e=="string"?_e(this,"connection",Object.freeze({url:e})):_e(this,"connection",Object.freeze(bi(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Ch(this,void 0,void 0,function*(){yield P1e(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){let r=Rn(this.constructor,"getNetwork");try{return r(De.from(e).toNumber())}catch(i){return so.throwError("could not detect network",ce.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:i})}}return so.throwError("could not detect network",ce.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new x3(xL,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){let i={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Tn(i),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];let o=lu(this.connection,JSON.stringify(i),tKe).then(s=>(this.emit("debug",{action:"response",request:i,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:i,provider:this}),s});return n&&(this._cache[e]=o,setTimeout(()=>{this._cache[e]=null},0)),o}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[O5(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[O5(r.address),r.blockTag]];case"getCode":return["eth_getCode",[O5(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[O5(r.address),Jr(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":{let i=Rn(this.constructor,"hexlifyTransaction");return["eth_call",[i(r.transaction,{from:!0}),r.blockTag]]}case"estimateGas":{let i=Rn(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[i(r.transaction,{from:!0})]]}case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=O5(r.filter.address)),["eth_getLogs",[r.filter]];default:break}return null}perform(e,r){return Ch(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){let n=r.transaction;if(n&&n.type!=null&&De.from(n.type).isZero()&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){let o=yield this.getFeeData();o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(r=bi(r),r.transaction=bi(n),delete r.transaction.type)}}let i=this.prepareRequest(e,r);i==null&&so.throwError(e+" not implemented",ce.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(i[0],i[1])}catch(n){return O1e(e,n,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;let e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(i){function n(){e.send("eth_getFilterChanges",[i]).then(function(o){if(e._pendingFilter!=r)return null;let s=Promise.resolve();return o.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),s.then(function(){return P1e(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[i]);return}return setTimeout(function(){n()},0),null}).catch(o=>{})}return n(),i}).catch(i=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){let i=bi(rKe);if(r)for(let o in r)r[o]&&(i[o]=!0);zw(e,i);let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(o){if(e[o]==null)return;let s=Cf(De.from(e[o]));o==="gasLimit"&&(o="gas"),n[o]=s}),["from","to","data"].forEach(function(o){e[o]!=null&&(n[o]=Ue(e[o]))}),e.accessList&&(n.accessList=vc(e.accessList)),n}};var _3=null;try{if(_3=WebSocket,_3==null)throw new Error("inject please")}catch{let e=new ce(ki);_3=function(){e.throwError("WebSockets not supported in this environment",ce.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var EL=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},bE=new ce(ki),iKe=1,Sh=class extends ka{constructor(e,r){r==="any"&&bE.throwError("WebSocketProvider does not support 'any' network yet",ce.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof e=="string"?super(e,r):super("_websocket",r),this._pollingInterval=-1,this._wsReady=!1,typeof e=="string"?_e(this,"_websocket",new _3(this.connection.url)):_e(this,"_websocket",e),_e(this,"_requests",{}),_e(this,"_subs",{}),_e(this,"_subIds",{}),_e(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(n=>{this.websocket.send(this._requests[n].payload)})},this.websocket.onmessage=n=>{let o=n.data,s=JSON.parse(o);if(s.id!=null){let a=String(s.id),c=this._requests[a];if(delete this._requests[a],s.result!==void 0)c.callback(null,s.result),this.emit("debug",{action:"response",request:JSON.parse(c.payload),response:s.result,provider:this});else{let h=null;s.error?(h=new Error(s.error.message||"unknown error"),_e(h,"code",s.error.code||null),_e(h,"response",o)):h=new Error("unknown error"),c.callback(h,void 0),this.emit("debug",{action:"response",error:h,request:JSON.parse(c.payload),provider:this})}}else if(s.method==="eth_subscription"){let a=this._subs[s.params.subscription];a&&a.processFunc(s.params.result)}else console.warn("this should not happen")};let i=setInterval(()=>{this.emit("poll")},1e3);i.unref&&i.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){bE.throwError("cannot reset events block on WebSocketProvider",ce.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){bE.throwError("cannot set polling interval on WebSocketProvider",ce.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return EL(this,void 0,void 0,function*(){return null})}set polling(e){!e||bE.throwError("cannot set polling on WebSocketProvider",ce.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,r){let i=iKe++;return new Promise((n,o)=>{function s(c,h){return c?o(c):n(h)}let a=JSON.stringify({method:e,params:r,id:i,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(i)]={callback:s,payload:a},this._wsReady&&this.websocket.send(a)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,r,i){return EL(this,void 0,void 0,function*(){let n=this._subIds[e];n==null&&(n=Promise.all(r).then(s=>this.send("eth_subscribe",s)),this._subIds[e]=n);let o=yield n;this._subs[o]={tag:e,processFunc:i}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],r=>{let i=De.from(r.number).toNumber();this._emitted.block=i,this.emit("block",i)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(e.filter,this.formatter.filterLog(r))});break;case"tx":{let r=i=>{let n=i.hash;this.getTransactionReceipt(n).then(o=>{!o||this.emit(n,o)})};r(e),this._subscribe("tx",["newHeads"],i=>{this._events.filter(n=>n.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}}_stopEvent(e){let r=e.tag;if(e.type==="tx"){if(this._events.filter(n=>n.type==="tx").length)return;r="tx"}else if(this.listenerCount(e.event))return;let i=this._subIds[r];!i||(delete this._subIds[r],i.then(n=>{!this._subs[n]||(delete this._subs[n],this.send("eth_unsubscribe",[n]))}))}destroy(){return EL(this,void 0,void 0,function*(){this.websocket.readyState===_3.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}};var nKe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},D5=new ce(ki),L5=class extends ka{detectNetwork(){let e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return nKe(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||D5.throwError("no network detected",ce.errors.UNKNOWN_ERROR,{}),this._network==null&&(_e(this,"_network",r),this.emit("network",r,null))),r})}},Uo=class extends L5{constructor(e,r){D5.checkAbstract(new.target,Uo),e=Rn(new.target,"getNetwork")(e),r=Rn(new.target,"getApiKey")(r);let i=Rn(new.target,"getUrl")(e,r);super(i,e),typeof r=="string"?_e(this,"apiKey",r):r!=null&&Object.keys(r).forEach(n=>{_e(this,n,r[n])})}_startPending(){D5.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return D5.throwError("API provider does not support signing",ce.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,r){return D5.throwError("not implemented; sub-classes must override getUrl",ce.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}};var M1e=new ce(ki),yE="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",B5=class extends Sh{constructor(e,r){let i=new E3(e,r),n=i.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(n,i.network),_e(this,"apiKey",i.apiKey)}isCommunityResource(){return this.apiKey===yE}},E3=class extends Uo{static getWebSocketProvider(e,r){return new B5(e,r)}static getApiKey(e){return e==null?yE:(e&&typeof e!="string"&&M1e.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,r){let i=null;switch(e.name){case"homestead":i="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":i="eth-goerli.g.alchemy.com/v2/";break;case"matic":i="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":i="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":i="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":i="arb-goerli.g.alchemy.com/v2/";break;case"optimism":i="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":i="opt-goerli.g.alchemy.com/v2/";break;default:M1e.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+i+r,throttleCallback:(n,o)=>(r===yE&&Ff(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===yE}};var oKe=new ce(ki),xE="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function sKe(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return oKe.throwArgumentError("unsupported network","name",t)}var U5=class extends Uo{isCommunityResource(){return this.apiKey===xE}static getApiKey(e){return e??xE}static getUrl(e,r){r==null&&(r=xE);let i={allowGzip:!0,url:"https://"+sKe(e.name)+r,throttleCallback:(n,o)=>(r.apiKey===xE&&Ff(),Promise.resolve(!0))};return r.projectSecret!=null&&(i.user="",i.password=r.projectSecret),i}};var aKe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},D1e=new ce(ki),F5=class extends Uo{static getApiKey(e){return e!=null&&D1e.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,r){let i=null;switch(e.name){case"homestead":i="https://cloudflare-eth.com/";break;default:D1e.throwArgumentError("unsupported network","network",arguments[0])}return i}perform(e,r){let i=Object.create(null,{perform:{get:()=>super.perform}});return aKe(this,void 0,void 0,function*(){return e==="getBlockNumber"?(yield i.perform.call(this,"getBlock",{blockTag:"latest"})).number:i.perform.call(this,e,r)})}};var _E=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},wp=new ce(ki);function L1e(t){let e={};for(let r in t){if(t[r]==null)continue;let i=t[r];r==="type"&&i===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?i=Cf(Ue(i)):r==="accessList"?i="["+vc(i).map(n=>`{address:"${n.address}",storageKeys:["${n.storageKeys.join('","')}"]}`).join(",")+"]":i=Ue(i),e[r]=i)}return e}function cKe(t){if(t.status==0&&(t.message==="No records found"||t.message==="No transactions found"))return t.result;if(t.status!=1||typeof t.message!="string"||!t.message.match(/^OK/)){let e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function B1e(t){if(t&&t.status==0&&t.message=="NOTOK"&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){let e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if(t.jsonrpc!="2.0"){let e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){let e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function U1e(t){if(t==="pending")throw new Error("pending not supported");return t==="latest"?t:parseInt(t.substring(2),16)}function AL(t,e,r){if(t==="call"&&e.code===ce.errors.SERVER_ERROR){let n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){let o=n.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),Qt(o))return o;wp.throwError("missing revert data in call exception",ce.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let i=e.message;throw e.code===ce.errors.SERVER_ERROR&&(e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText)),i=(i||"").toLowerCase(),i.match(/insufficient funds/)&&wp.throwError("insufficient funds for intrinsic transaction cost",ce.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&wp.throwError("nonce has already been used",ce.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),i.match(/another transaction with same nonce/)&&wp.throwError("replacement fee too low",ce.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),i.match(/execution failed due to an exception|execution reverted/)&&wp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ce.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}var j5=class extends jf{constructor(e,r){super(e),_e(this,"baseUrl",this.getBaseUrl()),_e(this,"apiKey",r||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";default:}return wp.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,r){let i=Object.keys(r).reduce((o,s)=>{let a=r[s];return a!=null&&(o+=`&${s}=${a}`),o},""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${i}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}fetch(e,r,i){return _E(this,void 0,void 0,function*(){let n=i?this.getPostUrl():this.getUrl(e,r),o=i?this.getPostData(e,r):null,s=e==="proxy"?B1e:cKe;this.emit("debug",{action:"request",request:n,provider:this});let a={url:n,throttleSlotInterval:1e3,throttleCallback:(g,w)=>(this.isCommunityResource()&&Ff(),Promise.resolve(!0))},c=null;o&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},c=Object.keys(o).map(g=>`${g}=${o[g]}`).join("&"));let h=yield lu(a,c,s||B1e);return this.emit("debug",{action:"response",request:n,response:Tn(h),provider:this}),h})}detectNetwork(){return _E(this,void 0,void 0,function*(){return this.network})}perform(e,r){let i=Object.create(null,{perform:{get:()=>super.perform}});return _E(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(n=>AL("sendTransaction",n,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");let n=L1e(r.transaction);n.module="proxy",n.action="eth_call";try{return yield this.fetch("proxy",n,!0)}catch(o){return AL("call",o,r.transaction)}}case"estimateGas":{let n=L1e(r.transaction);n.module="proxy",n.action="eth_estimateGas";try{return yield this.fetch("proxy",n,!0)}catch(o){return AL("estimateGas",o,r.transaction)}}case"getLogs":{let n={action:"getLogs"};if(r.filter.fromBlock&&(n.fromBlock=U1e(r.filter.fromBlock)),r.filter.toBlock&&(n.toBlock=U1e(r.filter.toBlock)),r.filter.address&&(n.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&wp.throwError("unsupported topic count",ce.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){let a=r.filter.topics[0];(typeof a!="string"||a.length!==66)&&wp.throwError("unsupported topic format",ce.errors.UNSUPPORTED_OPERATION,{topic0:a}),n.topic0=a}let o=yield this.fetch("logs",n),s={};for(let a=0;a<o.length;a++){let c=o[a];if(c.blockHash==null){if(s[c.blockNumber]==null){let h=yield this.getBlock(c.blockNumber);h&&(s[c.blockNumber]=h.hash)}c.blockHash=s[c.blockNumber]}}return o}case"getEtherPrice":return this.network.name!=="homestead"?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd);default:break}return i.perform.call(this,e,r)})}getHistory(e,r,i){return _E(this,void 0,void 0,function*(){let n={action:"txlist",address:yield this.resolveName(e),startblock:r??0,endblock:i??99999999,sort:"asc"};return(yield this.fetch("account",n)).map(s=>{["contractAddress","to"].forEach(function(c){s[c]==""&&delete s[c]}),s.creates==null&&s.contractAddress!=null&&(s.creates=s.contractAddress);let a=this.formatter.transactionResponse(s);return s.timeStamp&&(a.timestamp=parseInt(s.timeStamp)),a})})}isCommunityResource(){return this.apiKey==null}};var CE=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(g){try{h(i.next(g))}catch(w){s(w)}}function c(g){try{h(i.throw(g))}catch(w){s(w)}}function h(g){g.done?o(g.value):n(g.value).then(a,c)}h((i=i.apply(t,e||[])).next())})},Km=new ce(ki);function EE(){return new Date().getTime()}function F1e(t){let e=null;for(let r=0;r<t.length;r++){let i=t[r];if(i==null)return null;e?e.name===i.name&&e.chainId===i.chainId&&(e.ensAddress===i.ensAddress||e.ensAddress==null&&i.ensAddress==null)||Km.throwArgumentError("provider mismatch","networks",t):e=i}return e}function j1e(t,e){t=t.slice().sort();let r=Math.floor(t.length/2);if(t.length%2)return t[r];let i=t[r-1],n=t[r];return e!=null&&Math.abs(i-n)>e?null:(i+n)/2}function A3(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(De.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>A3(e)));if(typeof t=="object"){let e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let i=t[r];return typeof i=="function"?i="[function]":i=A3(i),JSON.stringify(r)+":"+i}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}var lKe=1;function $1e(t){let e=null,r=null,i=new Promise(s=>{e=function(){r&&(clearTimeout(r),r=null),s()},r=setTimeout(e,t)}),n=s=>(i=i.then(s),i);function o(){return i}return{cancel:e,getPromise:o,wait:n}}var uKe=[ce.errors.CALL_EXCEPTION,ce.errors.INSUFFICIENT_FUNDS,ce.errors.NONCE_EXPIRED,ce.errors.REPLACEMENT_UNDERPRICED,ce.errors.UNPREDICTABLE_GAS_LIMIT],fKe=["address","args","errorArgs","errorSignature","method","transaction"];function AE(t,e){let r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function hKe(t,e){return function(r){let i={};r.forEach(o=>{let s=t(o.result);i[s]||(i[s]={count:0,result:o.result}),i[s].count++});let n=Object.keys(i);for(let o=0;o<n.length;o++){let s=i[n[o]];if(s.count>=e)return s.result}}}function dKe(t,e,r){let i=A3;switch(e){case"getBlockNumber":return function(n){let o=n.map(a=>a.result),s=j1e(n.map(a=>a.result),2);if(s!=null)return s=Math.ceil(s),o.indexOf(s+1)>=0&&s++,s>=t._highestBlockNumber&&(t._highestBlockNumber=s),t._highestBlockNumber};case"getGasPrice":return function(n){let o=n.map(s=>s.result);return o.sort(),o[Math.floor(o.length/2)]};case"getEtherPrice":return function(n){return j1e(n.map(o=>o.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":i=function(n){return n==null?null:(n=bi(n),n.confirmations=-1,A3(n))};break;case"getBlock":r.includeTransactions?i=function(n){return n==null?null:(n=bi(n),n.transactions=n.transactions.map(o=>(o=bi(o),o.confirmations=-1,o)),A3(n))}:i=function(n){return n==null?null:A3(n)};break;default:throw new Error("unknown method: "+e)}return hKe(i,t.quorum)}function $5(t,e){return CE(this,void 0,void 0,function*(){let r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:uu(()=>new Promise((i,n)=>{setTimeout(function(){return r.blockNumber>=e?i(r):t.cancelled?i(null):i(void 0)},0)}),{oncePoll:r})})}function pKe(t,e,r,i){return CE(this,void 0,void 0,function*(){let n=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return n[r]();case"getEtherPrice":if(n.getEtherPrice)return n.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),n[r](i.address,i.blockTag||"latest");case"getStorageAt":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),n.getStorageAt(i.address,i.position,i.blockTag||"latest");case"getBlock":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),n[i.includeTransactions?"getBlockWithTransactions":"getBlock"](i.blockTag||i.blockHash);case"call":case"estimateGas":return i.blockTag&&Qt(i.blockTag)&&(n=yield $5(t,e)),r==="call"&&i.blockTag?n[r](i.transaction,i.blockTag):n[r](i.transaction);case"getTransaction":case"getTransactionReceipt":return n[r](i.transactionHash);case"getLogs":{let o=i.filter;return(o.fromBlock&&Qt(o.fromBlock)||o.toBlock&&Qt(o.toBlock))&&(n=yield $5(t,e)),n.getLogs(o)}}return Km.throwError("unknown method error",ce.errors.UNKNOWN_ERROR,{method:r,params:i})})}var W5=class extends jf{constructor(e,r){e.length===0&&Km.throwArgumentError("missing providers","providers",e);let i=e.map((s,a)=>{if(Ia.isProvider(s)){let g=k5(s)?2e3:750;return Object.freeze({provider:s,weight:1,stallTimeout:g,priority:1})}let c=bi(s);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=k5(s)?2e3:750),c.weight==null&&(c.weight=1);let h=c.weight;return(h%1||h>512||h<1)&&Km.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,h),Object.freeze(c)}),n=i.reduce((s,a)=>s+a.weight,0);r==null?r=n/2:r>n&&Km.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let o=F1e(i.map(s=>s.provider.network));o==null&&(o=new Promise((s,a)=>{setTimeout(()=>{this.detectNetwork().then(s,a)},0)})),super(o),_e(this,"providerConfigs",Object.freeze(i)),_e(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return CE(this,void 0,void 0,function*(){let e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return F1e(e)})}perform(e,r){return CE(this,void 0,void 0,function*(){if(e==="sendTransaction"){let c=yield Promise.all(this.providerConfigs.map(h=>h.provider.sendTransaction(r.signedTransaction).then(g=>g.hash,g=>g)));for(let h=0;h<c.length;h++){let g=c[h];if(typeof g=="string")return g}throw c[0]}this._highestBlockNumber===-1&&e!=="getBlockNumber"&&(yield this.getBlockNumber());let i=dKe(this,e,r),n=C5(this.providerConfigs.map(bi));n.sort((c,h)=>c.priority-h.priority);let o=this._highestBlockNumber,s=0,a=!0;for(;;){let c=EE(),h=n.filter(E=>E.runner&&c-E.start<E.stallTimeout).reduce((E,I)=>E+I.weight,0);for(;h<this.quorum&&s<n.length;){let E=n[s++],I=lKe++;E.start=EE(),E.staller=$1e(E.stallTimeout),E.staller.wait(()=>{E.staller=null}),E.runner=pKe(E,o,e,r).then(k=>{E.done=!0,E.result=k,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:I,backend:AE(E,EE()),request:{method:e,params:Tn(r)},provider:this})},k=>{E.done=!0,E.error=k,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:I,backend:AE(E,EE()),request:{method:e,params:Tn(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:I,backend:AE(E,null),request:{method:e,params:Tn(r)},provider:this}),h+=E.weight}let g=[];n.forEach(E=>{E.done||!E.runner||(g.push(E.runner),E.staller&&g.push(E.staller.getPromise()))}),g.length&&(yield Promise.race(g));let w=n.filter(E=>E.done&&E.error==null);if(w.length>=this.quorum){let E=i(w);if(E!==void 0)return n.forEach(I=>{I.staller&&I.staller.cancel(),I.cancelled=!0}),E;a||(yield $1e(100).getPromise()),a=!1}let A=n.reduce((E,I)=>{if(!I.done||I.error==null)return E;let k=I.error.code;return uKe.indexOf(k)>=0&&(E[k]||(E[k]={error:I.error,weight:0}),E[k].weight+=I.weight),E},{});if(Object.keys(A).forEach(E=>{let I=A[E];if(I.weight<this.quorum)return;n.forEach(j=>{j.staller&&j.staller.cancel(),j.cancelled=!0});let k=I.error,M={};fKe.forEach(j=>{k[j]!=null&&(M[j]=k[j])}),Km.throwError(k.reason||k.message,E,M)}),n.filter(E=>!E.done).length===0)break}return n.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),Km.throwError("failed to meet quorum",ce.errors.SERVER_ERROR,{method:e,params:r,results:n.map(c=>AE(c)),provider:this})})}};var CL=null;var SE=new ce(ki),q5="84842078b09946638c03157f83405213",H5=class extends Sh{constructor(e,r){let i=new C3(e,r),n=i.connection;n.password&&SE.throwError("INFURA WebSocket project secrets unsupported",ce.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});let o=n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,e),_e(this,"apiKey",i.projectId),_e(this,"projectId",i.projectId),_e(this,"projectSecret",i.projectSecret)}isCommunityResource(){return this.projectId===q5}},C3=class extends Uo{static getWebSocketProvider(e,r){return new H5(e,r)}static getApiKey(e){let r={apiKey:q5,projectId:q5,projectSecret:null};return e==null||(typeof e=="string"?r.projectId=e:e.projectSecret!=null?(SE.assertArgument(typeof e.projectId=="string","projectSecret requires a projectId","projectId",e.projectId),SE.assertArgument(typeof e.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),r.projectId=e.projectId,r.projectSecret=e.projectSecret):e.projectId&&(r.projectId=e.projectId),r.apiKey=r.projectId),r}static getUrl(e,r){let i=null;switch(e?e.name:"unknown"){case"homestead":i="mainnet.infura.io";break;case"goerli":i="goerli.infura.io";break;case"sepolia":i="sepolia.infura.io";break;case"matic":i="polygon-mainnet.infura.io";break;case"maticmum":i="polygon-mumbai.infura.io";break;case"optimism":i="optimism-mainnet.infura.io";break;case"optimism-goerli":i="optimism-goerli.infura.io";break;case"arbitrum":i="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":i="arbitrum-goerli.infura.io";break;default:SE.throwError("unsupported network",ce.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n={allowGzip:!0,url:"https://"+i+"/v3/"+r.projectId,throttleCallback:(o,s)=>(r.projectId===q5&&Ff(),Promise.resolve(!0))};return r.projectSecret!=null&&(n.user="",n.password=r.projectSecret),n}isCommunityResource(){return this.projectId===q5}};var IE=class extends ka{send(e,r){let i={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);let n={request:i,resolve:null,reject:null},o=new Promise((s,a)=>{n.resolve=s,n.reject=a});return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{let s=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;let a=s.map(c=>c.request);return this.emit("debug",{action:"requestBatch",request:Tn(a),provider:this}),lu(this.connection,JSON.stringify(a)).then(c=>{this.emit("debug",{action:"response",request:a,response:c,provider:this}),s.forEach((h,g)=>{let w=c[g];if(w.error){let A=new Error(w.error.message);A.code=w.error.code,A.data=w.error.data,h.reject(A)}else h.resolve(w.result)})},c=>{this.emit("debug",{action:"response",error:c,request:a,provider:this}),s.forEach(h=>{h.reject(c)})})},10)),o}};var SL=new ce(ki),mKe="ETHERS_JS_SHARED",z5=class extends Uo{static getApiKey(e){return e&&typeof e!="string"&&SL.throwArgumentError("invalid apiKey","apiKey",e),e||mKe}static getUrl(e,r){SL.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let i=null;switch(e.name){case"homestead":i="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":i="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":i="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":i="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":i="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:SL.throwArgumentError("unsupported network","network",arguments[0])}return i+"?apiKey="+r}};var W1e=new ce(ki),q1e="62e1ad51b37b8e00394bda3b",V5=class extends Uo{static getApiKey(e){let r={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return e==null?r.applicationId=q1e:typeof e=="string"?r.applicationId=e:e.applicationSecretKey!=null?(r.applicationId=e.applicationId,r.applicationSecretKey=e.applicationSecretKey):e.applicationId?r.applicationId=e.applicationId:W1e.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),r}static getUrl(e,r){let i=null;switch(e?e.name:"unknown"){case"goerli":i="eth-goerli.gateway.pokt.network";break;case"homestead":i="eth-mainnet.gateway.pokt.network";break;case"kovan":i="poa-kovan.gateway.pokt.network";break;case"matic":i="poly-mainnet.gateway.pokt.network";break;case"maticmum":i="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":i="eth-rinkeby.gateway.pokt.network";break;case"ropsten":i="eth-ropsten.gateway.pokt.network";break;default:W1e.throwError("unsupported network",ce.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n=`https://${i}/v1/lb/${r.applicationId}`,o={headers:{},url:n};return r.applicationSecretKey!=null&&(o.user="",o.password=r.applicationSecretKey),o}isCommunityResource(){return this.applicationId===q1e}};var H1e=new ce(ki),gKe=1;function z1e(t,e){let r="Web3LegacyFetcher";return function(i,n){let o={method:i,params:n,id:gKe++,jsonrpc:"2.0"};return new Promise((s,a)=>{this.emit("debug",{action:"request",fetcher:r,request:Tn(o),provider:this}),e(o,(c,h)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:o,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:h,provider:this}),h.error){let g=new Error(h.error.message);return g.code=h.error.code,g.data=h.error.data,a(g)}s(h.result)})})}}function wKe(t){return function(e,r){r==null&&(r=[]);let i={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Tn(i),provider:this}),t.request(i).then(n=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:n,provider:this}),n),n=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:n,provider:this}),n})}}var K5=class extends ka{constructor(e,r){e==null&&H1e.throwArgumentError("missing provider","provider",e);let i=null,n=null,o=null;typeof e=="function"?(i="unknown:",n=e):(i=e.host||e.path||"",!i&&e.isMetaMask&&(i="metamask"),o=e,e.request?(i===""&&(i="eip-1193:"),n=wKe(e)):e.sendAsync?n=z1e(e,e.sendAsync.bind(e)):e.send?n=z1e(e,e.send.bind(e)):H1e.throwArgumentError("unsupported provider","provider",e),i||(i="unknown:")),super(i,r),_e(this,"jsonRpcFetchFunc",n),_e(this,"provider",o)}send(e,r){return this.jsonRpcFetchFunc(e,r)}};var V1e=new ce(ki);function TE(t,e){if(t==null&&(t="homestead"),typeof t=="string"){let i=t.match(/^(ws|http)s?:/i);if(i)switch(i[1].toLowerCase()){case"http":case"https":return new ka(t);case"ws":case"wss":return new Sh(t);default:V1e.throwArgumentError("unsupported URL scheme","network",t)}}let r=I5(t);return(!r||!r._defaultProvider)&&V1e.throwError("unsupported getDefaultProvider network",ce.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:W5,AlchemyProvider:E3,AnkrProvider:U5,CloudflareProvider:F5,EtherscanProvider:j5,InfuraProvider:C3,JsonRpcProvider:ka,NodesmithProvider:z5,PocketProvider:V5,Web3Provider:K5,IpcProvider:null},e)}var bc={};qr(bc,{AbiCoder:()=>Jw,ConstructorFragment:()=>Es,ErrorFragment:()=>dc,EventFragment:()=>Qs,FormatTypes:()=>ui,Fragment:()=>Xs,FunctionFragment:()=>As,HDNode:()=>Bo,Indexed:()=>ph,Interface:()=>fp,LogDescription:()=>t3,Logger:()=>ce,ParamType:()=>dn,RLP:()=>A_,SigningKey:()=>ml,SupportedAlgorithm:()=>Bf,TransactionDescription:()=>r3,TransactionTypes:()=>eE,UnicodeNormalizationForm:()=>ea,Utf8ErrorFuncs:()=>U_,Utf8ErrorReason:()=>Cs,_TypedDataEncoder:()=>Nn,_fetchData:()=>dL,_toEscapedUtf8String:()=>vD,accessListify:()=>vc,arrayify:()=>Pe,base58:()=>bh,base64:()=>AD,checkProperties:()=>zw,checkResultErrors:()=>Kw,commify:()=>eme,computeAddress:()=>gl,computeHmac:()=>yh,computePublicKey:()=>v5,concat:()=>Hr,deepCopy:()=>Tn,defaultAbiCoder:()=>d5,defaultPath:()=>xh,defineReadOnly:()=>_e,dnsEncode:()=>m5,entropyToMnemonic:()=>Vm,fetchJson:()=>lu,formatBytes32String:()=>bD,formatEther:()=>tme,formatUnits:()=>IL,getAccountPath:()=>Vpe,getAddress:()=>Vr,getContractAddress:()=>Bm,getCreate2Address:()=>ade,getIcapAddress:()=>sde,getJsonWalletAddress:()=>cL,getStatic:()=>Rn,hashMessage:()=>e3,hexConcat:()=>no,hexDataLength:()=>_s,hexDataSlice:()=>zi,hexStripZeros:()=>aD,hexValue:()=>Cf,hexZeroPad:()=>Jr,hexlify:()=>Ue,id:()=>pc,isAddress:()=>ode,isBytes:()=>cl,isBytesLike:()=>uh,isHexString:()=>Qt,isValidMnemonic:()=>zpe,isValidName:()=>SD,joinSignature:()=>i5,keccak256:()=>zr,mnemonicToEntropy:()=>m3,mnemonicToSeed:()=>tL,namehash:()=>up,nameprep:()=>ED,parseBytes32String:()=>yD,parseEther:()=>rme,parseTransaction:()=>tE,parseUnits:()=>TL,poll:()=>uu,randomBytes:()=>Uf,recoverAddress:()=>$m,recoverPublicKey:()=>X_,resolveProperties:()=>Vi,ripemd160:()=>_5,serializeTransaction:()=>b5,sha256:()=>Ra,sha512:()=>JD,shallowCopy:()=>bi,shuffled:()=>C5,solidityKeccak256:()=>Y1e,solidityPack:()=>kE,soliditySha256:()=>Z1e,splitSignature:()=>Sf,stripZeros:()=>fc,toUtf8Bytes:()=>gi,toUtf8CodePoints:()=>lp,toUtf8String:()=>Sa,verifyMessage:()=>l1e,verifyTypedData:()=>u1e,zeroPad:()=>Om});var K1e="solidity/5.7.0";var vKe=new RegExp("^bytes([0-9]+)$"),bKe=new RegExp("^(u?int)([0-9]*)$"),yKe=new RegExp("^(.*)\\[([0-9]*)\\]$"),xKe="0000000000000000000000000000000000000000000000000000000000000000",S3=new ce(K1e);function G1e(t,e,r){switch(t){case"address":return r?Om(e,32):Pe(e);case"string":return gi(e);case"bytes":return Pe(e);case"bool":return e=e?"0x01":"0x00",r?Om(e,32):Pe(e)}let i=t.match(bKe);if(i){let n=parseInt(i[2]||"256");return(i[2]&&String(n)!==i[2]||n%8!==0||n===0||n>256)&&S3.throwArgumentError("invalid number type","type",t),r&&(n=256),e=De.from(e).toTwos(n),Om(e,n/8)}if(i=t.match(vKe),i){let n=parseInt(i[1]);return(String(n)!==i[1]||n===0||n>32)&&S3.throwArgumentError("invalid bytes type","type",t),Pe(e).byteLength!==n&&S3.throwArgumentError(`invalid value for ${t}`,"value",e),r?Pe((e+xKe).substring(0,66)):e}if(i=t.match(yKe),i&&Array.isArray(e)){let n=i[1];parseInt(i[2]||String(e.length))!=e.length&&S3.throwArgumentError(`invalid array length for ${t}`,"value",e);let s=[];return e.forEach(function(a){s.push(G1e(n,a,!0))}),Hr(s)}return S3.throwArgumentError("invalid type","type",t)}function kE(t,e){t.length!=e.length&&S3.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);let r=[];return t.forEach(function(i,n){r.push(G1e(i,e[n]))}),Ue(Hr(r))}function Y1e(t,e){return zr(kE(t,e))}function Z1e(t,e){return Ra(kE(t,e))}var J1e="units/5.7.0";var Q1e=new ce(J1e),X1e=["wei","kwei","mwei","gwei","szabo","finney","ether"];function eme(t){let e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&Q1e.throwArgumentError("invalid value","value",t);let r=e[0],i="";for(r.substring(0,1)==="-"&&(i="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let n="";for(e.length===2&&(n="."+(e[1]||"0"));n.length>2&&n[n.length-1]==="0";)n=n.substring(0,n.length-1);let o=[];for(;r.length;)if(r.length<=3){o.unshift(r);break}else{let s=r.length-3;o.unshift(r.substring(s)),r=r.substring(0,s)}return i+o.join(",")+n}function IL(t,e){if(typeof e=="string"){let r=X1e.indexOf(e);r!==-1&&(e=3*r)}return Hw(t,e??18)}function TL(t,e){if(typeof t!="string"&&Q1e.throwArgumentError("value must be a string","value",t),typeof e=="string"){let r=X1e.indexOf(e);r!==-1&&(e=3*r)}return ul(t,e??18)}function tme(t){return IL(t,18)}function rme(t){return TL(t,18)}var NE="ethers/5.7.2";var ime=new ce(NE);try{let t=window;t._ethers==null&&(t._ethers=Ih)}catch{}var Ni={WALLET_ID:"@w3m/wallet_id",ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3};var Fo={getCaipDefaultChain(t){if(!!t)return{id:`${Je.EIP155}:${t.chainId}`,name:t.name,imageId:po.EIP155NetworkImageIds[t.chainId]}},hexStringToNumber(t){let e=t.startsWith("0x")?t.slice(2):t;return parseInt(e,16)},numberToHexString(t){return`0x${t.toString(16)}`},async getUserInfo(t){let[e,r]=await Promise.all([Fo.getAddress(t),Fo.getChainId(t)]);return{chainId:r,address:e}},async getChainId(t){let e=await t.request({method:"eth_chainId"});return Number(e)},async getAddress(t){let[e]=await t.request({method:"eth_accounts"});return e},async addEthereumChain(t,e){await t.request({method:"wallet_addEthereumChain",params:[{chainId:Fo.numberToHexString(e.chainId),rpcUrls:[e.rpcUrl],chainName:e.name,nativeCurrency:{name:e.currency,decimals:18,symbol:e.currency},blockExplorerUrls:[e.explorerUrl],iconUrls:[po.EIP155NetworkImageIds[e.chainId]]}]})}};cs();mn();var ao=er({provider:void 0,providerType:void 0,address:void 0,chainId:void 0,status:"reconnecting",isConnected:!1}),ht={state:ao,subscribeKey(t,e){return wi(ao,t,e)},subscribe(t){return jr(ao,()=>t(ao))},setProvider(t){t&&(ao.provider=Yo(t))},setProviderType(t){ao.providerType=t},setAddress(t){ao.address=t},setPreferredAccountType(t){ao.preferredAccountType=t},setChainId(t){ao.chainId=t},setStatus(t){ao.status=t},setIsConnected(t){ao.isConnected=t},setError(t){ao.error=t},reset(){ao.provider=void 0,ao.address=void 0,ao.chainId=void 0,ao.providerType=void 0,ao.status="disconnected",ao.isConnected=!1,ao.error=void 0,ao.preferredAccountType=void 0}};Ui();var PE=class extends zb{constructor(e){let{ethersConfig:r,siweConfig:i,chains:n,defaultChain:o,tokens:s,chainImages:a,_sdkVersion:c,...h}=e;if(!r)throw new Error("web3modal:constructor - ethersConfig is undefined");if(!h.projectId)throw new Error("web3modal:constructor - projectId is undefined");let g={switchCaipNetwork:async A=>{let E=Il.caipNetworkIdToNumber(A?.id);if(E)try{ht.setError(void 0),await this.switchNetwork(E)}catch(I){throw ht.setError(I),new Error("networkControllerClient:switchCaipNetwork - unable to switch chain")}},getApprovedCaipNetworksData:async()=>new Promise(async A=>{if(localStorage.getItem(Ni.WALLET_ID)?.includes(Je.WALLET_CONNECT_CONNECTOR_ID)){let I=await this.getWalletConnectProvider();if(!I)throw new Error("networkControllerClient:getApprovedCaipNetworks - provider is undefined");let k=I.signer?.session?.namespaces,M=k?.[Je.EIP155]?.methods,j=k?.[Je.EIP155]?.chains,W={supportsAllNetworks:M?.includes(Je.ADD_CHAIN_METHOD)??!1,approvedCaipNetworkIds:j};A(W)}else A({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})},w={connectWalletConnect:async A=>{let E=await this.getWalletConnectProvider();if(!E)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(E.on("display_uri",I=>{A(I)}),i?.options?.enabled){let{SIWEController:I,getDidChainId:k,getDidAddress:M}=await Promise.resolve().then(()=>(U0(),B0)),W=(await E.authenticate({nonce:await i.getNonce(),methods:OE.OPTIONAL_METHODS,...await i.getMessageParams()}))?.auths?.[0];if(W){let{p:G,s:Y}=W,te=k(G.iss),oe=M(G.iss);oe&&te&&I.setSession({address:oe,chainId:parseInt(te,10)});try{let Q=E.signer.client.formatAuthMessage({request:G,iss:G.iss});await I.verifyMessage({message:Q,signature:Y.s,cacao:W})}catch(Q){throw console.error("Error verifying message",Q),await E.disconnect().catch(console.error),await I.signOut().catch(console.error),Q}}}else await E.connect();await this.setWalletConnectProvider()},connectExternal:async({id:A,info:E,provider:I})=>{if(A===Je.INJECTED_CONNECTOR_ID){let k=r.injected;if(!k)throw new Error("connectionControllerClient:connectInjected - provider is undefined");try{ht.setError(void 0),await k.request({method:"eth_requestAccounts"}),this.setInjectedProvider(r)}catch(M){ht.setError(M)}}else if(A===Je.EIP6963_CONNECTOR_ID&&E&&I){try{ht.setError(void 0),await I.request({method:"eth_requestAccounts"})}catch(k){ht.setError(k)}this.setEIP6963Provider(I,E.name)}else if(A===Je.COINBASE_SDK_CONNECTOR_ID){let k=r.coinbase;if(!k)throw new Error("connectionControllerClient:connectCoinbase - connector is undefined");try{ht.setError(void 0),await k.request({method:"eth_requestAccounts"}),this.setCoinbaseProvider(r)}catch(M){throw ht.setError(M),new Error(M.message)}}},checkInstalled:A=>A?r.injected&&!window?.ethereum?!1:A.some(E=>Boolean(window.ethereum?.[String(E)])):Boolean(window.ethereum),disconnect:async()=>{let A=ht.state.provider,E=ht.state.providerType;if(localStorage.removeItem(Ni.WALLET_ID),ht.reset(),i?.options?.signOutOnDisconnect){let{SIWEController:I}=await Promise.resolve().then(()=>(U0(),B0));await I.signOut()}E===Je.WALLET_CONNECT_CONNECTOR_ID?await A.disconnect():A&&A.emit("disconnect")},signMessage:async A=>{let E=ht.state.provider;if(!E)throw new Error("connectionControllerClient:signMessage - provider is undefined");let I=bc.isHexString(A)?A:bc.hexlify(bc.toUtf8Bytes(A));return await E.request({method:"personal_sign",params:[I,this.getAddress()]})},parseUnits:(A,E)=>Ih.utils.parseUnits(A,E).toBigInt(),formatUnits:(A,E)=>Ih.utils.formatUnits(A,E),sendTransaction:async A=>{let E=ht.state.provider,I=ht.state.address;if(!E)throw new Error("connectionControllerClient:sendTransaction - provider is undefined");if(!I)throw new Error("connectionControllerClient:sendTransaction - address is undefined");let k={to:A.to,value:A.value,gasLimit:A.gas,gasPrice:A.gasPrice,data:A.data,type:0};return(await(await new Ih.providers.Web3Provider(E).getSigner().sendTransaction(k)).wait())?.blockHash||null}};super({networkControllerClient:g,connectionControllerClient:w,siweControllerClient:i,defaultChain:Fo.getCaipDefaultChain(o),tokens:mT.getCaipTokens(s),_sdkVersion:c??`html-ethers5-${Je.VERSION}`,...h}),this.hasSyncedConnectedAccount=!1,this.EIP6963Providers=[],this.options=void 0,this.options=e,this.metadata=r.metadata,this.projectId=h.projectId,this.chains=n,this.createProvider(),ht.subscribeKey("address",()=>{this.syncAccount()}),ht.subscribeKey("chainId",()=>{this.syncNetwork(a)}),this.syncRequestedNetworks(n,a),this.syncConnectors(r),r.injected&&this.checkActiveInjectedProvider(r),r.coinbase&&this.checkActiveCoinbaseProvider(r),typeof window<"u"&&(this.listenConnectors(!0),this.checkActive6963Provider()),this.setEIP6963Enabled(r.EIP6963)}getState(){let e=super.getState();return{...e,selectedNetworkId:Il.caipNetworkIdToNumber(e.selectedNetworkId)}}subscribeState(e){return super.subscribeState(r=>e({...r,selectedNetworkId:Il.caipNetworkIdToNumber(r.selectedNetworkId)}))}setAddress(e){let r=e?bc.getAddress(e):void 0;ht.setAddress(r)}getAddress(){let{address:e}=ht.state;return e&&bc.getAddress(e)}getError(){return ht.state.error}getChainId(){return ht.state.chainId}getStatus(){return ht.state.status}getIsConnected(){return ht.state.isConnected}getWalletProvider(){return ht.state.provider}getWalletProviderType(){return ht.state.providerType}subscribeProvider(e){return ht.subscribe(e)}async disconnect(){let{provider:e,providerType:r}=ht.state;localStorage.removeItem(Ni.WALLET_ID),ht.reset(),r==="injected"||r==="eip6963"?e?.emit("disconnect"):await e.disconnect()}createProvider(){return!this.walletConnectProviderInitPromise&&typeof window<"u"&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider()),this.walletConnectProviderInitPromise}async initWalletConnectProvider(){let e={projectId:this.projectId,showQrModal:!1,rpcMap:this.chains?this.chains.reduce((r,i)=>(r[i.chainId]=i.rpcUrl,r),{}):{},optionalChains:[...this.chains.map(r=>r.chainId)],metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]}};this.walletConnectProvider=await OE.default.init(e),await this.checkActiveWalletConnectProvider()}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{ht.setError(void 0),await this.createProvider()}catch(e){ht.setError(e)}return this.walletConnectProvider}syncRequestedNetworks(e,r){let i=e?.map(n=>({id:`${Je.EIP155}:${n.chainId}`,name:n.name,imageId:po.EIP155NetworkImageIds[n.chainId],imageUrl:r?.[n.chainId]}));this.setRequestedCaipNetworks(i??[])}async checkActiveWalletConnectProvider(){let e=await this.getWalletConnectProvider(),r=localStorage.getItem(Ni.WALLET_ID);e&&r===Je.WALLET_CONNECT_CONNECTOR_ID&&await this.setWalletConnectProvider();let i=ht.state.isConnected;ht.setStatus(i?"connected":"disconnected")}checkActiveInjectedProvider(e){let r=e.injected,i=localStorage.getItem(Ni.WALLET_ID);r&&i===Je.INJECTED_CONNECTOR_ID&&(this.setInjectedProvider(e),this.watchInjected(e))}checkActiveCoinbaseProvider(e){let r=e.coinbase,i=localStorage.getItem(Ni.WALLET_ID);r&&i===Je.COINBASE_SDK_CONNECTOR_ID&&(r._addresses&&r._addresses?.length>0?(this.setCoinbaseProvider(e),this.watchCoinbase(e)):(localStorage.removeItem(Ni.WALLET_ID),ht.reset()))}checkActive6963Provider(){let e=window?.localStorage.getItem(Ni.WALLET_ID);if(e){let r=this.EIP6963Providers.find(i=>i.info.name===e);r&&this.setEIP6963Provider(r.provider,r.info.name)}}async setWalletConnectProvider(){window?.localStorage.setItem(Ni.WALLET_ID,Je.WALLET_CONNECT_CONNECTOR_ID);let e=await this.getWalletConnectProvider();e&&(ht.setChainId(e.chainId),ht.setProviderType("walletConnect"),ht.setProvider(e),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(e.accounts?.[0]),this.watchWalletConnect())}async setEIP6963Provider(e,r){if(window?.localStorage.setItem(Ni.WALLET_ID,r),e){let{address:i,chainId:n}=await Fo.getUserInfo(e);i&&n&&(ht.setChainId(n),ht.setProviderType("eip6963"),ht.setProvider(e),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(i),this.watchEIP6963(e))}}async setInjectedProvider(e){window?.localStorage.setItem(Ni.WALLET_ID,Je.INJECTED_CONNECTOR_ID);let r=e.injected;if(r){let{address:i,chainId:n}=await Fo.getUserInfo(r);i&&n&&(ht.setChainId(n),ht.setProviderType("injected"),ht.setProvider(e.injected),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(i),this.watchCoinbase(e))}}async setCoinbaseProvider(e){window?.localStorage.setItem(Ni.WALLET_ID,Je.COINBASE_SDK_CONNECTOR_ID);let r=e.coinbase;if(r){let{address:i,chainId:n}=await Fo.getUserInfo(r);i&&n&&(ht.setChainId(n),ht.setProviderType("coinbaseWalletSDK"),ht.setProvider(e.coinbase),ht.setStatus("connected"),ht.setIsConnected(!0),this.setAddress(i),this.watchCoinbase(e))}}async watchWalletConnect(){let e=await this.getWalletConnectProvider();function r(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),e?.removeListener("disconnect",r),e?.removeListener("accountsChanged",n),e?.removeListener("chainChanged",i)}function i(o){if(o){let s=Fo.hexStringToNumber(o);ht.setChainId(s)}}let n=async o=>{o.length>0&&await this.setWalletConnectProvider()};e&&(e.on("disconnect",r),e.on("accountsChanged",n),e.on("chainChanged",i))}watchInjected(e){let r=e.injected;function i(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),r?.removeListener("disconnect",i),r?.removeListener("accountsChanged",n),r?.removeListener("chainChanged",o)}function n(s){let a=s?.[0];a?ht.setAddress(bc.getAddress(a)):(localStorage.removeItem(Ni.WALLET_ID),ht.reset())}function o(s){if(s){let a=typeof s=="string"?Fo.hexStringToNumber(s):Number(s);ht.setChainId(a)}}r&&(r.on("disconnect",i),r.on("accountsChanged",n),r.on("chainChanged",o))}watchEIP6963(e){function r(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),e.removeListener("disconnect",r),e.removeListener("accountsChanged",i),e.removeListener("chainChanged",n)}function i(o){let s=o?.[0];s?ht.setAddress(bc.getAddress(s)):(localStorage.removeItem(Ni.WALLET_ID),ht.reset())}function n(o){if(o){let s=typeof o=="string"?Fo.hexStringToNumber(o):Number(o);ht.setChainId(s)}}e.on("disconnect",r),e.on("accountsChanged",i),e.on("chainChanged",n)}watchCoinbase(e){let r=e.coinbase,i=localStorage.getItem(Ni.WALLET_ID);function n(){localStorage.removeItem(Ni.WALLET_ID),ht.reset(),r?.removeListener("disconnect",n),r?.removeListener("accountsChanged",o),r?.removeListener("chainChanged",s)}function o(a){a.length===0?(localStorage.removeItem(Ni.WALLET_ID),ht.reset()):ht.setAddress(a[0])}function s(a){if(a&&i===Je.COINBASE_SDK_CONNECTOR_ID){let c=Number(a);ht.setChainId(c)}}r&&(r.on("disconnect",n),r.on("accountsChanged",o),r.on("chainChanged",s))}async syncAccount(){let e=ht.state.address,r=ht.state.chainId,i=ht.state.isConnected;if(this.resetAccount(),i&&e&&r){let n=`${Je.EIP155}:${r}:${e}`;this.setIsConnected(i),this.setCaipAddress(n),this.syncConnectedWalletInfo(),await Promise.all([this.syncProfile(e),this.syncBalance(e),this.getApprovedCaipNetworksData()]),this.hasSyncedConnectedAccount=!0}else!i&&this.hasSyncedConnectedAccount&&(this.resetWcConnection(),this.resetNetwork())}async syncNetwork(e){let r=ht.state.address,i=ht.state.chainId,n=ht.state.isConnected;if(this.chains){let o=this.chains.find(s=>s.chainId===i);if(o){let s=`${Je.EIP155}:${o.chainId}`;if(this.setCaipNetwork({id:s,name:o.name,imageId:po.EIP155NetworkImageIds[o.chainId],imageUrl:e?.[o.chainId]}),n&&r){let a=`${Je.EIP155}:${i}:${r}`;if(this.setCaipAddress(a),o.explorerUrl){let c=`${o.explorerUrl}/address/${r}`;this.setAddressExplorerUrl(c)}else this.setAddressExplorerUrl(void 0);this.hasSyncedConnectedAccount&&await this.syncBalance(r)}}else n&&this.setCaipNetwork({id:`${Je.EIP155}:${i}`})}}async syncProfile(e){let r=ht.state.chainId;try{let{name:i,avatar:n}=await this.fetchIdentity({address:e});this.setProfileName(i),this.setProfileImage(n)}catch{if(r===1){let i=new Ih.providers.InfuraProvider("mainnet"),n=await i.lookupAddress(e),o=await i.getAvatar(e);n&&this.setProfileName(n),o&&this.setProfileImage(o)}else this.setProfileName(null),this.setProfileImage(null)}}async syncBalance(e){let r=ht.state.chainId;if(r&&this.chains){let i=this.chains.find(n=>n.chainId===r);if(i){let n=new Ih.providers.JsonRpcProvider(i.rpcUrl,{chainId:r,name:i.name});if(n){let o=await n.getBalance(e),s=bc.formatEther(o);this.setBalance(s,i.currency)}}}}syncConnectedWalletInfo(){let e=window?.localStorage.getItem(Ni.WALLET_ID),r=ht.state.providerType;if(r===Je.EIP6963_CONNECTOR_ID){if(e){let i=this.EIP6963Providers.find(n=>n.info.name===e);i&&this.setConnectedWalletInfo({...i.info})}}else if(r===Je.WALLET_CONNECT_CONNECTOR_ID){let i=ht.state.provider;i.session&&this.setConnectedWalletInfo({...i.session.peer.metadata,name:i.session.peer.metadata.name,icon:i.session.peer.metadata.icons?.[0]})}else e&&this.setConnectedWalletInfo({name:e})}async switchNetwork(e){let r=ht.state.provider,i=ht.state.providerType;if(this.chains){let n=this.chains.find(o=>o.chainId===e);if(i===Je.WALLET_CONNECT_CONNECTOR_ID&&n){let o=r;if(o)try{await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Fo.numberToHexString(n.chainId)}]}),ht.setChainId(e)}catch(s){if(s.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Ni.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await Fo.addEthereumChain(o,n);else throw new Error("Chain is not supported")}}else if(i===Je.EIP6963_CONNECTOR_ID&&n){let o=r;if(o)try{await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Fo.numberToHexString(n.chainId)}]}),ht.setChainId(n.chainId)}catch(s){if(s.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Ni.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await Fo.addEthereumChain(o,n);else throw new Error("Chain is not supported")}}else if(i===Je.COINBASE_SDK_CONNECTOR_ID&&n){let o=r;if(o)try{await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Fo.numberToHexString(n.chainId)}]}),ht.setChainId(n.chainId)}catch(s){(s.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||s.code===Ni.ERROR_CODE_DEFAULT||s?.data?.originalError?.code===Ni.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)&&await Fo.addEthereumChain(o,n)}}}}syncConnectors(e){let r=[],i=po.ConnectorTypesMap[Je.WALLET_CONNECT_CONNECTOR_ID];if(i&&r.push({id:Je.WALLET_CONNECT_CONNECTOR_ID,explorerId:po.ConnectorExplorerIds[Je.WALLET_CONNECT_CONNECTOR_ID],imageId:po.ConnectorImageIds[Je.WALLET_CONNECT_CONNECTOR_ID],imageUrl:this.options?.connectorImages?.[Je.WALLET_CONNECT_CONNECTOR_ID],name:po.ConnectorNamesMap[Je.WALLET_CONNECT_CONNECTOR_ID],type:i}),e.injected){let n=po.ConnectorTypesMap[Je.INJECTED_CONNECTOR_ID];n&&r.push({id:Je.INJECTED_CONNECTOR_ID,explorerId:po.ConnectorExplorerIds[Je.INJECTED_CONNECTOR_ID],imageId:po.ConnectorImageIds[Je.INJECTED_CONNECTOR_ID],imageUrl:this.options?.connectorImages?.[Je.INJECTED_CONNECTOR_ID],name:po.ConnectorNamesMap[Je.INJECTED_CONNECTOR_ID],type:n})}e.coinbase&&r.push({id:Je.COINBASE_SDK_CONNECTOR_ID,explorerId:po.ConnectorExplorerIds[Je.COINBASE_SDK_CONNECTOR_ID],imageId:po.ConnectorImageIds[Je.COINBASE_SDK_CONNECTOR_ID],imageUrl:this.options?.connectorImages?.[Je.COINBASE_SDK_CONNECTOR_ID],name:po.ConnectorNamesMap[Je.COINBASE_SDK_CONNECTOR_ID],type:"EXTERNAL"}),this.setConnectors(r)}eip6963EventHandler(e){if(e.detail){let{info:r,provider:i}=e.detail,n=this.getConnectors(),o=n.find(c=>c.name===r.name),a=n.find(c=>c.id===Je.COINBASE_SDK_CONNECTOR_ID)&&e.detail.info.rdns===Je.CONNECTOR_RDNS_MAP[Je.COINBASE_SDK_CONNECTOR_ID];if(!o&&!a){let c=po.ConnectorTypesMap[Je.EIP6963_CONNECTOR_ID];if(c){this.addConnector({id:Je.EIP6963_CONNECTOR_ID,type:c,imageUrl:r.icon??this.options?.connectorImages?.[Je.EIP6963_CONNECTOR_ID],name:r.name,provider:i,info:r});let h={provider:i,info:r};this.EIP6963Providers.push(h)}}}}listenConnectors(e){if(typeof window<"u"&&e){let r=this.eip6963EventHandler.bind(this);window.addEventListener(Je.EIP6963_ANNOUNCE_EVENT,r),window.dispatchEvent(new Event(Je.EIP6963_REQUEST_EVENT))}}};WS();var r3e=Dr(t3e(),1);function nU(t){let{enableEIP6963:e=!0,enableInjected:r=!0,enableCoinbase:i=!0,metadata:n}=t,o,s,a={metadata:n};function c(){if(o)return o;if(!(typeof window>"u")&&!!window.ethereum)return o=window.ethereum,o}function h(){return s||(typeof window>"u"?void 0:(s=new r3e.CoinbaseWalletSDK({appName:n.name,appLogoUrl:n.icons[0],appChainIds:t.chains?.map(w=>w.chainId)||[1,84532]}).makeWeb3Provider({options:t.coinbasePreference||"all"}),s))}return i&&(a.coinbase=h()),r&&(a.injected=c()),e&&(a.EIP6963=!0),a}function i3e(t){return new PE({...t,_sdkVersion:`html-ethers5-${Je.VERSION}`})}var ZQe=(t=>(t.MissingApiKey="MISSING_API_KEY",t.ModalNotReady="MODAL_NOT_READY",t.ConnectionLost="CONNECTION_WAS_LOST",t.MalformedResponse="MALFORMED_RESPONSE",t.InvalidArgument="INVALID_ARGUMENT",t.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",t.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",t))(ZQe||{}),JQe=(t=>(t.SyncWeb3Method="SYNC_WEB3_METHOD",t.DuplicateIframe="DUPLICATE_IFRAME",t.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",t.DeprecationNotice="DEPRECATION_NOTICE",t.ProductAnnouncement="ANNOUNCEMENT",t))(JQe||{}),QQe=(t=>(t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed",t[t.UserRequestEditEmail=-10005]="UserRequestEditEmail",t[t.InactiveRecipient=-10010]="InactiveRecipient",t[t.AccessDeniedToUser=-10011]="AccessDeniedToUser",t[t.RedirectLoginComplete=-10015]="RedirectLoginComplete",t))(QQe||{}),du=(t=>(t.PROVIDER="magic_3pw_provider",t.ADDRESS="magic_3pw_address",t.CHAIN_ID="magic_3pw_chainId",t))(du||{}),G3=(t=>(t.WalletConnected="wallet_connected",t.WalletRejected="wallet_rejected",t.Web3ModalSelected="web3modal_selected",t))(G3||{}),XQe=(t=>(t.LoginWithSms="magic_auth_login_with_sms",t.LoginWithEmailOTP="magic_auth_login_with_email_otp",t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.LoginWithCredential="magic_auth_login_with_credential",t.SetAuthorizationToken="magic_auth_set_authorization_token",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email",t.UserSettings="magic_auth_settings",t.UserSettingsTestMode="magic_auth_settings_testing_mode",t.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",t.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",t.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",t.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",t.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",t.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",t.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",t.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",t.LogoutTestMode="magic_auth_logout_testing_mode",t.UpdateEmailTestMode="magic_auth_update_email_testing_mode",t.IntermediaryEvent="magic_intermediary_event",t.RequestAccounts="eth_requestAccounts",t.GetInfo="magic_get_info",t.ShowUI="magic_wallet",t.NFTPurchase="magic_nft_purchase",t.NFTCheckout="magic_nft_checkout",t.NFTTransfer="magic_nft_transfer",t.RequestUserInfoWithUI="mc_request_user_info",t.Disconnect="mc_disconnect",t.RecoverAccount="magic_auth_recover_account",t.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",t.MagicBoxHeartBeat="magic_box_heart_beat",t.AutoConnect="mc_auto_connect",t.Login="mc_login",t.EncryptV1="magic_auth_encrypt_v1",t.DecryptV1="magic_auth_decrypt_v1",t.ShowNFTs="magic_show_nfts",t.ShowOnRamp="magic_show_fiat_onramp",t.ShowSendTokensUI="magic_show_send_tokens_ui",t.ShowAddress="magic_show_address",t.ShowBalances="magic_show_balances",t.SendGaslessTransaction="eth_sendGaslessTransaction",t.RevealPK="magic_reveal_key",t.EnableMFA="magic_auth_enable_mfa_flow",t.DisableMFA="magic_auth_disable_mfa_flow",t))(XQe||{});var eXe=(t=>(t.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",t.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",t.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",t.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",t.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",t.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",t.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",t.MAGIC_PONG="MAGIC_PONG",t.MAGIC_POPUP_RESPONSE="MAGIC_POPUP_RESPONSE",t.MAGIC_POPUP_OAUTH_VERIFY_RESPONSE="MAGIC_POPUP_OAUTH_VERIFY_RESPONSE",t))(eXe||{}),tXe=(t=>(t.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",t.MAGIC_PING="MAGIC_PING",t))(tXe||{}),rXe=(t=>(t.UpdateEmail="update-email",t.MFA="mfa",t.Recovery="recovery",t))(rXe||{}),iXe=(t=>(t.Retry="retry",t))(iXe||{}),nXe=(t=>(t.EmailSent="email-sent",t.EmailNotDeliverable="email-not-deliverable",t))(nXe||{}),oXe=(t=>(t.VerifyEmailOtp="verify-email-otp",t.VerifyMFACode="verify-mfa-code",t.LostDevice="lost-device",t.VerifyRecoveryCode="verify-recovery-code",t.Cancel="cancel",t))(oXe||{}),sXe=(t=>(t.VerifySmsOtp="verify-sms-otp",t.Cancel="cancel",t.Retry="retry",t))(sXe||{}),aXe=(t=>(t.SmsOTPSent="sms-otp-sent",t.InvalidSmsOtp="invalid-sms-otp",t.ExpiredSmsOtp="expired-sms-otp",t))(aXe||{}),cXe=(t=>(t.EmailOTPSent="email-otp-sent",t.InvalidEmailOtp="invalid-email-otp",t.InvalidMfaOtp="invalid-mfa-otp",t.ExpiredEmailOtp="expired-email-otp",t.MfaSentHandle="mfa-sent-handle",t.RecoveryCodeSentHandle="recovery-code-sent-handle",t.InvalidRecoveryCode="invalid-recovery-code",t.RecoveryCodeSuccess="recovery-code-success",t))(cXe||{}),lXe=(t=>(t.Retry="device-retry",t))(lXe||{}),uXe=(t=>(t.DeviceApproved="device-approved",t.DeviceNeedsApproval="device-needs-approval",t.DeviceVerificationLinkExpired="device-verification-link-expired",t.DeviceVerificationEmailSent="device-verification-email-sent",t))(uXe||{}),fXe=(t=>(t.Retry="Recency/auth-factor-retry",t.Cancel="Recency/auth-factor-verification-cancel",t.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",t.VerifyMFACode="Recency/verify-mfa-code",t))(fXe||{}),hXe=(t=>(t.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",t.PrimaryAuthFactorVerified="Recency/auth-factor-verified",t.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",t.EmailExpired="Recency/auth-factor-verification-email-expired",t.EmailSent="Recency/auth-factor-verification-email-sent",t.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",t))(hXe||{}),dXe=(t=>(t.RetryWithNewEmail="UpdateEmail/retry-with-new-email",t.Cancel="UpdateEmail/new-email-verification-cancel",t.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",t))(dXe||{}),pXe=(t=>(t.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",t.EmailUpdated="UpdateEmail/email-updated",t.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",t.EmailExpired="UpdateEmail/new-email-verification-email-expired",t.EmailSent="UpdateEmail/new-email-verification-email-sent",t.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",t.InvalidEmail="UpdateEmail/new-email-invalid",t.EmailAlreadyExists="UpdateEmail/new-email-already-exists",t))(pXe||{}),mXe=(t=>(t.IDTokenCreated="Auth/id-token-created",t))(mXe||{}),gXe=(t=>(t.Cancel="Farcaster/cancel",t))(gXe||{}),wXe=(t=>(t.MFASecretGenerated="mfa-secret-generated",t.InvalidMFAOtp="invalid-mfa-otp",t.MFARecoveryCodes="mfa-recovery-codes",t))(wXe||{}),vXe=(t=>(t.VerifyMFACode="verify-mfa-code",t.Cancel="cancel-mfa-setup",t))(vXe||{}),bXe=(t=>(t.MFACodeRequested="mfa-code-requested",t.InvalidMFAOtp="invalid-mfa-otp",t.InvalidRecoveryCode="invalid-recovery-code",t))(bXe||{}),yXe=(t=>(t.VerifyMFACode="verify-mfa-code",t.LostDevice="lost-device",t.Cancel="cancel-mfa-disable",t))(yXe||{}),xXe=(t=>(t.Harmony="HARMONY",t))(xXe||{}),_Xe=(t=>(t.ClosedByUser="closed-by-user",t))(_Xe||{}),EXe=(t=>(t.ClosedByUser="closed-by-user-on-received",t))(EXe||{}),AXe=(t=>(t.EnterNewPhoneNumber="enter-new-phone-number",t.EnterOtpCode="enter-otp-code",t.RecoveryFactorAlreadyExists="recovery-factor-already-exists",t.MalformedPhoneNumber="malformed-phone-number",t.InvalidOtpCode="invalid-otp-code",t))(AXe||{}),CXe=(t=>(t.SendNewPhoneNumber="send-new-phone-number",t.SendOtpCode="send-otp-code",t.Cancel="cancel",t.StartEditPhoneNumber="start-edit-phone-number",t))(CXe||{}),SXe=(t=>(t.PhoneNumber="phone_number",t))(SXe||{}),IXe=(t=>(t.SmsOtpSent="sms-otp-sent",t.LoginThrottled="login-throttled",t.InvalidSmsOtp="invalid-sms-otp",t.SmsVerified="sms-verified",t.AccountRecovered="account-recovered",t.UpdateEmailRequired="update-email-required",t))(IXe||{}),TXe=(t=>(t.Cancel="cancel",t.VerifyOtp="verify-otp-code",t.ResendSms="resend-sms-otp",t.UpdateEmail="update-email",t))(TXe||{}),RXe=(t=>(t.Success="nft-checkout-success",t.Failure="nft-checkout-failure",t.Initiated="nft-checkout-initiated",t.Disconnect="disconnect",t))(RXe||{}),kXe=(t=>(t.WalletInfoFetched="Wallet/wallet-info-fetched",t))(kXe||{}),NXe=(t=>(t.CloseMagicWindow="close-magic-window",t))(NXe||{});var WA=class extends n3e.Extension.Internal{constructor({configOptions:r,modalOptions:i}){super();this.name="web3modal";this.config={};this.modal=i3e(eS(XC({},i),{themeVariables:eS(XC({},i.themeVariables||{}),{"--w3m-z-index":3e9}),ethersConfig:nU(r)}));let n=this.modal.subscribeProvider(({status:o})=>{o==="connected"&&(n(),this.setIsConnected(),this.setEip1193EventListeners()),o==="disconnected"&&n()})}setIsConnected(){localStorage.setItem(du.PROVIDER,"web3modal"),localStorage.setItem(du.ADDRESS,this.modal.getAddress()),localStorage.setItem(du.CHAIN_ID,this.modal.getChainId().toString()),this.sdk.thirdPartyWallets.isConnected=!0}initialize(){this.sdk.thirdPartyWallets.enabledWallets.web3modal=!0,this.sdk.thirdPartyWallets.isConnected=Boolean(localStorage.getItem(du.ADDRESS)),this.sdk.thirdPartyWallets.eventListeners.push({event:G3.Web3ModalSelected,callback:r=>tS(this,null,function*(){yield this.connectToWeb3modal(r)})})}setEip1193EventListeners(){WA.eventsListenerAdded||(WA.eventsListenerAdded=!0,this.modal.subscribeProvider(({address:r,chainId:i})=>!r&&localStorage.getItem(du.ADDRESS)?(this.sdk.thirdPartyWallets.resetThirdPartyWalletState(),this.sdk.rpcProvider.emit("accountsChanged",[])):r&&r!==localStorage.getItem(du.ADDRESS)?(localStorage.setItem(du.ADDRESS,r),this.sdk.rpcProvider.emit("accountsChanged",[r])):i&&i!==Number(localStorage.getItem(du.CHAIN_ID))?(localStorage.setItem(du.CHAIN_ID,i.toString()),this.sdk.rpcProvider.emit("chainChanged",i)):null))}handleUserConnected(r,i=this.modal.getAddress()){this.setIsConnected(),this.createIntermediaryEvent(G3.WalletConnected,r)(i),this.setEip1193EventListeners()}connectToWeb3modal(r){let{modal:i}=this;return this.utils.createPromiEvent(()=>tS(this,null,function*(){try{i.getIsConnected()&&(yield i.disconnect())}catch(a){console.error(a)}let o=i.subscribeProvider(({address:a,error:c})=>{c&&(console.error("Provider event error:",c),o(),this.createIntermediaryEvent(G3.WalletRejected,r)()),a&&(this.handleUserConnected(r),o())}),s=i.subscribeEvents(a=>{a.data.event==="MODAL_CLOSE"&&(s(),o(),this.createIntermediaryEvent(G3.WalletRejected,r)())});i.open()}))}},xx=WA;xx.eventsListenerAdded=!1;var PXe=xx;return En(OXe);})();
9978
9978
  if (MagicWeb3ModalExtension && MagicWeb3ModalExtension.default != null) { MagicWeb3ModalExtension = Object.assign(MagicWeb3ModalExtension.default, MagicWeb3ModalExtension); delete MagicWeb3ModalExtension.default; }