>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){var t;if(y[e])return y[e];if("k256"===e)t=new w;else if("p224"===e)t=new A;else if("p192"===e)t=new E;else if("p25519"===e)t=new k;else throw Error("Unknown prime "+e);return y[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),l=a.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=o;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],u=l-1;u>=0;u--){var h=c>>u&1;if(i!==r[0]&&(i=this.sqr(i)),0===h&&0===o){a=0;continue}o<<=1,o|=h,(4==++a||0===n&&0===u)&&(i=this.mul(i,r[o]),a=0,o=0)}l=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new T(e)},i(T,S),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},2145:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseContract:()=>r1,BigNumber:()=>Q,Contract:()=>r2,ContractFactory:()=>r3,FixedNumber:()=>ni,Signer:()=>tJ,VoidSigner:()=>tW,Wallet:()=>iv,Wordlist:()=>nO,constants:()=>u,errors:()=>i,ethers:()=>p,getDefaultProvider:()=>oR,logger:()=>o8,providers:()=>h,utils:()=>f,version:()=>o4,wordlists:()=>nF});var n,i,s,o,a,l,c={};r.r(c),r.d(c,{decode:()=>eT,encode:()=>eE});var u={};r.r(u),r.d(u,{AddressZero:()=>iE,EtherSymbol:()=>iS,HashZero:()=>ik,MaxInt256:()=>tr,MaxUint256:()=>te,MinInt256:()=>tt,NegativeOne:()=>e6,One:()=>e8,Two:()=>e9,WeiPerEther:()=>e7,Zero:()=>e4});var h={};r.r(h),r.d(h,{AlchemyProvider:()=>sX,AlchemyWebSocketProvider:()=>sQ,AnkrProvider:()=>s1,BaseProvider:()=>sC,CloudflareProvider:()=>s3,EtherscanProvider:()=>ot,FallbackProvider:()=>om,Formatter:()=>se,InfuraProvider:()=>ov,InfuraWebSocketProvider:()=>oy,IpcProvider:()=>og,JsonRpcBatchProvider:()=>ow,JsonRpcProvider:()=>sH,JsonRpcSigner:()=>sD,NodesmithProvider:()=>oE,PocketProvider:()=>oT,Provider:()=>tj,Resolver:()=>sk,StaticJsonRpcProvider:()=>sq,UrlJsonRpcProvider:()=>sY,Web3Provider:()=>oN,WebSocketProvider:()=>sz,getDefaultProvider:()=>oR,getNetwork:()=>iO,isCommunityResourcable:()=>st,isCommunityResource:()=>sr,showThrottleMessage:()=>si});var d={};r.r(d),r.d(d,{decode:()=>iI,encode:()=>iB});var f={};r.r(f),r.d(f,{AbiCoder:()=>tR,ConstructorFragment:()=>tw,ErrorFragment:()=>tk,EventFragment:()=>tx,FormatTypes:()=>td,Fragment:()=>tg,FunctionFragment:()=>tA,HDNode:()=>nY,Indexed:()=>tF,Interface:()=>t$,LogDescription:()=>tB,Logger:()=>A,ParamType:()=>tp,RLP:()=>c,SigningKey:()=>rA,SupportedAlgorithm:()=>l,TransactionDescription:()=>tL,TransactionTypes:()=>a,UnicodeNormalizationForm:()=>s,Utf8ErrorFuncs:()=>eU,Utf8ErrorReason:()=>o,_TypedDataEncoder:()=>nE,_fetchData:()=>i3,_toEscapedUtf8String:()=>eG,accessListify:()=>rI,arrayify:()=>M,base58:()=>nS,base64:()=>d,checkProperties:()=>eo,checkResultErrors:()=>ef,commify:()=>o1,computeAddress:()=>rN,computeHmac:()=>nN,computePublicKey:()=>rk,concat:()=>N,deepCopy:()=>ec,defaultAbiCoder:()=>tO,defaultPath:()=>nq,defineReadOnly:()=>en,dnsEncode:()=>iZ,entropyToMnemonic:()=>nQ,fetchJson:()=>i5,formatBytes32String:()=>oQ,formatEther:()=>o5,formatUnits:()=>o2,getAccountPath:()=>nZ,getAddress:()=>eR,getContractAddress:()=>eB,getCreate2Address:()=>eL,getIcapAddress:()=>eI,getJsonWalletAddress:()=>ix,getStatic:()=>ei,hashMessage:()=>na,hexConcat:()=>F,hexDataLength:()=>L,hexDataSlice:()=>D,hexStripZeros:()=>H,hexValue:()=>U,hexZeroPad:()=>$,hexlify:()=>B,id:()=>eq,isAddress:()=>eO,isBytes:()=>_,isBytesLike:()=>T,isHexString:()=>O,isValidMnemonic:()=>nX,isValidName:()=>iQ,joinSignature:()=>G,keccak256:()=>ey,mnemonicToEntropy:()=>nW,mnemonicToSeed:()=>nJ,namehash:()=>iX,nameprep:()=>oW,parseBytes32String:()=>oX,parseEther:()=>o6,parseTransaction:()=>rH,parseUnits:()=>o3,poll:()=>i6,randomBytes:()=>n3,recoverAddress:()=>rP,recoverPublicKey:()=>rE,resolveProperties:()=>es,ripemd160:()=>nC,serializeTransaction:()=>rF,sha256:()=>n_,sha512:()=>nM,shallowCopy:()=>ea,shuffled:()=>or,solidityKeccak256:()=>oF,solidityPack:()=>oD,soliditySha256:()=>oU,splitSignature:()=>K,stripZeros:()=>P,toUtf8Bytes:()=>e$,toUtf8CodePoints:()=>eV,toUtf8String:()=>ez,verifyMessage:()=>iw,verifyTypedData:()=>iA,zeroPad:()=>R});var p={};r.r(p),r.d(p,{BaseContract:()=>r1,BigNumber:()=>Q,Contract:()=>r2,ContractFactory:()=>r3,FixedNumber:()=>ni,Signer:()=>tJ,VoidSigner:()=>tW,Wallet:()=>iv,Wordlist:()=>nO,constants:()=>u,errors:()=>i,getDefaultProvider:()=>oR,logger:()=>o8,providers:()=>h,utils:()=>f,version:()=>o4,wordlists:()=>nF});let m=!1,g=!1,x={debug:1,default:2,info:2,warning:3,error:4,off:5},b=x.default,y=null,v=function(){try{let e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(e){return e.message}return null}();(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(n||(n={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(i||(i={}));let w="0123456789abcdef";class A{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();null==x[r]&&this.throwArgumentError("invalid log level name","logLevel",e),b>x[r]||console.log.apply(console,t)}debug(...e){this._log(A.levels.DEBUG,e)}info(...e){this._log(A.levels.INFO,e)}warn(...e){this._log(A.levels.WARNING,e)}makeError(e,t,r){if(g)return this.makeError("censored error",t,{});t||(t=A.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=w[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);let s=e,o="";switch(t){case i.NUMERIC_FAULT:{o="NUMERIC_FAULT";let t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let a=Error(e);return a.reason=s,a.code=t,Object.keys(r).forEach(function(e){a[e]=r[e]}),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,A.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),v&&this.throwError("platform missing String.prototype.normalize",A.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:v})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=0x1fffffffffffff)&&this.throwError(t,A.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,A.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,A.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||null==e)&&this.throwError("missing new",A.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",A.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||null==e)&&this.throwError("missing new",A.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return y||(y=new A("logger/5.7.0")),y}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",A.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),m){if(!e)return;this.globalLogger().throwError("error censorship permanent",A.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}g=!!e,m=!!t}static setLogLevel(e){let t=x[e.toLowerCase()];if(null==t){A.globalLogger().warn("invalid log level - "+e);return}b=t}static from(e){return new A(e)}}A.errors=i,A.levels=n;let E=new A("bytes/5.7.0");function k(e){return!!e.toHexString}function S(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return S(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function T(e){return O(e)&&!(e.length%2)||_(e)}function C(e){return"number"==typeof e&&e==e&&e%1==0}function _(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e||!C(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function M(e,t){if(t||(t={}),"number"==typeof e){E.checkSafeUint53(e,"invalid arrayify value");let t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),S(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),k(e)&&(e=e.toHexString()),O(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":E.throwArgumentError("hex data is odd-length","value",e));let n=[];for(let e=0;eM(e)),r=new Uint8Array(t.reduce((e,t)=>e+t.length,0));return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),S(r)}function P(e){let t=M(e);if(0===t.length)return t;let r=0;for(;rt&&E.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),S(r)}function O(e,t){return"string"==typeof e&&!!e.match(/^0x[0-9A-Fa-f]*$/)&&(!t||e.length===2+2*t)}let I="0123456789abcdef";function B(e,t){if(t||(t={}),"number"==typeof e){E.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=I[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),k(e))return e.toHexString();if(O(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":E.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(_(e)){let t="0x";for(let r=0;r>4]+I[15&n]}return t}return E.throwArgumentError("invalid hexlify value","value",e)}function L(e){if("string"!=typeof e)e=B(e);else if(!O(e)||e.length%2)return null;return(e.length-2)/2}function D(e,t,r){return("string"!=typeof e?e=B(e):(!O(e)||e.length%2)&&E.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r)?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function F(e){let t="0x";return e.forEach(e=>{t+=B(e).substring(2)}),t}function U(e){let t=H(B(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function H(e){"string"!=typeof e&&(e=B(e)),O(e)||E.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&E.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function K(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(T(e)){let r=M(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=B(r.slice(0,32)),t.s=B(r.slice(32,64))):65===r.length?(t.r=B(r.slice(0,32)),t.s=B(r.slice(32,64)),t.v=r[64]):E.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:E.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=B(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){let r=R(M(t._vs),32);t._vs=B(r);let n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&E.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;let i=B(r);null==t.s?t.s=i:t.s!==i&&E.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?E.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{let r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&E.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&O(t.r)?t.r=$(t.r,32):E.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&O(t.s)?t.s=$(t.s,32):E.throwArgumentError("signature missing or invalid s","signature",e);let r=M(t.s);r[0]>=128&&E.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);let n=B(r);t._vs&&(O(t._vs)||E.throwArgumentError("signature invalid _vs","signature",e),t._vs=$(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&E.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function G(e){return B(N([(e=K(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var j=r(5001),z=r.n(j);let V="bignumber/5.7.0";var q=z().BN;let Y=new A(V),J={},W=!1;class Q{constructor(e,t){e!==J&&Y.throwError("cannot call constructor directly; use BigNumber.from",A.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Z(ee(this).fromTwos(e))}toTwos(e){return Z(ee(this).toTwos(e))}abs(){return"-"===this._hex[0]?Q.from(this._hex.substring(1)):this}add(e){return Z(ee(this).add(ee(e)))}sub(e){return Z(ee(this).sub(ee(e)))}div(e){return Q.from(e).isZero()&&et("division-by-zero","div"),Z(ee(this).div(ee(e)))}mul(e){return Z(ee(this).mul(ee(e)))}mod(e){let t=ee(e);return t.isNeg()&&et("division-by-zero","mod"),Z(ee(this).umod(t))}pow(e){let t=ee(e);return t.isNeg()&&et("negative-power","pow"),Z(ee(this).pow(t))}and(e){let t=ee(e);return(this.isNegative()||t.isNeg())&&et("unbound-bitwise-result","and"),Z(ee(this).and(t))}or(e){let t=ee(e);return(this.isNegative()||t.isNeg())&&et("unbound-bitwise-result","or"),Z(ee(this).or(t))}xor(e){let t=ee(e);return(this.isNegative()||t.isNeg())&&et("unbound-bitwise-result","xor"),Z(ee(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&et("negative-width","mask"),Z(ee(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&et("negative-width","shl"),Z(ee(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&et("negative-width","shr"),Z(ee(this).shrn(e))}eq(e){return ee(this).eq(ee(e))}lt(e){return ee(this).lt(ee(e))}lte(e){return ee(this).lte(ee(e))}gt(e){return ee(this).gt(ee(e))}gte(e){return ee(this).gte(ee(e))}isNegative(){return"-"===this._hex[0]}isZero(){return ee(this).isZero()}toNumber(){try{return ee(this).toNumber()}catch(e){et("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Y.throwError("this platform does not support BigInt",A.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?W||(W=!0,Y.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Y.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",A.errors.UNEXPECTED_ARGUMENT,{}):Y.throwError("BigNumber.toString does not accept parameters",A.errors.UNEXPECTED_ARGUMENT,{})),ee(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Q)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Q(J,X(e)):e.match(/^-?[0-9]+$/)?new Q(J,X(new q(e))):Y.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&et("underflow","BigNumber.from",e),(e>=0x1fffffffffffff||e<=-0x1fffffffffffff)&&et("overflow","BigNumber.from",e),Q.from(String(e));if("bigint"==typeof e)return Q.from(e.toString());if(_(e))return Q.from(B(e));if(e){if(e.toHexString){let t=e.toHexString();if("string"==typeof t)return Q.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(O(t)||"-"===t[0]&&O(t.substring(1))))return Q.from(t)}}return Y.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function X(e){if("string"!=typeof e)return X(e.toString(16));if("-"===e[0])return("-"===(e=e.substring(1))[0]&&Y.throwArgumentError("invalid hex","value",e),"0x00"===(e=X(e)))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Z(e){return Q.from(X(e))}function ee(e){let t=Q.from(e).toHexString();return"-"===t[0]?new q("-"+t.substring(3),16):new q(t.substring(2),16)}function et(e,t,r){let n={fault:e,operation:t};return null!=r&&(n.value=r),Y.throwError(e,A.errors.NUMERIC_FAULT,n)}let er=new A("properties/5.7.0");function en(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ei(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function es(e){var t,r,n,i;return t=this,r=void 0,n=void 0,i=function*(){let t=Object.keys(e).map(t=>Promise.resolve(e[t]).then(e=>({key:t,value:e})));return(yield Promise.all(t)).reduce((e,t)=>(e[t.key]=t.value,e),{})},new(n||(n=Promise))(function(e,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(o,a)}l((i=i.apply(t,r||[])).next())})}function eo(e,t){e&&"object"==typeof e||er.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||er.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}function ea(e){let t={};for(let r in e)t[r]=e[r];return t}let el={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function ec(e){return function(e){if(function e(t){if(null==t||el[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;let r=Object.keys(t);for(let n=0;nec(e)));if("object"==typeof e){let t={};for(let r in e){let n=e[r];void 0!==n&&en(t,r,ec(n))}return t}return er.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}(e)}class eu{constructor(e){for(let t in e)this[t]=ec(e[t])}}let eh="abi/5.7.0",ed=new A(eh);function ef(e){let t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){let s=e.slice();s.push(i);try{r(s,n[i])}catch(e){t.push({path:s,error:e})}}};return r([],e),t}class ep{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){ed.throwArgumentError(e,this.localName,t)}}class em{constructor(e){en(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return F(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(N(e._data))}writeBytes(e){let t=M(e),r=t.length%this.wordSize;return r&&(t=N([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=M(Q.from(e));return t.length>this.wordSize&&ed.throwError("value out-of-bounds",A.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=N([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){let e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class eg{constructor(e,t,r,n){en(this,"_data",M(e)),en(this,"wordSize",t||32),en(this,"_coerceFunc",r),en(this,"allowLoose",n),this._offset=0}get data(){return B(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&48>=parseInt(r[1])&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):eg.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:ed.throwError("data out-of-bounds",A.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new eg(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Q.from(this.readBytes(this.wordSize))}}var ex=r(5845),eb=r.n(ex);function ey(e){return"0x"+eb().keccak_256(M(e))}let ev=new A("rlp/5.7.0");function ew(e){let t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function eA(e,t,r){let n=0;for(let i=0;it+1+n&&ev.throwError("child data too short",A.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function eS(e,t){if(0===e.length&&ev.throwError("data too short",A.errors.BUFFER_OVERRUN,{}),e[t]>=248){let r=e[t]-247;t+1+r>e.length&&ev.throwError("data short segment too short",A.errors.BUFFER_OVERRUN,{});let n=eA(e,t+1,r);return t+1+r+n>e.length&&ev.throwError("data long segment too short",A.errors.BUFFER_OVERRUN,{}),ek(e,t,t+1+r,r+n)}if(e[t]>=192){let r=e[t]-192;return t+1+r>e.length&&ev.throwError("data array too short",A.errors.BUFFER_OVERRUN,{}),ek(e,t,t+1,r)}if(e[t]>=184){let r=e[t]-183;t+1+r>e.length&&ev.throwError("data array too short",A.errors.BUFFER_OVERRUN,{});let n=eA(e,t+1,r);t+1+r+n>e.length&&ev.throwError("data array too short",A.errors.BUFFER_OVERRUN,{});let i=B(e.slice(t+1+r,t+1+r+n));return{consumed:1+r+n,result:i}}if(e[t]>=128){let r=e[t]-128;t+1+r>e.length&&ev.throwError("data too short",A.errors.BUFFER_OVERRUN,{});let n=B(e.slice(t+1,t+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:B(e[t])}}function eT(e){let t=M(e),r=eS(t,0);return r.consumed!==t.length&&ev.throwArgumentError("invalid rlp data","data",e),r.result}let eC=new A("address/5.7.0");function e_(e){O(e,20)||eC.throwArgumentError("invalid address","address",e);let t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);let n=M(ey(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}let eM={};for(let e=0;e<10;e++)eM[String(e)]=String(e);for(let e=0;e<26;e++)eM[String.fromCharCode(65+e)]=String(10+e);let eN=Math.floor(Math.log10?Math.log10(0x1fffffffffffff):Math.log(0x1fffffffffffff)/Math.LN10);function eP(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>eM[e]).join("");for(;t.length>=eN;){let e=t.substring(0,eN);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function eR(e){let t=null;if("string"!=typeof e&&eC.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=e_(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&eC.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==eP(e)&&eC.throwArgumentError("bad icap checksum","address",e),t=new q(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=e_("0x"+t)}else eC.throwArgumentError("invalid address","address",e);return t}function eO(e){try{return eR(e),!0}catch(e){}return!1}function eI(e){let t=new q(eR(e).substring(2),16).toString(36).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+eP("XE00"+t)+t}function eB(e){let t=null;try{t=eR(e.from)}catch(t){eC.throwArgumentError("missing from address","transaction",e)}return eR(D(ey(eE([t,P(M(Q.from(e.nonce).toHexString()))])),12))}function eL(e,t,r){return 32!==L(t)&&eC.throwArgumentError("salt must be 32 bytes","salt",t),32!==L(r)&&eC.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),eR(D(ey(N(["0xff",eR(e),t,r])),12))}let eD=new A("strings/5.7.0");function eF(e,t,r,n,i){if(e===o.BAD_PREFIX||e===o.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n>6==2;n++)e++;return e}return e===o.OVERRUN?r.length-t-1:0}(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(s||(s={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(o||(o={}));let eU=Object.freeze({error:function(e,t,r,n,i){return eD.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:eF,replace:function(e,t,r,n,i){return e===o.OVERLONG?(n.push(i),0):(n.push(65533),eF(e,t,r,n,i))}});function eH(e,t){null==t&&(t=eU.error),e=M(e);let r=[],n=0;for(;n>7==0){r.push(i);continue}let s=null,a=null;if((224&i)==192)s=1,a=127;else if((240&i)==224)s=2,a=2047;else if((248&i)==240)s=3,a=65535;else{(192&i)==128?n+=t(o.UNEXPECTED_CONTINUE,n-1,e,r):n+=t(o.BAD_PREFIX,n-1,e,r);continue}if(n-1+s>=e.length){n+=t(o.OVERRUN,n-1,e,r);continue}let l=i&(1<<8-s-1)-1;for(let i=0;i1114111){n+=t(o.OUT_OF_RANGE,n-1-s,e,r,l);continue}if(l>=55296&&l<=57343){n+=t(o.UTF16_SURROGATE,n-1-s,e,r,l);continue}if(l<=a){n+=t(o.OVERLONG,n-1-s,e,r,l);continue}r.push(l)}}return r}function e$(e,t=s.current){t!=s.current&&(eD.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if((64512&n)==55296){t++;let i=e.charCodeAt(t);if(t>=e.length||(64512&i)!=56320)throw Error("invalid utf-8 string");let s=65536+((1023&n)<<10)+(1023&i);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return M(r)}function eK(e){let t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function eG(e,t){return'"'+eH(e,t).map(e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?eK(e):eK(((e-=65536)>>10&1023)+55296)+eK((1023&e)+56320)}).join("")+'"'}function ej(e){return e.map(e=>e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10&1023)+55296,(1023&e)+56320)).join("")}function ez(e,t){return ej(eH(e,t))}function eV(e,t=s.current){return eH(e$(e,t))}function eq(e){return ey(e$(e))}class eY extends ep{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=eR(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return eR($(e.readValue().toHexString(),20))}}class eJ extends ep{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}let eW=new A(eh);function eQ(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map(t=>{let n=t.localName;return n||eW.throwError("cannot encode object for signature with missing names",A.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&eW.throwError("cannot encode object for signature with duplicate names",A.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]})}else eW.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&eW.throwArgumentError("types/value length mismatch","tuple",r);let i=new em(e.wordSize),s=new em(e.wordSize),o=[];return t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let t=s.length;e.encode(s,r);let n=i.writeUpdatableValue();o.push(e=>{n(e+t)})}else e.encode(i,r)}),o.forEach(e=>{e(i.length)}),e.appendWriter(i)+e.appendWriter(s)}function eX(e,t){let r=[],n=e.subReader(0);t.forEach(t=>{let i=null;if(t.dynamic){let r=e.readValue(),s=n.subReader(r.toNumber());try{i=t.decode(s)}catch(e){if(e.code===A.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===A.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&r.push(i)});let i=t.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});t.forEach((e,t)=>{let n=e.localName;if(!n||1!==i[n]||("length"===n&&(n="_length"),null!=r[n]))return;let s=r[t];s instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw s}}):r[n]=s});for(let e=0;e{throw t}})}return Object.freeze(r)}class eZ extends ep{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&eW.throwError("insufficient data length",A.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});let r=[];for(let e=0;e{e.dynamic&&(r=!0),n.push(e.type)}),super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){let e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});let t=this.coders.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))}),Object.freeze(e)}encode(e,t){return eQ(e,this.coders,t)}decode(e){return e.coerce(this.name,eX(e,this.coders))}}let to=new A(eh),ta={},tl={calldata:!0,memory:!0,storage:!0},tc={calldata:!0,memory:!0};function tu(e,t){if("bytes"===e||"string"===e){if(tl[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&tc[t])return!0;return(tl[t]||"payable"===t)&&to.throwArgumentError("invalid modifier","name",t),!1}function th(e,t){for(let r in t)en(e,r,t[r])}let td=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),tf=new RegExp(/^(.*)\[([0-9]*)\]$/);class tp{constructor(e,t){e!==ta&&to.throwError("use fromString",A.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),th(this,t);let r=this.type.match(tf);r?th(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:tp.fromObject({type:r[1],components:this.components}),baseType:"array"}):th(this,{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=td.sighash),td[e]||to.throwArgumentError("invalid format type","format",e),e===td.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==td.sighash&&(t+=this.type),t+="("+this.components.map(t=>t.format(e)).join(e===td.full?", ":",")+")"):t+=this.type,e!==td.sighash&&(!0===this.indexed&&(t+=" indexed"),e===td.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?tp.fromString(e,t):tp.fromObject(e)}static fromObject(e){return tp.isParamType(e)?e:new tp(ta,{name:e.name||null,type:tS(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(tp.fromObject):null})}static fromString(e,t){var r;return r=function(e,t){let r=e;function n(t){to.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let s={type:"",name:"",state:{allowType:!0}},o=s;for(let r=0;rtp.fromString(e,t))}class tg{constructor(e,t){e!==ta&&to.throwError("use a static from method",A.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),th(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return tg.isFragment(e)?e:"string"==typeof e?tg.fromString(e):tg.fromObject(e)}static fromObject(e){if(tg.isFragment(e))return e;switch(e.type){case"function":return tA.fromObject(e);case"event":return tx.fromObject(e);case"constructor":return tw.fromObject(e);case"error":return tk.fromObject(e);case"fallback":case"receive":return null}return to.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?tx.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?tA.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?tw.fromString(e.trim()):"error"===e.split(" ")[0]?tk.fromString(e.substring(5).trim()):to.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class tx extends tg{format(e){if(e||(e=td.sighash),td[e]||to.throwArgumentError("invalid format type","format",e),e===td.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==td.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===td.full?", ":",")+") ",e!==td.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?tx.fromString(e):tx.fromObject(e)}static fromObject(e){return tx.isEventFragment(e)?e:("event"!==e.type&&to.throwArgumentError("invalid event object","value",e),new tx(ta,{name:tC(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(tp.fromObject):[],type:"event"}))}static fromString(e){let t=e.match(t_);t||to.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:to.warn("unknown modifier: "+e)}}),tx.fromObject({name:t[1].trim(),anonymous:r,inputs:tm(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function tb(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&to.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||to.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Q.from(r[1]),r[0]):e}function ty(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}})}function tv(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&to.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&to.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||to.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&to.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&to.throwArgumentError("unable to determine stateMutability","value",e),t}class tw extends tg{format(e){if(e||(e=td.sighash),td[e]||to.throwArgumentError("invalid format type","format",e),e===td.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});e===td.sighash&&to.throwError("cannot format a constructor for sighash",A.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(t=>t.format(e)).join(e===td.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?tw.fromString(e):tw.fromObject(e)}static fromObject(e){if(tw.isConstructorFragment(e))return e;"constructor"!==e.type&&to.throwArgumentError("invalid constructor object","value",e);let t=tv(e);return t.constant&&to.throwArgumentError("constructor cannot be constant","value",e),new tw(ta,{name:null,type:e.type,inputs:e.inputs?e.inputs.map(tp.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Q.from(e.gas):null})}static fromString(e){let t={type:"constructor"},r=(e=tb(e,t)).match(t_);return r&&"constructor"===r[1].trim()||to.throwArgumentError("invalid constructor string","value",e),t.inputs=tm(r[2].trim(),!1),ty(r[3].trim(),t),tw.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class tA extends tw{format(e){if(e||(e=td.sighash),td[e]||to.throwArgumentError("invalid format type","format",e),e===td.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==td.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===td.full?", ":",")+") ",e!==td.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(t=>t.format(e)).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?tA.fromString(e):tA.fromObject(e)}static fromObject(e){if(tA.isFunctionFragment(e))return e;"function"!==e.type&&to.throwArgumentError("invalid function object","value",e);let t=tv(e);return new tA(ta,{type:e.type,name:tC(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(tp.fromObject):[],outputs:e.outputs?e.outputs.map(tp.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Q.from(e.gas):null})}static fromString(e){let t={type:"function"},r=(e=tb(e,t)).split(" returns ");r.length>2&&to.throwArgumentError("invalid function string","value",e);let n=r[0].match(t_);if(n||to.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&tC(t.name),t.inputs=tm(n[2],!1),ty(n[3].trim(),t),r.length>1){let n=r[1].match(t_);(""!=n[1].trim()||""!=n[3].trim())&&to.throwArgumentError("unexpected tokens","value",e),t.outputs=tm(n[2],!1)}else t.outputs=[];return tA.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function tE(e){let t=e.format();return("Error(string)"===t||"Panic(uint256)"===t)&&to.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class tk extends tg{format(e){if(e||(e=td.sighash),td[e]||to.throwArgumentError("invalid format type","format",e),e===td.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==td.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===td.full?", ":",")+") ").trim()}static from(e){return"string"==typeof e?tk.fromString(e):tk.fromObject(e)}static fromObject(e){return tk.isErrorFragment(e)?e:("error"!==e.type&&to.throwArgumentError("invalid error object","value",e),tE(new tk(ta,{type:e.type,name:tC(e.name),inputs:e.inputs?e.inputs.map(tp.fromObject):[]})))}static fromString(e){let t={type:"error"},r=e.match(t_);return r||to.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&tC(t.name),t.inputs=tm(r[2],!1),tE(tk.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function tS(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}let tT=RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function tC(e){return e&&e.match(tT)||to.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}let t_=RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),tM=new A(eh),tN=new RegExp(/^bytes([0-9]*)$/),tP=new RegExp(/^(u?int)([0-9]*)$/);class tR{constructor(e){en(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new eY(e.name);case"bool":return new e0(e.name);case"string":return new ti(e.name);case"bytes":return new e2(e.name);case"array":return new eZ(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ts((e.components||[]).map(e=>this._getCoder(e)),e.name);case"":return new e5(e.name)}let t=e.type.match(tP);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&tM.throwArgumentError("invalid "+t[1]+" bit length","param",e),new tn(r/8,"int"===t[1],e.name)}if(t=e.type.match(tN)){let r=parseInt(t[1]);return(0===r||r>32)&&tM.throwArgumentError("invalid bytes length","param",e),new e3(r,e.name)}return tM.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new eg(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new em(this._getWordSize())}getDefaultValue(e){return new ts(e.map(e=>this._getCoder(tp.from(e))),"_").defaultValue()}encode(e,t){e.length!==t.length&&tM.throwError("types/values length mismatch",A.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});let r=new ts(e.map(e=>this._getCoder(tp.from(e))),"_"),n=this._getWriter();return r.encode(n,t),n.data}decode(e,t,r){return new ts(e.map(e=>this._getCoder(tp.from(e))),"_").decode(this._getReader(M(t),r))}}let tO=new tR,tI=new A(eh);class tB extends eu{}class tL extends eu{}class tD extends eu{}class tF extends eu{static isIndexed(e){return!!(e&&e._isIndexed)}}let tU={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function tH(e,t){let r=Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class t${constructor(e){en(this,"fragments",("string"==typeof e?JSON.parse(e):e).map(e=>tg.from(e)).filter(e=>null!=e)),en(this,"_abiCoder",ei(new.target,"getAbiCoder")()),en(this,"functions",{}),en(this,"errors",{}),en(this,"events",{}),en(this,"structs",{}),this.fragments.forEach(e=>{let t=null;switch(e.type){case"constructor":if(this.deploy){tI.warn("duplicate definition - constructor");return}en(this,"deploy",e);return;case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();if(t[r]){tI.warn("duplicate definition - "+r);return}t[r]=e}),this.deploy||en(this,"deploy",tw.from({payable:!1,type:"constructor"})),en(this,"_isInterface",!0)}format(e){e||(e=td.full),e===td.sighash&&tI.throwArgumentError("interface does not support formatting sighash","format",e);let t=this.fragments.map(t=>t.format(e));return e===td.json?JSON.stringify(t.map(e=>JSON.parse(e))):t}static getAbiCoder(){return tO}static getAddress(e){return eR(e)}static getSighash(e){return D(eq(e.format()),0,4)}static getEventTopic(e){return eq(e.format())}getFunction(e){if(O(e)){for(let t in this.functions)if(e===this.getSighash(t))return this.functions[t];tI.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){let t=e.trim(),r=Object.keys(this.functions).filter(e=>e.split("(")[0]===t);return 0===r.length?tI.throwArgumentError("no matching function","name",t):r.length>1&&tI.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}let t=this.functions[tA.fromString(e).format()];return t||tI.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(O(e)){let t=e.toLowerCase();for(let e in this.events)if(t===this.getEventTopic(e))return this.events[e];tI.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){let t=e.trim(),r=Object.keys(this.events).filter(e=>e.split("(")[0]===t);return 0===r.length?tI.throwArgumentError("no matching event","name",t):r.length>1&&tI.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}let t=this.events[tx.fromString(e).format()];return t||tI.throwArgumentError("no matching event","signature",e),t}getError(e){if(O(e)){let t=ei(this.constructor,"getSighash");for(let r in this.errors)if(e===t(this.errors[r]))return this.errors[r];tI.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){let t=e.trim(),r=Object.keys(this.errors).filter(e=>e.split("(")[0]===t);return 0===r.length?tI.throwArgumentError("no matching error","name",t):r.length>1&&tI.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}let t=this.errors[tA.fromString(e).format()];return t||tI.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ei(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ei(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));let r=M(t);return B(r.slice(0,4))!==this.getSighash(e)&&tI.throwArgumentError(`data signature does not match error ${e.name}.`,"data",B(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),B(N([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=M(t);return B(r.slice(0,4))!==this.getSighash(e)&&tI.throwArgumentError(`data signature does not match function ${e.name}.`,"data",B(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),B(N([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=M(t),n=null,i="",s=null,o=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{let e=B(r.slice(0,4)),t=tU[e];if(t)s=this._abiCoder.decode(t.inputs,r.slice(4)),o=t.name,a=t.signature,t.reason&&(n=s[0]),"Error"===o?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===o&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{let t=this.getError(e);s=this._abiCoder.decode(t.inputs,r.slice(4)),o=t.name,a=t.format()}catch(e){}}}return tI.throwError("call revert exception"+i,A.errors.CALL_EXCEPTION,{method:e.format(),data:B(t),errorArgs:s,errorName:o,errorSignature:a,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),B(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&tI.throwError("too many arguments for "+e.format(),A.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));let n=(e,t)=>"string"===e.type?eq(t):"bytes"===e.type?ey(B(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Q.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),$(B(t),32));for(t.forEach((t,i)=>{let s=e.inputs[i];if(!s.indexed){null!=t&&tI.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+s.name,t);return}null==t?r.push(null):"array"===s.baseType||"tuple"===s.baseType?tI.throwArgumentError("filtering with tuples or arrays not supported","contract."+s.name,t):Array.isArray(t)?r.push(t.map(e=>n(s,e))):r.push(n(s,t))});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));let r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&tI.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((e,s)=>{let o=t[s];if(e.indexed){if("string"===e.type)r.push(eq(o));else if("bytes"===e.type)r.push(ey(o));else if("tuple"===e.baseType||"array"===e.baseType)throw Error("not implemented");else r.push(this._abiCoder.encode([e.type],[o]))}else n.push(e),i.push(o)}),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);O(r[0],32)&&r[0].toLowerCase()===t||tI.throwError("fragment/topic mismatch",A.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],s=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(tp.fromObject({type:"bytes32",name:e.name})),s.push(!0)):(n.push(e),s.push(!1)):(i.push(e),s.push(!1))});let o=null!=r?this._abiCoder.decode(n,N(r)):null,a=this._abiCoder.decode(i,t,!0),l=[],c=0,u=0;e.inputs.forEach((e,t)=>{if(e.indexed){if(null==o)l[t]=new tF({_isIndexed:!0,hash:null});else if(s[t])l[t]=new tF({_isIndexed:!0,hash:o[u++]});else try{l[t]=o[u++]}catch(e){l[t]=e}}else try{l[t]=a[c++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){let r=l[t];r instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:()=>{throw tH(`property ${JSON.stringify(e.name)}`,r)}}):l[e.name]=r}});for(let e=0;e{throw tH(`index ${e}`,t)}})}return Object.freeze(l)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new tL({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Q.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new tB({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){let t=B(e),r=this.getError(t.substring(0,10).toLowerCase());return r?new tD({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!!(e&&e._isInterface)}}let tK=new A("abstract-provider/5.7.0");class tG extends eu{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class tj{constructor(){tK.checkAbstract(new.target,tj),en(this,"_isProvider",!0)}getFeeData(){var e,t,r,n;return e=this,t=void 0,r=void 0,n=function*(){let{block:e,gasPrice:t}=yield es({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(e=>null)}),r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=Q.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}},new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!!(e&&e._isProvider)}}var tz=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let tV=new A("abstract-signer/5.7.0"),tq=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],tY=[A.errors.INSUFFICIENT_FUNDS,A.errors.NONCE_EXPIRED,A.errors.REPLACEMENT_UNDERPRICED];class tJ{constructor(){tV.checkAbstract(new.target,tJ),en(this,"_isSigner",!0)}getBalance(e){return tz(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return tz(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return tz(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let t=yield es(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return tz(this,void 0,void 0,function*(){this._checkProvider("call");let r=yield es(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return tz(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return tz(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return tz(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return tz(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return tz(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let t in e)-1===tq.indexOf(t)&&tV.throwArgumentError("invalid transaction key: "+t,"transaction",e);let t=ea(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&tV.throwArgumentError("from address mismatch","transaction",e),t[0])),t}populateTransaction(e){return tz(this,void 0,void 0,function*(){let t=yield es(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then(e=>tz(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.resolveName(e);return null==t&&tV.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})),t.to.catch(e=>{}));let r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null!=t.gasPrice&&(2===t.type||r)?tV.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(0===t.type||1===t.type)&&r&&tV.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(2===t.type||null==t.type)&&null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)t.type=2;else if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{let e=yield this.getFeeData();if(null==t.type){if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas){if(t.type=2,null!=t.gasPrice){let e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas)}else null!=e.gasPrice?(r&&tV.throwError("network does not support EIP-1559",A.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):tV.throwError("failed to get consistent fee data",A.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"})}else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch(e=>{if(tY.indexOf(e.code)>=0)throw e;return tV.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",A.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})})),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(t=>(0!==t[1]&&t[0]!==t[1]&&tV.throwArgumentError("chainId address mismatch","transaction",e),t[0])),yield es(t)})}_checkProvider(e){this.provider||tV.throwError("missing provider",A.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class tW extends tJ{constructor(e,t){super(),en(this,"address",e),en(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then(()=>{tV.throwError(e,A.errors.UNSUPPORTED_OPERATION,{operation:t})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new tW(this.address,e)}}var tQ=r(7453),tX=r.n(tQ);function tZ(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e,null==t?r.path:t)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var t0=t1;function t1(e,t){if(!e)throw Error(t||"Assertion failed")}t1.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var t2=tZ(function(e,t){function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,o=255&i;s?r.push(s,o):r.push(o)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}),t3=tZ(function(e,t){t.assert=t0,t.toArray=t2.toArray,t.zero2=t2.zero2,t.toHex=t2.toHex,t.encode=t2.encode,t.getNAF=function(e,t,r){var n=Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-l:l,s.isubn(a)):a=0,n[o]=a,s.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var s,o,a,l=e.andln(3)+n&3,c=t.andln(3)+i&3;3===l&&(l=-1),3===c&&(c=-1),o=(1&l)==0?0:(3==(s=e.andln(7)+n&7)||5===s)&&2===c?-l:l,r[0].push(o),a=(1&c)==0?0:(3==(s=t.andln(7)+i&7)||5===s)&&2===l?-c:c,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new(z())(e,"hex","le")}}),t5=t3.getNAF,t6=t3.getJSF,t4=t3.assert;function t8(e,t){this.type=e,this.p=new(z())(t.p,16),this.red=t.prime?z().red(t.prime):z().mont(this.p),this.zero=new(z())(0).toRed(this.red),this.one=new(z())(1).toRed(this.red),this.two=new(z())(2).toRed(this.red),this.n=t.n&&new(z())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],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))}function t9(e,t){this.curve=e,this.type=t,this.precomputed=null}t8.prototype.point=function(){throw Error("Not implemented")},t8.prototype.validate=function(){throw Error("Not implemented")},t8.prototype._fixedNafMul=function(e,t){t4(e.precomputed);var r,n,i=e._getDoubles(),s=t5(t,1,this._bitLength),o=(1<=r;l--)n=(n<<1)+s[l];a.push(n)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),h=o;h>0;h--){for(r=0;r=0;a--){for(var l=0;a>=0&&0===s[a];a--)l++;if(a>=0&&l++,o=o.dblp(l),a<0)break;var c=s[a];t4(0!==c),o="affine"===e.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},t8.prototype._wnafMulAdd=function(e,t,r,n,i){var s,o,a,l=this._wnafT1,c=this._wnafT2,u=this._wnafT3,h=0;for(s=0;s=1;s-=2){var f=s-1,p=s;if(1!==l[f]||1!==l[p]){u[f]=t5(r[f],l[f],this._bitLength),u[p]=t5(r[p],l[p],this._bitLength),h=Math.max(u[f].length,h),h=Math.max(u[p].length,h);continue}var m=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(m[1]=t[f].add(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].add(t[p].neg())):(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],x=t6(r[f],r[p]);for(o=0,h=Math.max(x[0].length,h),u[f]=Array(h),u[p]=Array(h);o=0;s--){for(var A=0;s>=0;){var E=!0;for(o=0;o=0&&A++,v=v.dblp(A),s<0)break;for(o=0;o0?a=c[o][k-1>>1]:k<0&&(a=c[o][-k-1>>1].neg()),v="affine"===a.type?v.mixedAdd(a):v.add(a))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},t9.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;ii[0].cmp(i[1])?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new(z())(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],re(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return n=e.basis?e.basis.map(function(e){return{a:new(z())(e.a,16),b:new(z())(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:n}}},rt.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:z().mont(e),r=new(z())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(z())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},rt.prototype._getEndoBasis=function(e){for(var t,r,n,i,s,o,a,l,c,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,d=this.n.clone(),f=new(z())(1),p=new(z())(0),m=new(z())(0),g=new(z())(1),x=0;0!==h.cmpn(0);){var b=d.div(h);l=d.sub(b.mul(h)),c=m.sub(b.mul(f));var y=g.sub(b.mul(p));if(!n&&0>l.cmp(u))t=a.neg(),r=f,n=l.neg(),i=c;else if(n&&2==++x)break;a=l,d=h,h=l,m=f,f=c,g=p,p=y}s=l.neg(),o=c;var v=n.sqr().add(i.sqr());return s.sqr().add(o.sqr()).cmp(v)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},rt.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),l=i.mul(r.b),c=s.mul(n.b);return{k1:e.sub(o).sub(a),k2:l.add(c).neg()}},rt.prototype.pointFromX=function(e,t){(e=new(z())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},rt.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},rt.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,s=0;s":""},rr.prototype.isInfinity=function(){return this.inf},rr.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)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},rr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},rr.prototype.getX=function(){return this.x.fromRed()},rr.prototype.getY=function(){return this.y.fromRed()},rr.prototype.mul=function(e){return(e=new(z())(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)},rr.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},rr.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},rr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},rr.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},rr.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},t7(rn,t8.BasePoint),rt.prototype.jpoint=function(e,t,r){return new rn(this,e,t,r)},rn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},rn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},rn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),l=s.redSub(o);if(0===a.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),h=n.redMul(c),d=l.redSqr().redIAdd(u).redISub(h).redISub(h),f=l.redMul(h.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,f,p)},rn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),c=l.redMul(o),u=r.redMul(l),h=a.redSqr().redIAdd(c).redISub(u).redISub(u),d=a.redMul(u.redISub(h)).redISub(i.redMul(c)),f=this.z.redMul(o);return this.curve.jpoint(h,d,f)},rn.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},rn.prototype.inspect=function(){return this.isInfinity()?"":""},rn.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var ri=tZ(function(e,t){t.base=t8,t.short=rt,t.mont=null,t.edwards=null}),rs=tZ(function(e,t){var r,n=t3.assert;function i(e){"short"===e.type?this.curve=new ri.short(e):"edwards"===e.type?this.curve=new ri.edwards(e):this.curve=new ri.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var n=new i(r);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}),n}})}t.PresetCurve=i,s("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:tX().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:tX().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:tX().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:tX().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"]}),s("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:tX().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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:tX().sha256,gRed:!1,g:["9"]}),s("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:tX().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("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:tX().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function ro(e){if(!(this instanceof ro))return new ro(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=t2.toArray(e.entropy,e.entropyEnc||"hex"),r=t2.toArray(e.nonce,e.nonceEnc||"hex"),n=t2.toArray(e.pers,e.persEnc||"hex");t0(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}ro.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},ro.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=t2.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var rc=t3.assert;function ru(e,t){if(e instanceof ru)return e;this._importDER(e,t)||(rc(e.r&&e.s,"Signature without r or s"),this.r=new(z())(e.r,16),this.s=new(z())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function rh(){this.place=0}function rd(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,s=0,o=t.place;s>>=0;return!(i<=127)&&(t.place=o,i)}function rf(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}ru.prototype._importDER=function(e,t){e=t3.toArray(e,t);var r=new rh;if(48!==e[r.place++])return!1;var n=rd(e,r);if(!1===n||n+r.place!==e.length||2!==e[r.place++])return!1;var i=rd(e,r);if(!1===i)return!1;var s=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=rd(e,r);if(!1===o||e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(z())(s),this.s=new(z())(a),this.recoveryParam=null,!0},ru.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=rf(t),r=rf(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];rp(n,t.length),(n=n.concat(t)).push(2),rp(n,r.length);var i=n.concat(r),s=[48];return rp(s,i.length),s=s.concat(i),t3.encode(s,e)};var rm=function(){throw Error("unsupported")},rg=t3.assert;function rx(e){if(!(this instanceof rx))return new rx(e);"string"==typeof e&&(rg(Object.prototype.hasOwnProperty.call(rs,e),"Unknown curve "+e),e=rs[e]),e instanceof rs.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}rx.prototype.keyPair=function(e){return new rl(this,e)},rx.prototype.keyFromPrivate=function(e,t){return rl.fromPrivate(this,e,t)},rx.prototype.keyFromPublic=function(e,t){return rl.fromPublic(this,e,t)},rx.prototype.genKeyPair=function(e){e||(e={});for(var t=new ro({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||rm(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(z())(2));;){var i=new(z())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},rx.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return(r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},rx.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(z())(e,16));for(var i=this.n.byteLength(),s=t.getPrivate().toArray("be",i),o=e.toArray("be",i),a=new ro({hash:this.hash,entropy:s,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(z())(1)),c=0;;c++){var u=n.k?n.k(c):new(z())(a.generate(this.n.byteLength()));if(!(0>=(u=this._truncateToN(u,!0)).cmpn(1)||u.cmp(l)>=0)){var h=this.g.mul(u);if(!h.isInfinity()){var d=h.getX(),f=d.umod(this.n);if(0!==f.cmpn(0)){var p=u.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==d.cmp(f)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new ru({r:f,s:p,recoveryParam:m})}}}}}},rx.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(z())(e,16)),r=this.keyFromPublic(r,n);var i,s=(t=new ru(t,"hex")).r,o=t.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>o.cmpn(1)||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),c=a.mul(s).umod(this.n);return this.curve._maxwellTrick?!(i=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&i.eqXToP(s):!(i=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===i.getX().umod(this.n).cmp(s)},rx.prototype.recoverPubKey=function(e,t,r,n){rg((3&r)===r,"The recovery param is more than two bits"),t=new ru(t,n);var i=this.n,s=new(z())(e),o=t.r,a=t.s,l=1&r,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw Error("Unable to find sencond key candinate");o=c?this.curve.pointFromX(o.add(this.curve.n),l):this.curve.pointFromX(o,l);var u=t.r.invm(i),h=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(h,o,d)},rx.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new ru(t,n)).recoveryParam)return t.recoveryParam;for(var i,s=0;s<4;s++){try{i=this.recoverPubKey(e,t,s)}catch(e){continue}if(i.eq(r))return s}throw Error("Unable to find valid recovery factor")};var rb=tZ(function(e,t){t.version="6.5.4",t.utils=t3,t.rand=function(){throw Error("unsupported")},t.curve=ri,t.curves=rs,t.ec=rx,t.eddsa=null}).ec;let ry=new A("signing-key/5.7.0"),rv=null;function rw(){return rv||(rv=new rb("secp256k1")),rv}class rA{constructor(e){en(this,"curve","secp256k1"),en(this,"privateKey",B(e)),32!==L(this.privateKey)&&ry.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=rw().keyFromPrivate(M(this.privateKey));en(this,"publicKey","0x"+t.getPublic(!1,"hex")),en(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),en(this,"_isSigningKey",!0)}_addPoint(e){let t=rw().keyFromPublic(M(this.publicKey)),r=rw().keyFromPublic(M(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=rw().keyFromPrivate(M(this.privateKey)),r=M(e);32!==r.length&&ry.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return K({recoveryParam:n.recoveryParam,r:$("0x"+n.r.toString(16),32),s:$("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=rw().keyFromPrivate(M(this.privateKey)),r=rw().keyFromPublic(M(rk(e)));return $("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function rE(e,t){let r=K(t),n={r:M(r.r),s:M(r.s)};return"0x"+rw().recoverPubKey(M(e),n,r.recoveryParam).encode("hex",!1)}function rk(e,t){let r=M(e);if(32===r.length){let e=new rA(r);return t?"0x"+rw().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?B(r):"0x"+rw().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+rw().keyFromPublic(r).getPublic(!0,"hex"):B(r):ry.throwArgumentError("invalid public or private key","key","[REDACTED]")}let rS=new A("transactions/5.7.0");function rT(e){return"0x"===e?null:eR(e)}function rC(e){return"0x"===e?e4:Q.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(a||(a={}));let r_=[{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"}],rM={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function rN(e){return eR(D(ey(D(rk(e),1)),12))}function rP(e,t){return rN(rE(M(e),t))}function rR(e,t){let r=P(Q.from(e).toHexString());return r.length>32&&rS.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function rO(e,t){return{address:eR(e),storageKeys:(t||[]).map((t,r)=>(32!==L(t)&&rS.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))}}function rI(e){if(Array.isArray(e))return e.map((e,t)=>Array.isArray(e)?(e.length>2&&rS.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),rO(e[0],e[1])):rO(e.address,e.storageKeys));let t=Object.keys(e).map(t=>{let r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return rO(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function rB(e){return rI(e).map(e=>[e.address,e.storageKeys])}function rL(e,t){if(null!=e.gasPrice){let t=Q.from(e.gasPrice),r=Q.from(e.maxFeePerGas||0);t.eq(r)||rS.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}let r=[rR(e.chainId||0,"chainId"),rR(e.nonce||0,"nonce"),rR(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),rR(e.maxFeePerGas||0,"maxFeePerGas"),rR(e.gasLimit||0,"gasLimit"),null!=e.to?eR(e.to):"0x",rR(e.value||0,"value"),e.data||"0x",rB(e.accessList||[])];if(t){let e=K(t);r.push(rR(e.recoveryParam,"recoveryParam")),r.push(P(e.r)),r.push(P(e.s))}return F(["0x02",eE(r)])}function rD(e,t){let r=[rR(e.chainId||0,"chainId"),rR(e.nonce||0,"nonce"),rR(e.gasPrice||0,"gasPrice"),rR(e.gasLimit||0,"gasLimit"),null!=e.to?eR(e.to):"0x",rR(e.value||0,"value"),e.data||"0x",rB(e.accessList||[])];if(t){let e=K(t);r.push(rR(e.recoveryParam,"recoveryParam")),r.push(P(e.r)),r.push(P(e.s))}return F(["0x01",eE(r)])}function rF(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&rS.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){eo(e,rM);let r=[];r_.forEach(function(t){let n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=M(B(n,i)),t.length&&n.length!==t.length&&n.length>0&&rS.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=P(n)).length>t.maxLength&&rS.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(B(n))});let n=0;if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&rS.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!T(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(B(n)),r.push("0x"),r.push("0x")),!t)return eE(r);let i=K(t),s=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),s+=2*n+8,i.v>28&&i.v!==s&&rS.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==s&&rS.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(B(s)),r.push(P(M(i.r))),r.push(P(M(i.s))),eE(r)}(e,t);switch(e.type){case 1:return rD(e,t);case 2:return rL(e,t)}return rS.throwError(`unsupported transaction type: ${e.type}`,A.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function rU(e,t,r){try{let r=rC(t[0]).toNumber();if(0!==r&&1!==r)throw Error("bad recid");e.v=r}catch(e){rS.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=$(t[1],32),e.s=$(t[2],32);try{let t=ey(r(e));e.from=rP(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function rH(e){let t=M(e);if(t[0]>127)return function(e){let t=eT(e);9!==t.length&&6!==t.length&&rS.throwArgumentError("invalid raw transaction","rawTransaction",e);let r={nonce:rC(t[0]).toNumber(),gasPrice:rC(t[1]),gasLimit:rC(t[2]),to:rT(t[3]),value:rC(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Q.from(t[6]).toNumber()}catch(e){return r}if(r.r=$(t[7],32),r.s=$(t[8],32),Q.from(r.r).isZero()&&Q.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 n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push(B(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);let s=ey(eE(i));try{r.from=rP(s,{r:B(r.r),s:B(r.s),recoveryParam:n})}catch(e){}r.hash=ey(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){let t=eT(e.slice(1));8!==t.length&&11!==t.length&&rS.throwArgumentError("invalid component count for transaction type: 1","payload",B(e));let r={type:1,chainId:rC(t[0]).toNumber(),nonce:rC(t[1]).toNumber(),gasPrice:rC(t[2]),gasLimit:rC(t[3]),to:rT(t[4]),value:rC(t[5]),data:t[6],accessList:rI(t[7])};return 8===t.length||(r.hash=ey(e),rU(r,t.slice(8),rD)),r}(t);case 2:return function(e){let t=eT(e.slice(1));9!==t.length&&12!==t.length&&rS.throwArgumentError("invalid component count for transaction type: 2","payload",B(e));let r=rC(t[2]),n=rC(t[3]),i={type:2,chainId:rC(t[0]).toNumber(),nonce:rC(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:rC(t[4]),to:rT(t[5]),value:rC(t[6]),data:t[7],accessList:rI(t[8])};return 9===t.length||(i.hash=ey(e),rU(i,t.slice(9),rL)),i}(t)}return rS.throwError(`unsupported transaction type: ${t[0]}`,A.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var r$=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let rK=new A("contracts/5.7.0"),rG={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 rj(e,t){return r$(this,void 0,void 0,function*(){let r=yield t;"string"!=typeof r&&rK.throwArgumentError("invalid address or ENS name","name",r);try{return eR(r)}catch(e){}e||rK.throwError("a provider or signer is needed to resolve ENS names",A.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});let n=yield e.resolveName(r);return null==n&&rK.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function rz(e,t,r){return r$(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((r,n)=>rz(e,Array.isArray(t)?t[n]:t[r.name],r))):"address"===r.type?yield rj(e,t):"tuple"===r.type?yield rz(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map(t=>rz(e,t,r.arrayChildren))):Promise.reject(rK.makeError("invalid value for array",A.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t})}function rV(e,t,r){return r$(this,void 0,void 0,function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ea(r.pop())),rK.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=es({override:rj(e.signer,n.from),signer:e.signer.getAddress()}).then(e=>r$(this,void 0,void 0,function*(){return eR(e.signer)!==e.override&&rK.throwError("Contract with a Signer cannot override from",A.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})):n.from=e.signer.getAddress():n.from&&(n.from=rj(e.provider,n.from));let i=yield es({args:rz(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:es(n)||{}}),s=e.interface.encodeFunctionData(t,i.args),o={data:s,to:i.address},a=i.overrides;if(null!=a.nonce&&(o.nonce=Q.from(a.nonce).toNumber()),null!=a.gasLimit&&(o.gasLimit=Q.from(a.gasLimit)),null!=a.gasPrice&&(o.gasPrice=Q.from(a.gasPrice)),null!=a.maxFeePerGas&&(o.maxFeePerGas=Q.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(o.maxPriorityFeePerGas=Q.from(a.maxPriorityFeePerGas)),null!=a.from&&(o.from=a.from),null!=a.type&&(o.type=a.type),null!=a.accessList&&(o.accessList=rI(a.accessList)),null==o.gasLimit&&null!=t.gas){let e=21e3,r=M(s);for(let t=0;tnull!=n[e]);return l.length&&rK.throwError(`cannot override ${l.map(e=>JSON.stringify(e)).join(",")}`,A.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function rq(e,t){let r=t.wait.bind(t);t.wait=t=>r(t).then(t=>(t.events=t.logs.map(r=>{let n=ec(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n}),t))}function rY(e,t,r){let n=e.signer||e.provider;return function(...i){return r$(this,void 0,void 0,function*(){let s;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){let e=ea(i.pop());null!=e.blockTag&&(s=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(s));let o=yield rV(e,t,i),a=yield n.call(o,s);try{let n=e.interface.decodeFunctionResult(t,a);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===A.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=o),t}})}}function rJ(e,t,r){return t.constant?rY(e,t,r):function(...r){return r$(this,void 0,void 0,function*(){e.signer||rK.throwError("sending a transaction requires a signer",A.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());let n=yield rV(e,t,r),i=yield e.signer.sendTransaction(n);return rq(e,i),i})}}function rW(e){return e.address&&(null==e.topics||0===e.topics.length)?"*":(e.address||"*")+"@"+(e.topics?e.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class rQ{constructor(e,t){en(this,"tag",e),en(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter(r=>!!t||r.listener!==e||(t=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){let t=this.listenerCount();return this._listeners=this._listeners.filter(t=>{let r=e.slice();return setTimeout(()=>{t.listener.apply(this,r)},0),!t.once}),t}prepareEvent(e){}getEmit(e){return[e]}}class rX extends rQ{constructor(){super("error",null)}}class rZ extends rQ{constructor(e,t,r,n){let i={address:e},s=t.getEventTopic(r);n?(s!==n[0]&&rK.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[s],super(rW(i),i),en(this,"address",e),en(this,"interface",t),en(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){let t=ef(e.args);if(t.length)throw t[0].error;let r=(e.args||[]).slice();return r.push(e),r}}class r0 extends rQ{constructor(e,t){super("*",{address:e}),en(this,"address",e),en(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{let t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class r1{constructor(e,t,r){en(this,"interface",ei(new.target,"getInterface")(t)),null==r?(en(this,"provider",null),en(this,"signer",null)):tJ.isSigner(r)?(en(this,"provider",r.provider||null),en(this,"signer",r)):tj.isProvider(r)?(en(this,"provider",r),en(this,"signer",null)):rK.throwArgumentError("invalid signer or provider","signerOrProvider",r),en(this,"callStatic",{}),en(this,"estimateGas",{}),en(this,"functions",{}),en(this,"populateTransaction",{}),en(this,"filters",{});{let e={};Object.keys(this.interface.events).forEach(t=>{let r=this.interface.events[t];en(this.filters,t,(...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)})),e[r.name]||(e[r.name]=[]),e[r.name].push(t)}),Object.keys(e).forEach(t=>{let r=e[t];1===r.length?en(this.filters,t,this.filters[r[0]]):rK.warn(`Duplicate definition of ${t} (${r.join(", ")})`)})}if(en(this,"_runningEvents",{}),en(this,"_wrappedEmits",{}),null==e&&rK.throwArgumentError("invalid contract address or ENS name","addressOrName",e),en(this,"address",e),this.provider)en(this,"resolvedAddress",rj(this.provider,e));else try{en(this,"resolvedAddress",Promise.resolve(eR(e)))}catch(e){rK.throwError("provider is required to use ENS name as contract address",A.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(e=>{});let n={},i={};Object.keys(this.interface.functions).forEach(e=>{let t=this.interface.functions[e];if(i[e]){rK.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);return}i[e]=!0;{let r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}if(null==this[e]&&en(this,e,rJ(this,t,!0)),null==this.functions[e]&&en(this.functions,e,rJ(this,t,!1)),null==this.callStatic[e]&&en(this.callStatic,e,rY(this,t,!0)),null==this.populateTransaction[e]){var r;en(this.populateTransaction,e,(r=this,function(...e){return rV(r,t,e)}))}null==this.estimateGas[e]&&en(this.estimateGas,e,function(e,t){let r=e.signer||e.provider;return function(...n){return r$(this,void 0,void 0,function*(){r||rK.throwError("estimate require a provider or signer",A.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});let i=yield rV(e,t,n);return yield r.estimateGas(i)})}}(this,t))}),Object.keys(n).forEach(e=>{let t=n[e];if(t.length>1)return;e=e.substring(1);let r=t[0];try{null==this[e]&&en(this,e,this[r])}catch(e){}null==this.functions[e]&&en(this.functions,e,this.functions[r]),null==this.callStatic[e]&&en(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&en(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&en(this.estimateGas,e,this.estimateGas[r])})}static getContractAddress(e){return eB(e)}static getInterface(e){return t$.isInterface(e)?e:new t$(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(e=>("0x"===e&&rK.throwError("contract not deployed",A.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||rK.throwError("sending a transactions require a signer",A.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});let t=ea(e||{});return["from","to"].forEach(function(e){null!=t[e]&&rK.throwError("cannot override "+e,A.errors.UNSUPPORTED_OPERATION,{operation:e})}),t.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(t))}connect(e){"string"==typeof e&&(e=new tW(e,this.provider));let t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&en(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return tF.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new rX);if("event"===e)return this._normalizeRunningEvent(new rQ("event",null));if("*"===e)return this._normalizeRunningEvent(new r0(this.address,this.interface));let t=this.interface.getEvent(e);return this._normalizeRunningEvent(new rZ(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{let t=e.topics[0];if("string"!=typeof t)throw Error("invalid topic");let r=this.interface.getEvent(t);return this._normalizeRunningEvent(new rZ(this.address,this.interface,r,e.topics))}catch(e){}let t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new rQ(rW(t),t))}return this._normalizeRunningEvent(new r0(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];let t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){let n=ec(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||rK.throwError("events require a provider or a signer with a provider",A.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){let r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{let t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){let n=this._getRunningEvent(e),i=ea(n.filter);return"string"==typeof t&&O(t,32)?(null!=r&&rK.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then(e=>e.map(e=>this._wrapEvent(n,e,null)))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;let r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce((e,t)=>e+this._runningEvents[t].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){let e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach(t=>{e.push(t)});return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(let e in this._runningEvents){let t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}let t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;let r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class r2 extends r1{}class r3{constructor(e,t,r){let n=null;"0x"!==(n="string"==typeof t?t:_(t)?B(t):t&&"string"==typeof t.object?t.object:"!").substring(0,2)&&(n="0x"+n),(!O(n)||n.length%2)&&rK.throwArgumentError("invalid bytecode","bytecode",t),r&&!tJ.isSigner(r)&&rK.throwArgumentError("invalid signer","signer",r),en(this,"bytecode",n),en(this,"interface",ei(new.target,"getInterface")(e)),en(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){for(let r in t=ea(e.pop()))if(!rG[r])throw Error("unknown transaction override "+r)}return["data","from","to"].forEach(e=>{null!=t[e]&&rK.throwError("cannot override "+e,A.errors.UNSUPPORTED_OPERATION,{operation:e})}),!t.value||Q.from(t.value).isZero()||this.interface.deploy.payable||rK.throwError("non-payable constructor cannot override value",A.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value}),rK.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=B(N([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return r$(this,void 0,void 0,function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),rK.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");let r=yield rz(this.signer,e,this.interface.deploy.inputs);r.push(t);let n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),s=ei(this.constructor,"getContractAddress")(i),o=ei(this.constructor,"getContract")(s,this.interface,this.signer);return rq(o,i),en(o,"deployTransaction",i),o})}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,t){null==e&&rK.throwError("missing compiler output",A.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));let r=e.abi,n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return r2.getInterface(e)}static getContractAddress(e){return eB(e)}static getContract(e,t,r){return new r2(e,t,r)}}let r5=new A(V),r6={},r4=Q.from(0),r8=Q.from(-1);function r9(e,t,r,n){let i={fault:t,operation:r};return void 0!==n&&(i.value=n),r5.throwError(e,A.errors.NUMERIC_FAULT,i)}let r7="0";for(;r7.length<256;)r7+=r7;function ne(e){if("number"!=typeof e)try{e=Q.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+r7.substring(0,e):r5.throwArgumentError("invalid decimal size","decimals",e)}function nt(e,t){null==t&&(t=0);let r=ne(t),n=(e=Q.from(e)).lt(r4);n&&(e=e.mul(r8));let i=e.mod(r).toString();for(;i.length2&&r5.throwArgumentError("too many decimal points","value",e);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&r9("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==e[t]?n:(typeof e[t]!==r&&r5.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&r5.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&r5.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new nn(r6,t,r,n)}}class ni{constructor(e,t,r,n){e!==r6&&r5.throwError("cannot use FixedNumber constructor; use FixedNumber.from",A.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&r5.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);let t=nr(this._value,this.format.decimals),r=nr(e._value,e.format.decimals);return ni.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);let t=nr(this._value,this.format.decimals),r=nr(e._value,e.format.decimals);return ni.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);let t=nr(this._value,this.format.decimals),r=nr(e._value,e.format.decimals);return ni.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);let t=nr(this._value,this.format.decimals),r=nr(e._value,e.format.decimals);return ni.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=ni.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(ns.toFormat(t.format))),t}ceiling(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=ni.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(ns.toFormat(t.format))),t}round(e){null==e&&(e=0);let t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&r5.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;let r=ni.from("1"+r7.substring(0,e),this.format),n=no.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){return null==e?this._hex:(e%8&&r5.throwArgumentError("invalid byte width","width",e),$(Q.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ni.fromString(this._value,e)}static fromValue(e,t,r){var n;return null!=r||null==t||null!=(n=t)&&(Q.isBigNumber(n)||"number"==typeof n&&n%1==0||"string"==typeof n&&n.match(/^-?[0-9]+$/)||O(n)||"bigint"==typeof n||_(n))||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ni.fromString(nt(e,t),nn.from(r))}static fromString(e,t){null==t&&(t="fixed");let r=nn.from(t),n=nr(e,r.decimals);!r.signed&&n.lt(r4)&&r9("unsigned value cannot be negative","overflow","value",e);let i=null;return new ni(r6,r.signed?n.toTwos(r.width).toHexString():$(n.toHexString(),r.width/8),nt(n,r.decimals),r)}static fromBytes(e,t){null==t&&(t="fixed");let r=nn.from(t);if(M(e).length>r.width/8)throw Error("overflow");let n=Q.from(e);return r.signed&&(n=n.fromTwos(r.width)),new ni(r6,n.toTwos((r.signed?0:1)+r.width).toHexString(),nt(n,r.decimals),r)}static from(e,t){if("string"==typeof e)return ni.fromString(e,t);if(_(e))return ni.fromBytes(e,t);try{return ni.fromValue(e,0,t)}catch(e){if(e.code!==A.errors.INVALID_ARGUMENT)throw e}return r5.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}let ns=ni.from(1),no=ni.from("0.5");function na(e){return"string"==typeof e&&(e=e$(e)),ey(N([e$("\x19Ethereum Signed Message:\n"),e$(String(e.length)),e]))}let nl="hash/5.7.0",nc=new A(nl),nu=new Uint8Array(32);nu.fill(0);let nh=Q.from(-1),nd=Q.from(0),nf=Q.from(1),np=Q.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),nm=$(nf.toHexString(),32),ng=$(nd.toHexString(),32),nx={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},nb=["name","version","chainId","verifyingContract","salt"];function ny(e){return function(t){return"string"!=typeof t&&nc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}let nv={name:ny("name"),version:ny("version"),chainId:function(e){try{return Q.from(e).toString()}catch(e){}return nc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return eR(e).toLowerCase()}catch(e){}return nc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{let t=M(e);if(32!==t.length)throw Error("bad length");return B(t)}catch(e){}return nc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function nw(e){{let t=e.match(/^(u?)int(\d*)$/);if(t){let r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&nc.throwArgumentError("invalid numeric width","type",e);let i=np.mask(r?n-1:n),s=r?i.add(nf).mul(nh):nd;return function(t){let r=Q.from(t);return(r.lt(s)||r.gt(i))&&nc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),$(r.toTwos(256).toHexString(),32)}}}{let t=e.match(/^bytes(\d+)$/);if(t){let r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&nc.throwArgumentError("invalid bytes width","type",e),function(t){return M(t).length!==r&&nc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){let t=M(e),r=t.length%32;return r?F([t,nu.slice(r)]):B(t)}(t)}}}switch(e){case"address":return function(e){return $(eR(e),32)};case"bool":return function(e){return e?nm:ng};case"bytes":return function(e){return ey(e)};case"string":return function(e){return eq(e)}}return null}function nA(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}class nE{constructor(e){en(this,"types",Object.freeze(ec(e))),en(this,"_encoderCache",{}),en(this,"_types",{});let t={},r={},n={};for(let i in Object.keys(e).forEach(e=>{t[e]={},r[e]=[],n[e]={}}),e){let n={};e[i].forEach(s=>{n[s.name]&&nc.throwArgumentError(`duplicate variable name ${JSON.stringify(s.name)} in ${JSON.stringify(i)}`,"types",e),n[s.name]=!0;let o=s.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===i&&nc.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),nw(o)||(r[o]||nc.throwArgumentError(`unknown type ${JSON.stringify(o)}`,"types",e),r[o].push(i),t[i][o]=!0)})}let i=Object.keys(r).filter(e=>0===r[e].length);for(let s in 0===i.length?nc.throwArgumentError("missing primary type","types",e):i.length>1&&nc.throwArgumentError(`ambiguous primary types or unused types: ${i.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),en(this,"primaryType",i[0]),function i(s,o){o[s]&&nc.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e),o[s]=!0,Object.keys(t[s]).forEach(e=>{r[e]&&(i(e,o),Object.keys(o).forEach(t=>{n[t][e]=!0}))}),delete o[s]}(this.primaryType,{}),n){let t=Object.keys(n[s]);t.sort(),this._types[s]=nA(s,e[s])+t.map(t=>nA(t,e[t])).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{let t=nw(e);if(t)return t}let t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){let e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&nc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(ey)),ey(F(i))}}let r=this.types[e];if(r){let t=eq(this._types[e]);return e=>{let n=r.map(({name:t,type:r})=>{let n=this.getEncoder(r)(e[t]);return this._types[r]?ey(n):n});return n.unshift(t),F(n)}}return nc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let t=this._types[e];return t||nc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ey(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(nw(e))return r(e,t);let n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){let e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&nc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map(t=>this._visit(e,t,r))}let i=this.types[e];return i?i.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{}):nc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new nE(e)}static getPrimaryType(e){return nE.from(e).primaryType}static hashStruct(e,t,r){return nE.from(t).hashStruct(e,r)}static hashDomain(e){let t=[];for(let r in e){let n=nx[r];n||nc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>nb.indexOf(e.name)-nb.indexOf(t.name)),nE.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return F(["0x1901",nE.hashDomain(e),nE.from(t).hash(r)])}static hash(e,t,r){return ey(nE.encode(e,t,r))}static resolveNames(e,t,r,n){var i,s,o,a;return i=this,s=void 0,o=void 0,a=function*(){e=ea(e);let i={};e.verifyingContract&&!O(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let s=nE.from(t);for(let e in s.visit(r,(e,t)=>("address"!==e||O(t,20)||(i[t]="0x"),t)),i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=s.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t),{domain:e,value:r}},new(o||(o=Promise))(function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function n(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):((i=t.value)instanceof o?i:new o(function(e){e(i)})).then(r,n)}l((a=a.apply(i,s||[])).next())})}static getPayload(e,t,r){nE.hashDomain(e);let n={},i=[];nb.forEach(t=>{let r=e[t];null!=r&&(n[t]=nv[t](r),i.push({name:t,type:nx[t]}))});let s=nE.from(t),o=ea(t);return o.EIP712Domain?nc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):o.EIP712Domain=i,s.encode(r),{types:o,domain:n,primaryType:s.primaryType,message:s.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return B(M(t));if(e.match(/^u?int/))return Q.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&nc.throwArgumentError("invalid string","value",t),t}return nc.throwArgumentError("unsupported type","type",e)})}}}class nk{constructor(e){en(this,"alphabet",e),en(this,"base",e.length),en(this,"_alphabetMap",{}),en(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,u[t.length+1]=h>>16&255,u[t.length+2]=h>>8&255,u[t.length+3]=255&h;let d=M(nN(i,e,u));s||(a=new Uint8Array(s=d.length),l=Math.ceil(n/s),o=n-(l-1)*s),a.set(d);for(let t=1;t=256)throw Error("Depth too large!");return nj(N([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",B(this.depth),this.parentFingerprint,$(B(this.index),4),this.chainCode,null!=this.privateKey?N(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new nY(nV,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>0xffffffff)throw Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(0x7fffffff&e));let r=new Uint8Array(37);if(0x80000000&e){if(!this.privateKey)throw Error("cannot derive child of neutered node");r.set(M(this.privateKey),1),t&&(t+="'")}else r.set(M(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;let n=M(nN(l.sha512,this.chainCode,r)),i=n.slice(0,32),s=n.slice(32),o=null,a=null;this.privateKey?o=nG(Q.from(i).add(this.privateKey).mod(nH)):a=new rA(B(i))._addPoint(this.publicKey);let c=t,u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new nY(nV,o,a,this.fingerprint,nG(s),e,this.depth+1,c)}derivePath(e){let t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e=0x80000000)throw Error("invalid path index - "+n);r=r._derive(0x80000000+e)}else if(n.match(/^[0-9]+$/)){let e=parseInt(n);if(e>=0x80000000)throw Error("invalid path index - "+n);r=r._derive(e)}else throw Error("invalid path component - "+n)}return r}static _fromSeed(e,t){let r=M(e);if(r.length<16||r.length>64)throw Error("invalid seed");let n=M(nN(l.sha512,n$,r));return new nY(nV,nG(n.slice(0,32)),null,"0x00000000",nG(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return r=nz(r),e=nQ(nW(e,r),r),nY._fromSeed(nJ(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return nY._fromSeed(e,null)}static fromExtendedKey(e){let t=nS.decode(e);(82!==t.length||nj(t.slice(0,78))!==e)&&nU.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let r=t[4],n=B(t.slice(5,9)),i=parseInt(B(t.slice(9,13)).substring(2),16),s=B(t.slice(13,45)),o=t.slice(45,78);switch(B(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new nY(nV,null,B(o),n,s,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==o[0])break;return new nY(nV,B(o.slice(1)),null,n,s,i,r,null)}return nU.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function nJ(e,t){t||(t="");let r=e$("mnemonic"+t,s.NFKD);return nP(e$(e,s.NFKD),r,2048,64,"sha512")}function nW(e,t){t=nz(t),nU.checkNormalize();let r=t.split(e);if(r.length%3!=0)throw Error("invalid mnemonic");let n=M(new Uint8Array(Math.ceil(11*r.length/8))),i=0;for(let e=0;e>3]|=1<<7-i%8),i++}let s=32*r.length/3,o=nK(r.length/3);if((M(n_(n.slice(0,s/8)))[0]&o)!=(n[n.length-1]&o))throw Error("invalid checksum");return B(n.slice(0,s/8))}function nQ(e,t){if(t=nz(t),(e=M(e)).length%4!=0||e.length<16||e.length>32)throw Error("invalid entropy");let r=[0],n=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);let i=e.length/4,s=M(n_(e))[0]&nK(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,t.join(r.map(e=>t.getWord(e)))}function nX(e,t){try{return nW(e,t),!0}catch(e){}return!1}function nZ(e){return("number"!=typeof e||e<0||e>=0x80000000||e%1)&&nU.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}let n0=new A("random/5.7.0"),n1=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}(),n2=n1.crypto||n1.msCrypto;function n3(e){(e<=0||e>1024||e%1||e!=e)&&n0.throwArgumentError("invalid length","length",e);let t=new Uint8Array(e);return n2.getRandomValues(t),M(t)}n2&&n2.getRandomValues||(n0.warn("WARNING: Missing strong random number source"),n2={getRandomValues:function(e){return n0.throwError("no secure random source avaialble",A.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var n5=r(9349),n6=r.n(n5),n4=r(8946),n8=r.n(n4);function n9(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),M(e)}function n7(e,t){for(e=String(e);e.lengtht),en(this,"address",rN(this.publicKey)),this.address!==eR(e.address)&&iy.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){let t=e.mnemonic;return t&&t.phrase}(e)){let t=e.mnemonic;en(this,"_mnemonic",()=>({phrase:t.phrase,path:t.path||nq,locale:t.locale||"en"}));let r=this.mnemonic;rN(nY.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&iy.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else en(this,"_mnemonic",()=>null)}else{if(rA.isSigningKey(e))"secp256k1"!==e.curve&&iy.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),en(this,"_signingKey",()=>e);else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);let t=new rA(e);en(this,"_signingKey",()=>t)}en(this,"_mnemonic",()=>null),en(this,"address",rN(this.publicKey))}t&&!tj.isProvider(t)&&iy.throwArgumentError("invalid provider","provider",t),en(this,"provider",t||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 iv(this,e)}signTransaction(e){return es(e).then(t=>{null!=t.from&&(eR(t.from)!==this.address&&iy.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);let r=this._signingKey().signDigest(ey(rF(t)));return rF(t,r)})}signMessage(e){return ib(this,void 0,void 0,function*(){return G(this._signingKey().signDigest(na(e)))})}_signTypedData(e,t,r){return ib(this,void 0,void 0,function*(){let n=yield nE.resolveNames(e,t,r,e=>(null==this.provider&&iy.throwError("cannot resolve ENS names without a provider",A.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e)));return G(this._signingKey().signDigest(nE.hash(n.domain,t,n.value)))})}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(eR(e.address)!==rN(e.privateKey))throw Error("address/privateKey mismatch");if(is(e)){let t=e.mnemonic;if(nY.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||nq).privateKey!=e.privateKey)throw Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});let i=M(e.privateKey),s=ie(t),o=null,a=null,l=null;if(is(e)){let t=e.mnemonic;o=M(nW(t.phrase,t.locale||"en")),a=t.path||nq,l=t.locale||"en"}let c=r.client;c||(c="ethers.js");let u=null;u=r.salt?M(r.salt):n3(32);let h=null;if(r.iv){if(16!==(h=M(r.iv)).length)throw Error("invalid iv")}else h=n3(16);let d=null;if(r.uuid){if(16!==(d=M(r.uuid)).length)throw Error("invalid uuid")}else d=n3(16);let f=131072,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(f=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),n8().scrypt(s,u,f,p,m,64,n).then(t=>{let r=(t=M(t)).slice(0,16),n=t.slice(16,32),s=t.slice(32,64),g=new(n6()).Counter(h),x=M(new(n6()).ModeOfOperation.ctr(r,g).encrypt(i)),b=ey(N([n,x])),y={address:e.address.substring(2).toLowerCase(),id:function(e){let t=M(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;let r=B(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:B(h).substring(2)},ciphertext:B(x).substring(2),kdf:"scrypt",kdfparams:{salt:B(u).substring(2),n:f,dklen:32,p:m,r:p},mac:b.substring(2)}};if(o){let e=n3(16),t=new(n6()).Counter(e),r=M(new(n6()).ModeOfOperation.ctr(s,t).encrypt(o)),n=new Date,i=n.getUTCFullYear()+"-"+n7(n.getUTCMonth()+1,2)+"-"+n7(n.getUTCDate(),2)+"T"+n7(n.getUTCHours(),2)+"-"+n7(n.getUTCMinutes(),2)+"-"+n7(n.getUTCSeconds(),2)+".0Z";y["x-ethers"]={client:c,gethFilename:"UTC--"+i+"--"+y.address,mnemonicCounter:B(e).substring(2),mnemonicCiphertext:B(r).substring(2),path:a,locale:l,version:"0.1"}}return JSON.stringify(y)})}(this,e,t,r)}static createRandom(e){let t=n3(16);e||(e={}),e.extraEntropy&&(t=M(D(ey(N([t,e.extraEntropy])),0,16)));let r=nQ(t,e.locale);return iv.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return(function(e,t,r){if(im(e)){r&&r(0);let n=ip(e,t);return r&&r(1),Promise.resolve(n)}return ig(e)?function(e,t,r){var n,i,s,o;return n=this,i=void 0,s=void 0,o=function*(){let n=JSON.parse(e),i=yield iu(n,t,ic,n8().scrypt,r);return ia(n,i)},new(s||(s=Promise))(function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof s?n:new s(function(e){e(n)})).then(r,a)}l((o=o.apply(n,i||[])).next())})}(e,t,r):Promise.reject(Error("invalid JSON wallet"))})(e,t,r).then(e=>new iv(e))}static fromEncryptedJsonSync(e,t){return new iv(function(e,t){if(im(e))return ip(e,t);if(ig(e))return function(e,t){let r=JSON.parse(e),n=iu(r,t,il,n8().syncScrypt);return ia(r,n)}(e,t);throw Error("invalid JSON wallet")}(e,t))}static fromMnemonic(e,t,r){return t||(t=nq),new iv(nY.fromMnemonic(e,null,r).derivePath(t))}}function iw(e,t){return rP(na(e),t)}function iA(e,t,r,n){return rP(nE.hash(e,t,r),n)}let iE="0x0000000000000000000000000000000000000000",ik="0x0000000000000000000000000000000000000000000000000000000000000000",iS="Ξ",iT=new A("networks/5.7.1");function iC(e){let t=function(t,r){null==r&&(r={});let n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket)try{let i=new t.PocketProvider(e,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(e){}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{let i=new t.AnkrProvider(e,r.ankr);i.network&&-1===["ropsten"].indexOf(i.network.name)&&n.push(i)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return iC(e)},t}function i_(e,t){let r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return i_(e,t)},r}let iM={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:iC("homestead")},iN={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:iC("ropsten")},iP={chainId:63,name:"classicMordor",_defaultProvider:i_("https://www.ethercluster.com/mordor","classicMordor")},iR={unspecified:{chainId:0,name:"unspecified"},homestead:iM,mainnet:iM,morden:{chainId:2,name:"morden"},ropsten:iN,testnet:iN,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:iC("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:iC("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:iC("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:0xaa36a7,name:"sepolia",_defaultProvider:iC("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:i_("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:iP,classicTestnet:iP,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:i_("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:iC("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:iC("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 iO(e){if(null==e)return null;if("number"==typeof e){for(let t in iR){let r=iR[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){let t=iR[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}let t=iR[e.name];if(!t)return"number"!=typeof e.chainId&&iT.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&iT.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;if(null==r&&t._defaultProvider){var n;r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider}return{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}function iI(e){e=atob(e);let t=[];for(let r=0;r0&&Array.isArray(e)?i(e,t-1):r.push(e)})};return i(e,t),r}function iD(e,t){let r=Array(e);for(let n=0,i=-1;nt[e]):r}function iU(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i>1:n>>1}return r})(e,r).forEach((e,t)=>n[t].push(e));return n}let iH=function(){var e;let t;return e=function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,s=[0,1];for(let e=1;e>--l&1}let h=0;for(let e=0;e<31;e++)h=h<<1|u();let d=[],f=0,p=0x80000000;for(;;){let e=Math.floor(((h-f+1)*i-1)/p),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e{switch(t-m){case 3:return m+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return m+256+(e[a++]<<8|e[a++]);case 1:return m+e[a++];default:return t-1}})}(iI("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")),t=0,()=>e[t++]}(),i$=new Set(iF(iH)),iK=new Set(iF(iH)),iG=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(function(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return iL(iU(i.length,1+e,t).map((e,t)=>{let s=e[0],o=e.slice(1);return Array(i[t]).fill(void 0).map((e,t)=>{let i=t*n;return[s+t*r,o.map(e=>e+i)]})}))}(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(iU(1+e(),1+r,e).map(e=>[e[0],e.slice(1)]))}return function(e){let t={};for(let r=0;re-t);return function r(){let n=[];for(;;){let i=iF(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort((e,t)=>t.set.size-e.set.size);let i=e();return{branches:n,valid:i%3,fe0f:!!(1&(i=i/3|0)),save:1==(i>>=1),check:2==i}}()}(iH);function iz(e){return e.filter(e=>65039!=e)}function iV(e){for(let t of e.split(".")){let e=eV(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw Error("underscore only allowed at start");if(e.length>=4&&e.every(e=>e<128)&&45===e[2]&&45===e[3])throw Error("invalid label extension")}catch(e){throw Error(`Invalid label "${t}": ${e.message}`)}}return e}let iq=new A(nl),iY=new Uint8Array(32);function iJ(e){if(0===e.length)throw Error("invalid ENS name; empty component");return e}function iW(e){let t=e$(iV(function(e,t){let r=eV(e).reverse(),n=[];for(;r.length;){let e=function(e,t){var r;let n,i;let s=ij,o=[],a=e.length;for(;a;){let t=e[--a];if(!(s=null===(r=s.branches.find(e=>e.set.has(t)))||void 0===r?void 0:r.node))break;if(s.save)i=t;else if(s.check&&t===i)break;o.push(t),s.fe0f&&(o.push(65039),a>0&&65039==e[a-1]&&a--),s.valid&&(n=o.slice(),2==s.valid&&n.splice(1,1),e.length=a)}return n}(r);if(e){n.push(...t(e));continue}let i=r.pop();if(i$.has(i)){n.push(i);continue}if(iK.has(i))continue;let s=iG[i];if(s){n.push(...s);continue}throw Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`)}return iV(String.fromCodePoint(...n).normalize("NFC"))}(e,iz))),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw Error("invalid ENS name; empty component");return r.push(iJ(t.slice(n))),r}function iQ(e){try{return 0!==iW(e).length}catch(e){}return!1}function iX(e){"string"!=typeof e&&iq.throwArgumentError("invalid ENS name; not a string","name",e);let t=iY,r=iW(e);for(;r.length;)t=ey(N([t,ey(r.pop())]));return B(t)}function iZ(e){return B(N(iW(e).map(e=>{if(e.length>63)throw Error("invalid DNS encoded entry; length exceeds 63 bytes");let t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}iY.fill(0);let i0=new A("web/5.7.1");function i1(e){return new Promise(t=>{setTimeout(t,e)})}function i2(e,t){if(null==e)return null;if("string"==typeof e)return e;if(T(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return ez(e)}catch(e){}return B(e)}return e}function i3(e,t,r){let n;let i="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;i0.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);let s="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;i0.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);let a="object"==typeof e&&!!e.errorPassThrough,l={},c=null,u={method:"GET"},h=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if((null==e||null==e.url)&&i0.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(let t in e.headers)l[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(h=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&i0.throwError("basic authentication requires a secure https url",A.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});let t=e.user+":"+e.password;l.authorization={key:"Authorization",value:"Basic "+iB(e$(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=ea(e.fetchOptions))}let f=RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=c?c.match(f):null;if(p)try{var m;let e={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?iI(p[3]):(m=p[3],e$(m.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))))},t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){i0.throwError("processing response error",A.errors.SERVER_ERROR,{body:i2(p[1],p[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}t&&(u.method="POST",u.body=t,null==l["content-type"]&&(l["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==l["content-length"]&&(l["content-length"]={key:"Content-Length",value:String(t.length)}));let g={};Object.keys(l).forEach(e=>{let t=l[e];g[t.key]=t.value}),u.headers=g;let x=(n=null,{promise:new Promise(function(e,t){d&&(n=setTimeout(()=>{null!=n&&(n=null,t(i0.makeError("timeout",A.errors.TIMEOUT,{requestBody:i2(u.body,g["content-type"]),requestMethod:u.method,timeout:d,url:c})))},d))}),cancel:function(){null!=n&&(clearTimeout(n),n=null)}}),b=function(){var e,t,n,l;return e=this,t=void 0,n=void 0,l=function*(){for(let e=0;e{s[t.toLowerCase()]=e}):n.headers.keys().forEach(e=>{s[e.toLowerCase()]=n.headers.get(e)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:M(new Uint8Array(i))}},new(i||(i=Promise))(function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(o,a)}l((s=s.apply(r,n||[])).next())})}(c,u),e=300)&&(x.cancel(),i0.throwError("bad response",A.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:i2(n,t.headers?t.headers["content-type"]:null),requestBody:i2(u.body,g["content-type"]),requestMethod:u.method,url:c})),r)try{let e=yield r(n,t);return x.cancel(),e}catch(r){if(r.throttleRetry&&e"content-type"===e.toLowerCase()).length||(r.headers=ea(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return i3(e,n,(e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(ez(e))}catch(t){i0.throwError("invalid JSON",A.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n})}function i6(e,t){return t||(t={}),null==(t=ea(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise(function(r,n){let i=null,s=!1,o=()=>!s&&(s=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout(()=>{o()&&n(Error("timeout"))},t.timeout));let a=t.retryLimit,l=0;!function i(){return e().then(function(e){if(void 0!==e)o()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!s){if(++l>a){o()&&n(Error("retry limit reached"));return}let e=t.interval*parseInt(String(Math.random()*Math.pow(2,l)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null},function(e){o()&&n(e)})}()})}var i4=r(5711),i8=r.n(i4);let i9="providers/5.7.2",i7=new A(i9);class se{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),s=this.hash.bind(this),o=this.hex.bind(this),a=this.number.bind(this),l=this.type.bind(this);return e.transaction={hash:s,type:l,accessList:se.allowNull(this.accessList.bind(this),null),blockHash:se.allowNull(s,null),blockNumber:se.allowNull(a,null),transactionIndex:se.allowNull(a,null),confirmations:se.allowNull(a,null),from:t,gasPrice:se.allowNull(r),maxPriorityFeePerGas:se.allowNull(r),maxFeePerGas:se.allowNull(r),gasLimit:r,to:se.allowNull(t,null),value:r,nonce:a,data:i,r:se.allowNull(this.uint256),s:se.allowNull(this.uint256),v:se.allowNull(a),creates:se.allowNull(t,null),raw:se.allowNull(i)},e.transactionRequest={from:se.allowNull(t),nonce:se.allowNull(a),gasLimit:se.allowNull(r),gasPrice:se.allowNull(r),maxPriorityFeePerGas:se.allowNull(r),maxFeePerGas:se.allowNull(r),to:se.allowNull(t),value:se.allowNull(r),data:se.allowNull(e=>this.data(e,!0)),type:se.allowNull(a),accessList:se.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:s,address:t,topics:se.arrayOf(s),data:i,logIndex:a,blockHash:s},e.receipt={to:se.allowNull(this.address,null),from:se.allowNull(this.address,null),contractAddress:se.allowNull(t,null),transactionIndex:a,root:se.allowNull(o),gasUsed:r,logsBloom:se.allowNull(i),blockHash:s,transactionHash:s,logs:se.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:se.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:se.allowNull(r),status:se.allowNull(a),type:l},e.block={hash:se.allowNull(s),parentHash:s,number:a,timestamp:a,nonce:se.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:se.allowNull(t),extraData:i,transactions:se.allowNull(se.arrayOf(s)),baseFeePerGas:se.allowNull(r)},e.blockWithTransactions=ea(e.block),e.blockWithTransactions.transactions=se.allowNull(se.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:se.allowNull(n,void 0),toBlock:se.allowNull(n,void 0),blockHash:se.allowNull(s,void 0),address:se.allowNull(t,void 0),topics:se.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:se.allowNull(a),blockHash:se.allowNull(s),transactionIndex:a,removed:se.allowNull(this.boolean.bind(this)),address:t,data:se.allowFalsish(i,"0x"),topics:se.arrayOf(s),transactionHash:s,logIndex:a},e}accessList(e){return rI(e||[])}number(e){return"0x"===e?0:Q.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Q.from(e).toNumber()}bigNumber(e){return Q.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),O(e))?e.toLowerCase():i7.throwArgumentError("invalid hash","value",e)}data(e,t){let r=this.hex(e,t);if(r.length%2!=0)throw Error("invalid data; odd-length - "+e);return r}address(e){return eR(e)}callAddress(e){if(!O(e,32))return null;let t=eR(D(e,12));return t===iE?null:t}contractAddress(e){return eB(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||O(e))return U(e);throw Error("invalid blockTag")}hash(e,t){let r=this.hex(e,t);return 32!==L(r)?i7.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;let t=Q.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!O(e))throw Error("invalid uint256");return $(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);let r=null!=e._difficulty?e._difficulty:e.difficulty,n=se.check(t,e);return n._difficulty=null==r?null:Q.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return se.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Q.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),(1===e.type||2===e.type)&&null==e.accessList&&(e.accessList=[]);let t=se.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;O(r)&&(r=Q.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),O(r)&&(r=Q.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&((r=(t.v-35)/2)<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return rH(e)}receiptLog(e){return se.check(this.formats.receiptLog,e)}receipt(e){let t=se.check(this.formats.receipt,e);if(null!=t.root){if(t.root.length<=4){let e=Q.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&i7.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):i7.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&i7.throwArgumentError("invalid root hash","value.root",t.root)}return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(e=>this.topics(e)):null!=e?this.hash(e,!0):null}filter(e){return se.check(this.formats.filter,e)}filterLog(e){return se.check(this.formats.filterLog,e)}static check(e,t){let r={};for(let n in e)try{let i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw Error("not an array");let r=[];return t.forEach(function(t){r.push(e(t))}),r}}}function st(e){return e&&"function"==typeof e.isCommunityResource}function sr(e){return st(e)&&e.isCommunityResource()}let sn=!1;function si(){sn||(sn=!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 ss=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let so=new A(i9);function sa(e){return null==e?"null":(32!==L(e)&&so.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function sl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map(e=>{if(!Array.isArray(e))return sa(e);{let t={};e.forEach(e=>{t[sa(e)]=!0});let r=Object.keys(t);return r.sort(),r.join("|")}}).join("&")}function sc(e){if("string"==typeof e){if(32===L(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else if(Array.isArray(e))return"filter:*:"+sl(e);else if(tG.isForkEvent(e))throw so.warn("not implemented"),Error("not implemented");else if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+sl(e.topics||[]);throw Error("invalid event - "+e)}function su(){return new Date().getTime()}function sh(e){return new Promise(t=>{setTimeout(t,e)})}let sd=["block","network","pending","poll"];class sf{constructor(e,t,r){en(this,"tag",e),en(this,"listener",t),en(this,"once",r),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"tx"!==e[0]?null:e[1]}get filter(){var e;let t=this.tag.split(":");if("filter"!==t[0])return null;let r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map(e=>{if(""===e)return[];let t=e.split("|").map(e=>"null"===e?null:e);return 1===t.length?t[0]:t}),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||sd.indexOf(this.tag)>=0}}let sp={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 sm(e){return $(Q.from(e).toHexString(),32)}function sg(e){return nS.encode(N([e,D(n_(n_(e)),0,4)]))}let sx=RegExp("^(ipfs)://(.*)$","i"),sb=[RegExp("^(https)://(.*)$","i"),RegExp("^(data):(.*)$","i"),sx,RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function sy(e,t){try{return ez(sv(e,t))}catch(e){}return null}function sv(e,t){if("0x"===e)return null;let r=Q.from(D(e,t,t+32)).toNumber(),n=Q.from(D(e,r,r+32)).toNumber();return D(e,r+32,r+32+n)}function sw(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):so.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function sA(e){let t=M(e);if(t.length>32)throw Error("internal; should not happen");let r=new Uint8Array(32);return r.set(t,32-t.length),r}function sE(e){let t=[],r=0;for(let n=0;nQ.from(e).eq(1)).catch(e=>{if(e.code===A.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return ss(this,void 0,void 0,function*(){let r={to:this.address,ccipReadEnabled:!0,data:F([e,iX(this.name),t||"0x"])},n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=F(["0x9061b923",sE([iZ(this.name),r.data])]));try{let e=yield this.provider.call(r);return M(e).length%32==4&&so.throwError("resolver threw error",A.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=sv(e,0)),e}catch(e){if(e.code===A.errors.CALL_EXCEPTION)return null;throw e}})}_fetchBytes(e,t){return ss(this,void 0,void 0,function*(){let r=yield this._fetch(e,t);return null!=r?sv(r,0):null})}_getAddress(e,t){let r=sp[String(e)];if(null==r&&so.throwError(`unsupported coin type: ${e}`,A.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);let n=M(t);if(null!=r.p2pkh){let e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){let t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return sg(N([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){let e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){let t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return sg(N([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){let e=n[1],t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){let e=i8().toWords(n.slice(2));return e.unshift(t),i8().encode(r.prefix,e)}}return null}getAddress(e){return ss(this,void 0,void 0,function*(){if(null==e&&(e=60),60===e)try{let e=yield this._fetch("0x3b3b57de");if("0x"===e||e===ik)return null;return this.provider.formatter.callAddress(e)}catch(e){if(e.code===A.errors.CALL_EXCEPTION)return null;throw e}let t=yield this._fetchBytes("0xf1cb7e06",sm(e));if(null==t||"0x"===t)return null;let r=this._getAddress(e,t);return null==r&&so.throwError("invalid or unsupported coin data",A.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r})}getAvatar(){return ss(this,void 0,void 0,function*(){let e=[{type:"name",content:this.name}];try{let t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t])}return so.throwError("invalid or unsupported content hash data",A.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return ss(this,void 0,void 0,function*(){let t=e$(e);(t=N([sm(64),sm(t.length),t])).length%32!=0&&(t=N([t,$("0x",32-e.length%32)]));let r=yield this._fetchBytes("0x59d1d43c",B(t));return null==r||"0x"===r?null:ez(r)})}}let sS=null,sT=1;class sC extends tj{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),en(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(e=>{}),this._ready().catch(e=>{});else{let t=ei(new.target,"getNetwork")(e);t?(en(this,"_network",t),this.emit("network",t,null)):so.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ss(this,void 0,void 0,function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||so.throwError("no network detected",A.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:en(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return i6(()=>this._ready().then(e=>e,e=>{if(e.code!==A.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}static getFormatter(){return null==sS&&(sS=new se),sS}static getNetwork(e){return iO(null==e?"homestead":e)}ccipReadFetch(e,t,r){return ss(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;let n=e.to.toLowerCase(),i=t.toLowerCase(),s=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),l=yield i5({url:o,errorPassThrough:!0},a,(e,t)=>(e.status=t.statusCode,e));if(l.data)return l.data;let c=l.message||"unknown error";if(l.status>=400&&l.status<500)return so.throwError(`response not found during CCIP fetch: ${c}`,A.errors.SERVER_ERROR,{url:t,errorMessage:c});s.push(c)}return so.throwError(`error encountered during CCIP fetch: ${s.map(e=>JSON.stringify(e)).join(", ")}`,A.errors.SERVER_ERROR,{urls:r,errorMessages:s})})}_getInternalBlockNumber(e){return ss(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){let t=this._internalBlockNumber;try{let r=yield t;if(su()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}let t=su(),r=es({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(e=>null,e=>e)}).then(({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;let i=su();return(e=Q.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)}),(yield r).blockNumber})}poll(){return ss(this,void 0,void 0,function*(){let e=sT++,t=[],r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){this.emit("error",e);return}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r===this._lastBlockNumber){this.emit("didPoll",e);return}if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)so.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",so.makeError("network block skew detected",A.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(e=>{if("block"===e)return;let t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(e=>{switch(e.type){case"tx":{let r=e.hash,n=this.getTransactionReceipt(r).then(e=>(e&&null!=e.blockNumber&&(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e)),null)).catch(e=>{this.emit("error",e)});t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);let n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;let i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);let s=this.getLogs(n).then(t=>{e._inflight=!1,0!==t.length&&t.forEach(t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)})}).catch(t=>{this.emit("error",t),e._inflight=!1});t.push(s)}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(e=>{this.emit("error",e)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ss(this,void 0,void 0,function*(){return so.throwError("provider does not support network detection",A.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ss(this,void 0,void 0,function*(){let e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield sh(0),this._network;let r=so.makeError("underlying network changed",A.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}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("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let e=su();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){(null==this._fastBlockNumber||!(ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return ss(this,void 0,void 0,function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)})}_waitForTransaction(e,t,r,n){return ss(this,void 0,void 0,function*(){let i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise((i,s)=>{let o=[],a=!1,l=function(){return!!a||(a=!0,o.forEach(e=>{e()}),!1)},c=e=>{e.confirmations{this.removeListener(e,c)}),n){let r=n.startBlock,i=null,c=o=>ss(this,void 0,void 0,function*(){a||(yield sh(1e3),this.getTransactionCount(n.from).then(u=>ss(this,void 0,void 0,function*(){if(!a){if(u<=n.nonce)r=o;else{{let t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3){a||this.once("block",c)}))});if(a)return;this.once("block",c),o.push(()=>{this.removeListener("block",c)})}if("number"==typeof r&&r>0){let e=setTimeout(()=>{l()||s(so.makeError("timeout exceeded",A.errors.TIMEOUT,{timeout:r}))},r);e.unref&&e.unref(),o.push(()=>{clearTimeout(e)})}})})}getBlockNumber(){return ss(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ss(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield this.perform("getGasPrice",{});try{return Q.from(e)}catch(t){return so.throwError("bad result from backend",A.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return ss(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield es({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Q.from(n)}catch(e){return so.throwError("bad result from backend",A.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}})}getTransactionCount(e,t){return ss(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield es({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Q.from(n).toNumber()}catch(e){return so.throwError("bad result from backend",A.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}})}getCode(e,t){return ss(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield es({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return B(n)}catch(e){return so.throwError("bad result from backend",A.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}})}getStorageAt(e,t,r){return ss(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield es({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then(e=>U(e))}),i=yield this.perform("getStorageAt",n);try{return B(i)}catch(e){return so.throwError("bad result from backend",A.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}})}_wrapTransaction(e,t,r){if(null!=t&&32!==L(t))throw Error("invalid response - sendTransaction");return null!=t&&e.hash!==t&&so.throwError("Transaction hash mismatch from Provider.sendTransaction.",A.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),e.wait=(t,n)=>ss(this,void 0,void 0,function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});let s=yield this._waitForTransaction(e.hash,t,n,i);return null==s&&0===t?null:(this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&so.throwError("transaction failed",A.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),s)}),e}sendTransaction(e){return ss(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield Promise.resolve(e).then(e=>B(e)),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}})}_getTransactionRequest(e){return ss(this,void 0,void 0,function*(){let t=yield e,r={};return["from","to"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?this._getAddress(e):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?Q.from(e):null))}),["type"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>null!=e?e:null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?B(e):null))}),this.formatter.transactionRequest((yield es(r)))})}_getFilter(e){return ss(this,void 0,void 0,function*(){e=yield e;let t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{null!=e[r]&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter((yield es(t)))})}_call(e,t,r){return ss(this,void 0,void 0,function*(){r>=10&&so.throwError("CCIP read exceeded maximum redirections",A.errors.SERVER_ERROR,{redirects:r,transaction:e});let n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&L(i)%32==4)try{let s=D(i,4),o=D(s,0,32);Q.from(o).eq(n)||so.throwError("CCIP Read sender did not match",A.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});let a=[],l=Q.from(D(s,32,64)).toNumber(),c=Q.from(D(s,l,l+32)).toNumber(),u=D(s,l+32);for(let t=0;tss(this,void 0,void 0,function*(){let e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e)),r}return this.formatter.block(e)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ss(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return i6(()=>ss(this,void 0,void 0,function*(){let r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;let n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(e){return ss(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return i6(()=>ss(this,void 0,void 0,function*(){let r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;let n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}),{oncePoll:this})})}getLogs(e){return ss(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield es({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(e=>{null==e.removed&&(e.removed=!1)}),se.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return ss(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return ss(this,void 0,void 0,function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&so.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return(t+=e)<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return ss(this,void 0,void 0,function*(){let t=e;for(;;){if(""===t||"."===t||"eth"!==e&&"eth"===t)return null;let r=yield this._getResolver(t,"getResolver");if(null!=r){let n=new sk(this,r,e);if(t!==e&&!(yield n.supportsWildcard()))return null;return n}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return ss(this,void 0,void 0,function*(){null==t&&(t="ENS");let r=yield this.getNetwork();r.ensAddress||so.throwError("network does not support ENS",A.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{let t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+iX(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null})}resolveName(e){return ss(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(O(e))throw t}"string"!=typeof e&&so.throwArgumentError("invalid ENS name","name",e);let t=yield this.getResolver(e);return t?yield t.getAddress():null})}lookupAddress(e){return ss(this,void 0,void 0,function*(){e=yield e;let t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;let n=sy((yield this.call({to:r,data:"0x691f3431"+iX(t).substring(2)})),0);return(yield this.resolveName(n))!=e?null:n})}getAvatar(e){return ss(this,void 0,void 0,function*(){let t=null;if(O(e)){let r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new sk(this,n,r);try{let e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==A.errors.CALL_EXCEPTION)throw e}try{let e=sy((yield this.call({to:n,data:"0x691f3431"+iX(r).substring(2)})),0);t=yield this.getResolver(e)}catch(e){if(e.code!==A.errors.CALL_EXCEPTION)throw e;return null}}else if(!(t=yield this.getResolver(e)))return null;let r=yield t.getAvatar();return null==r?null:r.url})}perform(e,t){return so.throwError(e+" not implemented",A.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(e,t,r){let n=new sf(sc(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=sc(e);return this._events=this._events.filter(e=>e.tag!==i||(setTimeout(()=>{e.listener.apply(this,t)},0),r=!0,!e.once||(n.push(e),!1))),n.forEach(e=>{this._stopEvent(e)}),r}listenerCount(e){if(!e)return this._events.length;let t=sc(e);return this._events.filter(e=>e.tag===t).length}listeners(e){if(null==e)return this._events.map(e=>e.listener);let t=sc(e);return this._events.filter(e=>e.tag===t).map(e=>e.listener)}off(e,t){if(null==t)return this.removeAllListeners(e);let r=[],n=!1,i=sc(e);return this._events=this._events.filter(e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1)),r.forEach(e=>{this._stopEvent(e)}),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{let r=sc(e);this._events=this._events.filter(e=>e.tag!==r||(t.push(e),!1))}return t.forEach(e=>{this._stopEvent(e)}),this}}var s_=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let sM=new A(i9),sN=["call","estimateGas"];function sP(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){let r=O(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(let r in e){let n=sP(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return sP(JSON.parse(e),t)}catch(e){}return null}function sR(e,t,r){let n=r.transaction||r.signedTransaction;if("call"===e){let e=sP(t,!0);if(e)return e.data;sM.throwError("missing revert data in call exception; Transaction reverted without a reason string",A.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=sP(t.body,!1);null==r&&(r=sP(t,!1)),r&&sM.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",A.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===A.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),(i=(i||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&sM.throwError("insufficient funds for intrinsic transaction cost",A.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&sM.throwError("nonce has already been used",A.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&sM.throwError("replacement fee too low",A.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&sM.throwError("legacy pre-eip-155 transactions not supported",A.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),sN.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&sM.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",A.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function sO(e){return new Promise(function(t){setTimeout(t,e)})}function sI(e){if(e.error){let t=Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function sB(e){return e?e.toLowerCase():e}let sL={};class sD extends tJ{constructor(e,t,r){if(super(),e!==sL)throw Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");en(this,"provider",t),null==r&&(r=0),"string"==typeof r?(en(this,"_address",this.provider.formatter.address(r)),en(this,"_index",null)):"number"==typeof r?(en(this,"_index",r),en(this,"_address",null)):sM.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return sM.throwError("cannot alter JSON-RPC Signer connection",A.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new sF(sL,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&&sM.throwError("unknown account #"+this._index,A.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=ea(e);let t=this.getAddress().then(e=>(e&&(e=e.toLowerCase()),e));if(null==e.gasLimit){let r=ea(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then(e=>s_(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.provider.resolveName(e);return null==t&&sM.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))),es({tx:es(e),sender:t}).then(({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&sM.throwArgumentError("from address mismatch","transaction",e):t.from=r;let n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(e=>e,e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&sM.throwError("user rejected transaction",A.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),sR("sendTransaction",e,n)))})}signTransaction(e){return sM.throwError("signing transactions is unsupported",A.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return s_(this,void 0,void 0,function*(){let t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield i6(()=>s_(this,void 0,void 0,function*(){let e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}})}signMessage(e){return s_(this,void 0,void 0,function*(){let t="string"==typeof e?e$(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[B(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&sM.throwError("user rejected signing",A.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}})}_legacySignMessage(e){return s_(this,void 0,void 0,function*(){let t="string"==typeof e?e$(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),B(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&sM.throwError("user rejected signing",A.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}})}_signTypedData(e,t,r){return s_(this,void 0,void 0,function*(){let n=yield nE.resolveNames(e,t,r,e=>this.provider.resolveName(e)),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(nE.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&sM.throwError("user rejected signing",A.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}})}unlock(e){return s_(this,void 0,void 0,function*(){let t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class sF extends sD{sendTransaction(e){return this.sendUncheckedTransaction(e).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)}))}}let sU={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class sH extends sC{constructor(e,t){let r=t;null==r&&(r=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(t=>{e(t)},e=>{t(e)})},0)})),super(r),e||(e=ei(this.constructor,"defaultUrl")()),"string"==typeof e?en(this,"connection",Object.freeze({url:e})):en(this,"connection",Object.freeze(ea(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(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 s_(this,void 0,void 0,function*(){yield sO(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){let t=ei(this.constructor,"getNetwork");try{return t(Q.from(e).toNumber())}catch(t){return sM.throwError("could not detect network",A.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return sM.throwError("could not detect network",A.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new sD(sL,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(e=>this.formatter.address(e)))}send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:ec(r),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];let i=i5(this.connection,JSON.stringify(r),sI).then(e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e});return n&&(this._cache[e]=i,setTimeout(()=>{this._cache[e]=null},0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[sB(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[sB(t.address),t.blockTag]];case"getCode":return["eth_getCode",[sB(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[sB(t.address),$(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":if(t.blockTag)return["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]];if(t.blockHash)return["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]];break;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[ei(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ei(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=sB(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return s_(this,void 0,void 0,function*(){if("call"===e||"estimateGas"===e){let e=t.transaction;if(e&&null!=e.type&&Q.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){let r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ea(t)).transaction=ea(e),delete t.transaction.type)}}let r=this.prepareRequest(e,t);null==r&&sM.throwError(e+" not implemented",A.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return sR(e,r,t)}})}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;let e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){return function n(){e.send("eth_getFilterChanges",[r]).then(function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach(function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then(function(){return e.getTransaction(t).then(function(t){return e.emit("pending",t),null})})}),n.then(function(){return sO(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(e=>{})}(),r}).catch(e=>{})}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){let r=ea(sU);if(t)for(let e in t)t[e]&&(r[e]=!0);eo(e,r);let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(t){if(null==e[t])return;let r=U(Q.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r}),["from","to","data"].forEach(function(t){null!=e[t]&&(n[t]=B(e[t]))}),e.accessList&&(n.accessList=rI(e.accessList)),n}}let s$=null;try{if(s$=WebSocket,null==s$)throw Error("inject please")}catch(t){let e=new A(i9);s$=function(){e.throwError("WebSockets not supported in this environment",A.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var sK=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let sG=new A(i9),sj=1;class sz extends sH{constructor(e,t){"any"===t&&sG.throwError("WebSocketProvider does not support 'any' network yet",A.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),"string"==typeof e?super(e,t):super("_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof e?en(this,"_websocket",new s$(this.connection.url)):en(this,"_websocket",e),en(this,"_requests",{}),en(this,"_subs",{}),en(this,"_subIds",{}),en(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(e=>{this.websocket.send(this._requests[e].payload)})},this.websocket.onmessage=e=>{let t=e.data,r=JSON.parse(t);if(null!=r.id){let e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(en(e=Error(r.error.message||"unknown error"),"code",r.error.code||null),en(e,"response",t)):e=Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){let e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};let r=setInterval(()=>{this.emit("poll")},1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){sG.throwError("cannot reset events block on WebSocketProvider",A.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){sG.throwError("cannot set polling interval on WebSocketProvider",A.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return sK(this,void 0,void 0,function*(){return null})}set polling(e){e&&sG.throwError("cannot set polling on WebSocketProvider",A.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){let r=sj++;return new Promise((n,i)=>{let s=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(s),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:s},this._wsReady&&this.websocket.send(s)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return sK(this,void 0,void 0,function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then(e=>this.send("eth_subscribe",e)),this._subIds[e]=n);let i=yield n;this._subs[i]={tag:e,processFunc:r}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],e=>{let t=Q.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],e=>{this.emit("pending",e)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))});break;case"tx":{let t=e=>{let t=e.hash;this.getTransactionReceipt(t).then(e=>{e&&this.emit(t,e)})};t(e),this._subscribe("tx",["newHeads"],e=>{this._events.filter(e=>"tx"===e.type).forEach(t)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter(e=>"tx"===e.type).length)return;t="tx"}else if(this.listenerCount(e.event))return;let r=this._subIds[t];r&&(delete this._subIds[t],r.then(e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))}))}destroy(){return sK(this,void 0,void 0,function*(){this.websocket.readyState===s$.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}}let sV=new A(i9);class sq extends sH{detectNetwork(){var e,t,r,n;let i=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return e=this,t=void 0,r=void 0,n=function*(){let e=this.network;return null==e&&((e=yield i.detectNetwork.call(this))||sV.throwError("no network detected",A.errors.UNKNOWN_ERROR,{}),null==this._network&&(en(this,"_network",e),this.emit("network",e,null))),e},new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}}class sY extends sq{constructor(e,t){sV.checkAbstract(new.target,sY),e=ei(new.target,"getNetwork")(e),super(ei(new.target,"getUrl")(e,t=ei(new.target,"getApiKey")(t)),e),"string"==typeof t?en(this,"apiKey",t):null!=t&&Object.keys(t).forEach(e=>{en(this,e,t[e])})}_startPending(){sV.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return sV.throwError("API provider does not support signing",A.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return sV.throwError("not implemented; sub-classes must override getUrl",A.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}let sJ=new A(i9),sW="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class sQ extends sz{constructor(e,t){let r=new sX(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),en(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===sW}}class sX extends sY{static getWebSocketProvider(e,t){return new sQ(e,t)}static getApiKey(e){return null==e?sW:(e&&"string"!=typeof e&&sJ.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:sJ.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===sW&&si(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===sW}}let sZ=new A(i9),s0="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class s1 extends sY{isCommunityResource(){return this.apiKey===s0}static getApiKey(e){return null==e?s0:e}static getUrl(e,t){null==t&&(t=s0);let r={allowGzip:!0,url:"https://"+function(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return sZ.throwArgumentError("unsupported network","name",e)}(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===s0&&si(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}let s2=new A(i9);class s3 extends sY{static getApiKey(e){return null!=e&&s2.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;return"homestead"===e.name?r="https://cloudflare-eth.com/":s2.throwArgumentError("unsupported network","network",arguments[0]),r}perform(e,t){var r,n,i,s;let o=Object.create(null,{perform:{get:()=>super.perform}});return r=this,n=void 0,i=void 0,s=function*(){return"getBlockNumber"===e?(yield o.perform.call(this,"getBlock",{blockTag:"latest"})).number:o.perform.call(this,e,t)},new(i||(i=Promise))(function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(o,a)}l((s=s.apply(r,n||[])).next())})}}var s5=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let s6=new A(i9);function s4(e){let t={};for(let r in e){if(null==e[r])continue;let n=e[r];("type"!==r||0!==n)&&(n=({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0})[r]?U(B(n)):"accessList"===r?"["+rI(n).map(e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`).join(",")+"]":B(n),t[r]=n)}return t}function s8(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){let t=Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function s9(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){let t=Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){let t=Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){let t=Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function s7(e){if("pending"===e)throw Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function oe(e,t,r){if("call"===e&&t.code===A.errors.SERVER_ERROR){let e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),O(r))return r;s6.throwError("missing revert data in call exception",A.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===A.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText)),(n=(n||"").toLowerCase()).match(/insufficient funds/)&&s6.throwError("insufficient funds for intrinsic transaction cost",A.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&s6.throwError("nonce has already been used",A.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&s6.throwError("replacement fee too low",A.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&s6.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",A.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class ot extends sC{constructor(e,t){super(e),en(this,"baseUrl",this.getBaseUrl()),en(this,"apiKey",t||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"}return s6.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){let r=Object.keys(t).reduce((e,r)=>{let n=t[r];return null!=n&&(e+=`&${r}=${n}`),e},""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return s5(this,void 0,void 0,function*(){let n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,s="proxy"===e?s9:s8;this.emit("debug",{action:"request",request:n,provider:this});let o={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&si(),Promise.resolve(!0))},a=null;i&&(o.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map(e=>`${e}=${i[e]}`).join("&"));let l=yield i5(o,a,s||s9);return this.emit("debug",{action:"response",request:n,response:ec(l),provider:this}),l})}detectNetwork(){return s5(this,void 0,void 0,function*(){return this.network})}perform(e,t){let r=Object.create(null,{perform:{get:()=>super.perform}});return s5(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:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch(e=>oe("sendTransaction",e,t.signedTransaction));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw Error("EtherscanProvider does not support blockTag for call");let e=s4(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(e){return oe("call",e,t.transaction)}}case"estimateGas":{let e=s4(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(e){return oe("estimateGas",e,t.transaction)}}case"getLogs":{let e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=s7(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=s7(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&s6.throwError("unsupported topic count",A.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){let r=t.filter.topics[0];("string"!=typeof r||66!==r.length)&&s6.throwError("unsupported topic format",A.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}let r=yield this.fetch("logs",e),n={};for(let e=0;e{["contractAddress","to"].forEach(function(t){""==e[t]&&delete e[t]}),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);let t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t})})}isCommunityResource(){return null==this.apiKey}}function or(e){e=e.slice();for(let t=e.length-1;t>0;t--){let r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}var on=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let oi=new A(i9);function os(){return new Date().getTime()}function oo(e){let t=null;for(let r=0;rt?null:(n+i)/2}function ol(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(Q.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map(e=>ol(e)));if("object"==typeof e){let t=Object.keys(e);return t.sort(),"{"+t.map(t=>{let r=e[t];return r="function"==typeof r?"[function]":ol(r),JSON.stringify(t)+":"+r}).join(",")+"}"}throw Error("unknown value type: "+typeof e)}let oc=1;function ou(e){let t=null,r=null,n=new Promise(n=>{r=setTimeout(t=function(){r&&(clearTimeout(r),r=null),n()},e)});return{cancel:t,getPromise:function(){return n},wait:e=>n=n.then(e)}}let oh=[A.errors.CALL_EXCEPTION,A.errors.INSUFFICIENT_FUNDS,A.errors.NONCE_EXPIRED,A.errors.REPLACEMENT_UNDERPRICED,A.errors.UNPREDICTABLE_GAS_LIMIT],od=["address","args","errorArgs","errorSignature","method","transaction"];function of(e,t){let r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function op(e,t){return on(this,void 0,void 0,function*(){let r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:i6(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}class om extends sC{constructor(e,t){0===e.length&&oi.throwArgumentError("missing providers","providers",e);let r=e.map((e,t)=>{if(tj.isProvider(e)){let t=sr(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:1})}let r=ea(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=sr(e)?2e3:750),null==r.weight&&(r.weight=1);let n=r.weight;return(n%1||n>512||n<1)&&oi.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)}),n=r.reduce((e,t)=>e+t.weight,0);null==t?t=n/2:t>n&&oi.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=oo(r.map(e=>e.provider.network));null==i&&(i=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(e,t)},0)})),super(i),en(this,"providerConfigs",Object.freeze(r)),en(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return on(this,void 0,void 0,function*(){return oo((yield Promise.all(this.providerConfigs.map(e=>e.provider.getNetwork()))))})}perform(e,t){return on(this,void 0,void 0,function*(){if("sendTransaction"===e){let e=yield Promise.all(this.providerConfigs.map(e=>e.provider.sendTransaction(t.signedTransaction).then(e=>e.hash,e=>e)));for(let t=0;te.result),n=oa(t.map(e=>e.result),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){let t=e.map(e=>e.result);return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return oa(e.map(e=>e.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":s=function(e){return null==e?null:((e=ea(e)).confirmations=-1,ol(e))};break;case"getBlock":s=r.includeTransactions?function(e){return null==e?null:((e=ea(e)).transactions=e.transactions.map(e=>((e=ea(e)).confirmations=-1,e)),ol(e))}:function(e){return null==e?null:ol(e)};break;default:throw Error("unknown method: "+t)}return n=s,i=e.quorum,function(e){let t={};e.forEach(e=>{let r=n(e.result);t[r]||(t[r]={count:0,result:e.result}),t[r].count++});let r=Object.keys(t);for(let e=0;e=i)return n.result}}}(this,e,t),n=or(this.providerConfigs.map(ea));n.sort((e,t)=>e.priority-t.priority);let i=this._highestBlockNumber,s=0,o=!0;for(;;){let a=os(),l=n.filter(e=>e.runner&&a-e.starte+t.weight,0);for(;l{r.staller=null}),r.runner=(function(e,t,r,n){return on(this,void 0,void 0,function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&O(n.blockTag)&&(i=yield op(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&O(n.blockTag)&&(i=yield op(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&O(n.blockTag)&&(i=yield op(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":if(n.blockTag&&O(n.blockTag)&&(i=yield op(e,t)),"call"===r&&n.blockTag)return i[r](n.transaction,n.blockTag);return i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&O(r.fromBlock)||r.toBlock&&O(r.toBlock))&&(i=yield op(e,t)),i.getLogs(r)}}return oi.throwError("unknown method error",A.errors.UNKNOWN_ERROR,{method:r,params:n})})})(r,i,e,t).then(n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:of(r,os()),request:{method:e,params:ec(t)},provider:this})},n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:of(r,os()),request:{method:e,params:ec(t)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:of(r,null),request:{method:e,params:ec(t)},provider:this}),l+=r.weight}let c=[];n.forEach(e=>{!e.done&&e.runner&&(c.push(e.runner),e.staller&&c.push(e.staller.getPromise()))}),c.length&&(yield Promise.race(c));let u=n.filter(e=>e.done&&null==e.error);if(u.length>=this.quorum){let e=r(u);if(void 0!==e)return n.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),e;o||(yield ou(100).getPromise()),o=!1}let h=n.reduce((e,t)=>{if(!t.done||null==t.error)return e;let r=t.error.code;return oh.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e},{});if(Object.keys(h).forEach(e=>{let t=h[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0});let r=t.error,i={};od.forEach(e=>{null!=r[e]&&(i[e]=r[e])}),oi.throwError(r.reason||r.message,e,i)}),0===n.filter(e=>!e.done).length)break}return n.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),oi.throwError("failed to meet quorum",A.errors.SERVER_ERROR,{method:e,params:t,results:n.map(e=>of(e)),provider:this})})}}let og=null,ox=new A(i9),ob="84842078b09946638c03157f83405213";class oy extends sz{constructor(e,t){let r=new ov(e,t),n=r.connection;n.password&&ox.throwError("INFURA WebSocket project secrets unsupported",A.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"}),super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),en(this,"apiKey",r.projectId),en(this,"projectId",r.projectId),en(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===ob}}class ov extends sY{static getWebSocketProvider(e,t){return new oy(e,t)}static getApiKey(e){let t={apiKey:ob,projectId:ob,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(ox.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),ox.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:ox.throwError("unsupported network",A.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===ob&&si(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===ob}}class ow extends sH{send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);let n={request:r,resolve:null,reject:null},i=new Promise((e,t)=>{n.resolve=e,n.reject=t});return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{let e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;let t=e.map(e=>e.request);return this.emit("debug",{action:"requestBatch",request:ec(t),provider:this}),i5(this.connection,JSON.stringify(t)).then(r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach((e,t)=>{let n=r[t];if(n.error){let t=Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)})},r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach(e=>{e.reject(r)})})},10)),i}}let oA=new A(i9);class oE extends sY{static getApiKey(e){return e&&"string"!=typeof e&&oA.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){oA.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:oA.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}let ok=new A(i9),oS="62e1ad51b37b8e00394bda3b";class oT extends sY{static getApiKey(e){let t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=oS:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:ok.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:ok.throwError("unsupported network",A.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n={headers:{},url:`https://${r}/v1/lb/${t.applicationId}`};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}isCommunityResource(){return this.applicationId===oS}}let oC=new A(i9),o_=1;function oM(e,t){let r="Web3LegacyFetcher";return function(e,n){let i={method:e,params:n,id:o_++,jsonrpc:"2.0"};return new Promise((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:ec(i),provider:this}),t(i,(t,s)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:s,provider:this}),s.error){let e=Error(s.error.message);return e.code=s.error.code,e.data=s.error.data,n(e)}e(s.result)})})}}class oN extends sH{constructor(e,t){null==e&&oC.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"==typeof e?(r="unknown:",n=e):(((r=e.host||e.path||"")||!e.isMetaMask||(r="metamask"),i=e,e.request)?(""===r&&(r="eip-1193:"),n=function(t,r){null==r&&(r=[]);let n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:ec(n),provider:this}),e.request(n).then(e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e})}):e.sendAsync?n=oM(e,e.sendAsync.bind(e)):e.send?n=oM(e,e.send.bind(e)):oC.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),en(this,"jsonRpcFetchFunc",n),en(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}let oP=new A(i9);function oR(e,t){if(null==e&&(e="homestead"),"string"==typeof e){let t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1].toLowerCase()){case"http":case"https":return new sH(e);case"ws":case"wss":return new sz(e);default:oP.throwArgumentError("unsupported URL scheme","network",e)}}let r=iO(e);return r&&r._defaultProvider||oP.throwError("unsupported getDefaultProvider network",A.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:om,AlchemyProvider:sX,AnkrProvider:s1,CloudflareProvider:s3,EtherscanProvider:ot,InfuraProvider:ov,JsonRpcProvider:sH,NodesmithProvider:oE,PocketProvider:oT,Web3Provider:oN,IpcProvider:og},t)}let oO=RegExp("^bytes([0-9]+)$"),oI=RegExp("^(u?int)([0-9]*)$"),oB=RegExp("^(.*)\\[([0-9]*)\\]$"),oL=new A("solidity/5.7.0");function oD(e,t){e.length!=t.length&&oL.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);let r=[];return e.forEach(function(e,n){r.push(function e(t,r,n){switch(t){case"address":if(n)return R(r,32);return M(r);case"string":return e$(r);case"bytes":return M(r);case"bool":if(r=r?"0x01":"0x00",n)return R(r,32);return M(r)}let i=t.match(oI);if(i){let e=parseInt(i[2]||"256");return(i[2]&&String(e)!==i[2]||e%8!=0||0===e||e>256)&&oL.throwArgumentError("invalid number type","type",t),n&&(e=256),R(r=Q.from(r).toTwos(e),e/8)}if(i=t.match(oO)){let e=parseInt(i[1]);return((String(e)!==i[1]||0===e||e>32)&&oL.throwArgumentError("invalid bytes type","type",t),M(r).byteLength!==e&&oL.throwArgumentError(`invalid value for ${t}`,"value",r),n)?M((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((i=t.match(oB))&&Array.isArray(r)){let n=i[1];parseInt(i[2]||String(r.length))!=r.length&&oL.throwArgumentError(`invalid array length for ${t}`,"value",r);let s=[];return r.forEach(function(t){s.push(e(n,t,!0))}),N(s)}return oL.throwArgumentError("invalid type","type",t)}(e,t[n]))}),B(N(r))}function oF(e,t){return ey(oD(e,t))}function oU(e,t){return n_(oD(e,t))}function oH(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach(e=>{let i=e.split(":");n[r+=parseInt(i[0],16)]=t(i[1])}),n}function o$(e){let t=0;return e.split(",").map(e=>{let r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}})}function oK(e,t){let r=0;for(let n=0;n=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}let oG=o$("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"),oj="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),oz=[{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}],oV=oH("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"),oq=oH("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"),oY=oH("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",function(e){if(e.length%4!=0)throw Error("bad data");let t=[];for(let r=0;roj.indexOf(e)>=0||e>=65024&&e<=65039?[]:function(e){let t=oK(e,oz);if(t)return[e+t.s];let r=oV[e];if(r)return r;let n=oq[e];return n?[e+n[0]]:oY[e]||null}(e)||[e]).reduce((e,t)=>(t.forEach(t=>{e.push(t)}),e),[])),s.NFKC)).forEach(e=>{if(oK(e,oJ))throw Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(e=>{if(oK(e,oG))throw Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=ej(t);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw Error("invalid hyphen");return r}function oQ(e){let t=e$(e);if(t.length>31)throw Error("bytes32 string must be less than 32 bytes");return B(N([t,ik]).slice(0,32))}function oX(e){let t=M(e);if(32!==t.length)throw Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return ez(t.slice(0,r))}let oZ=new A("units/5.7.0"),o0=["wei","kwei","mwei","gwei","szabo","finney","ether"];function o1(e){let t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&oZ.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);let s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{let e=r.length-3;s.unshift(r.substring(e)),r=r.substring(0,e)}}return n+s.join(",")+i}function o2(e,t){if("string"==typeof t){let e=o0.indexOf(t);-1!==e&&(t=3*e)}return nt(e,null!=t?t:18)}function o3(e,t){if("string"!=typeof e&&oZ.throwArgumentError("value must be a string","value",e),"string"==typeof t){let e=o0.indexOf(t);-1!==e&&(t=3*e)}return nr(e,null!=t?t:18)}function o5(e){return o2(e,18)}function o6(e){return o3(e,18)}let o4="ethers/5.7.2",o8=new A(o4);try{let e=window;null==e._ethers&&(e._ethers=p)}catch(e){}},7453:(e,t,r)=>{t.utils=r(7291),t.common=r(4769),t.sha=r(4956),t.ripemd=r(9739),t.hmac=r(5315),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160},4769:(e,t,r)=>{"use strict";var n=r(7291),i=r(1978);function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=s,s.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(s=8,n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;s{"use strict";var n=r(7291),i=r(1978);function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=s,s.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var n=r(7291),i=r(4769),s=n.rotl32,o=n.sum32,a=n.sum32_3,l=n.sum32_4,c=i.BlockHash;function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.endian="little"}function h(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}n.inherits(u,c),t.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],u=this.h[4],g=r,x=n,b=i,y=c,v=u,w=0;w<80;w++){var A,E,k=o(s(l(r,h(w,n,i,c),e[d[w]+t],(A=w)<=15?0:A<=31?0x5a827999:A<=47?0x6ed9eba1:A<=63?0x8f1bbcdc:0xa953fd4e),p[w]),u);r=u,u=c,c=s(i,10),i=n,n=k,k=o(s(l(g,h(79-w,x,b,y),e[f[w]+t],(E=w)<=15?0x50a28be6:E<=31?0x5c4dd124:E<=47?0x6d703ef3:E<=63?0x7a6d76e9:0),m[w]),v),g=v,v=y,y=s(b,10),b=x,x=k}k=a(this.h[1],i,y),this.h[1]=a(this.h[2],c,v),this.h[2]=a(this.h[3],u,g),this.h[3]=a(this.h[4],r,x),this.h[4]=a(this.h[0],n,b),this.h[0]=k},u.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},4956:(e,t,r)=>{"use strict";t.sha1=r(1640),t.sha224=r(9811),t.sha256=r(4554),t.sha384=r(2026),t.sha512=r(6947)},1640:(e,t,r)=>{"use strict";var n=r(7291),i=r(4769),s=r(3734),o=n.rotl32,a=n.sum32,l=n.sum32_5,c=s.ft_1,u=i.BlockHash,h=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}n.inherits(d,u),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(7291),i=r(4554);function s(){if(!(this instanceof s))return new s;i.call(this),this.h=[0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]}n.inherits(s,i),e.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},4554:(e,t,r)=>{"use strict";var n=r(7291),i=r(4769),s=r(3734),o=r(1978),a=n.sum32,l=n.sum32_4,c=n.sum32_5,u=s.ch32,h=s.maj32,d=s.s0_256,f=s.s1_256,p=s.g0_256,m=s.g1_256,g=i.BlockHash,x=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],this.k=x,this.W=Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(7291),i=r(6947);function s(){if(!(this instanceof s))return new s;i.call(this),this.h=[0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]}n.inherits(s,i),e.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},6947:(e,t,r)=>{"use strict";var n=r(7291),i=r(4769),s=r(1978),o=n.rotr64_hi,a=n.rotr64_lo,l=n.shr64_hi,c=n.shr64_lo,u=n.sum64,h=n.sum64_hi,d=n.sum64_lo,f=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,x=i.BlockHash,b=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817];function y(){if(!(this instanceof y))return new y;x.call(this),this.h=[0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179],this.k=b,this.W=Array(160)}n.inherits(y,x),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(7291).rotr32;function i(e,t,r){return e&t^e&r^t&r}t.ft_1=function(e,t,r,n){return 0===e?t&r^~t&n:1===e||3===e?t^r^n:2===e?i(t,r,n):void 0},t.ch32=function(e,t,r){return e&t^~e&r},t.maj32=i,t.p32=function(e,t,r){return e^t^r},t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},7291:(e,t,r)=>{"use strict";var n=r(1978),i=r(6386);function s(e){return(e>>>24|e>>>8&65280|e<<8&0xff0000|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function a(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),i=0;i>6|192:((s=e,o=i,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length?1:(64512&s.charCodeAt(o+1))!=56320)?r[n++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128),r[n++]=a>>6&63|128),r[n++]=63&a|128)}}else for(i=0;i>>0;return a},t.split32=function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=255&s):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=255&s)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],s=n+e[t+1]>>>0;e[t]=(s>>0,e[t+1]=s},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,s,o,a){var l,c=t;return e+r+i+o+(0+((c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,s,o,a){return t+n+s+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,s,o,a,l,c){var u,h=t;return e+r+i+o+l+(0+((h=h+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,s,o,a,l,c){return t+n+s+a+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},6386:(e,t,r)=>{try{var n=r(8354);if("function"!=typeof n.inherits)throw"";e.exports=n.inherits}catch(t){e.exports=r(469)}},469:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},5845:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",s="object"==typeof window,o=s?window:{};o.JS_SHA3_NO_WINDOW&&(s=!1);var a=!s&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=global:a&&(o=self);var l=!o.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,u=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),d=[4,1024,262144,0x4000000],f=[0,8,16,24],p=[1,0,32898,0,32906,0x80000000,0x80008000,0x80000000,32907,0,0x80000001,0,0x80008081,0x80000000,32777,0x80000000,138,0,136,0,0x80008009,0,0x8000000a,0,0x8000808b,0,139,0x80000000,32905,0x80000000,32771,0x80000000,32770,0x80000000,128,0x80000000,32778,0,0x8000000a,0x80000000,0x80008081,0x80000000,32896,0x80000000,0x80000001,0,0x80008008,0x80000000],m=[224,256,384,512],g=[128,256],x=["hex","buffer","arrayBuffer","array","digest"],b={128:168,256:136};(o.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),u&&(o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var y=function(e,t,r){return function(n){return new I(e,t,e).update(n)[r]()}},v=function(e,t,r){return function(n,i){return new I(e,t,i).update(n)[r]()}},w=function(e,t,r){return function(t,n,i,s){return T["cshake"+e].update(t,n,i,s)[r]()}},A=function(e,t,r){return function(t,n,i,s){return T["kmac"+e].update(t,n,i,s)[r]()}},E=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function B(e,t,r){I.call(this,e,t,r)}I.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(i);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!u||!ArrayBuffer.isView(e)))throw Error(i)}else throw Error(i);t=!0}for(var n,s,o=this.blocks,a=this.byteCount,l=e.length,c=this.blockCount,h=0,d=this.s;h>2]|=e[h]<>2]|=s<>2]|=(192|s>>6)<=57344?o[n>>2]|=(224|s>>12)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=a){for(this.start=n-a,this.block=o[c],n=0;n>=8,r=255&e;r>0;)i.unshift(r),e>>=8,r=255&e,++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},I.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(i);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!u||!ArrayBuffer.isView(e)))throw Error(i)}else throw Error(i);t=!0}var n=0,s=e.length;if(t)n=s;else for(var o=0;o=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},I.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(t=1,e[0]=e[r];t>4&15]+h[15&e]+h[e>>12&15]+h[e>>8&15]+h[e>>20&15]+h[e>>16&15]+h[e>>28&15]+h[e>>24&15];o%t==0&&(L(r),s=0)}return i&&(a+=h[(e=r[s])>>4&15]+h[15&e],i>1&&(a+=h[e>>12&15]+h[e>>8&15]),i>2&&(a+=h[e>>20&15]+h[e>>16&15])),a},I.prototype.arrayBuffer=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,s=0,o=0,a=this.outputBits>>3,l=new Uint32Array(e=new ArrayBuffer(i?n+1<<2:a));o>8&255,l[e+2]=t>>16&255,l[e+3]=t>>24&255;a%r==0&&L(n)}return s&&(e=a<<2,t=n[o],l[e]=255&t,s>1&&(l[e+1]=t>>8&255),s>2&&(l[e+2]=t>>16&255)),l},B.prototype=new I,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var L=function(e){var t,r,n,i,s,o,a,l,c,u,h,d,f,m,g,x,b,y,v,w,A,E,k,S,T,C,_,M,N,P,R,O,I,B,L,D,F,U,H,$,K,G,j,z,V,q,Y,J,W,Q,X,Z,ee,et,er,en,ei,es,eo,ea,el,ec,eu;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49],t=d^(o<<1|a>>>31),r=f^(a<<1|o>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(l<<1|c>>>31),r=s^(c<<1|l>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=o^(u<<1|h>>>31),r=a^(h<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=l^(d<<1|f>>>31),r=c^(f<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(i<<1|s>>>31),r=h^(s<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],q=e[11]<<4|e[10]>>>28,Y=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,N=e[21]<<3|e[20]>>>29,ea=e[31]<<9|e[30]>>>23,el=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,j=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,x=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,W=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,ec=e[42]<<2|e[43]>>>30,eu=e[43]<<2|e[42]>>>30,et=e[5]<<30|e[4]>>>2,er=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,v=e[24]<<11|e[25]>>>21,Q=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,I=e[44]<<29|e[45]>>>3,S=e[6]<<28|e[7]>>>4,T=e[7]<<28|e[6]>>>4,en=e[17]<<23|e[16]>>>9,ei=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,H=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,C=e[18]<<20|e[19]>>>12,_=e[19]<<20|e[18]>>>12,es=e[29]<<7|e[28]>>>25,eo=e[28]<<7|e[29]>>>25,$=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=m^~x&y,e[1]=g^~b&v,e[10]=S^~C&M,e[11]=T^~_&N,e[20]=B^~D&U,e[21]=L^~F&H,e[30]=z^~q&J,e[31]=V^~Y&W,e[40]=et^~en&es,e[41]=er^~ei&eo,e[2]=x^~y&w,e[3]=b^~v&A,e[12]=C^~M&P,e[13]=_^~N&R,e[22]=D^~U&$,e[23]=F^~H&K,e[32]=q^~J&Q,e[33]=Y^~W&X,e[42]=en^~es&ea,e[43]=ei^~eo&el,e[4]=y^~w&E,e[5]=v^~A&k,e[14]=M^~P&O,e[15]=N^~R&I,e[24]=U^~$&G,e[25]=H^~K&j,e[34]=J^~Q&Z,e[35]=W^~X&ee,e[44]=es^~ea&ec,e[45]=eo^~el&eu,e[6]=w^~E&m,e[7]=A^~k&g,e[16]=P^~O&S,e[17]=R^~I&T,e[26]=$^~G&B,e[27]=K^~j&L,e[36]=Q^~Z&z,e[37]=X^~ee&V,e[46]=ea^~ec&et,e[47]=el^~eu&er,e[8]=E^~m&x,e[9]=k^~g&b,e[18]=O^~S&C,e[19]=I^~T&_,e[28]=G^~B&D,e[29]=j^~L&F,e[38]=Z^~z&q,e[39]=ee^~V&Y,e[48]=ec^~et&en,e[49]=eu^~er&ei,e[0]^=p[n],e[1]^=p[n+1]};if(l)e.exports=T;else{for(_=0;_{function t(e,t){if(!e)throw Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)}},8946:function(e){"use strict";!function(t){function r(e){let t=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),r=0x6a09e667,n=0xbb67ae85,i=0x3c6ef372,s=0xa54ff53a,o=0x510e527f,a=0x9b05688c,l=0x1f83d9ab,c=0x5be0cd19,u=new Uint32Array(64);function h(e){let h=0,d=e.length;for(;d>=64;){let f=r,p=n,m=i,g=s,x=o,b=a,y=l,v=c,w,A,E,k,S;for(A=0;A<16;A++)E=h+4*A,u[A]=(255&e[E])<<24|(255&e[E+1])<<16|(255&e[E+2])<<8|255&e[E+3];for(A=16;A<64;A++)k=((w=u[A-2])>>>17|w<<15)^(w>>>19|w<<13)^w>>>10,S=((w=u[A-15])>>>7|w<<25)^(w>>>18|w<<14)^w>>>3,u[A]=(k+u[A-7]|0)+(S+u[A-16]|0)|0;for(A=0;A<64;A++)k=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&b^~x&y)|0)+(v+(t[A]+u[A]|0)|0)|0,S=((f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10))+(f&p^f&m^p&m)|0,v=y,y=b,b=x,x=g+k|0,g=m,m=p,p=f,f=k+S|0;r=r+f|0,n=n+p|0,i=i+m|0,s=s+g|0,o=o+x|0,a=a+b|0,l=l+y|0,c=c+v|0,h+=64,d-=64}}h(e);let d,f=e.length%64,p=e.length/0x20000000|0,m=e.length<<3,g=f<56?56:120,x=e.slice(e.length-f,e.length);for(x.push(128),d=f+1;d>>24&255),x.push(p>>>16&255),x.push(p>>>8&255),x.push(p>>>0&255),x.push(m>>>24&255),x.push(m>>>16&255),x.push(m>>>8&255),x.push(m>>>0&255),h(x),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function n(e,t,n){let i;e=e.length<=64?e:r(e);let s=64+t.length+4,o=Array(s),a=Array(64),l=[];for(i=0;i<64;i++)o[i]=54;for(i=0;i=s-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;n>=32;)c(),l=l.concat(r(a.concat(r(o)))),n-=32;return n>0&&(c(),l=l.concat(r(a.concat(r(o))).slice(0,n))),l}function i(e,t,r,n,i){let l;for(a(e,(2*r-1)*16,i,0,16),l=0;l<2*r;l++)o(e,16*l,i,16),function(e,t){a(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}(i,n),a(i,0,e,t+16*l,16);for(l=0;l