7 lines
319 KiB
JavaScript
7 lines
319 KiB
JavaScript
async function t(t){const e=Object.keys(t);return(await Promise.all(e.map((e=>Promise.resolve(t[e]))))).reduce(((t,r,n)=>(t[e[n]]=r,t)),{})}function e(t,e){const r=e.split("|").map((t=>t.trim()));for(let n=0;n<r.length;n++)switch(e){case"any":return;case"boolean":case"number":case"string":if(typeof t===e)return}throw new Error("invalid value for type")}function r(t,r,n,s){for(let i in r){let o=r[i];const a=s?s[i]:void 0;if(void 0!==a)o=a;else{const t=n?n[i]:null;t&&e(o,t)}Object.defineProperty(t,i,{enumerable:!0,value:o,writable:!1})}}var n,s=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},i=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class o{constructor(t,e,i){n.set(this,void 0),s(this,n,e,"f"),r(this,{emitter:t,filter:i})}async removeListener(){null!=i(this,n,"f")&&await this.emitter.off(this.filter,i(this,n,"f"))}}function a(t,e){return t[e]}function c(t,e,r){if(Object.isFrozen(t))throw new Error("frozen object is immuatable; cannot set "+e);t[e]=r}function l(t,e){return t&&t.code===e}function u(t){return l(t,"CALL_EXCEPTION")}n=new WeakMap;var h,f,d,p,w=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(p||(p={}));const g={debug:1,default:2,info:2,warning:3,error:4,off:5};let m=g.default,y=null;const b=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){const t=String.fromCharCode(233).normalize("NFD");if(t!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function v(t,e,r){Object.defineProperty(t,e,{enumerable:!0,writable:!1,value:r})}const E=9007199254740991,A={};A.INVALID_ARGUMENT=TypeError,A.NUMERIC_FAULT=RangeError,A.BUFFER_OVERRUN=RangeError;class T{constructor(t){h.add(this),v(this,"version",t||"_")}makeError(t,e,r){{const s=[];if(r)for(const t in r){const e=r[t];try{s.push(t+"="+JSON.stringify(e))}catch(n){s.push(t+"=[could not serialize object]")}}s.push(`code=${e}`),s.push(`version=${this.version}`),s.length&&(t+=" ("+s.join(", ")+")")}const n=new(A[e]||Error)(t);if(v(n,"code",e),r)for(const t in r)v(n,t,r[t]);return n}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,"INVALID_ARGUMENT",{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r||"UNKNOWN_ERROR",n)}assertArgument(t,e,r,n){return this.assert(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}assertIntegerArgument(t,e,r,n){let s=null;"number"!=typeof e?s="expected a number":Number.isInteger(e)?(null!=r&&e<r||null!=n&&e>n)&&(s="value is out of range"):s="invalid integer",s&&this.throwArgumentError(s,t,e)}assertSafeUint53(t,e){this.assertArgument("number"==typeof t,"invalid number","value",t),null==e&&(e="value not safe");const r="assertSafeInteger";this.assert(t>=0&&t<9007199254740991,e,"NUMERIC_FAULT",{operation:r,fault:"out-of-safe-range",value:t}),this.assert(t%1==0,e,"NUMERIC_FAULT",{operation:r,fault:"non-integer",value:t})}assertNormalize(t){-1===b.indexOf(t)&&this.throwError("platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}assertPrivate(t,e,r=""){if(t!==e){let t=r,e="new";r&&(t+=".",e+=" "+r),this.throwError(`private constructor; use ${t}from* methods`,"UNSUPPORTED_OPERATION",{operation:e})}}assertArgumentCount(t,e,r=""){r&&(r=": "+r),this.assert(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),this.assert(t>=e,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}getBytes(t,e){return w(this,h,"m",f).call(this,t,e,!1)}getBytesCopy(t,e){return w(this,h,"m",f).call(this,t,e,!0)}getNumber(t,e){switch(typeof t){case"bigint":return(t<-E||t>E)&&this.throwArgumentError("overflow",e||"value",t),Number(t);case"number":return Number.isInteger(t)?(t<-E||t>E)&&this.throwArgumentError("overflow",e||"value",t):this.throwArgumentError("underflow",e||"value",t),t;case"string":try{return this.getNumber(BigInt(t),e)}catch(r){this.throwArgumentError(`invalid numeric string: ${r.message}`,e||"value",t)}}return this.throwArgumentError("invalid numeric value",e||"value",t)}getBigInt(t,e){switch(typeof t){case"bigint":return t;case"number":return Number.isInteger(t)?(t<-E||t>E)&&this.throwArgumentError("overflow",e||"value",t):this.throwArgumentError("underflow",e||"value",t),BigInt(t);case"string":try{return BigInt(t)}catch(r){this.throwArgumentError(`invalid BigNumberish string: ${r.message}`,e||"value",t)}}return this.throwArgumentError("invalid BigNumberish value",e||"value",t)}debug(...t){w(this,h,"m",d).call(this,p.DEBUG,t)}info(...t){w(this,h,"m",d).call(this,p.INFO,t)}warn(...t){w(this,h,"m",d).call(this,p.WARNING,t)}static globalLogger(){return y||(y=new T("@ethersproject/logger@6.0.0-beta.7")),y}static setLogLevel(t){const e=g[t.toLowerCase()];null!=e?m=e:T.globalLogger().warn("invalid log level - "+t)}}h=new WeakSet,f=function(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if("string"==typeof t&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const e=new Uint8Array((t.length-2)/2);let r=2;for(let n=0;n<e.length;n++)e[n]=parseInt(t.substring(r,r+2),16),r+=2;return e}return this.throwArgumentError("invalid BytesLike value",e||"value",t)},d=function(t,e){const r=t.toLowerCase();null==g[r]&&this.throwArgumentError("invalid log level name","logLevel",t),m>g[r]||console.log.apply(console,e)},T.LogLevels=p;const k=new T("@ethersproject/abi@6.0.0-beta.3");var P,N,x,O,I,S,R,B=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},_=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function C(t){const e=new Set;return t.forEach((t=>e.add(t))),Object.freeze(e)}!function(t){t.sighash="sighash",t.minimal="minimal",t.full="full",t.json="json"}(R||(R={}));const F="constant external internal payable private public pure view",U=C(F.split(" ")),L="constructor error event function struct",D=C(L.split(" ")),M="calldata memory storage payable indexed",j=C(M.split(" ")),G=C([L,M,"tuple returns",F].join(" ").split(" ")),$={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},z=new RegExp("^(\\s*)"),W=new RegExp("^([0-9]+)"),H=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),V=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))");class K{constructor(t){P.add(this),N.set(this,void 0),x.set(this,void 0),B(this,N,0,"f"),B(this,x,t.slice(),"f")}get offset(){return _(this,N,"f")}get length(){return _(this,x,"f").length-_(this,N,"f")}clone(){return new K(_(this,x,"f"))}reset(){B(this,N,0,"f")}popKeyword(t){const e=this.peek();if("KEYWORD"!==e.type||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t)throw new Error(`expected ${t}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=_(this,P,"m",O).call(this,_(this,N,"f")+1,t.match+1);return B(this,N,t.match+1,"f"),e}popParams(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=[];for(;_(this,N,"f")<t.match-1;){const t=this.peek().linkNext;e.push(_(this,P,"m",O).call(this,_(this,N,"f")+1,t)),B(this,N,t,"f")}return B(this,N,t.match+1,"f"),e}peek(){if(_(this,N,"f")>=_(this,x,"f").length)throw new Error("out-of-bounds");return _(this,x,"f")[_(this,N,"f")]}peekKeyword(t){const e=this.peekType("KEYWORD");return null!=e&&t.has(e)?e:null}peekType(t){if(0===this.length)return null;const e=this.peek();return e.type===t?e.text:null}pop(){var t;const e=this.peek();return B(this,N,(t=_(this,N,"f"),++t),"f"),e}toString(){const t=[];for(let e=_(this,N,"f");e<_(this,x,"f").length;e++){const r=_(this,x,"f")[e];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}}function J(t){const e=[],r=e=>{const r=i<t.length?JSON.stringify(t[i]):"$EOI";throw new Error(`invalid token ${r} at ${i}: ${e}`)};let n=[],s=[],i=0;for(;i<t.length;){let o=t.substring(i),a=o.match(z);a&&(i+=a[1].length,o=t.substring(i));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(c);let l=$[o[0]]||"";if(l){if(c.type=l,c.text=o[0],i++,"OPEN_PAREN"===l)n.push(e.length-1),s.push(e.length-1);else if("CLOSE_PAREN"==l)0===n.length&&r("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if("COMMA"===l)c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.push(e.length-1);else if("OPEN_BRACKET"===l)c.type="BRACKET";else if("CLOSE_BRACKET"===l){let t=e.pop().text;if(e.length>0&&"NUMBER"===e[e.length-1].type){const r=e.pop().text;t=r+t,e[e.length-1].value=k.getNumber(r)}if(0===e.length||"BRACKET"!==e[e.length-1].type)throw new Error("missing opening bracket");e[e.length-1].text+=t}}else if(a=o.match(H),a){if(c.text=a[1],i+=c.text.length,G.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(V)){c.type="TYPE";continue}c.type="ID"}else{if(a=o.match(W),!a)throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`);c.text=a[1],c.type="NUMBER",i+=c.text.length}}return new K(e.map((t=>Object.freeze(t))))}function q(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function X(t,e){if(e.peekKeyword(D)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function Y(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(null==n||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function Z(t,e){return t.popParams().map((t=>it.fromTokens(t,e)))}function Q(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return k.getBigInt(t.pop().text);throw new Error("invalid gas")}return null}function tt(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}N=new WeakMap,x=new WeakMap,P=new WeakSet,O=function(t=0,e=0){return new K(_(this,x,"f").slice(t,e).map((e=>Object.freeze(Object.assign({},e,{match:e.match-t,linkBack:e.linkBack-t,linkNext:e.linkNext-t})))))};const et=new RegExp(/^(.*)\[([0-9]*)\]$/);function rt(t){const e=t.match(V);if(!e)return k.throwArgumentError("invalid type","type",t);if("uint"===t)return"uint256";if("int"===t)return"int256";if(e[2]){const r=parseInt(e[2]);(0===r||r>32)&&k.throwArgumentError("invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);(0===r||r>256||r%8)&&k.throwArgumentError("invalid numeric width","type",t)}return t}const nt={},st=Symbol.for("_ethers_internal");class it{constructor(t,e,n,s,i,o,a,c){if(I.add(this),k.assertPrivate(t,nt,"ParamType"),Object.defineProperty(this,st,{value:"_ParamTypeInternal"}),o&&(o=Object.freeze(o.slice())),"array"===s){if(null==a||null==c)throw new Error("")}else if(null!=a||null!=c)throw new Error("");if("tuple"===s){if(null==o)throw new Error("")}else if(null!=o)throw new Error("");r(this,{name:e,type:n,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:c})}format(t=R.sighash){if(R[t]||k.throwArgumentError("invalid format type","format",t),t===R.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.isTuple()&&(e.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(t!==R.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===R.full?", ":",")+")"):e+=this.type,t!==R.sighash&&(!0===this.indexed&&(e+=" indexed"),t===R.full&&this.name&&(e+=" "+this.name)),e}static isArray(t){return t&&"array"===t.baseType}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invlaid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");return t.map((t=>this.arrayChildren.walk(t,e)))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invlaid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");return t.map(((t,r)=>this.components[r].walk(t,e)))}return e(this.type,t)}async walkAsync(t,e){const r=[],n=[t];return _(this,I,"m",S).call(this,r,t,e,(t=>{n[0]=t})),r.length&&await Promise.all(r),n[0]}static from(t,e){if(it.isParamType(t))return t;if("string"==typeof t)return it.fromTokens(J(t),e);if(t instanceof K)return it.fromTokens(t,e);const r=t.name;!r||"string"==typeof r&&r.match(H)||k.throwArgumentError("invalid name","obj.name",r);let n=t.indexed;null!=n&&(e||k.throwArgumentError("parameter cannot be indexed","obj.indexed",t.indexed),n=!!n);let s=t.type,i=s.match(et);if(i){const e=i[2],o=it.from({type:i[1],components:t.components});return new it(nt,r,s,"array",n,null,e,o)}if("tuple("===s.substring(0,5)||"("===s[0]){const e=null!=t.components?t.components.map((t=>it.from(t))):null;return new it(nt,r,s,"tuple",n,e,null,null)}return s=rt(t.type),new it(nt,r,s,s,n,null,null,null)}static fromObject(t,e){throw new Error("@TODO")}static fromTokens(t,e){let r="",n="",s=null;Y(t,C(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(n="tuple",s=t.popParams().map((t=>it.from(t))),r=`tuple(${s.map((t=>t.format())).join(",")})`):(r=rt(t.popType("TYPE")),n=r);let i=null,o=null;for(;t.length&&t.peekType("BRACKET");){const e=t.pop();i=new it(nt,"",r,n,null,s,o,i),o=e.value,r+=e.text,n="array",s=null}let a=null;if(Y(t,j).has("indexed")){if(!e)throw new Error("");a=!0}const c=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new it(nt,c,r,n,a,s,o,i)}static isParamType(t){return t&&"_ParamTypeInternal"===t[st]}}var ot;I=new WeakSet,S=function t(e,r,n,s){if(this.isArray()){if(!Array.isArray(r))throw new Error("invlaid array value");if(-1!==this.arrayLength&&r.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,o=r.slice();return o.forEach(((r,s)=>{_(i,I,"m",t).call(i,e,r,n,(t=>{o[s]=t}))})),void s(o)}if(this.isTuple()){const i=this.components;let o;if(Array.isArray(r))o=r.slice();else{if(null==r||"object"!=typeof r)throw new Error("invlaid tuple value");o=i.map((t=>{if(!t.name)throw new Error("cannot use object value with unnamed components");if(!(t.name in r))throw new Error(`missing value for component ${t.name}`);return r[t.name]}))}if(r.length!==this.components.length)throw new Error("array is wrong length");return o.forEach(((r,s)=>{var a;_(a=i[s],I,"m",t).call(a,e,r,n,(t=>{o[s]=t}))})),void s(o)}const i=n(this.type,r);i.then?e.push(async function(){s(await i)}()):s(i)},function(t){t.constructor="constructor",t.error="error",t.event="event",t.function="function",t.struct="struct"}(ot||(ot={}));class at{constructor(t,e,n){k.assertPrivate(t,nt,"Fragment"),r(this,{type:e,inputs:n=Object.freeze(n.slice())})}static from(t){if("string"==typeof t)return this.fromString(t);if(t instanceof K)return this.fromTokens(t);if("object"==typeof t)return this.fromObject(t);throw new Error(`unsupported type: ${t}`)}static fromObject(t){switch(t.type){case"constructor":return ft.fromObject(t);case"error":return ut.fromObject(t);case"event":return ht.fromObject(t);case"function":return dt.fromObject(t);case"struct":return pt.fromObject(t)}throw new Error("not implemented yet")}static fromString(t){try{at.from(JSON.parse(t))}catch(t){}return at.fromTokens(J(t))}static fromTokens(t){const e=t.popKeyword(D);switch(e){case"constructor":return ft.fromTokens(t);case"error":return ut.fromTokens(t);case"event":return ht.fromTokens(t);case"function":return dt.fromTokens(t);case"struct":return pt.fromTokens(t)}throw new Error(`unsupported type: ${e}`)}static isConstructor(t){return t&&"constructor"===t.type}static isError(t){return t&&"error"===t.type}static isEvent(t){return t&&"event"===t.type}static isFunction(t){return t&&"function"===t.type}static isStruct(t){return t&&"struct"===t.type}}class ct extends at{constructor(t,e,n,s){super(t,e,s),s=Object.freeze(s.slice()),r(this,{name:n})}}function lt(t,e){return"("+e.map((e=>e.format(t))).join(t===R.full?", ":",")+")"}class ut extends ct{constructor(t,e,r){super(t,ot.error,e,r)}format(t=R.sighash){if(R[t]||k.throwArgumentError("invalid format type","format",t),t===R.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return t!==R.sighash&&e.push("error"),e.push(this.name+lt(t,this.inputs)),e.join(" ")}static fromString(t){return ut.fromTokens(J(t))}static fromTokens(t){const e=X("error",t),r=Z(t);return tt(t),new ut(nt,e,r)}}class ht extends ct{constructor(t,e,n,s){super(t,ot.event,e,n),r(this,{anonymous:s})}format(t=R.sighash){if(R[t]||k.throwArgumentError("invalid format type","format",t),t===R.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return t!==R.sighash&&e.push("event"),e.push(this.name+lt(t,this.inputs)),t!==R.sighash&&this.anonymous&&e.push("anonymous"),e.join(" ")}static fromString(t){return ht.fromTokens(J(t))}static fromTokens(t){const e=X("event",t),r=Z(t,!0),n=!!Y(t,C(["anonymous"])).has("anonymous");return tt(t),new ht(nt,e,r,n)}}class ft extends at{constructor(t,e,n,s,i){super(t,e,n),r(this,{payable:s,gas:i})}format(t=R.sighash){if(R[t]||k.throwArgumentError("invalid format type","format",t),t===R.sighash&&k.throwError("cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t===R.json)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[`constructor${lt(t,this.inputs)}`];return e.push(this.payable?"payable":"nonpayable"),null!=this.gas&&e.push(`@${this.gas.toString()}`),e.join(" ")}static fromString(t){return ft.fromTokens(J(t))}static fromObject(t){throw new Error("TODO")}static fromTokens(t){Y(t,C(["constructor"]));const e=Z(t),r=!!Y(t,C(["payable"])).has("payable"),n=Q(t);return tt(t),new ft(nt,ot.constructor,e,r,n)}}class dt extends ct{constructor(t,e,n,s,i,o){super(t,ot.function,e,s);r(this,{constant:"view"===n||"pure"===n,gas:o,outputs:i=Object.freeze(i.slice()),payable:"payable"===n,stateMutability:n})}format(t=R.sighash){if(R[t]||k.throwArgumentError("invalid format type","format",t),t===R.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});const e=[];return t!==R.sighash&&e.push("function"),e.push(this.name+lt(t,this.inputs)),t!==R.sighash&&("nonpayable"!==this.stateMutability&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(lt(t,this.outputs))),null!=this.gas&&e.push(`@${this.gas.toString()}`)),e.join(" ")}static fromString(t){return dt.fromTokens(J(t))}static fromTokens(t){const e=X("function",t),r=Z(t),n=function(t){let e=Y(t,U);return q(e,C("constant payable nonpayable".split(" "))),q(e,C("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}(t);let s=[];Y(t,C(["returns"])).has("returns")&&(s=Z(t));const i=Q(t);return tt(t),new dt(nt,e,n,r,s,i)}}class pt extends ct{format(){throw new Error("@TODO")}static fromString(t){return pt.fromTokens(J(t))}static fromTokens(t){const e=X("struct",t),r=Z(t);return tt(t),new pt(nt,ot.struct,e,r)}}const wt=new T("@ethersproject/math@6.0.0-beta.3"),gt=BigInt(0);function mt(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+="0123456789abcdef"[r>>4],e+="0123456789abcdef"[15&r];return BigInt(e)}return wt.getBigInt(t,"value")}function yt(t){const e=mt(t);return(e<-9007199254740991||e>9007199254740991)&&wt.throwArgumentError("overflow","value",t),Number(e)}function bt(t,e){const r=wt.getBigInt(t,"value");if(r<0)throw new Error("cannot convert negative value to hex");let n=r.toString(16);if(null==e)n.length%2&&(n="0"+n);else{const t=wt.getNumber(e,"width");if(2*t<n.length)throw new Error(`value ${r} exceeds width ${t}`);for(;n.length<2*t;)n="0"+n}return"0x"+n}function vt(t){const e=wt.getBigInt(t,"value");if(e<0)throw new Error("cannot convert negative value to hex");if(e===gt)return new Uint8Array([]);let r=e.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let t=0;t<n.length;t++){const e=2*t;n[t]=parseInt(r.substring(e,e+2),16)}return n}const Et=BigInt(0),At=BigInt(1);function Tt(t,e){const r=wt.getBigInt(t,"value"),n=BigInt(wt.getNumber(e,"width"));if(r>>n-At){return-((~r&(At<<n)-At)+At)}return r}function kt(t,e){const r=wt.getBigInt(t,"value"),n=BigInt(wt.getNumber(e,"width"));if(r<Et){return(~-r&(At<<n)-At)+At}return r}function Pt(t,e){const r=wt.getBigInt(t,"value"),n=wt.getBigInt(e,"bits");return r&(At<<n)-At}var Nt,xt,Ot,It=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},St=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Rt={},Bt=BigInt(-1);function _t(t,e,r,n){const s={fault:e,operation:r};return void 0!==n&&(s.value=n),wt.throwError(t,"NUMERIC_FAULT",s)}let Ct="0";for(;Ct.length<256;)Ct+=Ct;function Ft(t){return("number"!=typeof t||t<0||t>256||t%1)&&wt.throwArgumentError("invalid decimal length","decimals",t),BigInt("1"+Ct.substring(0,t))}function Ut(t,e){null==e&&(e=18);let r=wt.getBigInt(t,"value");const n=Ft(wt.getNumber(e,"decimals")),s=String(n),i=r<0;i&&(r*=Bt);let o=String(r%n);for(;o.length<s.length-1;)o="0"+o;for(;o.length>1&&"0"===o.substring(o.length-1);)o=o.substring(0,o.length-1);let a=String(r/n);return 1!==s.length&&(a+="."+o),i&&(a="-"+a),a}function Lt(t,e){null==e&&(e=18);const r=Ft(wt.getNumber(e,"decimals"));"string"==typeof t&&t.match(/^-?[0-9.]+$/)||wt.throwArgumentError("invalid decimal value","value",t);const n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&wt.throwArgumentError("missing value","value",t);const s=t.split(".");s.length>2&&wt.throwArgumentError("too many decimal points","value",t);let i=s[0]||"0",o=s[1]||"0";for(;"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>String(r).length-1&&_t("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<String(r).length-1;)o+="0";let a=BigInt(i)*r+BigInt(o);return n&&(a*=Bt),a}class Dt{constructor(t,e,r,n){t!==Rt&&wt.throwError("cannot use FixedFormat constructor; use FixedFormat.from","UNSUPPORTED_OPERATION",{operation:"new FixedFormat"}),this.signed=e,this.width=r,this.decimals=n,this.name=(e?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=Ft(n),Object.freeze(this)}static from(t){if(t instanceof Dt)return t;"number"==typeof t&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)e=!1;else{const s=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);if(!s)return wt.throwArgumentError("invalid fixed format","format",t);e="u"!==s[1],r=parseInt(s[2]),n=parseInt(s[3])}else if(t){const s=(e,r,n)=>null==t[e]?n:(typeof t[e]!==r&&wt.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=s("signed","boolean",e),r=s("width","number",r),n=s("decimals","number",n)}return r%8&&wt.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&wt.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new Dt(Rt,e,r,n)}}class Mt{constructor(t,e,r,n){Nt.add(this),xt.set(this,void 0),t!==Rt&&wt.throwError("cannot use FixedNumber constructor; use FixedNumber.from","UNSUPPORTED_OPERATION",{operation:"new FixedFormat"}),this.format=Dt.from(n),It(this,xt,r,"f"),this._isFixedNumber=!0,Object.freeze(this)}addUnsafe(t){St(this,Nt,"m",Ot).call(this,t);const e=Lt(St(this,xt,"f"),this.format.decimals),r=Lt(St(t,xt,"f"),t.format.decimals);return Mt.fromValue(e+r,this.format.decimals,this.format)}subUnsafe(t){St(this,Nt,"m",Ot).call(this,t);const e=Lt(St(this,xt,"f"),this.format.decimals),r=Lt(St(t,xt,"f"),t.format.decimals);return Mt.fromValue(e-r,this.format.decimals,this.format)}mulUnsafe(t){St(this,Nt,"m",Ot).call(this,t);const e=Lt(St(this,xt,"f"),this.format.decimals),r=Lt(St(t,xt,"f"),t.format.decimals);return Mt.fromValue(e*r/this.format._multiplier,this.format.decimals,this.format)}divUnsafe(t){St(this,Nt,"m",Ot).call(this,t);const e=Lt(St(this,xt,"f"),this.format.decimals),r=Lt(St(t,xt,"f"),t.format.decimals);return Mt.fromValue(e*this.format._multiplier/r,this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Mt.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(jt.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Mt.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(jt.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&wt.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=Mt.from("1"+Ct.substring(0,t),this.format),n=Gt.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===St(this,xt,"f")||"0"===St(this,xt,"f")}isNegative(){return"-"===St(this,xt,"f")[0]}toString(){return St(this,xt,"f")}toHexString(t){throw new Error("TODO")}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Mt.fromString(St(this,xt,"f"),t)}static fromValue(t,e=0,r="fixed"){return Mt.fromString(Ut(t,e),Dt.from(r))}static fromString(t,e="fixed"){const r=Dt.from(e),n=Lt(t,r.decimals);!r.signed&&n<0&&_t("unsigned value cannot be negative","overflow","value",t);const s=r.signed?bt(kt(n,r.width)):bt(n,r.width/8),i=Ut(n,r.decimals);return new Mt(Rt,s,i,r)}static fromBytes(t,e="fixed"){const r=wt.getBytes(t,"value"),n=Dt.from(e);if(r.length>n.width/8)throw new Error("overflow");let s=mt(r);n.signed&&(s=Tt(s,n.width));const i=bt(kt(s,(n.signed?0:1)+n.width)),o=Ut(s,n.decimals);return new Mt(Rt,i,o,n)}static from(t,e){if("string"==typeof t)return Mt.fromString(t,e);if(t instanceof Uint8Array)return Mt.fromBytes(t,e);try{return Mt.fromValue(t,0,e)}catch(t){if("INVALID_ARGUMENT"!==t.code)throw t}return wt.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}xt=new WeakMap,Nt=new WeakSet,Ot=function(t){this.format.name!==t.format.name&&wt.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)};const jt=Mt.from(1),Gt=Mt.from("0.5"),$t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let zt=null;function Wt(t){if(null==zt){zt={};for(let t=0;t<$t.length;t++)zt[$t[t]]=BigInt(t)}const e=zt[t];return null==e&&wt.throwArgumentError("invalid base58 value","letter",t),e}const Ht=BigInt(0),Vt=BigInt(58);function Kt(t){let e=mt(wt.getBytes(t)),r="";for(;e;)r=$t[Number(e%Vt)]+r,e/=Vt;return r}function Jt(t){let e=Ht;for(let r=0;r<t.length;r++)e*=Vt,e+=Wt(t[r]);return bt(e)}const qt=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Xt(t,e){if("string"==typeof e){const t=qt.indexOf(e);-1===t&&wt.throwArgumentError("invalid unit","unit",e),e=3*t}return Ut(t,null!=e?e:18)}function Yt(t,e){if("string"!=typeof t&&wt.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=qt.indexOf(e);-1===t&&wt.throwArgumentError("invalid unit","unit",e),e=3*t}return Lt(t,null!=e?e:18)}function Zt(t){return Xt(t,18)}function Qt(t){return Yt(t,18)}function te(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof e||t.length===2+2*e)&&(!0!==e||t.length%2==0))}function ee(t){return te(t,!0)||t instanceof Uint8Array}const re=new T("@ethersproject/bytes@6.0.0-beta.3");let ne=null,se=null;try{ne=BigInt("8"),se=BigInt("255")}catch(t){console.log("Unsupported bigint",t)}function ie(t){if(null==t&&re.throwArgumentError("cannot arrayify nullish","data",t),"number"==typeof t){let e=re.getNumber(t,"data");const r=[];for(;e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),new Uint8Array(r)}if(ne&&"bigint"==typeof t){const e=[];for(;t;)e.unshift(Number(t&se)),t>>=ne;return 0===e.length&&e.push(0),new Uint8Array(e)}if((e=t)&&"function"==typeof e.toHexString)return ie(t.toHexString());var e;if("string"==typeof t){let e=t;if(!e.match(/^0x[0-9a-f]*$/i))throw new RangeError(`invalid hex data string (${JSON.stringify(t)})`);const r=[];for(let t=2;t<e.length;t+=2)r.push(parseInt(e.substring(t,t+2),16));return new Uint8Array(r)}if(t instanceof Uint8Array)return new Uint8Array(t);throw new TypeError(`cannot arrayify ${JSON.stringify(t)}`)}function oe(t){return ee(t)||re.throwArgumentError("invalid BytesLike value","data",t),t instanceof Uint8Array?t:ie(t)}function ae(t){return new Uint8Array(Buffer.from(t,"base64"))}function ce(t){return Buffer.from(re.getBytes(t,"data")).toString("base64")}function le(t){const e=oe(t);let r="0x";for(let t=0;t<e.length;t++){const n=e[t];r+="0123456789abcdef"[(240&n)>>4]+"0123456789abcdef"[15&n]}return r}function ue(t){let e=le(ie(t)).substring(2);for(;"0"===e.substring(0,1);)e=e.substring(1);return""===e&&(e="0"),"0x"+e}function he(t){return"0x"+t.map((t=>le(t).substring(2))).join("")}function fe(t){return te(t,!0)?(t.length-2)/2:oe(t).length}function de(t,e,r){const n=oe(t);return null!=r&&r>n.length&&re.throwError("cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),le(n.slice(null==e?0:e,null==r?n.length:r))}function pe(t){let e=le(t).substring(2);for(;"00"==e.substring(0,2);)e=e.substring(2);return"0x"+e}function we(t,e,r){const n=oe(t);e<n.length&&re.throwError("padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),r?s.set(n,e-n.length):s.set(n,0),le(s)}function ge(t,e){return we(t,e,!0)}function me(t,e){return we(t,e,!1)}var ye,be,ve,Ee,Ae,Te,ke,Pe,Ne,xe,Oe,Ie=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Se=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Re=new Uint8Array(32),Be=["then"],_e={};class Ce extends Array{constructor(t,e,r){return k.assertPrivate(t,_e,"Result"),super(...e),ye.add(this),be.set(this,void 0),Ie(this,be,new Map,"f"),r&&r.forEach(((t,e)=>{null!=t&&(Se(this,be,"f").has(t)?Se(this,be,"f").get(t).push(e):Se(this,be,"f").set(t,[e]))})),Object.freeze(this),new Proxy(this,{get:(t,e,r)=>{if("string"==typeof e){if(e.match(/^[0-9]+$/)){const r=k.getNumber(e,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const n=t[r];return n instanceof Error&&Se(this,ye,"m",ve).call(this,`index ${r}`,n),n}if(e in t||Be.indexOf(e)>=0)return Reflect.get(t,e,r);if(!(e in t))return t.getValue(e)}return Reflect.get(t,e,r)}})}slice(t,e){null==t&&(t=0),null==e&&(e=this.length);const r=[];for(let n=t;n<e;n++){let t;try{t=this[n]}catch(e){t=e.error}r.push(t)}return r}getValue(t){const e=Se(this,be,"f").get(t);if(null!=e&&1===e.length){const r=this[e[0]];return r instanceof Error&&Se(this,ye,"m",ve).call(this,`property ${JSON.stringify(t)}`,r),r}throw new Error(`no named parameter: ${JSON.stringify(t)}`)}static fromItems(t,e){return new Ce(_e,t,e)}}function Fe(t){let e=vt(t);return e.length>32&&k.throwError("value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:32,offset:e.length}),32!==e.length&&(e=ie(he([Re.slice(e.length%32),e]))),e}be=new WeakMap,ye=new WeakSet,ve=function(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r};class Ue{constructor(t,e,n,s){r(this,{name:t,type:e,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){return k.throwArgumentError(t,this.localName,e)}}class Le{constructor(){Ee.add(this),Ae.set(this,void 0),Te.set(this,void 0),Ie(this,Ae,[],"f"),Ie(this,Te,0,"f")}get data(){return he(Se(this,Ae,"f"))}get length(){return Se(this,Te,"f")}appendWriter(t){return Se(this,Ee,"m",ke).call(this,ie(t.data))}writeBytes(t){let e=ie(t);const r=e.length%32;return r&&(e=ie(he([e,Re.slice(r)]))),Se(this,Ee,"m",ke).call(this,e)}writeValue(t){return Se(this,Ee,"m",ke).call(this,Fe(t))}writeUpdatableValue(){const t=Se(this,Ae,"f").length;return Se(this,Ae,"f").push(Re),Ie(this,Te,Se(this,Te,"f")+32,"f"),e=>{Se(this,Ae,"f")[t]=Fe(e)}}}Ae=new WeakMap,Te=new WeakMap,Ee=new WeakSet,ke=function(t){return Se(this,Ae,"f").push(t),Ie(this,Te,Se(this,Te,"f")+t.length,"f"),t.length};class De{constructor(t,e){Pe.add(this),Ne.set(this,void 0),xe.set(this,void 0),r(this,{allowLoose:!!e}),Ie(this,Ne,ie(t),"f"),Ie(this,xe,0,"f")}get data(){return le(Se(this,Ne,"f"))}get dataLength(){return Se(this,Ne,"f").length}get consumed(){return Se(this,xe,"f")}get bytes(){return new Uint8Array(Se(this,Ne,"f"))}subReader(t){return new De(Se(this,Ne,"f").slice(Se(this,xe,"f")+t),this.allowLoose)}readBytes(t,e){let r=Se(this,Pe,"m",Oe).call(this,0,t,!!e);return Ie(this,xe,Se(this,xe,"f")+r.length,"f"),r.slice(0,t)}readValue(){return mt(this.readBytes(32))}readIndex(){return yt(this.readBytes(32))}}Ne=new WeakMap,xe=new WeakMap,Pe=new WeakSet,Oe=function(t,e,r){let n=32*Math.ceil(e/32);return Se(this,xe,"f")+n>Se(this,Ne,"f").length&&(this.allowLoose&&r&&Se(this,xe,"f")+e<=Se(this,Ne,"f").length?n=e:k.throwError("data out-of-bounds","BUFFER_OVERRUN",{buffer:ie(Se(this,Ne,"f")),length:Se(this,Ne,"f").length,offset:Se(this,xe,"f")+n})),Se(this,Ne,"f").slice(Se(this,xe,"f"),Se(this,xe,"f")+n)};
|
||
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||
const Me=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),je=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ge=(t,e)=>t<<32-e|t>>>e;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));const $e=(()=>{const t="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);try{if(t){const{setImmediate:e}=t("timers");return()=>new Promise((t=>e(t)))}}catch(t){}return()=>new Promise((t=>setTimeout(t,0)))})();async function ze(t,e,r){let n=Date.now();for(let s=0;s<t;s++){r(s);const t=Date.now()-n;t>=0&&t<e||(await $e(),n+=t)}}function We(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new TypeError("utf8ToBytes expected string, got "+typeof t);return(new TextEncoder).encode(t)}(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}function He(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Ve(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");He(t.outputLen),He(t.blockLen)}class Ke{clone(){return this._cloneInto()}}function Je(t,e){if(void 0!==e&&("object"!=typeof e||(r=e,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(t,e)}function qe(t){const e=e=>t().update(We(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}class Xe extends Ke{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Ve(t);const r=We(e);if(this.iHash=t.create(),!(this.iHash instanceof Ke))throw new TypeError("Expected instance of class which extends utils.Hash");const n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const s=new Uint8Array(n);s.set(r.length>this.iHash.blockLen?t.create().update(r).digest():r);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),s.fill(0)}update(t){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(t),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:s,blockLen:i,outputLen:o}=this;return(t=t).finished=n,t.destroyed=s,t.blockLen=i,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Ye=(t,e,r)=>new Xe(t,e).update(r).digest();function Ze(t,e,r,n){const{c:s,dkLen:i,DK:o,PRF:a,PRFSalt:c}=function(t,e,r,n){Ve(t);const s=Je({dkLen:32,asyncTick:10},n),{c:i,dkLen:o,asyncTick:a}=s;if(He(i),He(o),He(a),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=We(e),l=We(r),u=new Uint8Array(o),h=Ye.create(t,c),f=h._cloneInto().update(l);return{c:i,dkLen:o,asyncTick:a,DK:u,PRF:h,PRFSalt:f}}(t,e,r,n);let l;const u=new Uint8Array(4),h=je(u),f=new Uint8Array(a.outputLen);for(let t=1,e=0;e<i;t++,e+=a.outputLen){const r=o.subarray(e,e+a.outputLen);h.setInt32(0,t,!1),(l=c._cloneInto(l)).update(u).digestInto(f),r.set(f.subarray(0,r.length));for(let t=1;t<s;t++){a._cloneInto(l).update(f).digestInto(f);for(let t=0;t<r.length;t++)r[t]^=f[t]}}return function(t,e,r,n,s){return t.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),r}(a,c,o,l,f)}Ye.create=(t,e)=>new Xe(t,e);class Qe extends Ke{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=je(this.buffer)}update(t){if(this.destroyed)throw new Error("instance is destroyed");const{view:e,buffer:r,blockLen:n,finished:s}=this;if(s)throw new Error("digest() was already called");const i=(t=We(t)).length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);if(o!==n)r.set(t.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(e,0),this.pos=0);else{const e=je(t);for(;n<=i-s;s+=n)this.process(e,s)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:e,view:r,blockLen:n,isLE:s}=this;let{pos:i}=this;e[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>n-i&&(this.process(r,0),i=0);for(let t=i;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const s=BigInt(32),i=BigInt(4294967295),o=Number(r>>s&i),a=Number(r&i),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}(r,n-8,BigInt(8*this.length),s),this.process(r,0);const o=je(t);this.get().forEach(((t,e)=>o.setUint32(4*e,t,s)))}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:s,destroyed:i,pos:o}=this;return t.length=n,t.pos=o,t.finished=s,t.destroyed=i,n%e&&t.buffer.set(r),t}}const tr=(t,e,r)=>t&e^~t&r,er=(t,e,r)=>t&e^t&r^e&r,rr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),nr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),sr=new Uint32Array(64);class ir extends Qe{constructor(){super(64,32,8,!1),this.A=0|nr[0],this.B=0|nr[1],this.C=0|nr[2],this.D=0|nr[3],this.E=0|nr[4],this.F=0|nr[5],this.G=0|nr[6],this.H=0|nr[7]}get(){const{A:t,B:e,C:r,D:n,E:s,F:i,G:o,H:a}=this;return[t,e,r,n,s,i,o,a]}set(t,e,r,n,s,i,o,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|s,this.F=0|i,this.G=0|o,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)sr[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=sr[t-15],r=sr[t-2],n=Ge(e,7)^Ge(e,18)^e>>>3,s=Ge(r,17)^Ge(r,19)^r>>>10;sr[t]=s+sr[t-7]+n+sr[t-16]|0}let{A:r,B:n,C:s,D:i,E:o,F:a,G:c,H:l}=this;for(let t=0;t<64;t++){const e=l+(Ge(o,6)^Ge(o,11)^Ge(o,25))+tr(o,a,c)+rr[t]+sr[t]|0,u=(Ge(r,2)^Ge(r,13)^Ge(r,22))+er(r,n,s)|0;l=c,c=a,a=o,o=i+e|0,i=s,s=n,n=r,r=e+u|0}r=r+this.A|0,n=n+this.B|0,s=s+this.C|0,i=i+this.D|0,o=o+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,n,s,i,o,a,c,l)}roundClean(){sr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const or=qe((()=>new ir)),ar=BigInt(2**32-1),cr=BigInt(32);function lr(t,e=!1){return e?{h:Number(t&ar),l:Number(t>>cr&ar)}:{h:0|Number(t>>cr&ar),l:0|Number(t&ar)}}function ur(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:i,l:o}=lr(t[s],e);[r[s],n[s]]=[i,o]}return[r,n]}const hr=(t,e,r)=>t>>>r,fr=(t,e,r)=>t<<32-r|e>>>r,dr=(t,e,r)=>t>>>r|e<<32-r,pr=(t,e,r)=>t<<32-r|e>>>r,wr=(t,e,r)=>t<<64-r|e>>>r-32,gr=(t,e,r)=>t>>>r-32|e<<64-r;function mr(t,e,r,n){const s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:0|s}}const yr=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),br=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,vr=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Er=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0,Ar=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0),Tr=(t,e,r,n,s,i)=>e+r+n+s+i+(t/2**32|0)|0,[kr,Pr]=ur(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((t=>BigInt(t)))),Nr=new Uint32Array(80),xr=new Uint32Array(80);class Or extends Qe{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:r,Bl:n,Ch:s,Cl:i,Dh:o,Dl:a,Eh:c,El:l,Fh:u,Fl:h,Gh:f,Gl:d,Hh:p,Hl:w}=this;return[t,e,r,n,s,i,o,a,c,l,u,h,f,d,p,w]}set(t,e,r,n,s,i,o,a,c,l,u,h,f,d,p,w){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|s,this.Cl=0|i,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|h,this.Gh=0|f,this.Gl=0|d,this.Hh=0|p,this.Hl=0|w}process(t,e){for(let r=0;r<16;r++,e+=4)Nr[r]=t.getUint32(e),xr[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Nr[t-15],r=0|xr[t-15],n=dr(e,r,1)^dr(e,r,8)^hr(e,0,7),s=pr(e,r,1)^pr(e,r,8)^fr(e,r,7),i=0|Nr[t-2],o=0|xr[t-2],a=dr(i,o,19)^wr(i,o,61)^hr(i,0,6),c=pr(i,o,19)^gr(i,o,61)^fr(i,o,6),l=vr(s,c,xr[t-7],xr[t-16]),u=Er(l,n,a,Nr[t-7],Nr[t-16]);Nr[t]=0|u,xr[t]=0|l}let{Ah:r,Al:n,Bh:s,Bl:i,Ch:o,Cl:a,Dh:c,Dl:l,Eh:u,El:h,Fh:f,Fl:d,Gh:p,Gl:w,Hh:g,Hl:m}=this;for(let t=0;t<80;t++){const e=dr(u,h,14)^dr(u,h,18)^wr(u,h,41),y=pr(u,h,14)^pr(u,h,18)^gr(u,h,41),b=u&f^~u&p,v=Ar(m,y,h&d^~h&w,Pr[t],xr[t]),E=Tr(v,g,e,b,kr[t],Nr[t]),A=0|v,T=dr(r,n,28)^wr(r,n,34)^wr(r,n,39),k=pr(r,n,28)^gr(r,n,34)^gr(r,n,39),P=r&s^r&o^s&o,N=n&i^n&a^i&a;g=0|p,m=0|w,p=0|f,w=0|d,f=0|u,d=0|h,({h:u,l:h}=mr(0|c,0|l,0|E,0|A)),c=0|o,l=0|a,o=0|s,a=0|i,s=0|r,i=0|n;const x=yr(A,k,N);r=br(x,E,T,P),n=0|x}({h:r,l:n}=mr(0|this.Ah,0|this.Al,0|r,0|n)),({h:s,l:i}=mr(0|this.Bh,0|this.Bl,0|s,0|i)),({h:o,l:a}=mr(0|this.Ch,0|this.Cl,0|o,0|a)),({h:c,l:l}=mr(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:h}=mr(0|this.Eh,0|this.El,0|u,0|h)),({h:f,l:d}=mr(0|this.Fh,0|this.Fl,0|f,0|d)),({h:p,l:w}=mr(0|this.Gh,0|this.Gl,0|p,0|w)),({h:g,l:m}=mr(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,n,s,i,o,a,c,l,u,h,f,d,p,w,g,m)}roundClean(){Nr.fill(0),xr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Ir extends Or{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class Sr extends Or{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Rr=qe((()=>new Or));qe((()=>new Ir)),qe((()=>new Sr));const Br=new T("@ethersproject/crypto@6.0.0-beta.2");const _r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();let Cr=_r.crypto||_r.msCrypto;function Fr(t){switch(t){case"sha256":return or.create();case"sha512":return Rr.create()}return Br.throwArgumentError("invalid hashing algorithm name","algorithm",t)}let Ur=!1;const Lr=function(t,e,r){return"0x"+function(t,e){const r={sha256:or,sha512:Rr}[t];return null==r?Br.throwArgumentError("invalid hmac algorithm","algorithm",t):Ye.create(r,e)}(t,e).update(r).digest("hex")};let Dr=Lr;function Mr(t,e,r){const n=Br.getBytes(e,"key"),s=Br.getBytes(r,"data");return le(Dr(t,n,s))}Mr._=Lr,Mr.lock=function(){Ur=!0},Mr.register=function(t){if(Ur)throw new Error("computeHmac is locked");Dr=t},Object.freeze(Mr);const[jr,Gr,$r]=[[],[],[]],zr=BigInt(0),Wr=BigInt(1),Hr=BigInt(2),Vr=BigInt(7),Kr=BigInt(256),Jr=BigInt(113);for(let t=0,e=Wr,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],jr.push(2*(5*n+r)),Gr.push((t+1)*(t+2)/2%64);let s=zr;for(let t=0;t<7;t++)e=(e<<Wr^(e>>Vr)*Jr)%Kr,e&Hr&&(s^=Wr<<(Wr<<BigInt(t))-Wr);$r.push(s)}const[qr,Xr]=ur($r,!0),Yr=(t,e,r)=>r>32?((t,e,r)=>e<<r-32|t>>>64-r)(t,e,r):((t,e,r)=>t<<r|e>>>32-r)(t,e,r),Zr=(t,e,r)=>r>32?((t,e,r)=>t<<r-32|e>>>64-r)(t,e,r):((t,e,r)=>e<<r|t>>>32-r)(t,e,r);class Qr extends Ke{constructor(t,e,r,n=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,He(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Me(this.state)}keccak(){!function(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const n=(e+8)%10,s=(e+2)%10,i=r[s],o=r[s+1],a=Yr(i,o,1)^r[n],c=Zr(i,o,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=c}let e=t[2],s=t[3];for(let r=0;r<24;r++){const n=Gr[r],i=Yr(e,s,n),o=Zr(e,s,n),a=jr[r];e=t[a],s=t[a+1],t[a]=i,t[a+1]=o}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=qr[n],t[1]^=Xr[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){if(this.destroyed)throw new Error("instance is destroyed");if(this.finished)throw new Error("digest() was already called");const{blockLen:e,state:r}=this,n=(t=We(t)).length;for(let s=0;s<n;){const i=Math.min(e-this.pos,n-s);for(let e=0;e<i;e++)r[this.pos++]^=t[s++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,0!=(128&e)&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array))throw new Error("Keccak: invalid output buffer");this.finish();for(let e=0,r=t.length;e<r;){this.posOut>=this.blockLen&&this.keccak();const n=Math.min(this.blockLen-this.posOut,r-e);t.set(this.state.subarray(this.posOut,this.posOut+n),e),this.posOut+=n,e+=n}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return He(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(t.length<this.outputLen)throw new Error("Keccak: invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.finish(),this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:r,outputLen:n,rounds:s,enableXOF:i}=this;return t||(t=new Qr(e,r,n,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=n,t.enableXOF=i,t.destroyed=this.destroyed,t}}const tn=(t,e,r)=>qe((()=>new Qr(e,t,r)));tn(6,144,28),tn(6,136,32),tn(6,104,48),tn(6,72,64),tn(1,144,28);const en=tn(1,136,32);tn(1,104,48),tn(1,72,64);const rn=(t,e,r)=>function(t){const e=(e,r)=>t(r).update(We(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}(((n={})=>new Qr(e,t,void 0!==n.dkLen?n.dkLen:r,!0)));rn(31,168,16),rn(31,136,32);let nn=!1;const sn=function(t){return en(t)};let on=sn;function an(t){const e=Br.getBytes(t,"data");return le(on(e))}an._=sn,an.lock=function(){nn=!0},an.register=function(t){if(nn)throw new TypeError("keccak256 is locked");on=t},Object.freeze(an);const cn=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),ln=Uint8Array.from({length:16},((t,e)=>e)),un=ln.map((t=>(9*t+5)%16));let hn=[ln],fn=[un];for(let t=0;t<4;t++)for(let e of[hn,fn])e.push(e[t].map((t=>cn[t])));const dn=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((t=>new Uint8Array(t))),pn=hn.map(((t,e)=>t.map((t=>dn[e][t])))),wn=fn.map(((t,e)=>t.map((t=>dn[e][t])))),gn=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),mn=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),yn=(t,e)=>t<<e|t>>>32-e;function bn(t,e,r,n){return 0===t?e^r^n:1===t?e&r|~e&n:2===t?(e|~r)^n:3===t?e&n|r&~n:e^(r|~n)}const vn=new Uint32Array(16);class En extends Qe{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:e,h2:r,h3:n,h4:s}=this;return[t,e,r,n,s]}set(t,e,r,n,s){this.h0=0|t,this.h1=0|e,this.h2=0|r,this.h3=0|n,this.h4=0|s}process(t,e){for(let r=0;r<16;r++,e+=4)vn[r]=t.getUint32(e,!0);let r=0|this.h0,n=r,s=0|this.h1,i=s,o=0|this.h2,a=o,c=0|this.h3,l=c,u=0|this.h4,h=u;for(let t=0;t<5;t++){const e=4-t,f=gn[t],d=mn[t],p=hn[t],w=fn[t],g=pn[t],m=wn[t];for(let e=0;e<16;e++){const n=yn(r+bn(t,s,o,c)+vn[p[e]]+f,g[e])+u|0;r=u,u=c,c=0|yn(o,10),o=s,s=n}for(let t=0;t<16;t++){const r=yn(n+bn(e,i,a,l)+vn[w[t]]+d,m[t])+h|0;n=h,h=l,l=0|yn(a,10),a=i,i=r}}this.set(this.h1+o+l|0,this.h2+c+h|0,this.h3+u+n|0,this.h4+r+i|0,this.h0+s+a|0)}roundClean(){vn.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const An=qe((()=>new En));let Tn=!1;const kn=function(t){return An(t)};let Pn=kn;function Nn(t){const e=Br.getBytes(t,"data");return le(Pn(e))}Nn._=kn,Nn.lock=function(){Tn=!0},Nn.register=function(t){if(Tn)throw new TypeError("ripemd160 is locked");Pn=t},Object.freeze(Nn);let xn=!1;const On=function(t,e,r,n,s){return function(t,e,r,n,s){const i={sha256:or,sha512:Rr}[s];return null==i?Br.throwArgumentError("invalid pbkdf2 algorithm","algorithm",s):Ze(i,t,e,{c:r,dkLen:n})}(t,e,r,n,s)};let In=On;function Sn(t,e,r,n,s){const i=Br.getBytes(t,"password"),o=Br.getBytes(e,"salt");return le(In(i,o,r,n,s))}Sn._=On,Sn.lock=function(){xn=!0},Sn.register=function(t){if(xn)throw new Error("pbkdf2 is locked");In=t},Object.freeze(Sn);let Rn=!1;const Bn=function(t){return new Uint8Array(function(t){if(null==Cr)return Br.throwError("platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});(t<=0||t>1024||t%1||t!=t)&&Br.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return Cr.getRandomValues(e),e}(t))};let _n=Bn;function Cn(t){return _n(t)}Cn._=Bn,Cn.lock=function(){Rn=!0},Cn.register=function(t){if(Rn)throw new Error("random is locked");_n=t},Object.freeze(Cn);const Fn=(t,e)=>t<<e|t>>>32-e;function Un(t,e,r,n,s,i){let o=t[e++]^r[n++],a=t[e++]^r[n++],c=t[e++]^r[n++],l=t[e++]^r[n++],u=t[e++]^r[n++],h=t[e++]^r[n++],f=t[e++]^r[n++],d=t[e++]^r[n++],p=t[e++]^r[n++],w=t[e++]^r[n++],g=t[e++]^r[n++],m=t[e++]^r[n++],y=t[e++]^r[n++],b=t[e++]^r[n++],v=t[e++]^r[n++],E=t[e++]^r[n++],A=o,T=a,k=c,P=l,N=u,x=h,O=f,I=d,S=p,R=w,B=g,_=m,C=y,F=b,U=v,L=E;for(let t=0;t<8;t+=2)N^=Fn(A+C|0,7),S^=Fn(N+A|0,9),C^=Fn(S+N|0,13),A^=Fn(C+S|0,18),R^=Fn(x+T|0,7),F^=Fn(R+x|0,9),T^=Fn(F+R|0,13),x^=Fn(T+F|0,18),U^=Fn(B+O|0,7),k^=Fn(U+B|0,9),O^=Fn(k+U|0,13),B^=Fn(O+k|0,18),P^=Fn(L+_|0,7),I^=Fn(P+L|0,9),_^=Fn(I+P|0,13),L^=Fn(_+I|0,18),T^=Fn(A+P|0,7),k^=Fn(T+A|0,9),P^=Fn(k+T|0,13),A^=Fn(P+k|0,18),O^=Fn(x+N|0,7),I^=Fn(O+x|0,9),N^=Fn(I+O|0,13),x^=Fn(N+I|0,18),_^=Fn(B+R|0,7),S^=Fn(_+B|0,9),R^=Fn(S+_|0,13),B^=Fn(R+S|0,18),C^=Fn(L+U|0,7),F^=Fn(C+L|0,9),U^=Fn(F+C|0,13),L^=Fn(U+F|0,18);s[i++]=o+A|0,s[i++]=a+T|0,s[i++]=c+k|0,s[i++]=l+P|0,s[i++]=u+N|0,s[i++]=h+x|0,s[i++]=f+O|0,s[i++]=d+I|0,s[i++]=p+S|0,s[i++]=w+R|0,s[i++]=g+B|0,s[i++]=m+_|0,s[i++]=y+C|0,s[i++]=b+F|0,s[i++]=v+U|0,s[i++]=E+L|0}function Ln(t,e,r,n,s){let i=n+0,o=n+16*s;for(let n=0;n<16;n++)r[o+n]=t[e+16*(2*s-1)+n];for(let n=0;n<s;n++,i+=16,e+=16)Un(r,o,t,e,r,i),n>0&&(o+=16),Un(r,i,t,e+=16,r,o)}function Dn(t,e,r){const n=Je({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:s,r:i,p:o,dkLen:a,asyncTick:c,maxmem:l,onProgress:u}=n;if(He(s),He(i),He(o),He(a),He(c),He(l),void 0!==u&&"function"!=typeof u)throw new Error("progressCb should be function");const h=128*i,f=h/4;if(s<=1||0!=(s&s-1)||s>=2**(h/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>137438953440/h)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const d=h*(s+o);if(d>l)throw new Error(`Scrypt: parameters too large, ${d} (128 * r * (N + p)) > ${l} (maxmem)`);const p=Ze(or,t,e,{c:1,dkLen:h*o}),w=Me(p),g=Me(new Uint8Array(h*s)),m=Me(new Uint8Array(h));let y=()=>{};if(u){const t=2*s*o,e=Math.max(Math.floor(t/1e4),1);let r=0;y=()=>{r++,!u||r%e&&r!==t||u(r/t)}}return{N:s,r:i,p:o,dkLen:a,blockSize32:f,V:g,B32:w,B:p,tmp:m,blockMixCb:y,asyncTick:c}}function Mn(t,e,r,n,s){const i=Ze(or,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),s.fill(0),i}let jn=!1,Gn=!1;const $n=async function(t,e,r,n,s,i,o){return await async function(t,e,r){const{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:l,B:u,tmp:h,blockMixCb:f,asyncTick:d}=Dn(t,e,r);for(let t=0;t<i;t++){const e=a*t;for(let t=0;t<a;t++)c[t]=l[e+t];let r=0;await ze(n-1,d,(t=>{Ln(c,r,c,r+=a,s),f()})),Ln(c,(n-1)*a,l,e,s),f(),await ze(n,d,(t=>{const r=l[e+a-16]%n;for(let t=0;t<a;t++)h[t]=l[e+t]^c[r*a+t];Ln(h,0,l,e,s),f()}))}return Mn(t,o,u,c,h)}(t,e,{N:r,r:n,p:s,dkLen:i,onProgress:o})},zn=function(t,e,r,n,s,i){return function(t,e,r){const{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:l,B:u,tmp:h,blockMixCb:f}=Dn(t,e,r);for(let t=0;t<i;t++){const e=a*t;for(let t=0;t<a;t++)c[t]=l[e+t];for(let t=0,e=0;t<n-1;t++)Ln(c,e,c,e+=a,s),f();Ln(c,(n-1)*a,l,e,s),f();for(let t=0;t<n;t++){const t=l[e+a-16]%n;for(let r=0;r<a;r++)h[r]=l[e+r]^c[t*a+r];Ln(h,0,l,e,s),f()}}return Mn(t,o,u,c,h)}(t,e,{N:r,r:n,p:s,dkLen:i})};let Wn=$n,Hn=zn;async function Vn(t,e,r,n,s,i,o){const a=Br.getBytes(t,"passwd"),c=Br.getBytes(e,"salt");return le(await Wn(a,c,r,n,s,i,o))}function Kn(t,e,r,n,s,i){const o=Br.getBytes(t,"passwd"),a=Br.getBytes(e,"salt");return le(Hn(o,a,r,n,s,i))}Vn._=$n,Vn.lock=function(){Gn=!0},Vn.register=function(t){if(Gn)throw new Error("scrypt is locked");Wn=t},Object.freeze(Vn),Kn._=zn,Kn.lock=function(){jn=!0},Kn.register=function(t){if(jn)throw new Error("scryptSync is locked");Hn=t},Object.freeze(Kn);const Jn=function(t){return Fr("sha256").update(t).digest()},qn=function(t){return Fr("sha512").update(t).digest()};let Xn=Jn,Yn=qn,Zn=!1,Qn=!1;function ts(t){const e=Br.getBytes(t,"data");return le(Xn(e))}function es(t){const e=Br.getBytes(t,"data");return le(Yn(e))}function rs(){Mr.lock(),an.lock(),Sn.lock(),Cn.lock(),Nn.lock(),Vn.lock(),Kn.lock(),ts.lock(),es.lock()}ts._=Jn,ts.lock=function(){Zn=!0},ts.register=function(t){if(Zn)throw new Error("sha256 is locked");Xn=t},Object.freeze(ts),es._=qn,es.lock=function(){Qn=!0},es.register=function(t){if(Qn)throw new Error("sha512 is locked");Yn=t},Object.freeze(ts);const ns=new T("@ethersproject/address@6.0.0-beta.2"),ss=BigInt(0),is=BigInt(36);function os(t){const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const n=ie(an(r));for(let t=0;t<40;t+=2)n[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&n[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const as={};for(let t=0;t<10;t++)as[String(t)]=String(t);for(let t=0;t<26;t++)as[String.fromCharCode(65+t)]=String(10+t);function cs(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>as[t])).join("");for(;e.length>=15;){let t=e.substring(0,15);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const ls=function(){const t={};for(let e=0;e<36;e++){t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e)}return t}();function us(t){if("string"!=typeof t&&ns.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){"0x"!==t.substring(0,2)&&(t="0x"+t);const e=os(t);return t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&ns.throwArgumentError("bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){t.substring(2,4)!==cs(t)&&ns.throwArgumentError("bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=ss;for(let r=0;r<t.length;r++)e=e*is+ls[t[r]];return e}(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return os("0x"+e)}return ns.throwArgumentError("invalid address","address",t)}function hs(t){let e=BigInt(us(t)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+cs("XE00"+e)+e}const fs=new T("@ethersproject/rlp@6.0.0-beta.2");function ds(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function ps(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(ps(t))})),e.length<=55)return e.unshift(192+e.length),e;const r=ds(e.length);return r.unshift(247+r.length),r.concat(e)}const e=Array.prototype.slice.call(fs.getBytes(t,"object"));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=ds(e.length);return r.unshift(183+r.length),r.concat(e)}function ws(t){let e="0x";for(const r of ps(t))e+="0123456789abcdef"[r>>4],e+="0123456789abcdef"[15&r];return e}function gs(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function ms(t,e,r){let n=0;for(let s=0;s<r;s++)n=256*n+t[e+s];return n}function ys(t,e,r,n){const s=[];for(;r<e+1+n;){const i=bs(t,r);s.push(i.result),(r+=i.consumed)>e+1+n&&fs.throwError("child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:s}}function bs(t,e){0===t.length&&fs.throwError("data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=e=>{e>t.length&&fs.throwError("data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:e})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const s=ms(t,e+1,n);return r(e+1+n+s),ys(t,e,e+1+n,n+s)}if(t[e]>=192){const n=t[e]-192;return r(e+1+n),ys(t,e,e+1,n)}if(t[e]>=184){const n=t[e]-183;r(e+1+n);const s=ms(t,e+1,n);r(e+1+n+s);return{consumed:1+n+s,result:le(t.slice(e+1+n,e+1+n+s))}}if(t[e]>=128){const n=t[e]-128;r(e+1+n);return{consumed:1+n,result:le(t.slice(e+1,e+1+n))}}return{consumed:1,result:gs(t[e])}}function vs(t){const e=fs.getBytes(t,"data"),r=bs(e,0);return r.consumed!==e.length&&fs.throwArgumentError("unexpected junk after rlp payload","data",t),r.result}function Es(t){const e=us(t.from);let r=ns.getBigInt(t.nonce,"tx.nonce").toString(16);return r="0"===r?"0x":r.length%2?"0x0"+r:"0x"+r,us(de(an(ws([e,r])),12))}function As(t,e,r){const n=us(t),s=ns.getBytes(e,"salt"),i=ns.getBytes(r,"initCodeHash");return 32!==s.length&&ns.throwArgumentError("salt must be 32 bytes","salt",e),32!==i.length&&ns.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),us(de(an(he(["0xff",n,s,i])),12))}function Ts(t){return t&&"function"==typeof t.getAddress}function ks(t){try{return us(t),!0}catch(t){}return!1}async function Ps(t,e){if("string"==typeof t){if(t.match(/^0x[0-9a-f]{40}$/i))return us(t);if(null==e)return ns.throwError("ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"});const r=await e.resolveName(t);return null==r||"0x0000000000000000000000000000000000000000"===r?ns.throwError("unconfigured name","UNCONFIGURED_NAME",{value:t}):us(r)}if(Ts(t)){const e=await t.getAddress();return null==e&&ns.throwArgumentError("addressable resolved to null","target",t),us(e)}return ns.throwArgumentError("unsupported addressable value","target",t)}var Ns,xs=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Os=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Is={};function Ss(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new _s(Is,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function Rs(t,e){return new _s(Is,`bytes${e||""}`,t,{size:e})}const Bs=Symbol.for("_ethers_typed");class _s{constructor(t,e,n,s=null){if(Ns.set(this,void 0),t!==Is)throw new Error("private constructor");r(this,{_typedSymbol:Bs,type:e,value:n}),xs(this,Ns,s,"f"),this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((t=>t.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return"bytes"===this.type.substring(0,5)}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return Os(this,Ns,"f")}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===Os(this,Ns,"f")?-1:!1===Os(this,Ns,"f")?this.value.length:null}static from(t,e){return new _s(Is,t,e)}static uint8(t){return Ss(t,8)}static uint16(t){return Ss(t,16)}static uint24(t){return Ss(t,24)}static uint32(t){return Ss(t,32)}static uint40(t){return Ss(t,40)}static uint48(t){return Ss(t,46)}static uint56(t){return Ss(t,56)}static uint64(t){return Ss(t,64)}static uint72(t){return Ss(t,72)}static uint80(t){return Ss(t,80)}static uint88(t){return Ss(t,88)}static uint96(t){return Ss(t,96)}static uint104(t){return Ss(t,104)}static uint112(t){return Ss(t,112)}static uint120(t){return Ss(t,120)}static uint128(t){return Ss(t,128)}static uint136(t){return Ss(t,136)}static uint144(t){return Ss(t,144)}static uint152(t){return Ss(t,152)}static uint160(t){return Ss(t,160)}static uint168(t){return Ss(t,168)}static uint176(t){return Ss(t,176)}static uint184(t){return Ss(t,184)}static uint192(t){return Ss(t,192)}static uint200(t){return Ss(t,200)}static uint208(t){return Ss(t,208)}static uint216(t){return Ss(t,216)}static uint224(t){return Ss(t,224)}static uint232(t){return Ss(t,232)}static uint240(t){return Ss(t,240)}static uint248(t){return Ss(t,248)}static uint256(t){return Ss(t,256)}static uint(t){return Ss(t,256)}static int8(t){return Ss(t,-8)}static int16(t){return Ss(t,-16)}static int24(t){return Ss(t,-24)}static int32(t){return Ss(t,-32)}static int40(t){return Ss(t,-40)}static int48(t){return Ss(t,-46)}static int56(t){return Ss(t,-56)}static int64(t){return Ss(t,-64)}static int72(t){return Ss(t,-72)}static int80(t){return Ss(t,-80)}static int88(t){return Ss(t,-88)}static int96(t){return Ss(t,-96)}static int104(t){return Ss(t,-104)}static int112(t){return Ss(t,-112)}static int120(t){return Ss(t,-120)}static int128(t){return Ss(t,-128)}static int136(t){return Ss(t,-136)}static int144(t){return Ss(t,-144)}static int152(t){return Ss(t,-152)}static int160(t){return Ss(t,-160)}static int168(t){return Ss(t,-168)}static int176(t){return Ss(t,-176)}static int184(t){return Ss(t,-184)}static int192(t){return Ss(t,-192)}static int200(t){return Ss(t,-200)}static int208(t){return Ss(t,-208)}static int216(t){return Ss(t,-216)}static int224(t){return Ss(t,-224)}static int232(t){return Ss(t,-232)}static int240(t){return Ss(t,-240)}static int248(t){return Ss(t,-248)}static int256(t){return Ss(t,-256)}static int(t){return Ss(t,-256)}static bytes(t){return Rs(t)}static bytes1(t){return Rs(t,1)}static bytes2(t){return Rs(t,2)}static bytes3(t){return Rs(t,3)}static bytes4(t){return Rs(t,4)}static bytes5(t){return Rs(t,5)}static bytes6(t){return Rs(t,6)}static bytes7(t){return Rs(t,7)}static bytes8(t){return Rs(t,8)}static bytes9(t){return Rs(t,9)}static bytes10(t){return Rs(t,10)}static bytes11(t){return Rs(t,11)}static bytes12(t){return Rs(t,12)}static bytes13(t){return Rs(t,13)}static bytes14(t){return Rs(t,14)}static bytes15(t){return Rs(t,15)}static bytes16(t){return Rs(t,16)}static bytes17(t){return Rs(t,17)}static bytes18(t){return Rs(t,18)}static bytes19(t){return Rs(t,19)}static bytes20(t){return Rs(t,20)}static bytes21(t){return Rs(t,21)}static bytes22(t){return Rs(t,22)}static bytes23(t){return Rs(t,23)}static bytes24(t){return Rs(t,24)}static bytes25(t){return Rs(t,25)}static bytes26(t){return Rs(t,26)}static bytes27(t){return Rs(t,27)}static bytes28(t){return Rs(t,28)}static bytes29(t){return Rs(t,29)}static bytes30(t){return Rs(t,30)}static bytes31(t){return Rs(t,31)}static bytes32(t){return Rs(t,32)}static address(t){return new _s(Is,"address",t)}static bool(t){return new _s(Is,"bool",!!t)}static string(t){return new _s(Is,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new _s(Is,"overrides",Object.assign({},t))}static isTyped(t){return t&&t._typedSymbol===Bs}static dereference(t,e){if(_s.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}}Ns=new WeakMap;class Cs extends Ue{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let r=_s.dereference(e,"string");try{r=us(r)}catch(t){return this._throwError(t.message,e)}return t.writeValue(r)}decode(t){return us(bt(t.readValue(),20))}}class Fs extends Ue{constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}function Us(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let t={};n=e.map((e=>{const n=e.localName;return n||k.throwError("cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:r}),t[n]&&k.throwError("cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:r}),t[n]=!0,r[n]}))}else k.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&k.throwArgumentError("types/value length mismatch","tuple",r);let s=new Le,i=new Le,o=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=i.length;t.encode(i,r);let n=s.writeUpdatableValue();o.push((t=>{n(t+e)}))}else t.encode(s,r)})),o.forEach((t=>{t(s.length)}));let a=t.appendWriter(s);return a+=t.appendWriter(i),a}function Ls(t,e){let r=[],n=[],s=t.subReader(0);return e.forEach((e=>{let i=null;if(e.dynamic){let r=t.readIndex(),n=s.subReader(r);try{i=e.decode(n)}catch(t){if(l(t,"BUFFER_OVERRUN"))throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(l(t,"BUFFER_OVERRUN"))throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}if(null==i)throw new Error("investigate");r.push(i),n.push(e.localName||null)})),Ce.fromItems(r,n)}class Ds extends Ue{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),r(this,{coder:t,length:e})}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;r<this.length;r++)e.push(t);return e}encode(t,e){const r=_s.dereference(e,"array");Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;-1===n&&(n=r.length,t.writeValue(r.length)),k.assertArgumentCount(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let t=0;t<r.length;t++)s.push(this.coder);return Us(t,s,r)}decode(t){let e=this.length;-1===e&&(e=t.readIndex(),32*e>t.dataLength&&k.throwError("insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:32*e,length:t.dataLength}));let r=[];for(let t=0;t<e;t++)r.push(new Fs(this.coder));return Ls(t,r)}}class Ms extends Ue{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const r=_s.dereference(e,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}}class js extends Ue{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=ie(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readIndex(),!0)}}class Gs extends js{constructor(t){super("bytes",t)}decode(t){return le(super.decode(t))}}class $s extends Ue{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),r(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let r=ie(_s.dereference(e,this.type));return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return le(t.readBytes(this.size))}}const zs=new Uint8Array([]);class Ws extends Ue{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes(zs)}decode(t){return t.readBytes(0),null}}const Hs=BigInt(0),Vs=BigInt(1),Ks=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Js extends Ue{constructor(t,e,n){const s=(e?"int":"uint")+8*t;super(s,s,n,!1),r(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let r=k.getBigInt(_s.dereference(e,this.type)),n=Pt(Ks,256);if(this.signed){let t=Pt(n,8*this.size-1);(r>t||r<-(t+Vs))&&this._throwError("value out-of-bounds",e)}else(r<Hs||r>Pt(n,8*this.size))&&this._throwError("value out-of-bounds",e);return r=Pt(kt(r,8*this.size),8*this.size),this.signed&&(r=kt(Tt(r,8*this.size),256)),t.writeValue(r)}decode(t){let e=Pt(t.readValue(),8*this.size);return this.signed&&(e=Tt(e,8*this.size)),e}}const qs=new T("@ethersproject/strings@6.0.0-beta.2");var Xs,Ys;function Zs(t,e,r,n,s){if(t===Ys.BAD_PREFIX||t===Ys.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n<r.length&&r[n]>>6==2;n++)t++;return t}return t===Ys.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(Xs||(Xs={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Ys||(Ys={}));const Qs=Object.freeze({error:function(t,e,r,n,s){return qs.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:Zs,replace:function(t,e,r,n,s){return t===Ys.OVERLONG?(n.push(null!=s?s:-1),0):(n.push(65533),Zs(t,e,r))}});function ti(t,e){null==e&&(e=Qs.error);const r=qs.getBytes(t,"bytes"),n=[];let s=0;for(;s<r.length;){const t=r[s++];if(t>>7==0){n.push(t);continue}let i=null,o=null;if(192==(224&t))i=1,o=127;else if(224==(240&t))i=2,o=2047;else{if(240!=(248&t)){s+=e(128==(192&t)?Ys.UNEXPECTED_CONTINUE:Ys.BAD_PREFIX,s-1,r,n);continue}i=3,o=65535}if(s-1+i>=r.length){s+=e(Ys.OVERRUN,s-1,r,n);continue}let a=t&(1<<8-i-1)-1;for(let t=0;t<i;t++){let t=r[s];if(128!=(192&t)){s+=e(Ys.MISSING_CONTINUE,s,r,n),a=null;break}a=a<<6|63&t,s++}null!==a&&(a>1114111?s+=e(Ys.OUT_OF_RANGE,s-1-i,r,n,a):a>=55296&&a<=57343?s+=e(Ys.UTF16_SURROGATE,s-1-i,r,n,a):a<=o?s+=e(Ys.OVERLONG,s-1-i,r,n,a):n.push(a))}return n}function ei(t,e=Xs.current){e!=Xs.current&&(qs.assertNormalize(e),t=t.normalize(e));let r=[];for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){e++;const s=t.charCodeAt(e);if(e>=t.length||56320!=(64512&s))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&s);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return new Uint8Array(r)}function ri(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function ni(t,e){return'"'+ti(t,e).map((t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?ri(t):ri(55296+((t-=65536)>>10&1023))+ri(56320+(1023&t))})).join("")+'"'}function si(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function ii(t,e){return si(ti(t,e))}function oi(t,e=Xs.current){return ti(ei(t,e))}function ai(t){const e=ei(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return me(e,32)}function ci(t){const e=qs.getBytes(t,"bytes");if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===e[r-1];)r--;return ii(e.slice(0,r))}function li(t,e){const r=e||function(t){return[parseInt(t,16)]};let n=0,s={};return t.split(",").forEach((t=>{let e=t.split(":");n+=parseInt(e[0],16),s[n]=r(e[1])})),s}function ui(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:n,h:e}}))}function hi(t,e){let r=0;for(let n=0;n<e.length;n++){let s=e[n];if(r+=s.l,t>=r&&t<=r+s.h&&(t-r)%(s.d||1)==0){if(s.e&&-1!==s.e.indexOf(t-r))continue;return s}}return null}const fi=ui("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"),di="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),pi=[{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}],wi=li("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"),gi=li("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"),mi=li("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(t){if(t.length%4!=0)throw new Error("should not happen; bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),yi=ui("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function bi(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=oi(t);var r;r=e.map((t=>{if(di.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){const e=hi(t,pi);if(e){if(null==e.s)throw new Error("should not happenl bad range");return[t+e.s]}const r=wi[t];if(r)return r;const n=gi[t];return n?[t+n[0]]:mi[t]||null}(t);return e||[t]})),e=r.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=oi(si(e),Xs.NFKC),e.forEach((e=>{hi(e,yi)&&qs.throwArgumentError("STRINGPREP_CONTAINS_PROHIBITED","value",t)})),e.forEach((e=>{hi(e,fi)&&qs.throwArgumentError("STRINGPREP_CONTAINS_UNASSIGNED","value",t)}));let n=si(e);return"-"!==n.substring(0,1)&&"--"!==n.substring(2,4)&&"-"!==n.substring(n.length-1)||qs.throwArgumentError("invalid hyphen","value",t),n.length>63&&qs.throwArgumentError("too long","value",t),n}class vi extends js{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,ei(_s.dereference(e,"string")))}decode(t){return ii(super.decode(t))}}class Ei extends Ue{constructor(t,e){let n=!1;const s=[];t.forEach((t=>{t.dynamic&&(n=!0),s.push(t.type)}));super("tuple","tuple("+s.join(",")+")",e,n),r(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach(((r,n)=>{let s=r.localName;s&&1===e[s]&&("length"===s&&(s="_length"),null==t[s]&&(t[s]=t[n]))})),Object.freeze(t)}encode(t,e){const r=_s.dereference(e,"tuple");return Us(t,this.coders,r)}decode(t){return Ls(t,this.coders)}}var Ai,Ti,ki=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Pi=new RegExp(/^bytes([0-9]*)$/),Ni=new RegExp(/^(u?int)([0-9]*)$/);Ai=new WeakSet,Ti=function t(e){if(e.isArray())return new Ds(ki(this,Ai,"m",t).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Ei(e.components.map((e=>ki(this,Ai,"m",t).call(this,e))),e.name);switch(e.baseType){case"address":return new Cs(e.name);case"bool":return new Ms(e.name);case"string":return new vi(e.name);case"bytes":return new Gs(e.name);case"":return new Ws(e.name)}let r=e.type.match(Ni);if(r){let t=parseInt(r[2]||"256");return(0===t||t>256||t%8!=0)&&k.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Js(t/8,"int"===r[1],e.name)}if(r=e.type.match(Pi),r){let t=parseInt(r[1]);return(0===t||t>32)&&k.throwArgumentError("invalid bytes length","param",e),new $s(t,e.name)}return k.throwArgumentError("invalid type","type",e.type)};const xi=new class{constructor(){Ai.add(this)}getDefaultValue(t){const e=t.map((t=>ki(this,Ai,"m",Ti).call(this,it.from(t))));return new Ei(e,"_").defaultValue()}encode(t,e){k.assertArgumentCount(e.length,t.length,"types/values length mismatch");const r=t.map((t=>ki(this,Ai,"m",Ti).call(this,it.from(t)))),n=new Ei(r,"_"),s=new Le;return n.encode(s,e),s.data}decode(t,e,r){const n=t.map((t=>ki(this,Ai,"m",Ti).call(this,it.from(t))));return new Ei(n,"_").decode(new De(e,r))}};function Oi(t){return an(ei(t))}const Ii=new T("@ethersproject/hash@6.0.0-beta.7"),Si=new Uint8Array(32);Si.fill(0);const Ri=new RegExp("^((.*)\\.)?([^.]+)$");function Bi(t){try{const e=t.split(".");for(let t=0;t<e.length;t++)if(0===bi(e[t]).length)throw new Error("empty");return!0}catch(t){}return!1}function _i(t){"string"!=typeof t&&Ii.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Si;for(;e.length;){const n=e.match(Ri);if(null==n||""===n[2])return Ii.throwArgumentError("invalid ENS name; missing component","name",t);r=an(he([r,an(ei(bi(n[3])))])),e=n[2]||""}return le(r)}function Ci(t){return"string"!=typeof t&&Ii.throwArgumentError("invalid DNS name; not a string","name",t),""===t?"0x00":he(t.split(".").map((e=>{""===e&&Ii.throwArgumentError("invalid DNS name; missing component","name",t);const r=ei("_"+bi(e));return r[0]=r.length-1,r})))+"00"}const Fi="Ethereum Signed Message:\n";function Ui(t){return"string"==typeof t&&(t=ei(t)),an(he([ei(Fi),ei(String(t.length)),t]))}const Li=new RegExp("^bytes([0-9]+)$"),Di=new RegExp("^(u?int)([0-9]*)$"),Mi=new RegExp("^(.*)\\[([0-9]*)\\]$");function ji(t,e,r){switch(t){case"address":return r?Ii.getBytes(ge(e,32)):Ii.getBytes(e);case"string":return ei(e);case"bytes":return Ii.getBytes(e);case"bool":return e=e?"0x01":"0x00",r?Ii.getBytes(ge(e,32)):Ii.getBytes(e)}let n=t.match(Di);if(n){let s=parseInt(n[2]||"256");return n[2]&&String(s)!==n[2]||s%8!=0||0===s||s>256?Ii.throwArgumentError("invalid number type","type",t):(r&&(s=256),e=kt(e,s),Ii.getBytes(ge(vt(e),s/8)))}if(n=t.match(Li),n){const s=parseInt(n[1]);return String(s)!==n[1]||0===s||s>32?Ii.throwArgumentError("invalid bytes type","type",t):fe(e)!==s?Ii.throwArgumentError(`invalid value for ${t}`,"value",e):r?Ii.getBytes(me(e,32)):e}if(n=t.match(Mi),n&&Array.isArray(e)){const r=n[1];parseInt(n[2]||String(e.length))!=e.length&&Ii.throwArgumentError(`invalid array length for ${t}`,"value",e);const s=[];return e.forEach((function(t){s.push(ji(r,t,!0))})),Ii.getBytes(he(s))}return Ii.throwArgumentError("invalid type","type",t)}function Gi(t,e){t.length!=e.length&&Ii.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach((function(t,n){r.push(ji(t,e[n]))})),le(he(r))}function $i(t,e){return an(Gi(t,e))}function zi(t,e){return ts(Gi(t,e))}var Wi,Hi,Vi,Ki,Ji,qi=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Xi=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Yi=new Uint8Array(32);Yi.fill(0);const Zi=BigInt(-1),Qi=BigInt(0),to=BigInt(1),eo=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const ro=bt(to,32),no=bt(Qi,32),so={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},io=["name","version","chainId","verifyingContract","salt"];function oo(t){return function(e){return"string"!=typeof e&&Ii.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const ao={name:oo("name"),version:oo("version"),chainId:function(t){return Ii.getBigInt(t,"domain.chainId")},verifyingContract:function(t){try{return us(t).toLowerCase()}catch(t){}return Ii.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ii.getBytes(t,"domain.salt");return 32!==e.length&&Ii.throwArgumentError('invalid domain value "salt"',"domain.salt",t),le(e)}};function co(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&Ii.throwArgumentError("invalid numeric width","type",t);const s=Pt(eo,r?n-1:n),i=r?(s+to)*Zi:Qi;return function(e){const r=Ii.getBigInt(e,"value");return(r<i||r>s)&&Ii.throwArgumentError(`value out-of-bounds for ${t}`,"value",r),bt(kt(r,256),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&Ii.throwArgumentError("invalid bytes width","type",t),function(e){return ie(e).length!==r&&Ii.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=ie(t),r=e.length%32;return r?he([e,Yi.slice(r)]):le(e)}(e)}}}switch(t){case"address":return function(t){return ge(us(t),32)};case"bool":return function(t){return t?ro:no};case"bytes":return function(t){return an(t)};case"string":return function(t){return Oi(t)}}return null}function lo(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class uo{constructor(t){Wi.add(this),Hi.set(this,void 0),Vi.set(this,void 0),Ki.set(this,void 0),qi(this,Hi,JSON.stringify(t),"f"),qi(this,Vi,new Map,"f"),qi(this,Ki,new Map,"f");const e=new Map,n=new Map,s=new Map;Object.keys(t).forEach((t=>{e.set(t,new Set),n.set(t,[]),s.set(t,new Set)}));for(const r in t){const s=new Set;for(const i of t[r]){s.has(i.name)&&Ii.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(r)}`,"types",t),s.add(i.name);const o=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;o===r&&Ii.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t);co(o)||(n.has(o)||Ii.throwArgumentError(`unknown type ${JSON.stringify(o)}`,"types",t),n.get(o).push(r),e.get(r).add(o))}}const i=Array.from(n.keys()).filter((t=>0===n.get(t).length));0===i.length?Ii.throwArgumentError("missing primary type","types",t):i.length>1&&Ii.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),r(this,{primaryType:i[0]}),function r(i,o){o.has(i)&&Ii.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),o.add(i);for(const t of e.get(i))if(n.has(t)){r(t,o);for(const e of o)s.get(e).add(t)}o.delete(i)}(this.primaryType,new Set);for(const[e,r]of s){const n=Array.from(r);n.sort(),Xi(this,Vi,"f").set(e,lo(e,t[e])+n.map((e=>lo(e,t[e]))).join(""))}}get types(){return JSON.parse(Xi(this,Hi,"f"))}getEncoder(t){let e=Xi(this,Ki,"f").get(t);return e||(e=Xi(this,Wi,"m",Ji).call(this,t),Xi(this,Ki,"f").set(t,e)),e}encodeType(t){const e=Xi(this,Vi,"f").get(t);return e||Ii.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t)}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return an(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(co(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],s=parseInt(n[3]);return s>=0&&e.length!==s&&Ii.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const s=this.types[t];return s?s.reduce(((t,{name:n,type:s})=>(t[n]=this._visit(s,e[n],r),t)),{}):Ii.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new uo(t)}static getPrimaryType(t){return uo.from(t).primaryType}static hashStruct(t,e,r){return uo.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=so[r];n||Ii.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>io.indexOf(t.name)-io.indexOf(e.name))),uo.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return he(["0x1901",uo.hashDomain(t),uo.from(e).hash(r)])}static hash(t,e,r){return an(uo.encode(t,e,r))}static async resolveNames(t,e,r,n){t=Object.assign({},t);const s={};t.verifyingContract&&!te(t.verifyingContract,20)&&(s[t.verifyingContract]="0x");const i=uo.from(e);i.visit(r,((t,e)=>("address"!==t||te(e,20)||(s[e]="0x"),e)));for(const t in s)s[t]=await n(t);return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),{domain:t,value:r=i.visit(r,((t,e)=>"address"===t&&s[e]?s[e]:e))}}static getPayload(t,e,r){uo.hashDomain(t);const n={},s=[];io.forEach((e=>{const r=t[e];null!=r&&(n[e]=ao[e](r),s.push({name:e,type:so[e]}))}));const i=uo.from(e),o=Object.assign({},e);return o.EIP712Domain?Ii.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):o.EIP712Domain=s,i.encode(r),{types:o,domain:n,primaryType:i.primaryType,message:i.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return le(Ii.getBytes(e));if(t.match(/^u?int/))return Ii.getBigInt(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Ii.throwArgumentError("invalid string","value",e),e}return Ii.throwArgumentError("unsupported type","type",t)}))}}}Hi=new WeakMap,Vi=new WeakMap,Ki=new WeakMap,Wi=new WeakSet,Ji=function(t){{const e=co(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&Ii.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let s=e.map(r);return Xi(this,Vi,"f").has(t)&&(s=s.map(an)),an(he(s))}}const r=this.types[t];if(r){const e=Oi(Xi(this,Vi,"f").get(t));return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return Xi(this,Vi,"f").has(r)?an(n):n}));return n.unshift(e),he(n)}}return Ii.throwArgumentError(`unknown type: ${t}`,"type",t)};var ho,fo,po,wo,go,mo,yo,bo=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},vo=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Eo{constructor(t,e,n){const s=t.name,i=t.format();r(this,{fragment:t,name:s,signature:i,topic:e,args:n})}}class Ao{constructor(t,e,n,s){const i=t.name,o=t.format();r(this,{fragment:t,name:i,args:n,signature:o,selector:e,value:s})}}class To{constructor(t,e,n){const s=t.name,i=t.format();r(this,{fragment:t,name:s,args:n,signature:i,selector:e})}}class ko{constructor(t){r(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!(!t||!t._isIndexed)}}const Po={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},No={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&Po[t.toString()]&&(e=Po[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};class xo{constructor(t){ho.add(this),fo.set(this,void 0),po.set(this,void 0),wo.set(this,void 0),go.set(this,void 0);let e=[];e="string"==typeof t?JSON.parse(t):t,bo(this,wo,new Map,"f"),bo(this,fo,new Map,"f"),bo(this,po,new Map,"f"),r(this,{fragments:Object.freeze(e.map((t=>at.from(t))).filter((t=>null!=t)))}),bo(this,go,this.getAbiCoder(),"f"),this.fragments.forEach((t=>{let e;switch(t.type){case"constructor":return this.deploy?void k.warn("duplicate definition - constructor"):void r(this,{deploy:t});case"function":e=vo(this,wo,"f");break;case"event":e=vo(this,po,"f");break;case"error":e=vo(this,fo,"f");break;default:return}const n=t.format();e.has(n)?k.warn("duplicate definition - "+n):e.set(n,t)})),this.deploy||r(this,{deploy:ft.fromString("constructor()")})}format(t){t||(t=R.full),t===R.sighash&&k.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===R.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}getAbiCoder(){return xi}getFunctionName(t){return vo(this,ho,"m",mo).call(this,t,null,!1).name}getFunction(t,e){return vo(this,ho,"m",mo).call(this,t,e||null,!0)}getEventName(t){return vo(this,ho,"m",yo).call(this,t,null,!1).name}getEvent(t,e){return vo(this,ho,"m",yo).call(this,t,e||null,!0)}getError(t,e){if(te(t)){const e=t.toLowerCase();for(const t of vo(this,fo,"f").values())if(e===this.getSelector(t))return t;k.throwArgumentError("no matching error","selector",t)}if(-1===t.indexOf("(")){const e=[];for(const[r,n]of vo(this,fo,"f"))r.split("(")[0]===t&&e.push(n);return 0===e.length?k.throwArgumentError("no matching error","name",t):e.length>1&&k.throwArgumentError("multiple matching errors","name",t),e[0]}const r=vo(this,fo,"f").get(ut.fromString(t).format());return r||k.throwArgumentError("no matching error","signature",t)}getSelector(t){return de(Oi(t.format()),0,4)}getEventTopic(t){return Oi(t.format())}_decodeParams(t,e){return vo(this,go,"f").decode(t,e)}_encodeParams(t,e){return vo(this,go,"f").encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),de(e,0,4)!==this.getSelector(t)&&k.throwArgumentError(`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,de(e,4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),he([this.getSelector(t),this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),de(e,0,4)!==this.getSelector(t)&&k.throwArgumentError(`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,de(e,4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),he([this.getSelector(t),this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r="invalid length for result data";const n=ie(e);if(n.length%32==0)try{return vo(this,go,"f").decode(t.outputs,n)}catch(t){r="could not decode result data"}return k.throwError(r,"BAD_DATA",{value:le(n),info:{method:t.name,signature:t.format()}})}makeError(t,e,r){"string"==typeof t&&(t=this.getFunction(t));const n=k.getBytes(e);let s,i,o,a;if(r)try{s=vo(this,go,"f").decode(t.inputs,r.data||"0x")}catch(t){console.log(t)}let c="unknown reason";if(0===n.length)c="missing error reason";else if(n.length%32==4){const t=le(n.slice(0,4)),e=No[t];if(e)try{o=e.name,a=e.signature,i=vo(this,go,"f").decode(e.inputs,n.slice(4)),c=e.reason(...i)}catch(t){console.log(t)}else{c="unknown custom error";try{const e=this.getError(t);o=e.name,a=e.format(),c=`custom error: ${a}`;try{i=vo(this,go,"f").decode(e.inputs,n.slice(4))}catch(t){c=`custom error: ${a} (coult not decode error data)`}}catch(t){console.log(t)}}}return k.makeError("call revert exception","CALL_EXCEPTION",{data:le(n),transaction:null,method:t.name,signature:t.format(),args:s,errorArgs:i,errorName:o,errorSignature:a,reason:c})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),le(vo(this,go,"f").encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&k.throwError("too many arguments for "+t.format(),"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});const r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?Oi(e):"bytes"===t.type?an(le(e)):("address"===t.type&&vo(this,go,"f").encode(["address"],[e]),ge(le(e),32));for(e.forEach(((e,s)=>{const i=t.inputs[s];i.indexed?null==e?r.push(null):"array"===i.baseType||"tuple"===i.baseType?k.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,e):Array.isArray(e)?r.push(e.map((t=>n(i,t)))):r.push(n(i,e)):null!=e&&k.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,e)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const r=[],n=[],s=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&k.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,i)=>{const o=e[i];if(t.indexed)if("string"===t.type)r.push(Oi(o));else if("bytes"===t.type)r.push(an(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(vo(this,go,"f").encode([t.type],[o]))}else n.push(t),s.push(o)})),{data:vo(this,go,"f").encode(n,s),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){const e=this.getEventTopic(t);te(r[0],32)&&r[0].toLowerCase()===e||k.throwArgumentError("fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const n=[],s=[],i=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(n.push(it.fromObject({type:"bytes32",name:t.name})),i.push(!0)):(n.push(t),i.push(!1)):(s.push(t),i.push(!1))}));const o=null!=r?vo(this,go,"f").decode(n,he(r)):null,a=vo(this,go,"f").decode(s,e,!0),c=[],l=[];let u=0,h=0;return t.inputs.forEach(((t,e)=>{let r=null;if(t.indexed)if(null==o)r=new ko(null);else if(i[e])r=new ko(o[h++]);else try{r=o[h++]}catch(t){r=t}else try{r=a[u++]}catch(t){r=t}c.push(r),l.push(t.name||null)})),Ce.fromItems(c,l)}parseTransaction(t){const e=k.getBytes(t.data,"tx.data"),r=k.getBigInt(null!=t.value?t.value:0,"tx.value"),n=this.getFunction(le(e.slice(0,4)));if(!n)return null;const s=vo(this,go,"f").decode(n.inputs,e.slice(4));return new Ao(n,this.getSelector(n),s,r)}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Eo(e,this.getEventTopic(e),this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=le(t),r=this.getError(de(e,0,4));if(!r)return null;const n=vo(this,go,"f").decode(r.inputs,de(e,4));return new To(r,this.getSelector(r),n)}static from(t){return t instanceof xo?t:"string"==typeof t?new xo(JSON.parse(t)):"function"==typeof t.format?new xo(t.format(R.json)):new xo(t)}}fo=new WeakMap,po=new WeakMap,wo=new WeakMap,go=new WeakMap,ho=new WeakSet,mo=function(t,e,r){if(te(t)){const e=t.toLowerCase();for(const t of vo(this,wo,"f").values())if(e===this.getSelector(t))return t;k.throwArgumentError("no matching function","selector",t)}if(-1===t.indexOf("(")){const n=[];for(const[e,r]of vo(this,wo,"f"))e.split("(")[0]===t&&n.push(r);if(e){const t=e.length>0?e[e.length-1]:null;let r=e.length,s=!0;_s.isTyped(t)&&"overrides"===t.type&&(s=!1,r--);for(let t=n.length-1;t>=0;t--){const e=n[t].inputs.length;e===r||s&&e===r-1||n.splice(t,1)}for(let t=n.length-1;t>=0;t--){const r=n[t].inputs;for(let s=0;s<e.length;s++)if(_s.isTyped(e[s])){if(s>=r.length){if("overrides"===e[s].type)continue;n.splice(t,1);break}if(e[s].type!==r[s].baseType){n.splice(t,1);break}}}}if(1===n.length&&e&&e.length!==n[0].inputs.length){const t=e[e.length-1];(null==t||Array.isArray(t)||"object"!=typeof t)&&n.splice(0,1)}if(0===n.length)k.throwArgumentError("no matching function","name",t);else if(n.length>1&&r){const e=n.map((t=>JSON.stringify(t.format()))).join(", ");k.throwArgumentError(`multiple matching functions (i.e. ${e})`,"name",t)}return n[0]}const n=vo(this,wo,"f").get(dt.fromString(t).format());return n||k.throwArgumentError("no matching function","signature",t)},yo=function(t,e,r){if(te(t)){const e=t.toLowerCase();for(const t of vo(this,po,"f").values())if(e===this.getEventTopic(t))return t;k.throwArgumentError("no matching event","eventTopic",t)}if(-1===t.indexOf("(")){const n=[];for(const[e,r]of vo(this,po,"f"))e.split("(")[0]===t&&n.push(r);if(e){for(let t=n.length-1;t>=0;t--)n[t].inputs.length<e.length&&n.splice(t,1);for(let t=n.length-1;t>=0;t--){const r=n[t].inputs;for(let s=0;s<e.length;s++)if(_s.isTyped(e[s])&&e[s].type!==r[s].baseType){n.splice(t,1);break}}}return 0===n.length?k.throwArgumentError("no matching event","name",t):n.length>1&&r&&k.throwArgumentError("multiple matching events","name",t),n[0]}const n=vo(this,po,"f").get(ht.fromString(t).format());return n||k.throwArgumentError("no matching event","signature",t)};const Oo=new T("@ethersproject/web@6.0.0-beta.6");var Io,So,Ro=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Bo=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _o{constructor(t,e,r,n,s){Io.set(this,void 0),So.set(this,void 0),Ro(this,Io,{statusCode:t,statusMessage:e,headers:Object.freeze(Object.assign({},Object.keys(r).reduce(((t,e)=>(t[e.toLowerCase()]=r[e],t)),{}))),body:null==n?null:new Uint8Array(n),request:s||null},"f"),Ro(this,So,{message:""},"f")}toString(){const t=a(Bo(this,Io,"f"),"body");return`<Response status=${this.statusCode} body=${t?le(t):"null"}>`}get statusCode(){return a(Bo(this,Io,"f"),"statusCode")}get statusMessage(){return a(Bo(this,Io,"f"),"statusMessage")}get headers(){return a(Bo(this,Io,"f"),"headers")}get body(){const t=a(Bo(this,Io,"f"),"body");return null==t?null:new Uint8Array(t)}get bodyText(){try{const t=a(Bo(this,Io,"f"),"body");return null==t?"":ii(t)}catch(t){return Oo.throwError("response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(t){return Oo.throwError("response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[(Io=new WeakMap,So=new WeakMap,Symbol.iterator)](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const n=e[r++];return{value:[n,t[n]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(t,e){let r;r=t?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:`CLIENT ESCALATED SERVER ERROR (${t=`${this.statusCode} ${this.statusMessage}`})`;const n=new _o(599,r,this.headers,this.body,a(Bo(this,Io,"f"),"request")||void 0);return Ro(n,So,{message:t,error:e},"f"),n}throwThrottleError(t,e){null==e&&(e=1e3),("number"!=typeof e||!Number.isInteger(e)||e<0)&&Oo.throwArgumentError("invalid stall timeout","stall",e);const n=new Error(t||"throttling requests");throw r(n,{stall:e,throttle:!0}),n}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return null!=a(Bo(this,Io,"f"),"body")}get request(){return a(Bo(this,Io,"f"),"request")}ok(){return""===Bo(this,So,"f").message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:e}=Bo(this,So,"f");""===t&&(t=`server response ${this.statusCode} ${this.statusMessage}`),Oo.throwError(t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:e})}}async function Co(t,e){const r=t.url.split(":")[0].toLowerCase();"http"!==r&&"https"!==r&&Oo.throwError(`unsupported protocol ${r}`,"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),t.credentials&&!t.allowInsecureAuthentication&&Oo.throwError("insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});const n={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0},s=await fetch(t.url,n),i={};s.headers.forEach(((t,e)=>{i[e.toLowerCase()]=t}));const o=new Uint8Array(await s.arrayBuffer());return new _o(s.status,s.statusText,i,o,t)}var Fo,Uo=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Lo=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function Do(t,e,r){if(typeof t!==e)throw new Error(`invalid ${r}`);return t}class Mo{constructor(t){Fo.set(this,void 0),Uo(this,Fo,{allowInsecure:!1,gzip:!1,headers:{},method:"",timeout:300,url:Do(t,"string","url")},"f")}get url(){return a(Lo(this,Fo,"f"),"url")}set url(t){c(Lo(this,Fo,"f"),"url",Do(t,"string","url"))}get body(){const t=a(Lo(this,Fo,"f"),"body");return null==t?null:this.isFrozen()?new Uint8Array(t):t}set body(t){if(null==t)c(Lo(this,Fo,"f"),"body",void 0),c(Lo(this,Fo,"f"),"bodyType",void 0);else if("string"==typeof t)c(Lo(this,Fo,"f"),"body",ei(t)),c(Lo(this,Fo,"f"),"bodyType","text/plain");else if(t instanceof Uint8Array)c(Lo(this,Fo,"f"),"body",t),c(Lo(this,Fo,"f"),"bodyType","application/octet-stream");else{if("object"!=typeof t)throw new Error("invalid body");c(Lo(this,Fo,"f"),"body",ei(JSON.stringify(t))),c(Lo(this,Fo,"f"),"bodyType","application/json")}}hasBody(){return null!=a(Lo(this,Fo,"f"),"body")}get method(){const t=a(Lo(this,Fo,"f"),"method");return t?t.toUpperCase():this.body?"POST":"GET"}set method(t){null==t&&(t=""),c(Lo(this,Fo,"f"),"method",Do(t,"string","method"))}get headers(){const t=Object.assign({},a(Lo(this,Fo,"f"),"headers")),e=a(Lo(this,Fo,"f"),"bodyType");return this.credentials,this.allowGzip&&(t["accept-encoding"]="gzip"),null==t["content-type"]&&e&&(t["content-type"]=e),this.body&&(t["content-length"]=String(this.body.length)),Object.freeze(t)}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,e){const r=a(Lo(this,Fo,"f"),"headers");c(Lo(this,Fo,"f"),"headers",r),r[Do(t,"string","key").toLowerCase()]=String(e)}clearHeaders(){c(Lo(this,Fo,"f"),"headers",{})}[(Fo=new WeakMap,Symbol.iterator)](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const n=e[r++];return{value:[n,t[n]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return a(Lo(this,Fo,"f"),"creds")||null}setCredentials(t,e){t.match(/:/)&&Oo.throwArgumentError("invalid basic authentication username","username","[REDACTED]"),c(Lo(this,Fo,"f"),"creds",`${t}:${e}`)}get allowGzip(){return a(Lo(this,Fo,"f"),"gzip")}set allowGzip(t){c(Lo(this,Fo,"f"),"gzip",!!t)}get allowInsecureAuthentication(){return!!a(Lo(this,Fo,"f"),"allowInsecure")}set allowInsecureAuthentication(t){c(Lo(this,Fo,"f"),"allowInsecure",Do(t,"boolean","allowInsecureAuthentication"))}get timeout(){return a(Lo(this,Fo,"f"),"timeout")}set timeout(t){if((t=Do(t,"number","timeout"))<=0)throw new Error("invalid timerout");c(Lo(this,Fo,"f"),"timeout",t)}redirect(t){const e=this.url.split(":")[0].toLowerCase(),r=t.split(":")[0].toLowerCase();if("GET"!==this.method||"https"===e&&"http"===r||!t.match(/^https?:/))return Oo.throwError("unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});const n=new Mo(t);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,c(Lo(n,Fo,"f"),"body",a(Lo(this,Fo,"f"),"body")),c(Lo(n,Fo,"f"),"headers",Object.assign({},a(Lo(this,Fo,"f"),"headers"))),c(Lo(n,Fo,"f"),"bodyType",a(Lo(this,Fo,"f"),"bodyType")),n}clone(){const t=new Mo(this.url);c(Lo(t,Fo,"f"),"method",a(Lo(this,Fo,"f"),"method"));const e=a(Lo(this,Fo,"f"),"body");return c(Lo(t,Fo,"f"),"body",null==e?void 0:new Uint8Array(e)),c(Lo(t,Fo,"f"),"bodyType",a(Lo(this,Fo,"f"),"bodyType")),c(Lo(t,Fo,"f"),"headers",Object.assign({},a(Lo(this,Fo,"f"),"headers"))),c(Lo(t,Fo,"f"),"creds",a(Lo(this,Fo,"f"),"creds")),this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),t}freeze(){const t=a(Lo(this,Fo,"f"),"body");return null!=t&&c(Lo(this,Fo,"f"),"body",new Uint8Array(t)),Object.freeze(Lo(this,Fo,"f").headers),Object.freeze(Lo(this,Fo,"f")),this}isFrozen(){return Object.isFrozen(Lo(this,Fo,"f"))}}async function jo(t){return new Promise((e=>{setTimeout(e,t)}))}function Go(){return(new Date).getTime()}let $o=!1;async function zo(t){const e="string"==typeof t?{request:new Mo(t)}:t instanceof Mo?{request:t}:Object.assign({},t);if(null==e.request)return Oo.throwArgumentError("missing request","connection",t);let r=e.request.clone().freeze();switch(e.request.url.split(":")[0]){case"data":{const t=r.url.match(/^data:([^;:]*)?(;base64)?,(.*)$/i);if(t)try{const e={"content-type":t[1]?t[1]:"text/plain"},n=t[2]?ae(t[3]):ei(t[3].replace(/%([0-9a-f][0-9a-f])/gi,((t,e)=>String.fromCharCode(parseInt(e,16)))));return new _o(200,"OK",e,n,r.clone())}catch(t){return new _o(400,"BAD REQUEST (invalid base64 encoded data)",{},null,r.clone())}return new _o(500,"INTERNAL SERVER ERROR (unsupported dara URI)",{},null,r.clone())}case"ipfs":case"ipns":case"ar":throw new Error("not implemented yet");case"http":case"https":break;default:throw new Error("unsupported scheme")}const n=null!=e.throttleLimit?e.throttleLimit:12;if(!Number.isInteger(n)||n<1)return Oo.throwArgumentError("invalid throttleLimit","connection",t);const s=null!=e.throttleSlotInterval?e.throttleSlotInterval:100;if(!Number.isInteger(s)||n<0)return Oo.throwArgumentError("invalid throttleSlotInterval","connection",t);const i=null!=e.throttleRetry?e.throttleRetry:null;if(i&&"function"!=typeof i)return Oo.throwArgumentError("invalid throttleRetry callback","connection",t);const o=e.preflightRequest||null;if(o&&"function"!=typeof o)return Oo.throwArgumentError("invalid preflightRequest callback","connection",t);const a=e.processResponse||null;if(a&&"function"!=typeof a)return Oo.throwArgumentError("invalid processResponse callback","connection",t);const c=Go();let l=null;for(let t=0;t<n;t++){let e=r.clone();o&&(e=(await o(e.freeze())).clone());if(Go()-c<0)return Oo.throwError("timeout","TIMEOUT",{operation:"request",reason:"timeout",request:e});if(l=await Co(e),t<n){if(301===l.statusCode||302===l.statusCode){try{r=e.redirect(l.headers.location||"");continue}catch(t){}return l}if(429===l.statusCode&&(null==i||await i(e.freeze(),l,t))){const e=l.headers["retry-after"];"string"==typeof e&&e.match(/^[1-9][0-9]*$/)?await jo(parseInt(e)):await jo(s*Math.trunc(Math.random()*Math.pow(2,t)));continue}}if(a)try{return await a(e,l)}catch(e){if(e.throttle&&"number"==typeof e.stall){if(t<n){await jo(e.stall);continue}return l.makeServerError("exceeded maximum retry limit",e)}l.makeServerError("error in post-processing function",e).assertOk()}return l}return l.makeServerError("exceeded maximum retry limit")}zo.lock=function(){$o=!0},zo.setGateway=function(t){},zo.setIpfsGateway=function(t){$o&&Oo.throwError("gateways are locked","UNSUPPORTED_OPERATION",{operation:"setIpfsGateway"})},zo.setArGateway=function(t){$o&&Oo.throwError("gateways are locked","UNSUPPORTED_OPERATION",{operation:"setArGateway"})};const Wo=new T("@ethersproject/providers@6.0.0-beta.8");var Ho,Vo,Ko,Jo=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},qo=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Xo=BigInt(1),Yo=new Uint8Array([]),Zo="0x0000000000000000000000000000000000000000000000000000000000000000";function Qo(t,e){if("0x"===t)return null;const r=yt(de(t,e,e+32)),n=yt(de(t,r,r+32));return de(t,r+32,r+32+n)}function ta(t,e){try{const r=Qo(t,e);if(null!=r)return ii(r)}catch(t){}return null}function ea(t){const e=vt(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function ra(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function na(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(Yo),r+=32;for(let n=0;n<t.length;n++){const s=Wo.getBytes(t[n]);e[n]=ea(r),e.push(ea(s.length)),e.push(ra(s)),r+=32+32*Math.ceil(s.length/32)}return he(e)}function sa(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Wo.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class ia{constructor(t){r(this,{name:t})}validate(t){return this}supportsCoinType(t){return!1}async encodeAddress(t,e){throw new Error("unsupported coin")}async decodeAddress(t,e){throw new Error("unsupported coin")}}const oa=new RegExp("^(ipfs)://(.*)$","i"),aa=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),oa,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class ca{constructor(t,e,n){Vo.set(this,void 0),r(this,{provider:t,address:e,name:n}),Jo(this,Vo,null,"f")}async supportsWildcard(){return qo(this,Vo,"f")||Jo(this,Vo,this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>Wo.getBigInt(t)===Xo)).catch((t=>{if("CALL_EXCEPTION"===t.code)return!1;throw Jo(this,Vo,null,"f"),t})),"f"),await qo(this,Vo,"f")}async _fetch(t,e="0x"){const r=he([t,_i(this.name),e]),n={to:this.address,enableCcipRead:!0,data:r};let s=!1;await this.supportsWildcard()&&(s=!0,n.data=he(["0x9061b923",na([Ci(this.name),r])]));try{let t=await this.provider.call(n);return Wo.getBytes(t).length%32==4?Wo.throwError("resolver threw error","CALL_EXCEPTION",{transaction:n,data:t}):s?Qo(t,0):t}catch(t){if("CALL_EXCEPTION"!==t.code)throw t}return null}async getAddress(t=60){if(60===t)try{const t=await this._fetch("0x3b3b57de");if("0x"===t||t===Zo)return null;return(await this.provider.getNetwork()).formatter.callAddress(t)}catch(t){if("CALL_EXCEPTION"===t.code)return null;throw t}let e=null;for(const r of this.provider.plugins)if(r instanceof ia&&r.supportsCoinType(t)){e=r;break}if(null==e)return null;const r=Qo(await this._fetch("0xf1cb7e06",ea(t))||"0x",0);if(null==r||"0x"===r)return null;const n=await e.encodeAddress(t,r);return null!=n?n:Wo.throwError("invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){let e=ei(t);const r=Wo.getBytes(he([ea(64),ea(e.length),e])),n=Qo(await this._fetch("0x59d1d43c",ra(r))||"0x",0);return null==n||"0x"===n?null:ii(n)}async getContentHash(){const t=Qo(await this._fetch("0xbc1c58d1")||"0x",0);if(null==t||"0x"===t)return null;const e=t.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t="e3010170"===e[1]?"ipfs":"ipns",r=parseInt(e[4],16);if(e[5].length===2*r)return`${t}://${Kt("0x"+e[2])}`}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);return r&&64===r[1].length?`bzz://${r[1]}`:Wo.throwError("invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:t}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const t=[{type:"name",value:this.name}];try{const e=await this.getText("avatar");if(null==e)throw t.push({type:"!avatar",value:""}),new Error("!avatar");t.push({type:"avatar",value:e});for(let r=0;r<aa.length;r++){const n=e.match(aa[r]);if(null==n)continue;const s=n[1].toLowerCase();switch(s){case"https":case"data":return t.push({type:"url",value:e}),{linkage:t,url:e};case"ipfs":{const r=sa(e);return t.push({type:"ipfs",value:e}),t.push({type:"url",value:r}),{linkage:t,url:r}}case"erc721":case"erc1155":{const r="erc721"===s?"0xc87b56dd":"0x0e89341c";t.push({type:s,value:e});const i=await this.getAddress();if(null==i)throw t.push({type:"!owner",value:""}),new Error("!owner");const o=(n[2]||"").split("/");if(2!==o.length)throw t.push({type:`!${s}caip`,value:n[2]||""}),new Error("!caip");const a=(await this.provider.getNetwork()).formatter,c=a.address(o[0]),l=ea(o[1]);if("erc721"===s){const e=a.callAddress(await this.provider.call({to:c,data:he(["0x6352211e",l])}));if(i!==e)throw t.push({type:"!owner",value:e}),new Error("!owner");t.push({type:"owner",value:e})}else if("erc1155"===s){const e=Wo.getBigInt(await this.provider.call({to:c,data:he(["0x00fdd58e",ge(i,32),l])}));if(!e)throw t.push({type:"!balance",value:"0"}),new Error("!balance");t.push({type:"balance",value:e.toString()})}const u={to:o[0],data:he([r,l])};let h=ta(await this.provider.call(u),0);if(null==h)throw t.push({type:"!metadata-url",value:""}),new Error("!metadata-url");t.push({type:"metadata-url-base",value:h}),"erc1155"===s&&(h=h.replace("{id}",le(l).substring(2)),t.push({type:"metadata-url-expanded",value:h})),h.match(/^ipfs:/i)&&(h=sa(h)),t.push({type:"metadata-url",value:h});let f={};const d=await zo(h);d.assertOk();try{f=d.bodyJson}catch(e){try{t.push({type:"!metadata",value:d.bodyText})}catch(e){const r=d.body;throw r&&t.push({type:"!metadata",value:le(r)}),e}throw e}if(!f)throw t.push({type:"!metadata",value:""}),new Error("!metadata");t.push({type:"metadata",value:JSON.stringify(f)});let p=f.image;if("string"!=typeof p)throw t.push({type:"!imageUrl",value:""}),new Error("!imageUrl");if(p.match(/^(https:\/\/|data:)/i));else{if(null==p.match(oa))throw t.push({type:"!imageUrl-ipfs",value:p}),new Error("!imageUrl-ipfs");t.push({type:"imageUrl-ipfs",value:p}),p=sa(p)}return t.push({type:"url",value:p}),{linkage:t,url:p}}}}}catch(t){console.log("EE",t)}return{linkage:t,url:null}}static async fromName(t,e){let r=e;for(;;){if(""===r||"."===r)return null;if("eth"!==e&&"eth"===r)return null;const n=await qo(ca,Ho,"m",Ko).call(ca,t,r);if(null!=n){const s=new ca(t,n,e);return r===e||await s.supportsWildcard()?s:null}r=r.split(".").slice(1).join(".")}}}Ho=ca,Vo=new WeakMap,Ko=async function(t,e){const r=await t.getNetwork(),n=r.getPlugin("org.ethers.plugins.ens");if(!n)return Wo.throwError("network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getResolver",info:{network:r.name}});try{const s=await t.call({to:n.address,data:he(["0x0178b8bf",_i(e)]),enableCcipRead:!0}),i=r.formatter.callAddress(s);return i===de(Zo,0,20)?null:i}catch(t){throw t}return null};const la=new T("@ethersproject/signing-key@6.0.0-beta.2");var ua,ha=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},fa=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const da=BigInt(0),pa=BigInt(1),wa=BigInt(2),ga=BigInt(27),ma=BigInt(28),ya=BigInt(35),ba={},va="0x0000000000000000000000000000000000000000000000000000000000000000";class Ea{constructor(t,e,r,n){ua.set(this,void 0),la.assertPrivate(t,ba,"Signature"),ha(this,ua,{r:e,s:r,v:n,networkV:null},"f")}get r(){return a(fa(this,ua,"f"),"r")}set r(t){32!==fe(t)&&la.throwArgumentError("invalid r","value",t),c(fa(this,ua,"f"),"r",le(t))}get s(){return a(fa(this,ua,"f"),"s")}set s(t){32!==fe(t)?la.throwArgumentError("invalid r","value",t):128&la.getBytes(t)[0]&&la.throwArgumentError("non-canonical s","value",t),c(fa(this,ua,"f"),"s",le(t))}get v(){return a(fa(this,ua,"f"),"v")}set v(t){const e=la.getNumber(t,"value");if(27!==e&&28!==e)throw new Error("@TODO");c(fa(this,ua,"f"),"v",e)}get networkV(){return a(fa(this,ua,"f"),"networkV")}get legacyChainId(){const t=this.networkV;return null==t?null:Ea.getChainId(t)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const t=la.getBytes(this.s);return this.yParity&&(t[0]|=128),le(t)}get compactSerialized(){return he([this.r,this.yParityAndS])}get serialized(){return he([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[(ua=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const t=new Ea(ba,this.r,this.s,this.v);return this.networkV&&c(fa(t,ua,"f"),"networkV",this.networkV),t}freeze(){return Object.freeze(fa(this,ua,"f")),this}isFrozen(){return Object.isFrozen(fa(this,ua,"f"))}toJSON(){const t=this.networkV;return{_type:"signature",networkV:null!=t?t.toString():null,r:this.r,s:this.s,v:this.v}}static create(){return new Ea(ba,va,va,27)}static getChainId(t){const e=la.getBigInt(t,"v");return e==ga||e==ma?da:(e<ya&&la.throwArgumentError("invalid EIP-155 v","v",t),(e-ya)/wa)}static getChainIdV(t,e){return la.getBigInt(t)*wa+BigInt(35+e-27)}static getNormalizedV(t){const e=la.getBigInt(t);return e==da?27:e==pa?28:e&pa?27:28}static from(t){const e=e=>la.throwArgumentError(e,"signature",t);if("string"==typeof t){const r=la.getBytes(t,"signature");if(64===r.length){const t=le(r.slice(0,32)),e=r.slice(32,64),n=128&e[0]?28:27;return e[0]&=127,new Ea(ba,t,le(e),n)}if(65!==fe(t)){const n=le(t.slice(0,32)),s=r.slice(32,64);128&s[0]&&e("non-canonical s");const i=Ea.getNormalizedV(r[64]);return new Ea(ba,n,le(s),i)}return e("invlaid raw signature length")}if(t instanceof Ea)return t.clone();const r=t.r;null==r&&e("missing r"),te(r,32)||e("invalid r");const n=function(t,r){if(null!=t)return te(t,32)||e("invalid s"),t;if(null!=r){te(r,32)||e("invalid yParityAndS");const t=la.getBytes(r);return t[0]&=127,le(t)}return e("missing s")}(t.s,t.yParityAndS);128&la.getBytes(n)[0]&&e("non-canonical s");const{networkV:s,v:i}=function(t,r,n){if(null!=t){const e=la.getBigInt(t);return{networkV:e>=ya?e:void 0,v:Ea.getNormalizedV(e)}}if(null!=r)return te(r,32)||e("invalid yParityAndS"),{v:128&la.getBytes(r)[0]?28:27};if(null!=n){switch(n){case 0:return{v:27};case 1:return{v:28}}return e("invalid yParity")}return e("missing v")}(t.v,t.yParityAndS,t.yParity),o=new Ea(ba,r,n,i);return s&&c(fa(o,ua,"f"),"networkV",s),"yParity"in t&&t.yParity!==o.yParity?e("yParity mismatch"):"yParityAndS"in t&&t.yParityAndS!==o.yParityAndS&&e("yParityAndS mismatch"),o}}
|
||
/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const Aa=BigInt(0),Ta=BigInt(1),ka=BigInt(2),Pa=BigInt(3),Na=BigInt(8),xa=ka**BigInt(256),Oa={a:Aa,b:BigInt(7),P:xa-ka**BigInt(32)-BigInt(977),n:xa-BigInt("432420386565659656852420866394968145599"),h:Ta,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function Ia(t){const{a:e,b:r}=Oa,n=Ja(t*t),s=Ja(n*t);return Ja(s+e*t+r)}const Sa=Oa.a===Aa;class Ra{constructor(t,e,r){this.x=t,this.y=e,this.z=r}static fromAffine(t){if(!(t instanceof _a))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new Ra(t.x,t.y,Ta)}static toAffineBatch(t){const e=function(t,e=Oa.P){const r=new Array(t.length),n=Xa(t.reduce(((t,n,s)=>n===Aa?t:(r[s]=t,Ja(t*n,e))),Ta),e);return t.reduceRight(((t,n,s)=>n===Aa?t:(r[s]=Ja(t*r[s],e),Ja(t*n,e))),n),r}(t.map((t=>t.z)));return t.map(((t,r)=>t.toAffine(e[r])))}static normalizeZ(t){return Ra.toAffineBatch(t).map(Ra.fromAffine)}equals(t){if(!(t instanceof Ra))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:s,y:i,z:o}=t,a=Ja(n**ka),c=Ja(o**ka),l=Ja(e*c),u=Ja(s*a),h=Ja(Ja(r*o)*c),f=Ja(Ja(i*n)*a);return l===u&&h===f}negate(){return new Ra(this.x,Ja(-this.y),this.z)}double(){const{x:t,y:e,z:r}=this,n=Ja(t**ka),s=Ja(e**ka),i=Ja(s**ka),o=Ja(ka*(Ja((t+s)**ka)-n-i)),a=Ja(Pa*n),c=Ja(a**ka),l=Ja(c-ka*o),u=Ja(a*(o-l)-Na*i),h=Ja(ka*e*r);return new Ra(l,u,h)}add(t){if(!(t instanceof Ra))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:s,y:i,z:o}=t;if(s===Aa||i===Aa)return this;if(e===Aa||r===Aa)return t;const a=Ja(n**ka),c=Ja(o**ka),l=Ja(e*c),u=Ja(s*a),h=Ja(Ja(r*o)*c),f=Ja(Ja(i*n)*a),d=Ja(u-l),p=Ja(f-h);if(d===Aa)return p===Aa?this.double():Ra.ZERO;const w=Ja(d**ka),g=Ja(d*w),m=Ja(l*w),y=Ja(p**ka-g-ka*m),b=Ja(p*(m-y)-h*g),v=Ja(n*o*d);return new Ra(y,b,v)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){let e=Ka(t);const r=Ra.ZERO;if(e===Aa)return r;if(e===Ta)return this;if(!Sa){let t=r,n=this;for(;e>Aa;)e&Ta&&(t=t.add(n)),n=n.double(),e>>=Ta;return t}let{k1neg:n,k1:s,k2neg:i,k2:o}=Qa(e),a=r,c=r,l=this;for(;s>Aa||o>Aa;)s&Ta&&(a=a.add(l)),o&Ta&&(c=c.add(l)),l=l.double(),s>>=Ta,o>>=Ta;return n&&(a=a.negate()),i&&(c=c.negate()),c=new Ra(Ja(c.x*Oa.beta),c.y,c.z),a.add(c)}precomputeWindow(t){const e=Sa?128/t+1:256/t+1,r=[];let n=this,s=n;for(let i=0;i<e;i++){s=n,r.push(s);for(let e=1;e<2**(t-1);e++)s=s.add(n),r.push(s);n=s.double()}return r}wNAF(t,e){!e&&this.equals(Ra.BASE)&&(e=_a.BASE);const r=e&&e._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=e&&Ba.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=Ra.normalizeZ(n),Ba.set(e,n)));let s=Ra.ZERO,i=Ra.ZERO;const o=1+(Sa?128/r:256/r),a=2**(r-1),c=BigInt(2**r-1),l=2**r,u=BigInt(r);for(let e=0;e<o;e++){const r=e*a;let o=Number(t&c);if(t>>=u,o>a&&(o-=l,t+=Ta),0===o){let t=n[r];e%2&&(t=t.negate()),i=i.add(t)}else{let t=n[r+Math.abs(o)-1];o<0&&(t=t.negate()),s=s.add(t)}}return{p:s,f:i}}multiply(t,e){let r,n,s=Ka(t);if(Sa){const{k1neg:t,k1:i,k2neg:o,k2:a}=Qa(s);let{p:c,f:l}=this.wNAF(i,e),{p:u,f:h}=this.wNAF(a,e);t&&(c=c.negate()),o&&(u=u.negate()),u=new Ra(Ja(u.x*Oa.beta),u.y,u.z),r=c.add(u),n=l.add(h)}else{const{p:t,f:i}=this.wNAF(s,e);r=t,n=i}return Ra.normalizeZ([r,n])[0]}toAffine(t=Xa(this.z)){const{x:e,y:r,z:n}=this,s=t,i=Ja(s*s),o=Ja(i*s),a=Ja(e*i),c=Ja(r*o);if(Ja(n*s)!==Ta)throw new Error("invZ was invalid");return new _a(a,c)}}Ra.BASE=new Ra(Oa.Gx,Oa.Gy,Ta),Ra.ZERO=new Ra(Aa,Ta,Aa);const Ba=new WeakMap;class _a{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,Ba.delete(this)}static fromCompressedHex(t){const e=32===t.length,r=Ha(e?t:t.subarray(1));if(!rc(r))throw new Error("Point is not on curve");let n=function(t){const{P:e}=Oa,r=BigInt(6),n=BigInt(11),s=BigInt(22),i=BigInt(23),o=BigInt(44),a=BigInt(88),c=t*t*t%e,l=c*c*t%e,u=qa(l,Pa)*l%e,h=qa(u,Pa)*l%e,f=qa(h,ka)*c%e,d=qa(f,n)*f%e,p=qa(d,s)*d%e,w=qa(p,o)*p%e,g=qa(w,a)*w%e,m=qa(g,o)*p%e,y=qa(m,Pa)*l%e,b=qa(y,i)*d%e,v=qa(b,r)*c%e;return qa(v,ka)}(Ia(r));const s=(n&Ta)===Ta;if(e)s&&(n=Ja(-n));else{1==(1&t[0])!==s&&(n=Ja(-n))}const i=new _a(r,n);return i.assertValidity(),i}static fromUncompressedHex(t){const e=Ha(t.subarray(1,33)),r=Ha(t.subarray(33,65)),n=new _a(e,r);return n.assertValidity(),n}static fromHex(t){const e=Va(t),r=e.length,n=e[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(e);if(65===r&&4===n)return this.fromUncompressedHex(e);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(t){return _a.BASE.multiply(sc(t))}static fromSignature(t,e,r){const n=function(t){const{n:e}=Oa,r=8*t.length-256;let n=Ha(t);r>0&&(n>>=BigInt(r));n>=e&&(n-=e);return n}(t=Va(t)),{r:s,s:i}=function(t){if(t instanceof Ua)return t.assertValidity(),t;try{return Ua.fromDER(t)}catch(e){return Ua.fromCompact(t)}}(e);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");if(n===Aa)throw new Error("Cannot recover signature: msgHash cannot be 0");const o=1&r?"03":"02",a=_a.fromHex(o+Ga(s)),{n:c}=Oa,l=Xa(s,c),u=Ja(-n*l,c),h=Ja(i*l,c),f=_a.BASE.multiplyAndAddUnsafe(a,u,h);if(!f)throw new Error("Cannot recover signature: point at infinify");return f.assertValidity(),f}toRawBytes(t=!1){return Wa(this.toHex(t))}toHex(t=!1){const e=Ga(this.x);if(t){return`${this.y&Ta?"03":"02"}${e}`}return`04${e}${Ga(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:e,y:r}=this;if(!rc(e)||!rc(r))throw new Error(t);const n=Ja(r*r);if(Ja(n-Ia(e))!==Aa)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new _a(this.x,Ja(-this.y))}double(){return Ra.fromAffine(this).double().toAffine()}add(t){return Ra.fromAffine(this).add(Ra.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return Ra.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,e,r){const n=Ra.fromAffine(this).multiply(e),s=Ra.fromAffine(t).multiplyUnsafe(r),i=n.add(s);return i.equals(Ra.ZERO)?void 0:i.toAffine()}}function Ca(t){return Number.parseInt(t[0],16)>=8?"00"+t:t}function Fa(t){if(t.length<2||2!==t[0])throw new Error(`Invalid signature integer tag: ${ja(t)}`);const e=t[1],r=t.subarray(2,e+2);if(!e||r.length!==e)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:Ha(r),left:t.subarray(e+2)}}_a.BASE=new _a(Oa.Gx,Oa.Gy),_a.ZERO=new _a(Aa,Aa);class Ua{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromCompact(t){const e=Da(t),r="Signature.fromCompact";if("string"!=typeof t&&!e)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=e?ja(t):t;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new Ua(za(n.slice(0,64)),za(n.slice(64,128)))}static fromDER(t){const e=Da(t);if("string"!=typeof t&&!e)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:r,s:n}=function(t){if(t.length<2||48!=t[0])throw new Error(`Invalid signature tag: ${ja(t)}`);if(t[1]!==t.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:r}=Fa(t.subarray(2)),{data:n,left:s}=Fa(r);if(s.length)throw new Error(`Invalid signature: left bytes after parsing: ${ja(s)}`);return{r:e,s:n}}(e?t:Wa(t));return new Ua(r,n)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:e}=this;if(!ec(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!ec(e))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=Oa.n>>Ta;return this.s>t}normalizeS(){return this.hasHighS()?new Ua(this.r,Oa.n-this.s):this}toDERRawBytes(t=!1){return Wa(this.toDERHex(t))}toDERHex(t=!1){const e=Ca($a(this.s));if(t)return e;const r=Ca($a(this.r)),n=$a(r.length/2),s=$a(e.length/2);return`30${$a(r.length/2+e.length/2+4)}02${n}${r}02${s}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return Wa(this.toCompactHex())}toCompactHex(){return Ga(this.r)+Ga(this.s)}}function La(...t){if(!t.every(Da))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const s=t[e];r.set(s,n),n+=s.length}return r}function Da(t){return t instanceof Uint8Array}const Ma=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function ja(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let r=0;r<t.length;r++)e+=Ma[t[r]];return e}function Ga(t){if(t>xa)throw new Error("Expected number < 2^256");return t.toString(16).padStart(64,"0")}function $a(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function za(t){if("string"!=typeof t)throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt(`0x${t}`)}function Wa(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+t.length);const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r,s=t.slice(n,n+2),i=Number.parseInt(s,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");e[r]=i}return e}function Ha(t){return za(ja(t))}function Va(t){return t instanceof Uint8Array?Uint8Array.from(t):Wa(t)}function Ka(t){if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)return BigInt(t);if("bigint"==typeof t&&ec(t))return t;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Ja(t,e=Oa.P){const r=t%e;return r>=Aa?r:e+r}function qa(t,e){const{P:r}=Oa;let n=t;for(;e-- >Aa;)n*=n,n%=r;return n}function Xa(t,e=Oa.P){if(t===Aa||e<=Aa)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Ja(t,e),n=e,s=Aa,i=Ta;for(;r!==Aa;){const t=n%r,e=s-i*(n/r);n=r,r=t,s=i,i=e}if(n!==Ta)throw new Error("invert: does not exist");return Ja(s,e)}const Ya=(t,e)=>(t+e/ka)/e,Za=ka**BigInt(128);function Qa(t){const{n:e}=Oa,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Ta*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,o=Ya(i*t,e),a=Ya(-n*t,e);let c=Ja(t-o*r-a*s,e),l=Ja(-o*n-a*i,e);const u=c>Za,h=l>Za;if(u&&(c=e-c),h&&(l=e-l),c>Za||l>Za)throw new Error("splitScalarEndo: Endomorphism failed, k="+t);return{k1neg:u,k1:c,k2neg:h,k2:l}}class tc{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...t){return fc.hmacSha256(this.k,...t)}hmacSync(...t){if("function"!=typeof fc.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const e=fc.hmacSha256Sync(this.k,...t);if(e instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return e}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(t=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),t),this.v=await this.hmac(this.v),0!==t.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),t),this.v=await this.hmac(this.v))}reseedSync(t=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),t),this.v=this.hmacSync(this.v),0!==t.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),t),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function ec(t){return Aa<t&&t<Oa.n}function rc(t){return Aa<t&&t<Oa.P}function nc(t,e,r){const n=Ha(t);if(!ec(n))return;const{n:s}=Oa,i=_a.BASE.multiply(n),o=Ja(i.x,s);if(o===Aa)return;const a=Ja(Xa(n,s)*Ja(e+r*o,s),s);if(a===Aa)return;const c=new Ua(o,a);return{sig:c,recovery:(i.x===c.r?0:2)|Number(i.y&Ta)}}function sc(t){let e;if("bigint"==typeof t)e=t;else if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)e=BigInt(t);else if("string"==typeof t){if(64!==t.length)throw new Error("Expected 32 bytes of private key");e=za(t)}else{if(!Da(t))throw new TypeError("Expected valid private key");if(32!==t.length)throw new Error("Expected 32 bytes of private key");e=Ha(t)}if(!ec(e))throw new Error("Expected private key: 0 < key < n");return e}function ic(t){const e=Da(t),r="string"==typeof t,n=(e||r)&&t.length;return e?33===n||65===n:r?66===n||130===n:t instanceof _a}function oc(t,e,r=!1){if(ic(t))throw new TypeError("getSharedSecret: first arg must be private key");if(!ic(e))throw new TypeError("getSharedSecret: second arg must be public key");const n=(s=e)instanceof _a?(s.assertValidity(),s):_a.fromHex(s);var s;return n.assertValidity(),n.multiply(sc(t)).toRawBytes(r)}function ac(t){return Ha(t.length>32?t.slice(0,32):t)}function cc(t){const e=ac(t),r=Ja(e,Oa.n);return lc(r<Aa?e:r)}function lc(t){if("bigint"!=typeof t)throw new Error("Expected bigint");return Wa(Ga(t))}function uc(t,e,r={}){const{seed:n,m:s,d:i}=function(t,e,r){if(null==t)throw new Error(`sign: expected valid message hash, not "${t}"`);const n=Va(t),s=sc(e),i=[lc(s),cc(n)];if(null!=r){!0===r&&(r=fc.randomBytes(32));const t=Va(r);if(32!==t.length)throw new Error("sign: Expected 32 bytes of extra data");i.push(t)}return{seed:La(...i),m:ac(n),d:s}}(t,e,r.extraEntropy);let o;const a=new tc;for(a.reseedSync(n);!(o=nc(a.generateSync(),s,i));)a.reseedSync();return function(t,e){let{sig:r,recovery:n}=t;const{canonical:s,der:i,recovered:o}=Object.assign({canonical:!0,der:!0},e);s&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const a=i?r.toDERRawBytes():r.toCompactRawBytes();return o?[a,n]:a}(o,r)}_a.BASE._setWindowSize(8);const hc={node:undefined,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},fc={isValidPrivateKey(t){try{return sc(t),!0}catch(t){return!1}},hashToPrivateKey:t=>{if((t=Va(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const e=Ja(Ha(t),Oa.n);if(e===Aa||e===Ta)throw new Error("Invalid private key");return function(t){return Wa(Ga(t))}(e)},randomBytes:(t=32)=>{if(hc.web)return hc.web.getRandomValues(new Uint8Array(t));throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>fc.hashToPrivateKey(fc.randomBytes(40)),bytesToHex:ja,mod:Ja,sha256:async t=>{if(hc.web){const e=await hc.web.subtle.digest("SHA-256",t.buffer);return new Uint8Array(e)}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(t,...e)=>{if(hc.web){const r=await hc.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=La(...e),s=await hc.web.subtle.sign("HMAC",r,n);return new Uint8Array(s)}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(t=8,e=_a.BASE){const r=e===_a.BASE?e:new _a(e.x,e.y);return r._setWindowSize(t),r.multiply(Pa),r}};var dc,pc=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},wc=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};fc.hmacSha256Sync=function(t,...e){return ie(Mr("sha256",t,he(e)))};class gc{constructor(t){dc.set(this,void 0),la.assertArgument(32===fe(t),"invalid private key length","privateKey","[REDACTED]"),pc(this,dc,le(t),"f")}get privateKey(){return wc(this,dc,"f")}get publicKey(){return gc.computePublicKey(wc(this,dc,"f"))}get compressedPublicKey(){return gc.computePublicKey(wc(this,dc,"f"),!0)}sign(t){la.assertArgument(32===fe(t),"invalid digest length","digest",t);const[e,r]=uc(ie(t),ie(wc(this,dc,"f")),{recovered:!0,canonical:!0}),n=Ua.fromHex(e);return Ea.from({r:bt("0x"+n.r.toString(16),32),s:bt("0x"+n.s.toString(16),32),v:r?28:27}).freeze()}computeShardSecret(t){const e=gc.computePublicKey(t);return le(oc(ie(wc(this,dc,"f")),e))}static computePublicKey(t,e){let r=la.getBytes(t,"key");if(32===r.length){return le(function(t,e=!1){return _a.fromPrivateKey(t).toRawBytes(e)}(r,!!e))}if(64===r.length){const t=new Uint8Array(65);t[0]=4,t.set(r,1),r=t}return le(_a.fromHex(r).toRawBytes(e))}static recoverPublicKey(t,e){const r=Ea.from(e),n=Ua.fromCompact(ie(he([r.r,r.s]))).toDERRawBytes(),s=function(t,e,r,n=!1){return _a.fromSignature(t,e,r).toRawBytes(n)}(ie(t),n,r.yParity);return null!=s?le(s):la.throwArgumentError("invalid signautre for digest","signature",e)}static _addPoints(t,e,r){const n=_a.fromHex(gc.computePublicKey(t).substring(2)),s=_a.fromHex(gc.computePublicKey(e).substring(2));return"0x"+n.add(s).toHex(!!r)}}function mc(t,e){return{address:us(t),storageKeys:(e||[]).map(((t,e)=>{if(32!==fe(t))throw new Error("");return t.toLowerCase()}))}}function yc(t){if(Array.isArray(t))return t.map(((t,e)=>{if(Array.isArray(t)){if(t.length>2)throw new Error("");return mc(t[0],t[1])}return mc(t.address,t.storageKeys)}));const e=Object.keys(t).map((e=>{const r=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return mc(e,Object.keys(r).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function bc(t){return us(an("0x"+gc.computePublicKey(t,!1).substring(4)).substring(26))}function vc(t,e){return bc(gc.recoverPublicKey(t,e))}dc=new WeakMap;const Ec=new T("@ethersproject/transaction@6.0.0-beta.2");var Ac,Tc=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},kc=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Pc=BigInt(0),Nc=BigInt(2),xc=BigInt(27),Oc=BigInt(28),Ic=BigInt(35),Sc=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Rc(t){return"0x"===t?null:us(t)}function Bc(t,e){try{return le(t)}catch(r){return Ec.throwArgumentError("invalid data",e,t)}}function _c(t,e){try{return yc(t)}catch(r){return Ec.throwArgumentError("invalid accessList",e,t)}}function Cc(t,e){return"0x"===t?0:Ec.getNumber(t,e)}function Fc(t,e){if("0x"===t)return Pc;const r=Ec.getBigInt(t,e);return r>Sc&&Ec.throwArgumentError("value exceeds uint size",e,r),r}function Uc(t,e){const r=Ec.getBigInt(t,"value"),n=vt(r);return n.length>32&&Ec.throwArgumentError("value too large",`tx.${e}`,r),n}function Lc(t){return yc(t).map((t=>[t.address,t.storageKeys]))}function Dc(t,e){const r=[Uc(t.nonce||0,"nonce"),Uc(t.gasPrice||0,"gasPrice"),Uc(t.gasLimit||0,"gasLimit"),null!=t.to?us(t.to):"0x",Uc(t.value||0,"value"),t.data||"0x"];let n=Pc;if(null!=t.chainId)n=Ec.getBigInt(t.chainId,"tx.chainId"),e&&null!=e.networkV&&e.legacyChainId!==n&&Ec.throwArgumentError("tx.chainId/sig.v mismatch","sig",e);else if(e){const t=e.legacyChainId;null!=t&&(n=t)}if(!e)return n!==Pc&&(r.push(vt(n)),r.push("0x"),r.push("0x")),ws(r);let s=BigInt(27+e.yParity);return n!==Pc?s=Ea.getChainIdV(n,e.v):BigInt(e.v)!==s&&Ec.throwArgumentError("tx.chainId/sig.v mismatch","sig",e),r.push(vt(s)),r.push(vt(e.r)),r.push(vt(e.s)),ws(r)}function Mc(t,e,r){let n;try{if(n=Cc(e[0],"yParity"),0!==n&&1!==n)throw new Error("bad yParity")}catch(t){return Ec.throwArgumentError("invalid yParity","yParity",e[0])}const s=ge(e[1],32),i=ge(e[2],32),o=Ea.from({r:s,s:i,yParity:n});t.signature=o}function jc(t,e){const r=[Uc(t.chainId||0,"chainId"),Uc(t.nonce||0,"nonce"),Uc(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Uc(t.maxFeePerGas||0,"maxFeePerGas"),Uc(t.gasLimit||0,"gasLimit"),null!=t.to?us(t.to):"0x",Uc(t.value||0,"value"),t.data||"0x",Lc(t.accessList||[])];return e&&(r.push(Uc(e.yParity,"yParity")),r.push(vt(e.r)),r.push(vt(e.s))),he(["0x02",ws(r)])}function Gc(t,e){const r=[Uc(t.chainId||0,"chainId"),Uc(t.nonce||0,"nonce"),Uc(t.gasPrice||0,"gasPrice"),Uc(t.gasLimit||0,"gasLimit"),null!=t.to?us(t.to):"0x",Uc(t.value||0,"value"),t.data||"0x",Lc(t.accessList||[])];return e&&(r.push(Uc(e.yParity,"recoveryParam")),r.push(vt(e.r)),r.push(vt(e.s))),he(["0x01",ws(r)])}class $c{constructor(){Ac.set(this,void 0),Tc(this,Ac,{type:null,to:null,nonce:0,gasLimit:BigInt(0),gasPrice:null,maxPriorityFeePerGas:null,maxFeePerGas:null,data:"0x",value:BigInt(0),chainId:BigInt(0),sig:null,accessList:null},"f")}get type(){return a(kc(this,Ac,"f"),"type")}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}set type(t){switch(t){case null:c(kc(this,Ac,"f"),"type",null);break;case 0:case"legacy":c(kc(this,Ac,"f"),"type",0);break;case 1:case"berlin":case"eip-2930":c(kc(this,Ac,"f"),"type",1);break;case 2:case"london":case"eip-1559":c(kc(this,Ac,"f"),"type",2);break;default:throw new Error("unsupported transaction type")}}get to(){return a(kc(this,Ac,"f"),"to")}set to(t){c(kc(this,Ac,"f"),"to",null==t?null:us(t))}get nonce(){return a(kc(this,Ac,"f"),"nonce")}set nonce(t){c(kc(this,Ac,"f"),"nonce",Ec.getNumber(t,"value"))}get gasLimit(){return a(kc(this,Ac,"f"),"gasLimit")}set gasLimit(t){c(kc(this,Ac,"f"),"gasLimit",Ec.getBigInt(t))}get gasPrice(){const t=a(kc(this,Ac,"f"),"gasPrice");return null!=t||0!==this.type&&1!==this.type?t:Pc}set gasPrice(t){c(kc(this,Ac,"f"),"gasPrice",null==t?null:Ec.getBigInt(t,"gasPrice"))}get maxPriorityFeePerGas(){const t=a(kc(this,Ac,"f"),"maxPriorityFeePerGas");return null==t&&2===this.type?Pc:t}set maxPriorityFeePerGas(t){c(kc(this,Ac,"f"),"maxPriorityFeePerGas",null==t?null:Ec.getBigInt(t,"maxPriorityFeePerGas"))}get maxFeePerGas(){const t=a(kc(this,Ac,"f"),"maxFeePerGas");return null==t&&2===this.type?Pc:t}set maxFeePerGas(t){c(kc(this,Ac,"f"),"maxFeePerGas",null==t?null:Ec.getBigInt(t,"maxFeePerGas"))}get data(){return a(kc(this,Ac,"f"),"data")}set data(t){c(kc(this,Ac,"f"),"data",le(t))}get value(){return a(kc(this,Ac,"f"),"value")}set value(t){c(kc(this,Ac,"f"),"value",Ec.getBigInt(t,"value"))}get chainId(){return a(kc(this,Ac,"f"),"chainId")}set chainId(t){c(kc(this,Ac,"f"),"chainId",Ec.getBigInt(t))}get signature(){return a(kc(this,Ac,"f"),"sig")||null}set signature(t){c(kc(this,Ac,"f"),"sig",null==t?null:Ea.from(t))}get accessList(){const t=a(kc(this,Ac,"f"),"accessList")||null;return null!=t||1!==this.type&&2!==this.type?t:[]}set accessList(t){c(kc(this,Ac,"f"),"accessList",null==t?null:yc(t))}get hash(){if(null==this.signature)throw new Error("cannot hash unsigned transaction; maybe you meant .unsignedHash");return an(this.serialized)}get unsignedHash(){return an(this.unsignedSerialized)}get from(){return null==this.signature?null:vc(this.unsignedSerialized,this.signature)}get fromPublicKey(){return null==this.signature?null:""}isSigned(){return null!=this.signature}get serialized(){if(null==this.signature)throw new Error("cannot serialize unsigned transaction; maybe you meant .unsignedSerialized");const t=this.inferTypes();if(1!==t.length)throw new Error("cannot determine transaction type; specify type manually");switch(t[0]){case 0:return Dc(this,this.signature);case 1:return Gc(this,this.signature);case 2:return jc(this,this.signature)}throw new Error("unsupported type")}get unsignedSerialized(){const t=this.inferTypes();if(1!==t.length)throw new Error("cannot determine transaction type; specify type manually");switch(t[0]){case 0:return Dc(this);case 1:return Gc(this);case 2:return jc(this)}throw new Error("unsupported type")}inferTypes(){const t=null!=this.gasPrice,e=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,r=null!=this.accessList;if(null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&this.maxFeePerGas<this.maxPriorityFeePerGas)throw new Error("priorityFee cannot be more than maxFee");if((0===this.type||1===this.type)&&e)throw new Error("transaction type cannot have maxFeePerGas or maxPriorityFeePerGas");if(0===this.type&&r)throw new Error("legacy transaction cannot have accessList");const n=[];return null!=this.type?n.push(this.type):e?n.push(2):t?(n.push(1),r||n.push(0)):r?(n.push(1),n.push(2)):(n.push(0),n.push(1),n.push(2)),n.sort(),n}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}clone(){return $c.from(this)}freeze(){return kc(this,Ac,"f").sig&&(kc(this,Ac,"f").sig=kc(this,Ac,"f").sig.clone().freeze()),kc(this,Ac,"f").accessList&&(kc(this,Ac,"f").accessList=Object.freeze(kc(this,Ac,"f").accessList.map((t=>(Object.freeze(t.storageKeys),Object.freeze(t)))))),Object.freeze(kc(this,Ac,"f")),this}isFrozen(){return Object.isFrozen(kc(this,Ac,"f"))}static from(t){if("string"==typeof t){const e=ie(t);if(e[0]>=127)return $c.from(function(t){const e=vs(t);if(!Array.isArray(e)||9!==e.length&&6!==e.length)return Ec.throwArgumentError("invalid field count for legacy transaction","data",t);const r={type:0,nonce:Cc(e[0],"nonce"),gasPrice:Fc(e[1],"gasPrice"),gasLimit:Fc(e[2],"gasLimit"),to:Rc(e[3]),value:Fc(e[4],"value"),data:Bc(e[5],"dta"),chainId:Pc};if(6===e.length)return r;const n=Fc(e[6],"v"),s=Fc(e[7],"r"),i=Fc(e[8],"s");if(s===Pc&&i===Pc)r.chainId=n;else{let s=(n-Ic)/Nc;s<Pc&&(s=Pc),r.chainId=s,s===Pc&&(n<xc||n>Oc)&&Ec.throwArgumentError("non-canonical legacy v","v",e[6]),r.signature=Ea.from({r:ge(e[7],32),s:ge(e[8],32),v:n}),r.hash=an(t)}return r}(e));switch(e[0]){case 1:return $c.from(function(t){const e=vs(Ec.getBytes(t).slice(1));(!Array.isArray(e)||8!==e.length&&11!==e.length)&&Ec.throwArgumentError("invalid field count for transaction type: 1","data",le(t));const r={type:1,chainId:Fc(e[0],"chainId"),nonce:Cc(e[1],"nonce"),gasPrice:Fc(e[2],"gasPrice"),gasLimit:Fc(e[3],"gasLimit"),to:Rc(e[4]),value:Fc(e[5],"value"),data:Bc(e[6],"data"),accessList:_c(e[7],"accessList")};return 8===e.length||(r.hash=an(t),Mc(r,e.slice(8))),r}(e));case 2:return $c.from(function(t){const e=vs(Ec.getBytes(t).slice(1));(!Array.isArray(e)||9!==e.length&&12!==e.length)&&Ec.throwArgumentError("invalid field count for transaction type: 2","data",le(t));const r=Fc(e[2],"maxPriorityFeePerGas"),n=Fc(e[3],"maxFeePerGas"),s={type:2,chainId:Fc(e[0],"chainId"),nonce:Cc(e[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Fc(e[4],"gasLimit"),to:Rc(e[5]),value:Fc(e[6],"value"),data:Bc(e[7],"data"),accessList:_c(e[8],"accessList")};return 9===e.length||(s.hash=an(t),Mc(s,e.slice(9))),s}(e))}throw new Error("unsupported transaction type")}const e=new $c;if(null!=t.type&&(e.type=t.type),null!=t.to&&(e.to=t.to),null!=t.nonce&&(e.nonce=t.nonce),null!=t.gasLimit&&(e.gasLimit=t.gasLimit),null!=t.gasPrice&&(e.gasPrice=t.gasPrice),null!=t.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas),null!=t.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null!=t.data&&(e.data=t.data),null!=t.value&&(e.value=t.value),null!=t.chainId&&(e.chainId=t.chainId),null!=t.signature&&(e.signature=Ea.from(t.signature)),null!=t.accessList&&(e.accessList=t.accessList),null!=t.hash){if(!e.isSigned())throw new Error("unsigned transaction cannot have a hashs");if(e.hash!==t.hash)throw new Error("hash mismatch")}if(null!=t.from){if(!e.isSigned())throw new Error("unsigned transaction cannot have a from");if(e.from.toLowerCase()!==(t.from||"").toLowerCase())throw new Error("from mismatch")}return e}}Ac=new WeakMap;var zc,Wc,Hc=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Vc=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function Kc(t){return null==t?null:t}function Jc(t){return null==t?null:t.toString()}class qc{constructor(t,e,n){r(this,{gasPrice:Kc(t),maxFeePerGas:Kc(e),maxPriorityFeePerGas:Kc(n)})}toJSON(){const{gasPrice:t,maxFeePerGas:e,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Jc(t),maxFeePerGas:Jc(e),maxPriorityFeePerGas:Jc(r)}}}class Xc{constructor(t,e){zc.set(this,void 0),null==e&&(e=nl),Hc(this,zc,Object.freeze(t.transactions.map((t=>{if("string"!=typeof t&&t.provider!==e)throw new Error("provider mismatch");return t}))),"f"),r(this,{provider:e,hash:Kc(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,miner:t.miner,extraData:t.extraData,baseFeePerGas:Kc(t.baseFeePerGas)})}get transactions(){return Vc(this,zc,"f")}toJSON(){const{baseFeePerGas:t,difficulty:e,extraData:r,gasLimit:n,gasUsed:s,hash:i,miner:o,nonce:a,number:c,parentHash:l,timestamp:u,transactions:h}=this;return{_type:"Block",baseFeePerGas:Jc(t),difficulty:Jc(e),extraData:r,gasLimit:Jc(n),gasUsed:Jc(s),hash:i,miner:o,nonce:a,number:c,parentHash:l,timestamp:u,transactions:h}}[(zc=new WeakMap,Symbol.iterator)](){let t=0;return{next:()=>t<this.length?{value:this.transactions[t++],done:!1}:{value:void 0,done:!0}}}get length(){return this.transactions.length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(t){const e=this.transactions[t];if(null==e)throw new Error("no such tx");return"string"==typeof e?await this.provider.getTransaction(e):e}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return{orphan:"drop-block",hash:(t=this).hash,number:t.number};var t}}class Yc{constructor(t,e){null==e&&(e=nl),this.provider=e;const n=Object.freeze(t.topics.slice());r(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:n,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:e,blockNumber:r,data:n,index:s,removed:i,topics:o,transactionHash:a,transactionIndex:c}=this;return{_type:"log",address:t,blockHash:e,blockNumber:r,data:n,index:s,removed:i,topics:o,transactionHash:a,transactionIndex:c}}async getBlock(){return await this.provider.getBlock(this.blockHash)}async getTransaction(){return await this.provider.getTransaction(this.transactionHash)}async getTransactionReceipt(){return await this.provider.getTransactionReceipt(this.transactionHash)}removedEvent(){return{orphan:"drop-log",log:{transactionHash:(t=this).transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}};var t}}class Zc{constructor(t,e){Wc.set(this,void 0),null==e&&(e=nl),Hc(this,Wc,Object.freeze(t.logs.map((t=>{if(e!==t.provider)throw new Error("provider mismatch");return t}))),"f"),r(this,{provider:e,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,gasPrice:t.effectiveGasPrice||t.gasPrice,byzantium:t.byzantium,status:t.status,root:t.root})}get logs(){return Vc(this,Wc,"f")}toJSON(){const{to:t,from:e,contractAddress:r,hash:n,index:s,blockHash:i,blockNumber:o,logsBloom:a,logs:c,byzantium:l,status:u,root:h}=this;return{_type:"TransactionReceipt",blockHash:i,blockNumber:o,byzantium:l,contractAddress:r,cumulativeGasUsed:Jc(this.cumulativeGasUsed),from:e,gasPrice:Jc(this.gasPrice),gasUsed:Jc(this.gasUsed),hash:n,index:s,logs:c,logsBloom:a,root:h,status:u,to:t}}get length(){return this.logs.length}[(Wc=new WeakMap,Symbol.iterator)](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(null==t)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(null==t)throw new Error("TODO");return t}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return el(this)}reorderedEvent(t){return t&&!t.isMined()?Wo.throwError("unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}):tl(this,t)}}class Qc{constructor(t,e){null==e&&(e=nl),this.provider=e,this.blockNumber=null!=t.blockNumber?t.blockNumber:null,this.blockHash=null!=t.blockHash?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=null!=t.maxPriorityFeePerGas?t.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=t.maxFeePerGas?t.maxFeePerGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=null!=t.accessList?t.accessList:null}toJSON(){const{blockNumber:t,blockHash:e,index:r,hash:n,type:s,to:i,from:o,nonce:a,data:c,signature:l,accessList:u}=this;return{_type:"TransactionReceipt",accessList:u,blockNumber:t,blockHash:e,chainId:Jc(this.chainId),data:c,from:o,gasLimit:Jc(this.gasLimit),gasPrice:Jc(this.gasPrice),hash:n,maxFeePerGas:Jc(this.maxFeePerGas),maxPriorityFeePerGas:Jc(this.maxPriorityFeePerGas),nonce:a,signature:l,to:i,index:r,type:s,value:Jc(this.value)}}async getBlock(){let t=this.blockNumber;if(null==t){const e=await this.getTransaction();e&&(t=e.blockNumber)}if(null==t)return null;const e=this.provider.getBlock(t);if(null==e)throw new Error("TODO");return e}async getTransaction(){return this.provider.getTransaction(this.hash)}async wait(t){return this.provider.waitForTransaction(this.hash,t)}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}removedEvent(){return this.isMined()?el(this):Wo.throwError("unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"})}reorderedEvent(t){return this.isMined()?t&&!t.isMined()?Wo.throwError("unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}):tl(this,t):Wo.throwError("unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"})}}function tl(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function el(t){return{orphan:"drop-transaction",tx:t}}function rl(){throw new Error("this provider should not be used")}const nl=new class{get provider(){return this}async getNetwork(){return rl()}async getFeeData(){return rl()}async estimateGas(t){return rl()}async call(t){return rl()}async resolveName(t){return rl()}async getBlockNumber(){return rl()}async getBalanceOf(t,e){return rl()}async getTransactionCountOf(t,e){return rl()}async getCode(t,e){return rl()}async getStorageAt(t,e,r){return rl()}async broadcastTransaction(t){return rl()}async getBlock(t){return rl()}async getBlockWithTransactions(t){return rl()}async getTransaction(t){return rl()}async getTransactionReceipt(t){return rl()}async getLogs(t){return rl()}async lookupAddress(t){return rl()}async waitForTransaction(t,e,r){return rl()}async waitForBlock(t){return rl()}async on(t,e){return rl()}async once(t,e){return rl()}async emit(t,...e){return rl()}async listenerCount(t){return rl()}async listeners(t){return rl()}async off(t,e){return rl()}async removeAllListeners(t){return rl()}async addListener(t,e){return rl()}async removeListener(t,e){return rl()}};var sl,il,ol=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},al=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const cl=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function ll(t){if("string"!=typeof t)throw new Error("invalid string");return t}class ul{constructor(){sl.set(this,void 0),il.set(this,void 0);const t=this.address.bind(this),e=this.bigNumber.bind(this),r=this.blockTag.bind(this),n=this.data.bind(this),s=this.hash.bind(this),i=this.number.bind(this),o=this.uint256.bind(this),a=this.arrayOf(s);ol(this,sl,{address:t,bigNumber:e,blockTag:r,data:n,hash:s,number:i,uint256:o,topics:a,filter:this.object({fromBlock:this.allowNull(r,void 0),toBlock:this.allowNull(r,void 0),blockHash:this.allowNull(s,void 0),address:this.allowNull(t,void 0),topics:this.allowNull(a,void 0)}),transactionRequest:this.object({from:this.allowNull(t),type:this.allowNull(i),to:this.allowNull(t),nonce:this.allowNull(i),gasLimit:this.allowNull(o),gasPrice:this.allowNull(o),maxFeePerGas:this.allowNull(o),maxPriorityFeePerGas:this.allowNull(o),data:this.allowNull(n),value:this.allowNull(o)}),transactionResponse:this.object({hash:s,index:i,type:this.allowNull(i,0),blockHash:this.allowNull(s),blockNumber:this.allowNull(i),chainId:this.allowNull(i),from:t,to:this.address,gasLimit:e,gasPrice:this.allowNull(e),maxFeePerGas:this.allowNull(e),maxPriorityFeePerGas:this.allowNull(e),value:e,data:n,nonce:i,r:s,s:s,v:i,accessList:this.allowNull(this.accessList)},{index:["transactionIndex"]})},"f"),ol(this,il,this.object({number:i,hash:this.allowNull(s,null),timestamp:i,parentHash:s,nonce:this.allowNull(ll,"0x0000000000000000"),difficulty:e,gasLimit:e,gasUsed:e,miner:this.allowNull(t,"0x0000000000000000000000000000000000000000"),extraData:ll,baseFeePerGas:this.allowNull(e)}),"f")}address(t){return us(t)}callAddress(t){return 32===fe(t)&&"0x000000000000000000000000"===de(t,0,12)||Wo.throwArgumentError("invalid call address","value",t),this.address(de(t,12))}contractAddress(t){return Es({from:this.address(t.from),nonce:Wo.getNumber(t.nonce,"value.nonce")})}blockTag(t){if(null==t)return"latest";switch(t){case"earliest":return"0x0";case"latest":case"pending":return t}return"number"==typeof t||te(t)&&fe(t)<32?ue(t):Wo.throwArgumentError("invalid blockTag","value",t)}block(t,e){const r=al(this,il,"f").call(this,t);return r.transactions=t.transactions.map((t=>this.hash(t))),new Xc(r,e)}blockWithTransactions(t,e){throw new Error}transactionRequest(t,e){return al(this,sl,"f").transactionRequest(t)}transactionResponse(t,e){null==(t=Object.assign({},t)).data&&null!=t.input&&(t.data=t.input),null==t.gasLimit&&t.gas&&(t.gasLimit=t.gas),t=al(this,sl,"f").transactionResponse(t);const r=Ea.from({r:t.r,s:t.s,v:t.v});return t.signature=r,null==t.chainId&&(t.chainId=r.legacyChainId),new Qc(t,e)}log(t,e){const r=this.object({address:this.address,blockHash:this.hash,blockNumber:this.number,data:this.data,index:this.number,removed:this.boolean,topics:this.topics,transactionHash:this.hash,transactionIndex:this.number},{index:["logIndex"]})(t);return new Yc(r,e)}receipt(t,e){const r=this.object({blockHash:this.hash,blockNumber:this.number,contractAddress:this.allowNull(this.address),cumulativeGasUsed:this.bigNumber,from:this.address,gasUsed:this.bigNumber,logs:this.arrayOf((t=>this.log(t,e))),logsBloom:this.data,root:this.allowNull(this.data),status:this.allowNull(this.number),to:this.address,gasPrice:this.allowNull(this.bigNumber),hash:this.hash,index:this.number,type:this.allowNull(this.number,0)},{hash:["transactionHash"],gasPrice:["effectiveGasPrice"],index:["transactionIndex"]})(t);if(null!=r.root)if(r.root.length<=4){const t=parseInt(r.root);if(0!==t&&1!==t)return Wo.throwError("invalid alt-root-status","BAD_DATA",{value:r.root});if(null!=r.status&&r.status!==t)return Wo.throwError("alt-root-status/status mismatch","BAD_DATA",{value:{root:r.root,status:r.status}});r.status=t,delete r.root}else if(!te(r.root,32))return Wo.throwError("invalid receipt root hash","BAD_DATA",{value:r.root});return new Zc(r,e)}topics(t){return al(this,sl,"f").topics(t)}filter(t){return al(this,sl,"f").filter(t)}filterLog(t){return console.log("ME",t),null}transaction(t){throw new Error}accessList(t){return yc(t)}allowFalsish(t,e){return r=>r?t.call(this,r):e}allowNull(t,e){return r=>null==r?e:t.call(this,r)}arrayOf(t){return e=>{if(!Array.isArray(e))throw new Error("not an array");return e.map((e=>t.call(this,e)))}}bigNumber(t){return Wo.getBigInt(t,"value")}uint256(t){const e=this.bigNumber(t);return(e<0||e>cl)&&Wo.throwArgumentError("invalid uint256","value",t),e}boolean(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}return Wo.throwArgumentError(`invalid boolean; ${JSON.stringify(t)}`,"value",t)}_hexstring(t){return null==t&&(t=!1),function(e){if(te(e,t))return e.toLowerCase();throw new Error("bad hexstring")}}data(t){return null==fe(t)&&Wo.throwArgumentError("","value",t),t}hash(t){return 32!==fe(t)&&Wo.throwArgumentError("","value",t),al(this,sl,"f").data(t)}number(t){return Wo.getNumber(t)}object(t,e){return r=>{const n={};for(const s in t){let i=s;if(e&&s in e&&!(i in r))for(const t of e[s])if(t in r){i=t;break}try{const e=t[s].call(this,r[i]);void 0!==e&&(n[s]=e)}catch(t){const e=t instanceof Error?t.message:"not-an-error";Wo.throwError(`invalid value for value.${s} (${e})`,"BAD_DATA",{value:r})}}return n}}storageSlot(t){return bt(Wo.getBigInt(t),32)}}sl=new WeakMap,il=new WeakMap;class hl{constructor(t){r(this,{name:t})}clone(){return new hl(this.name)}validate(t){return this}}class fl extends hl{constructor(t=0,e){super(`org.ethers.plugins.gas-cost#${t||0}`);const n={effectiveBlock:t};function s(t,r){let s=(e||{})[t];null==s&&(s=r),"number"!=typeof s&&Wo.throwArgumentError(`invalud value for ${t}`,"costs",e),n[t]=s}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),r(this,n)}clone(){return new fl(this.effectiveBlock,this)}}class dl extends hl{constructor(t,e){super("org.ethers.plugins.ens"),r(this,{address:t||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==e?1:e})}clone(){return new dl(this.address,this.targetNetwork)}validate(t){return t.formatter.address(this.address),this}}class pl extends hl{constructor(t){super("org.ethers.plugins.max-priority-fee"),r(this,{priorityFee:Wo.getBigInt(t)})}async getPriorityFee(t){return this.priorityFee}clone(){return new pl(this.priorityFee)}}var wl,gl=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},ml=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const yl=new Map,bl=new ul;class vl{constructor(t,e,r){wl.set(this,void 0);const n=Wo.getBigInt(e);null==r&&(r=bl);const s=new Map;gl(this,wl,{name:t,chainId:n,formatter:r,plugins:s},"f")}toJSON(){return{name:this.name,chainId:this.chainId}}get name(){return a(ml(this,wl,"f"),"name")}set name(t){c(ml(this,wl,"f"),"name",t)}get chainId(){return a(ml(this,wl,"f"),"chainId")}set chainId(t){c(ml(this,wl,"f"),"chainId",Wo.getBigInt(t,"chainId"))}get formatter(){return a(ml(this,wl,"f"),"formatter")}set formatter(t){c(ml(this,wl,"f"),"formatter",t)}get plugins(){return Array.from(ml(this,wl,"f").plugins.values())}attachPlugin(t){if(this.isFrozen())throw new Error("frozen");if(ml(this,wl,"f").plugins.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return ml(this,wl,"f").plugins.set(t.name,t.validate(this)),this}getPlugin(t){return ml(this,wl,"f").plugins.get(t)||null}getPlugins(t){return this.plugins.filter((e=>e.name.split("#")[0]===t))}clone(){const t=new vl(this.name,this.chainId,this.formatter);return this.plugins.forEach((e=>{t.attachPlugin(e.clone())})),t}freeze(){return Object.freeze(ml(this,wl,"f")),this}isFrozen(){return Object.isFrozen(ml(this,wl,"f"))}computeIntrinsicGas(t){const e=this.getPlugin("org.ethers.gas-cost")||new fl;let r=e.txBase;if(null==t.to&&(r+=e.txCreate),t.data)for(let n=2;n<t.data.length;n+=2)"00"===t.data.substring(n,n+2)?r+=e.txDataZero:r+=e.txDataNonzero;if(t.accessList){const n=this.formatter.accessList(t.accessList);for(const t in n)r+=e.txAccessListAddress+e.txAccessListStorageKey*n[t].storageKeys.length}return r}static from(t){if(null==t)return vl.from("homestead");if("number"==typeof t&&(t=BigInt(t)),"string"==typeof t||"bigint"==typeof t){const e=yl.get(t);if(e)return e();if("bigint"==typeof t)return new vl("unknown",t);Wo.throwArgumentError("unknown network","network",t)}if("function"==typeof t.clone){return t.clone()}if("object"==typeof t){"string"==typeof t.name&&"number"==typeof t.chainId||Wo.throwArgumentError("invalid network object name or chainId","network",t);const e=new vl(t.name,t.chainId);return(t.ensAddress||null!=t.ensNetwork)&&e.attachPlugin(new dl(t.ensAddress,t.ensNetwork)),e}return Wo.throwArgumentError("invalid network","network",t)}static register(t,e){"number"==typeof t&&(t=BigInt(t));const r=yl.get(t);r&&Wo.throwArgumentError(`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),yl.set(t,e)}}wl=new WeakMap;var El,Al,Tl,kl,Pl,Nl,xl,Ol,Il,Sl,Rl,Bl,_l,Cl,Fl,Ul,Ll=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Dl=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function Ml(t){return JSON.parse(JSON.stringify(t))}class jl{constructor(t){El.add(this),Al.set(this,void 0),Tl.set(this,void 0),kl.set(this,void 0),Pl.set(this,void 0),Ll(this,Al,t,"f"),Ll(this,Tl,null,"f"),Ll(this,kl,4e3,"f"),Ll(this,Pl,-2,"f")}get pollingInterval(){return Dl(this,kl,"f")}set pollingInterval(t){Ll(this,kl,t,"f")}start(){if(Dl(this,Tl,"f"))throw new Error("subscriber already running");Dl(this,El,"m",Nl).call(this),Ll(this,Tl,Dl(this,Al,"f")._setTimeout(Dl(this,El,"m",Nl).bind(this),Dl(this,kl,"f")),"f")}stop(){if(!Dl(this,Tl,"f"))throw new Error("subscriber not running");Dl(this,Al,"f")._clearTimeout(Dl(this,Tl,"f")),Ll(this,Tl,null,"f")}pause(t){this.stop(),t&&Ll(this,Pl,-2,"f")}resume(){this.start()}}Al=new WeakMap,Tl=new WeakMap,kl=new WeakMap,Pl=new WeakMap,El=new WeakSet,Nl=async function t(){const e=await Dl(this,Al,"f").getBlockNumber();if(-2!==Dl(this,Pl,"f")){if(e!==Dl(this,Pl,"f")){for(let t=Dl(this,Pl,"f")+1;t<=e;t++)Dl(this,Al,"f").emit("block",t);Ll(this,Pl,e,"f")}Ll(this,Tl,Dl(this,Al,"f")._setTimeout(Dl(this,El,"m",t).bind(this),Dl(this,kl,"f")),"f")}else Ll(this,Pl,e,"f")};class Gl{constructor(t){xl.set(this,void 0),Ol.set(this,void 0),Ll(this,xl,t,"f"),Ll(this,Ol,(t=>{this._poll(t,Dl(this,xl,"f"))}),"f")}async _poll(t,e){throw new Error("sub-classes must override this")}start(){Dl(this,Ol,"f").call(this,-2),Dl(this,xl,"f").on("block",Dl(this,Ol,"f"))}stop(){Dl(this,xl,"f").off("block",Dl(this,Ol,"f"))}pause(t){this.stop()}resume(){this.start()}}xl=new WeakMap,Ol=new WeakMap;class $l extends Gl{constructor(t,e){super(t),Il.set(this,void 0),Ll(this,Il,Ml(e),"f")}async _poll(t,e){throw new Error("@TODO")}}Il=new WeakMap;class zl extends Gl{constructor(t,e){super(t),Sl.set(this,void 0),Ll(this,Sl,e,"f")}async _poll(t,e){const r=await e.getTransactionReceipt(Dl(this,Sl,"f"));r&&e.emit(Dl(this,Sl,"f"),r)}}Sl=new WeakMap;class Wl{constructor(t,e){Rl.add(this),Bl.set(this,void 0),_l.set(this,void 0),Cl.set(this,void 0),Fl.set(this,void 0),Ll(this,Bl,t,"f"),Ll(this,_l,Ml(e),"f"),Ll(this,Cl,Dl(this,Rl,"m",Ul).bind(this),"f"),Ll(this,Fl,-2,"f")}start(){-2===Dl(this,Fl,"f")&&Dl(this,Bl,"f").getBlockNumber().then((t=>{Ll(this,Fl,t,"f")})),Dl(this,Bl,"f").on("block",Dl(this,Cl,"f"))}stop(){Dl(this,Bl,"f").off("block",Dl(this,Cl,"f"))}pause(t){this.stop(),t&&Ll(this,Fl,-2,"f")}resume(){this.start()}}Bl=new WeakMap,_l=new WeakMap,Cl=new WeakMap,Fl=new WeakMap,Rl=new WeakSet,Ul=async function(t){if(-2===Dl(this,Fl,"f"))return;const e=Ml(Dl(this,_l,"f"));e.fromBlock=Dl(this,Fl,"f")+1,e.toBlock=t;const r=await Dl(this,Bl,"f").getLogs(e);if(0!==r.length){Ll(this,Fl,t,"f");for(const t of r)Dl(this,Bl,"f").emit(Dl(this,_l,"f"),t)}else Dl(this,Fl,"f")<t-60&&Ll(this,Fl,t-60,"f")};var Hl,Vl,Kl,Jl,ql,Xl,Yl,Zl,Ql,tu,eu,ru,nu,su,iu,ou=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},au=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const cu=BigInt(2);function lu(t,e){return t+":"+JSON.stringify(e,((t,e)=>{if("bigint"==typeof e)return`bigint:${e.toString()}`;if("string"==typeof e)return e.toLowerCase();if("object"==typeof e&&!Array.isArray(e)){const t=Object.keys(e);return t.sort(),t.reduce(((t,r)=>(t[r]=e[r],t)),{})}return e}))}class uu{constructor(t){r(this,{name:t})}start(){}stop(){}pause(t){}resume(){}}function hu(t){return(t=Array.from(new Set(t).values())).sort(),t}async function fu(t,e){if(null==t)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),"string"==typeof t)switch(t){case"block":case"pending":case"debug":case"network":return{type:t,tag:t}}if(te(t,32)){const e=t.toLowerCase();return{type:"transaction",tag:lu("tx",{hash:e}),hash:e}}if(t.orphan){const e=t;return{type:"orphan",tag:lu("orphan",e),filter:(r=e,JSON.parse(JSON.stringify(r)))}}var r;if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map((t=>null==t?null:Array.isArray(t)?hu(t.map((t=>t.toLowerCase()))):t.toLowerCase()))};if(r.address){const t=[],s=[],i=r=>{te(r)?t.push(r):s.push((async()=>{t.push(await Ps(r,e))})())};Array.isArray(r.address)?r.address.forEach(i):i(r.address),s.length&&await Promise.all(s),n.address=hu(t.map((t=>t.toLowerCase())))}return{filter:n,tag:lu("event",n),type:"event"}}return Wo.throwArgumentError("unknown ProviderEvent","event",t)}function du(){return(new Date).getTime()}class pu{constructor(t){if(Hl.add(this),Vl.set(this,void 0),Kl.set(this,void 0),Jl.set(this,void 0),ql.set(this,void 0),Xl.set(this,void 0),Yl.set(this,void 0),Zl.set(this,void 0),Ql.set(this,void 0),tu.set(this,void 0),"any"===t)ou(this,Xl,!0,"f"),ou(this,ql,null,"f");else if(t){const e=vl.from(t);ou(this,Xl,!1,"f"),ou(this,ql,Promise.resolve(e),"f"),setTimeout((()=>{this.emit("network",e,null)}),0)}else ou(this,Xl,!1,"f"),ou(this,ql,null,"f");ou(this,Yl,new Map,"f"),ou(this,Vl,new Map,"f"),ou(this,Kl,new Map,"f"),ou(this,Jl,null,"f"),ou(this,Zl,0,"f"),ou(this,Ql,new Map,"f"),ou(this,tu,!1,"f")}get provider(){return this}get plugins(){return Array.from(au(this,Kl,"f").values())}attachPlugin(t){if(au(this,Kl,"f").get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return au(this,Kl,"f").set(t.name,t.validate(this)),this}getPlugin(t){return au(this,Kl,"f").get(t)||null}set disableCcipRead(t){ou(this,tu,!!t,"f")}get disableCcipRead(){return au(this,tu,"f")}async ccipReadFetch(t,e,r){if(this.disableCcipRead||0===r.length||null==t.to)return null;const n=t.to.toLowerCase(),s=e.toLowerCase(),i=[];for(let e=0;e<r.length;e++){const o=r[e],a=o.replace("{sender}",n).replace("{data}",s),c=new Mo(a);-1===o.indexOf("{data}")&&(c.body={data:s,sender:n});let l="unknown error";const u=await zo(c);try{const t=u.bodyJson;if(t.data)return t.data;t.message&&(l=t.message)}catch(t){}if(u.statusCode>=400&&u.statusCode<500)return Wo.throwError(`response not found during CCIP fetch: ${l}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:t,info:{url:o,errorMessage:l}});i.push(l)}return Wo.throwError(`error encountered during CCIP fetch: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:t,info:{urls:r,errorMessages:i}})}_wrapTransaction(t,e,r){return t}_detectNetwork(){return Wo.throwError("sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){return Wo.throwError(`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){return Wo.getNumber(await au(this,Hl,"m",eu).call(this,{method:"getBlockNumber"}),"%response")}async _getAddress(t){return"string"==typeof t?t:await t.getAddress()}async _getBlockTag(t){const e=await this.getNetwork();if("number"==typeof t&&Number.isSafeInteger(t)&&t<0){let r=await this.getBlockNumber();return r+=t,r<0&&(r=0),e.formatter.blockTag(r)}return e.formatter.blockTag(t)}async getNetwork(){if(null==au(this,ql,"f")){const t=this._detectNetwork().then((t=>(this.emit("network",t,null),t)),(e=>{throw au(this,ql,"f")===t&&ou(this,ql,null,"f"),e}));return ou(this,ql,t,"f"),await t}const t=au(this,ql,"f"),[e,r]=await Promise.all([t,this._detectNetwork()]);return e.chainId!==r.chainId&&(au(this,Xl,"f")?(this.emit("network",r,e),au(this,ql,"f")===t&&ou(this,ql,Promise.resolve(r),"f")):Wo.throwError(`network changed: ${e.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),e.clone().freeze()}async getFeeData(){const{block:e,gasPrice:r}=await t({block:this.getBlock("latest"),gasPrice:(async()=>{try{const t=await au(this,Hl,"m",eu).call(this,{method:"getGasPrice"});return Wo.getBigInt(t,"%response")}catch(t){}return null})()});let n=null,s=null;if(e&&e.baseFeePerGas){s=BigInt("1500000000");const t=(await this.getNetwork()).getPlugin("org.ethers.plugins.max-priority-fee");t&&(s=await t.getPriorityFee(this)),n=e.baseFeePerGas*cu+s}return new qc(r,n,s)}async _getTransaction(e){const r=await this.getNetwork(),n=Object.assign({},e,await t({to:e.to?Ps(e.to,this):void 0,from:e.from?Ps(e.from,this):void 0}));return r.formatter.transactionRequest(n)}async estimateGas(t){const e=await this._getTransaction(t);return Wo.getBigInt(await au(this,Hl,"m",eu).call(this,{method:"estimateGas",transaction:e}),"%response")}async call(e){const{tx:r,blockTag:n}=await t({tx:this._getTransaction(e),blockTag:this._getBlockTag(e.blockTag)});return au(this,Hl,"m",ru).call(this,r,n,e.enableCcipRead?0:-1)}async getBalanceOf(e,r){const{address:n,blockTag:s}=await t({address:Ps(e),blockTag:this._getBlockTag(r)});return Wo.getBigInt(await au(this,Hl,"m",eu).call(this,{method:"getBalance",address:n,blockTag:s}),"%response")}async getTransactionCountOf(e,r){const{address:n,blockTag:s}=await t({address:Ps(e),blockTag:this._getBlockTag(r)});return Wo.getNumber(await au(this,Hl,"m",eu).call(this,{method:"getTransactionCount",address:n,blockTag:s}),"%response")}async getCode(e,r){const{address:n,blockTag:s}=await t({address:Ps(e),blockTag:this._getBlockTag(r)});return le(await au(this,Hl,"m",eu).call(this,{method:"getCode",address:n,blockTag:s}))}async getStorageAt(e,r,n){const s=Wo.getBigInt(r),{address:i,blockTag:o}=await t({address:Ps(e),blockTag:this._getBlockTag(n)});return le(await au(this,Hl,"m",eu).call(this,{method:"getStorageAt",address:i,position:s,blockTag:o}))}async broadcastTransaction(t){throw new Error}async getBlock(t){const e=(await this.getNetwork()).formatter,r=await au(this,Hl,"m",nu).call(this,t,!1);return null==r?null:e.block(r,this)}async getBlockWithTransactions(t){const e=(await this.getNetwork()).formatter,r=au(this,Hl,"m",nu).call(this,t,!0);return null==r?null:e.blockWithTransactions(r,this)}async getTransaction(t){const e=(await this.getNetwork()).formatter,r=await au(this,Hl,"m",eu).call(this,{method:"getTransaction",hash:t});return e.transactionResponse(r,this)}async getTransactionReceipt(t){const e=(await this.getNetwork()).formatter,r=await au(this,Hl,"m",eu).call(this,{method:"getTransactionReceipt",hash:t});if(null==r)return null;if(null==r.gasPrice&&null==r.effectiveGasPrice){const e=await au(this,Hl,"m",eu).call(this,{method:"getTransaction",hash:t});r.effectiveGasPrice=e.gasPrice}return e.receipt(r,this)}async _getFilter(e){const r=(e.topics||[]).map((t=>null==t?null:Array.isArray(t)?hu(t.map((t=>t.toLowerCase()))):t.toLowerCase())),n="blockHash"in e?e.blockHash:void 0,s={};e.address&&(Array.isArray(e.address)?s.address=Promise.all(e.address.map((t=>Ps(t,this)))):s.address=Ps(e.address,this));const i=t=>{null!=e[t]&&(s[t]=this._getBlockTag(e[t]))};i("fromBlock"),i("toBlock");const o=await t(s);if(Array.isArray(o.address)&&o.address.sort(),o.topics=r,n){if(e.fromBlock||e.toBlock)throw new Error("invalid filter");o.blockHash=n}return o}async getLogs(e){const{network:r,filter:n}=await t({network:this.getNetwork(),filter:this._getFilter(e)});return(await au(this,Hl,"m",eu).call(this,{method:"getLogs",filter:n})).map((t=>r.formatter.log(t,this)))}_getProvider(t){return Wo.throwError("provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await ca.fromName(this,t)}async getAvatar(t){const e=await this.getResolver(t);return e?await e.getAvatar():null}async resolveName(t){if("string"!=typeof t){const e=await t.getAddress();return null==e?Wo.throwArgumentError("Addressable returned no address","name",t):e}{const e=await this.getResolver(t);if(e)return await e.getAddress()}return null}async lookupAddress(t){throw new Error}async waitForTransaction(t,e=1,r){return 0===e?this.getTransactionReceipt(t):new Promise((async(n,s)=>{let i=null;const o=async r=>{try{const s=await this.getTransactionReceipt(t);if(null!=s&&r-s.blockNumber+1>=e)return n(s),this.off("block",o),void(i&&(clearTimeout(i),i=null))}catch(t){console.log("EEE",t)}this.once("block",o)};null!=r&&(i=setTimeout((()=>{null!=i&&(i=null,this.off("block",o),s(Wo.makeError("timeout","TIMEOUT",{reason:"timeout"})))}),r)),o(await this.getBlockNumber())}))}async waitForBlock(t){throw new Error}_clearTimeout(t){const e=au(this,Ql,"f").get(t);e&&(e.timer&&clearTimeout(e.timer),au(this,Ql,"f").delete(t))}_setTimeout(t,e=0){var r,n;const s=(ou(this,Zl,(n=au(this,Zl,"f"),r=n++,n),"f"),r),i=()=>{au(this,Ql,"f").delete(s),t()};if(this.paused)au(this,Ql,"f").set(s,{timer:null,func:i,time:e});else{const t=setTimeout(i,e);au(this,Ql,"f").set(s,{timer:t,func:i,time:du()})}return s}_forEachSubscriber(t){for(const e of au(this,Vl,"f").values())t(e.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"network":return new uu(t.type);case"block":return new jl(this);case"event":return new Wl(this,t.filter);case"transaction":return new zl(this,t.hash);case"orphan":return new $l(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,e){for(const r of au(this,Vl,"f").values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=e,r.started&&e.start(),null!=au(this,Jl,"f")&&e.pause(au(this,Jl,"f"));break}}async on(t,e){const r=await au(this,Hl,"m",iu).call(this,t);return r.listeners.push({listener:e,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=au(this,Jl,"f")&&r.subscriber.pause(au(this,Jl,"f"))),this}async once(t,e){const r=await au(this,Hl,"m",iu).call(this,t);return r.listeners.push({listener:e,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=au(this,Jl,"f")&&r.subscriber.pause(au(this,Jl,"f"))),this}async emit(t,...e){const r=await au(this,Hl,"m",su).call(this,t,e);if(!r)return!1;const n=r.listeners.length;return r.listeners=r.listeners.filter((({listener:r,once:n})=>{const s=new o(this,n?null:r,t);try{r.call(this,...e,s)}catch(t){}return!n})),n>0}async listenerCount(t){if(t){const e=await au(this,Hl,"m",su).call(this,t);return e?e.listeners.length:0}let e=0;for(const{listeners:t}of au(this,Vl,"f").values())e+=t.length;return e}async listeners(t){if(t){const e=await au(this,Hl,"m",su).call(this,t);return e?e.listeners.map((({listener:t})=>t)):[]}let e=[];for(const{listeners:t}of au(this,Vl,"f").values())e=e.concat(t.map((({listener:t})=>t)));return e}async off(t,e){const r=await au(this,Hl,"m",su).call(this,t);if(!r)return this;if(e){const t=r.listeners.map((({listener:t})=>t)).indexOf(e);t>=0&&r.listeners.splice(t,1)}return e&&0!==r.listeners.length||(r.started&&r.subscriber.stop(),au(this,Vl,"f").delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:e,started:r,subscriber:n}=await au(this,Hl,"m",iu).call(this,t);r&&n.stop(),au(this,Vl,"f").delete(e)}else for(const[t,{started:e,subscriber:r}]of au(this,Vl,"f"))e&&r.stop(),au(this,Vl,"f").delete(t);return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return this.off(t,e)}async shutdown(){this.removeAllListeners();for(const t of au(this,Ql,"f").keys())this._clearTimeout(t)}get paused(){return null!=au(this,Jl,"f")}pause(t){if(null!=au(this,Jl,"f")){if(au(this,Jl,"f")==!!t)return;return Wo.throwError("cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((e=>e.pause(t))),ou(this,Jl,!!t,"f");for(const t of au(this,Ql,"f").values())t.timer&&clearTimeout(t.timer),t.time=du()-t.time}resume(){if(null!=au(this,Jl,"f")){this._forEachSubscriber((t=>t.resume())),ou(this,Jl,null,"f");for(const t of au(this,Ql,"f").values()){let e=t.time;e<0&&(e=0),t.time=du(),setTimeout(t.func,e)}}}}function wu(t,e){try{const r=gu(t,e);if(r)return ii(r)}catch(t){}return null}function gu(t,e){if("0x"===t)return null;try{const r=Wo.getNumber(de(t,e,e+32)),n=Wo.getNumber(de(t,r,r+32));return de(t,r+32,r+32+n)}catch(t){}return null}function mu(t){const e=vt(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function yu(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}Vl=new WeakMap,Kl=new WeakMap,Jl=new WeakMap,ql=new WeakMap,Xl=new WeakMap,Yl=new WeakMap,Zl=new WeakMap,Ql=new WeakMap,tu=new WeakMap,Hl=new WeakSet,eu=async function(t){const e=lu(t.method,t);let r=au(this,Yl,"f").get(e);return r||(r=this._perform(t),au(this,Yl,"f").set(e,r),setTimeout((()=>{au(this,Yl,"f").get(e)===r&&au(this,Yl,"f").delete(e)}),250)),await r},ru=async function t(e,r,n){n>=10&&Wo.throwError("CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:r,enableCcipRead:!0})});const s=e;try{return le(await this._perform({method:"call",transaction:s,blockTag:r}))}catch(e){if(!this.disableCcipRead&&u(e)&&n>=0&&"latest"===r&&null!=s.to&&"0x556f1830"===de(e.data,0,4)){const i=e.data,o=await Ps(s.to,this);let a;try{a=function(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};if(fe(t)<160)throw new Error("insufficient OffchainLookup data");const r=de(t,0,32);if(de(r,0,12)!==de(Eu,0,12))throw new Error("corrupt OffchainLookup sender");e.sender=de(r,12);try{const r=[],n=Wo.getNumber(de(t,32,64)),s=Wo.getNumber(de(t,n,n+32)),i=de(t,n+32);for(let t=0;t<s;t++){const e=wu(i,32*t);if(null==e)throw new Error("abort");r.push(e)}e.urls=r}catch(t){throw new Error("corrupt OffchainLookup urls")}try{const r=gu(t,64);if(null==r)throw new Error("abort");e.calldata=r}catch(t){throw new Error("corrupt OffchainLookup calldata")}if(de(t,100,128)!==de(Eu,0,28))throw new Error("corrupt OffchainLookup callbaackSelector");e.selector=de(t,96,100);try{const r=gu(t,128);if(null==r)throw new Error("abort");e.extraData=r}catch(t){throw new Error("corrupt OffchainLookup extraData")}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map((t=>e[t])),e}(de(e.data,4))}catch(t){return Wo.throwError(t.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:i}})}if(a.sender.toLowerCase()!==o.toLowerCase())return Wo.throwError("CCIP Read sender mismatch","CALL_EXCEPTION",{data:i,transaction:s,errorSignature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",errorName:"OffchainLookup",errorArgs:a.errorArgs});const c=await this.ccipReadFetch(s,a.calldata,a.urls);return null==c?Wo.throwError("CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:e.data,errorArgs:a.errorArgs}}):au(this,Hl,"m",t).call(this,{to:o,data:he([a.selector,vu([c,a.extraData])])},r,n+1)}throw e}},nu=async function(t,e){const r=(await this.getNetwork()).formatter;return te(t,32)?await au(this,Hl,"m",eu).call(this,{method:"getBlock",blockHash:t,includeTransactions:e}):await au(this,Hl,"m",eu).call(this,{method:"getBlock",blockTag:r.blockTag(t),includeTransactions:e})},su=async function(t,e){let r=await fu(t,this);return"event"===r.type&&e&&e.length>0&&!0===e[0].removed&&(r=await fu({orphan:"drop-log",log:e[0]},this)),au(this,Vl,"f").get(r.tag)||null},iu=async function(t){const e=await fu(t,this),r=e.tag;let n=au(this,Vl,"f").get(r);if(!n){n={subscriber:this._getSubscriber(e),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},au(this,Vl,"f").set(r,n)}return n};const bu=new Uint8Array([]);function vu(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(bu),r+=32;for(let n=0;n<t.length;n++){const s=Wo.getBytes(t[n]);e[n]=mu(r),e.push(mu(s.length)),e.push(yu(s)),r+=32+32*Math.ceil(s.length/32)}return he(e)}const Eu="0x0000000000000000000000000000000000000000000000000000000000000000";var Au,Tu,ku,Pu,Nu,xu,Ou=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},Iu=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r};class Su{constructor(t){Au.add(this),r(this,{provider:t||null})}async getBalance(t){return Ou(this,Au,"m",Tu).call(this,"getBalance").getBalanceOf(await this.getAddress(),t)}async getTransactionCount(t){return Ou(this,Au,"m",Tu).call(this,"getTransactionCount").getTransactionCountOf(await this.getAddress(),t)}async estimateGas(t){return Ou(this,Au,"m",Tu).call(this,"estimateGas").estimateGas(await Ou(this,Au,"m",ku).call(this,t))}async call(t){return Ou(this,Au,"m",Tu).call(this,"call").call(await Ou(this,Au,"m",ku).call(this,t))}async populateTransaction(e){const r=Ou(this,Au,"m",Tu).call(this,"populateTransaction");let n=Object.assign({},e);if(null!=n.to&&(n.to=r.resolveName(n.to).then((t=>null==t?Wo.throwArgumentError("transaction to ENS name not configured","tx.to",n.to):t))),null!=n.from){const t=n.from;n.from=Promise.all([this.getAddress(),this.resolveName(t)]).then((([t,e])=>e&&t.toLowerCase()===e.toLowerCase()?t:Wo.throwArgumentError("transaction from mismatch","tx.from",e)))}return null==n.nonce&&(n.nonce=this.getTransactionCount()),n=t(n),null==n.gasLimit&&(n.gasLimit=r.estimateGas(n)),n=t(n),await t(n)}async resolveName(t){const e=Ou(this,Au,"m",Tu).call(this,"resolveName");return await e.resolveName(t)}async sendTransaction(t){const e=Ou(this,Au,"m",Tu).call(this,"sendTransaction"),r=$c.from(await this.populateTransaction(t));return await e.broadcastTransaction(await this.signTransaction(r))}}Au=new WeakSet,Tu=function(t){return this.provider?this.provider:Wo.throwError("missing provider","UNSUPPORTED_OPERATION",{operation:t})},ku=async function(t){const e=[];if(null!=(t=Object.assign({},t)).from){const r=t.from;e.push(Promise.all([this.getAddress(),this.resolveName(r)]).then((([e,r])=>{r&&e.toLowerCase()===r.toLowerCase()||Wo.throwArgumentError("transaction from mismatch","tx.from",r),t.from=e})))}return await Promise.all(e),t};class Ru extends Su{constructor(t,e){super(e),Pu.add(this),r(this,{address:t})}async getAddress(){return this.address}connect(t){return new Ru(this.address,t)}async signTransaction(t){Ou(this,Pu,"m",Nu).call(this,"transactions","signTransaction")}async signMessage(t){Ou(this,Pu,"m",Nu).call(this,"messages","signMessage")}async signTypedData(t,e,r){Ou(this,Pu,"m",Nu).call(this,"typed-data","signTypedData")}}Pu=new WeakSet,Nu=function(t,e){return Wo.throwError(`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:e})};class Bu extends Su{constructor(t){super(t.provider),xu.set(this,void 0),Iu(this,xu,t,"f")}async getAddress(){return await Ou(this,xu,"f").getAddress()}connect(t){return new Bu(Ou(this,xu,"f").connect(t))}async signTransaction(t){return await Ou(this,xu,"f").signTransaction(t)}async sendTransaction(t){return await Ou(this,xu,"f").sendTransaction(t)}async signMessage(t){return await Ou(this,xu,"f").signMessage(t)}async signTypedData(t,e,r){return await Ou(this,xu,"f").signTypedData(t,e,r)}}xu=new WeakMap;const _u=new Set;function Cu(t){_u.has(t)||(_u.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (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 Fu,Uu,Lu,Du,Mu,ju,Gu,$u,zu=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Wu=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Hu{constructor(t){Fu.add(this),Uu.set(this,void 0),Lu.set(this,void 0),Du.set(this,void 0),Mu.set(this,void 0),zu(this,Uu,t,"f"),zu(this,Lu,null,"f"),zu(this,Du,Wu(this,Fu,"m",ju).bind(this),"f"),zu(this,Mu,null,"f")}_subscribe(t){throw new Error("subclasses must override this")}_emitResults(t,e){throw new Error("subclasses must override this")}_recover(t){throw new Error("subclasses must override this")}start(){Wu(this,Fu,"m",ju).call(this,-2)}stop(){Wu(this,Fu,"m",Gu).call(this),Wu(this,Uu,"f").off("block",Wu(this,Du,"f"))}pause(t){t&&Wu(this,Fu,"m",Gu).call(this),Wu(this,Uu,"f").off("block",Wu(this,Du,"f"))}resume(){this.start()}}Uu=new WeakMap,Lu=new WeakMap,Du=new WeakMap,Mu=new WeakMap,Fu=new WeakSet,ju=async function(t){try{null==Wu(this,Lu,"f")&&zu(this,Lu,this._subscribe(Wu(this,Uu,"f")),"f");const t=await Wu(this,Lu,"f");if(null==t)return void Wu(this,Uu,"f")._recoverSubscriber(this,this._recover(Wu(this,Uu,"f")));const e=await Wu(this,Uu,"f").getNetwork();if(Wu(this,Mu,"f")||zu(this,Mu,e,"f"),Wu(this,Mu,"f").chainId!==e.chainId)throw new Error("chaid changed");const r=await Wu(this,Uu,"f").send("eth_getFilterChanges",[t]);await this._emitResults(Wu(this,Uu,"f"),r)}catch(t){console.log("@TODO",t)}Wu(this,Uu,"f").once("block",Wu(this,Du,"f"))},Gu=function(){const t=Wu(this,Lu,"f");t&&(zu(this,Lu,null,"f"),t.then((t=>{Wu(this,Uu,"f").send("eth_uninstallFilter",[t])})))};class Vu extends Hu{constructor(t,e){var r;super(t),$u.set(this,void 0),zu(this,$u,(r=e,JSON.parse(JSON.stringify(r))),"f")}_recover(t){return new Wl(t,Wu(this,$u,"f"))}async _subscribe(t){const e=await t.send("eth_newFilter",[Wu(this,$u,"f")]);return console.log("____SUB",e),e}async _emitResults(t,e){const r=await t.getNetwork();for(const n of e){const e=r.formatter.log(n,t);t.emit(Wu(this,$u,"f"),e)}}}$u=new WeakMap;class Ku extends Hu{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,e){const r=await t.getNetwork();for(const n of e)t.emit("pending",r.formatter.hash(n))}}var Ju,qu,Xu,Yu,Zu=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Qu=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const th="bigint,boolean,function,number,string,symbol".split(/,/g);function eh(t){if(null==t||th.indexOf(typeof t)>=0)return t;if("function"==typeof t.getAddress)return t;if(Array.isArray(t))return t.map(eh);if("object"==typeof t)return Object.keys(t).reduce(((e,r)=>(e[r]=t[r],e)),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function rh(t){return t?t.toLowerCase():t}const nh={polling:!1,batchMaxSize:1<<20,batchStallTime:250};class sh{constructor(t,e){r(this,{provider:t,address:e})}connect(t){return Wo.throwError("cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async getNetwork(){return await this.provider.getNetwork()}async getFeeData(){return await this.provider.getFeeData()}async estimateGas(t){return await this.provider.estimateGas(t)}async call(t){return await this.provider.call(t)}async resolveName(t){return await this.provider.resolveName(t)}async getBalance(t){return await this.provider.getBalanceOf(this.address)}async getTransactionCount(t){return await this.provider.getTransactionCountOf(this.address)}async sendUncheckedTransaction(t){const e=eh(t),r=[];if(e.from){const n=e.from;r.push((async()=>{const r=await Ps(n,this.provider);null!=r&&r.toLowerCase()===this.address.toLowerCase()||Wo.throwArgumentError("from address mismatch","transaction",t),e.from=r})())}else e.from=this.address;if(null==e.gasLimit&&r.push((async()=>{e.gasLimit=await this.provider.estimateGas(Object.assign(Object.assign({},e),{from:this.address}))})()),null!=e.to){const t=e.to;r.push((async()=>{e.to=await Ps(t,this.provider)})())}r.length&&await Promise.all(r);const n=this.provider.getRpcTransaction(e);return this.provider.send("eth_sendTransaction",[n])}async sendTransaction(t){const e=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(t);return await new Promise(((t,n)=>{const s=[1e3,100],i=async()=>{const n=await this.provider.getTransaction(r);null==n?this.provider._setTimeout((()=>{i()}),s.pop()||4e3):t(this.provider._wrapTransaction(n,r,e))};i()}))}async signTransaction(t){const e=eh(t);if(e.from){const r=await Ps(e.from,this.provider);if(null==r||r.toLowerCase()!==this.address.toLowerCase())return Wo.throwArgumentError("from address mismatch","transaction",t);e.from=r}else e.from=this.address;const r=this.provider.getRpcTransaction(e);return await this.provider.send("eth_sign_Transaction",[r])}async signMessage(t){const e="string"==typeof t?ei(t):t;return await this.provider.send("personal_sign",[le(e),this.address.toLowerCase()])}async signTypedData(t,e,r){const n=eh(r),s=await uo.resolveNames(t,e,n,(async t=>{const e=await Ps(t);return null==e?Wo.throwArgumentError("TypedData does not support null address","value",t):e}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(uo.getPayload(s.domain,e,s.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){const e="string"==typeof t?ei(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),le(e)])}}class ih extends pu{constructor(t){super(t),Ju.set(this,void 0),qu.set(this,void 0),Zu(this,Ju,1,"f"),Zu(this,qu,Object.assign({},nh),"f")}_getOptions(t){return Qu(this,qu,"f")[t]}_setOptions(t){for(const e in t){const r=e,n=t[r];if(typeof n!=typeof Qu(this,qu,"f")[r])return Wo.throwArgumentError("invalid option value",`options.${r}`,n)}for(const e in t){const r=e;Qu(this,qu,"f")[r]=t[r]}}prepareRequest(t,e){var r,n;return{method:t,params:e,id:(Zu(this,Ju,(n=Qu(this,Ju,"f"),r=n++,n),"f"),r),jsonrpc:"2.0"}}async send(t,e){throw new Error("sub-class must implement this")}async getSigner(t=0){const e=await this.getNetwork(),r=await this.send("eth_accounts",[]);if("number"==typeof t){if(t>r.length)throw new Error("no such account");return new sh(this,r[t])}t=e.formatter.address(t);for(const t of r)if(e.formatter.address(t)===t)return new sh(this,t);throw new Error("invalid account")}async _detectNetwork(){return vl.from(Wo.getBigInt(await this._perform({method:"chainId"})))}_getSubscriber(t){return"pending"===t.type?new Ku(this):"event"===t.type?new Vu(this,t.filter):"orphan"===t.type&&"drop-log"===t.filter.orphan?new uu("orphan"):super._getSubscriber(t)}getRpcTransaction(t){const e={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((r=>{if(null==t[r])return;let n=r;"gasLimit"===r&&(n="gas"),e[n]=ue(t[r])})),["from","to","data"].forEach((r=>{null!=t[r]&&(e[r]=le(t[r]))})),t.accessList&&(e.accessList=yc(t.accessList)),e}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[rh(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[rh(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[rh(t.address),t.blockTag]};case"getStorageAt":return{method:"eth_getStorageAt",args:[rh(t.address),"0x"+t.position.toString(16),t.blockTag]};case"sendTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&null!=t.filter.address&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(rh):t.filter.address=rh(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,e,r){if("eth_call"===t){const t=ch(r);return t?Wo.makeError("execution reverted during JSON-RPC call","CALL_EXCEPTION",{data:t.data,transaction:e[0]}):Wo.makeError("missing revert data during JSON-RPC call","CALL_EXCEPTION",{data:"0x",transaction:e[0],info:{error:r}})}const n=JSON.stringify(function(t){const e=[];return lh(t,e),e}(r));return n.match(/insufficient funds|base fee exceeds gas limit/)?Wo.makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:e[0]}):n.match(/nonce/)&&n.match(/too low/)?Wo.makeError("nonce has already been used","NONCE_EXPIRED",{transaction:e[0]}):n.match(/replacement transaction/)&&n.match(/underpriced/)?Wo.makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:e[0]}):n.match(/only replay-protected/)?Wo.makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:t,info:{transaction:e[0]}}):"estimateGas"===t&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted/)?Wo.makeError("cannot estimate gas; transaction may fail or may require manual gas limit","UNPREDICTABLE_GAS_LIMIT",{transaction:e[0]}):r}async _perform(t){if("call"===t.method||"estimateGas"===t.method){let e=t.transaction;if(e&&null!=e.type&&Wo.getBigInt(e.type)&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=await this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&(t=Object.assign({},t,{transaction:Object.assign({},e,{type:void 0})}))}}const e=this.getRpcRequest(t);if(null!=e){this.emit("debug",{type:"sendRequest",request:e});try{const t=await this.send(e.method,e.args);return this.emit("debug",{type:"getResponse",result:t}),t}catch(t){throw this.emit("debug",{type:"getError",error:t}),this.getRpcError(e.method,e.args,t)}}return super._perform(t)}}Ju=new WeakMap,qu=new WeakMap;class oh extends ih{constructor(t,e){null==t&&(t="http://localhost:8545"),super(e),Xu.set(this,void 0),Yu.set(this,void 0),"string"==typeof t?Zu(this,Xu,{request:new Mo(t)},"f"):(Zu(this,Xu,Object.assign({},t),"f"),Qu(this,Xu,"f").request=Qu(this,Xu,"f").request.clone()),Zu(this,Yu,4e3,"f")}async send(t,e){var r;r=e,e=JSON.parse(JSON.stringify(r));const n=Object.assign({},Qu(this,Xu,"f"));n.request=n.request.clone(),n.request.body=this.prepareRequest(t,e);const s=await zo(n);s.assertOk();const i=s.bodyJson;return"error"in i?Wo.throwError("error from JSON-RPC","UNKNOWN_ERROR",{result:i}):i.result}get pollingInterval(){return Qu(this,Yu,"f")}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");Zu(this,Yu,t,"f"),this._forEachSubscriber((t=>{(function(t){return t&&"number"==typeof t.pollingInterval})(t)&&(t.pollingInterval=Qu(this,Yu,"f"))}))}}Xu=new WeakMap,Yu=new WeakMap;class ah extends oh{constructor(t,e){super(t,e),r(this,{network:e})}async _detectNetwork(){return this.network}}function ch(t){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")&&te(t.data))return{message:t.message,data:t.data};if("object"==typeof t){for(const e in t){const r=ch(t[e]);if(r)return r}return null}if("string"==typeof t)try{return ch(JSON.parse(t))}catch(t){}return null}function lh(t,e){if(null!=t){if("string"==typeof t.message&&e.push(t.message),"object"==typeof t)for(const r in t)lh(t[r],e);if("string"==typeof t)try{return lh(JSON.parse(t),e)}catch(t){}}}const uh="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class hh extends ah{constructor(t="homestead",e){const n=vl.from(t);null==e&&(e=uh);super(hh.getConnection(n,e),n),r(this,{apiKey:e}),super._setOptions({polling:!0})}_getProvider(t){try{return new hh(t,this.apiKey)}catch(t){}return super._getProvider(t)}static getConnection(t,e){null==e&&(e=uh);const r=new Mo(`https://${function(t){switch(t){case"homestead":return"rpc.ankr.com/eth";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}return Wo.throwArgumentError("unsupported network","network",t)}(t.name)}/${e}`);r.allowGzip=!0;return{request:r,throttleRetry:async(t,r,n)=>(e===uh&&Cu("AnkrProvider"),!0)}}isCommunityResource(){return this.apiKey===uh}}const fh="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class dh extends ah{constructor(t="homestead",e){const n=vl.from(t);null==e&&(e=fh),super(dh.getConnection(n,e),n),r(this,{apiKey:e})}_getProvider(t){try{return new dh(t,this.apiKey)}catch(t){}return super._getProvider(t)}isCommunityResource(){return this.apiKey===fh}static getConnection(t,e){null==e&&(e=fh);const r=new Mo(`https://${function(t){switch(t){case"homestead":return"eth-mainnet.alchemyapi.io";case"ropsten":return"eth-ropsten.alchemyapi.io";case"rinkeby":return"eth-rinkeby.alchemyapi.io";case"goerli":return"eth-goerli.alchemyapi.io";case"kovan":return"eth-kovan.alchemyapi.io";case"matic":return"polygon-mainnet.g.alchemy.com";case"maticmum":return"polygon-mumbai.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-rinkeby":return"arb-rinkeby.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-kovan":return"opt-kovan.g.alchemy.com"}return Wo.throwArgumentError("unsupported network","network",t)}(t.name)}/v2/${e}`);r.allowGzip=!0;return{request:r,throttleRetry:async(t,r,n)=>(e===fh&&Cu("alchemy"),!0)}}}class ph extends ah{constructor(t="homestead"){const e=vl.from(t);if("homestead"!==e.name)return Wo.throwArgumentError("unsupported network","network",t);super("https://cloudflare-eth.com/",e)}}class wh extends pu{constructor(t,e){super();const n=vl.from(t);if(null==e){const t=n.getPlugin("org.ethers.plugins.etherscan");e=t?t.communityApiKey:"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"}r(this,{apiKey:e,network:n}),this.getBaseUrl()}getBaseUrl(){const t=this.network.getPlugin("org.ethers.plugins.etherscan");if(t)return t.baseUrl;switch(this.network.name){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return Wo.throwArgumentError("unsupported network","network",this.network)}getUrl(t,e){const r=Object.keys(e).reduce(((t,r)=>{const n=e[r];return null!=n&&(t+=`&${r}=${n}`),t}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${t}${r}${n}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e}async detectNetwork(){return this.network}async fetch(t,e,r){const n=r?this.getPostUrl():this.getUrl(t,e),s=r?this.getPostData(t,e):null,i=new Mo(n),o={request:i,throttleSlotInterval:1e3,processResponse:async(e,r)=>{const n=r.hasBody()?JSON.parse(ii(r.body)):{},s=("string"==typeof n.result?n.result:"").toLowerCase().indexOf("rate limit")>=0;return"proxy"===t?n&&0==n.status&&"NOTOK"==n.message&&s&&r.throwThrottleError(n.result):s&&r.throwThrottleError(n.result),r}};s&&(i.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),i.body=Object.keys(s).map((t=>`${t}=${s[t]}`)).join("&"));const a=await zo(o);if(a.assertOk(),!a.hasBody())throw new Error;const c=JSON.parse(ii(a.body));if("proxy"===t){if("2.0"!=c.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(c),t}if(c.error){const t=new Error(c.error.message||"unknown error");throw c.error.code&&(t.code=c.error.code),c.error.data&&(t.data=c.error.data),t}return c.result}if(0==c.status&&("No records found"===c.message||"No transactions found"===c.message))return c.result;if(1!=c.status||"OK"!=c.message){const t=new Error("invalid response");throw t.result=JSON.stringify(c),t}return c.result}_getTransactionPostData(t){const e={};for(let r in t){if(null==t[r])continue;let n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?ue(le(n)):"accessList"===r?"["+this.network.formatter.accessList(n).map((t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`)).join(",")+"]":le(n),e[r]=n)}return e}_checkError(t,e,r){throw e}async _detectNetwork(){return this.network}async _perform(t){switch(t.method){case"chainId":return this.network.chainId;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=>this._checkError(t,e,t.signedTransaction)));case"getBlock":return"blockTag"in t?this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}):Wo.throwError("getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.hash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=this._getTransactionPostData(t.transaction);e.module="proxy",e.action="eth_call";try{return await this.fetch("proxy",e,!0)}catch(e){return this._checkError(t,e,t.transaction)}}case"estimateGas":{const e=this._getTransactionPostData(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return await this.fetch("proxy",e,!0)}catch(e){return this._checkError(t,e,t.transaction)}}}return super._perform(t)}async getNetwork(){return this.network}async getEtherPrice(){return"homestead"!==this.network.name?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}isCommunityResource(){const t=this.network.getPlugin("org.ethers.plugins.etherscan");return t?t.communityApiKey===this.apiKey:"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"===this.apiKey}}const gh="84842078b09946638c03157f83405213";class mh extends ah{constructor(t="homestead",e,n){const s=vl.from(t);null==e&&(e=gh),null==n&&(n=null);super(mh.getConnection(s,e,n),s),r(this,{projectId:e,projectSecret:n})}_getProvider(t){try{return new mh(t,this.projectId,this.projectSecret)}catch(t){}return super._getProvider(t)}static getConnection(t,e,r){null==e&&(e=gh),null==r&&(r=null);const n=new Mo(`https://${function(t){switch(t){case"homestead":return"mainnet.infura.io";case"ropsten":return"ropsten.infura.io";case"rinkeby":return"rinkeby.infura.io";case"kovan":return"kovan.infura.io";case"goerli":return"goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"maticmum":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-kovan":return"optimism-kovan.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-rinkeby":return"arbitrum-rinkeby.infura.io"}return Wo.throwArgumentError("unsupported network","network",t)}(t.name)}/v3/${e}`);n.allowGzip=!0,r&&n.setCredentials("",r);return{request:n,throttleRetry:async(t,r,n)=>(e===gh&&Cu("InfuraProvider"),!0)}}isCommunityResource(){return this.projectId===gh}}const yh={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};function bh(t,e,r,n){n=!!n;let s=!1,i=e;return null==i?(i=yh[t.name],null==i&&Wo.throwArgumentError("network does not support default applicationId","applicationId",e),n=!0,s=!0):i===yh[t.name]&&(n=!0,s=!0),null==r&&(r=null),{applicationId:i,applicationSecretKey:r,community:s,loadBalancer:n}}class vh extends ah{constructor(t="homestead",e,n,s){const i=vl.from(t),{applicationId:o,applicationSecretKey:a,loadBalancer:c}=bh(i,e,n,s);super(vh.getConnection(i,o,a,c),i),r(this,{applicationId:o,applicationSecretKey:a,loadBalancer:c})}static getConnection(t,e,r,n){const{applicationId:s,applicationSecretKey:i,community:o,loadBalancer:a}=bh(t,e,r,n);let c=`https://${function(t){switch(t){case"homestead":return"eth-mainnet.gateway.pokt.network";case"ropsten":return"eth-ropsten.gateway.pokt.network";case"rinkeby":return"eth-rinkeby.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network"}return Wo.throwArgumentError("unsupported network","network",t)}(t.name)}/v1/`;a&&(c+="lb/"),c+=s;const l=new Mo(c);l.allowGzip=!0,i&&l.setCredentials("",i);return{request:l,throttleRetry:async(t,e,r)=>(o&&Cu("PocketProvider"),!0)}}isCommunityResource(){return this.applicationId===yh[this.network.name]}}var Eh,Ah,Th,kh,Ph,Nh,xh,Oh,Ih,Sh=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Rh=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Bh=BigInt("1"),_h=BigInt("2");function Ch(){return(new Date).getTime()}const Fh={stallTimeout:400,priority:1,weight:1},Uh={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};function Lh(t,e,r){switch(r.method){case"chainId":case"getGasPrice":case"getBalance":case"estimateGas":return Wo.getBigInt(e).toString();case"getBlockNumber":case"getTransactionCount":return Wo.getNumber(e).toString();case"getCode":case"getStorageAt":case"call":return le(e);case"getBlock":return r.includeTransactions?JSON.stringify(t.formatter.blockWithTransactions(e)):JSON.stringify(t.formatter.block(e));case"getTransaction":return JSON.stringify(t.formatter.transactionResponse(e));case"getTransactionReceipt":return JSON.stringify(t.formatter.receipt(e));case"getLogs":return JSON.stringify(e.map((e=>t.formatter.log(e))))}return Wo.throwError("unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${JSON.stringify(r.method)})`})}function Dh(t,e){const r=new Map;for(const{result:t,normal:n,weight:s}of e){const e=r.get(n)||{result:t,weight:0};e.weight+=s,r.set(n,e)}let n,s=0;for(const{weight:e,result:i}of r.values())e>=t&&e>s&&(s=e,n=i);return n}function Mh(t){const e=t.map((t=>BigInt(t.result)));e.sort(((t,e)=>t<e?-1:e>t?1:0));const r=e.length/2;return e.length%2?e[r]:(e[r-1]+e[r]+Bh)/_h}class jh extends pu{constructor(t,e){super(e),Eh.add(this),Ah.set(this,void 0),Th.set(this,void 0),kh.set(this,void 0),Sh(this,Ah,t.map((t=>t instanceof pu?Object.assign({provider:t},Fh,Uh):Object.assign({},Fh,t,Uh))),"f"),Sh(this,Th,-2,"f"),Sh(this,kh,null,"f"),this.quorum=2,this.eventQuorum=1,this.eventWorkers=1,this.quorum>Rh(this,Ah,"f").reduce(((t,e)=>t+e.weight),0)&&Wo.throwArgumentError("quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return Rh(this,Ah,"f").slice()}async _detectNetwork(){return vl.from(Wo.getBigInt(await this._perform({method:"chainId"}))).freeze()}async _perform(t){await Rh(this,Eh,"m",xh).call(this);const e=new Set;for(let r=0;r<this.quorum;r++)Rh(this,Eh,"m",Nh).call(this,e,t);const r=Rh(this,Eh,"m",Ih).call(this,e,t);for(const t of e)t.done=!0;return r}}Ah=new WeakMap,Th=new WeakMap,kh=new WeakMap,Eh=new WeakSet,Ph=function(t){const e=Rh(this,Ah,"f").slice();!function(t){for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}}(e),e.sort(((t,e)=>e.priority-t.priority));for(const r of e)if(-1===t.indexOf(r))return r;return null},Nh=function(t,e){const r=Rh(this,Eh,"m",Ph).call(this,Array.from(t).map((t=>t.config)));if(null==r)return null;const n={},s={config:r,result:n,didBump:!1,done:!1,perform:null,staller:null},i=Ch();return s.perform=(async()=>{try{r.requests++,n.result=await r.provider._perform(e)}catch(t){r.errorResponses++,n.error=t}s.done&&r.lateResponses++;const t=Ch()-i;r._totalTime+=t,r.rollingDuration=.95*r.rollingDuration+.05*t,s.perform=null})(),s.staller=(async()=>{var t;await(t=r.stallTimeout,new Promise((e=>{setTimeout(e,t)}))),s.staller=null})(),t.add(s),s},xh=async function(){let t=Rh(this,kh,"f");if(!t){const e=[];Rh(this,Ah,"f").forEach((t=>{e.push(async function(t,e){for(;t.blockNumber<0||t.blockNumber<e;)t._updateNumber||(t._updateNumber=(async()=>{const e=await t.provider.getBlockNumber();e>t.blockNumber&&(t.blockNumber=e),t._updateNumber=null})()),await t._updateNumber,t.outOfSync++}(t,0)),e.push((async()=>{t._network=await t.provider.getNetwork()})())})),Sh(this,kh,t=(async()=>{await Promise.all(e);let t=null;for(const e of Rh(this,Ah,"f")){const r=e._network;null==t?t=r.chainId:r.chainId!==t&&Wo.throwError("cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})(),"f")}await t},Oh=async function(t,e){const r=[];for(const n of t)if("result"in n.result){const t=n.result.result;r.push({result:t,normal:Lh(n.config._network,t,e),weight:n.config.weight})}if(!(r.reduce(((t,e)=>t+e.weight),0)<this.quorum)){switch(e.method){case"getBlockNumber":{if(-2===Rh(this,Th,"f")){const t=Math.ceil(Wo.getNumber(Mh(Rh(this,Ah,"f").map((t=>({result:t.blockNumber,normal:Wo.getNumber(t.blockNumber).toString(),weight:t.weight})))),"%internal"));Sh(this,Th,t,"f")}const t=function(t,e){if(1===t)return Wo.getNumber(Mh(e),"%internal");const r=new Map,n=(t,e)=>{const n=r.get(t)||{result:t,weight:0};n.weight+=e,r.set(t,n)};for(const{weight:t,result:r}of e){const e=Wo.getNumber(r);n(e-1,t),n(e,t),n(e+1,t)}let s,i=0;for(const{weight:e,result:n}of r.values())e>=t&&(e>i||null!=s&&e===i&&n>s)&&(i=e,s=n);return s}(this.quorum,r);if(void 0===t)return;return t>Rh(this,Th,"f")&&Sh(this,Th,t,"f"),Rh(this,Th,"f")}case"getGasPrice":case"estimateGas":return Mh(r);case"getBlock":return"blockTag"in e&&"pending"===e.blockTag?r[0].result:Dh(this.quorum,r);case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"getTransaction":case"getTransactionReceipt":case"getLogs":case"call":return Dh(this.quorum,r);case"sendTransaction":throw new Error("TODO")}return Wo.throwError("unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${JSON.stringify(e.method)})`})}},Ih=async function t(e,r){if(0===e.size)throw new Error("no runners?!");const n=[];let s=0;for(const t of e)t.perform&&n.push(t.perform),t.staller?n.push(t.staller):t.didBump||(t.didBump=!0,s++);const i=await Rh(this,Eh,"m",Oh).call(this,e,r);if(void 0!==i){if(i instanceof Error)throw i;return i}for(let t=0;t<s;t++)Rh(this,Eh,"m",Nh).call(this,e,r);if(0===n.length)throw new Error("quorum not met");return await Promise.race(n),await Rh(this,Eh,"m",t).call(this,e,r)};const Gh=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().WebSocket;var $h,zh,Wh,Hh,Vh,Kh,Jh,qh,Xh,Yh,Zh,Qh=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},tf=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class ef{constructor(t,e){$h.set(this,void 0),zh.set(this,void 0),Wh.set(this,void 0),Hh.set(this,void 0),Vh.set(this,void 0),Qh(this,$h,t,"f"),Qh(this,zh,JSON.stringify(e),"f"),Qh(this,Wh,null,"f"),Qh(this,Hh,null,"f"),Qh(this,Vh,null,"f")}get filter(){return JSON.parse(tf(this,zh,"f"))}start(){Qh(this,Wh,tf(this,$h,"f").send("eth_subscribe",this.filter).then((t=>(tf(this,$h,"f")._register(t,this),t))),"f")}stop(){tf(this,Wh,"f").then((t=>{tf(this,$h,"f").send("eth_unsubscribe",[t])})),Qh(this,Wh,null,"f")}pause(t){t||Wo.throwError("preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),Qh(this,Hh,!!t,"f")}resume(){Qh(this,Hh,null,"f")}_handleMessage(t){if(null!=tf(this,Wh,"f")&&null===tf(this,Hh,"f")){let e=tf(this,Vh,"f");e=null==e?this._emit(tf(this,$h,"f"),t):e.then((async()=>{await this._emit(tf(this,$h,"f"),t)})),Qh(this,Vh,e.then((()=>{tf(this,Vh,"f")===e&&Qh(this,Vh,null,"f")})),"f")}}async _emit(t,e){throw new Error("sub-classes must implemente this; _emit")}}$h=new WeakMap,zh=new WeakMap,Wh=new WeakMap,Hh=new WeakMap,Vh=new WeakMap;class rf extends ef{constructor(t){super(t,["newHeads"])}async _emit(t,e){t.emit("block",parseInt(e.number))}}class nf extends ef{constructor(t){super(t,["newPendingTransactions"])}async _emit(t,e){t.emit("pending",e)}}class sf extends ef{constructor(t,e){super(t,["logs",e]),Kh.set(this,void 0),Jh.set(this,void 0),Qh(this,Kh,JSON.stringify(e),"f"),Qh(this,Jh,t.getNetwork().then((t=>t.formatter)),"f")}get logFilter(){return JSON.parse(tf(this,Kh,"f"))}async _emit(t,e){const r=await tf(this,Jh,"f");t.emit(tf(this,Kh,"f"),r.log(e,t))}}Kh=new WeakMap,Jh=new WeakMap;class of extends ih{constructor(t){super(t),qh.set(this,void 0),Xh.set(this,void 0),Yh.set(this,void 0),Zh.set(this,void 0),Qh(this,qh,new Map,"f"),Qh(this,Xh,!1,"f"),Qh(this,Yh,new Map,"f"),Qh(this,Zh,new Map,"f")}_getSubscriber(t){switch(t.type){case"close":return new uu("close");case"block":return new rf(this);case"pending":return new nf(this);case"event":return new sf(this,t.filter);case"orphan":if("drop-log"===t.filter.orphan)return new uu("drop-log")}return super._getSubscriber(t)}_register(t,e){tf(this,Yh,"f").set(t,e);const r=tf(this,Zh,"f").get(t);if(r){for(const t of r)e._handleMessage(t);tf(this,Zh,"f").delete(t)}}async send(t,e){const r=this.prepareRequest(t,e),n=new Promise(((t,e)=>{tf(this,qh,"f").set(r.id,{payload:r,resolve:t,reject:e})}));return tf(this,Xh,"f")&&await this._write(JSON.stringify(r)),await n}async _start(){if(!tf(this,Xh,"f")){Qh(this,Xh,!0,"f");for(const{payload:t}of tf(this,qh,"f").values())await this._write(JSON.stringify(t))}}async _processMessage(t){const e=JSON.parse(t);if("id"in e){const t=tf(this,qh,"f").get(e.id);if(!t)return void console.log("Weird... Response for not a thing we sent");if(tf(this,qh,"f").delete(e.id),"error"in e){const{message:r,code:n,data:s}=e.error,i=Wo.makeError(r||"unkonwn error","SERVER_ERROR",{request:`ws:${JSON.stringify(t.payload)}`,info:{code:n,data:s}});t.reject(i)}else t.resolve(e.result)}else if("eth_subscription"===e.method){const t=e.params.subscription,r=tf(this,Yh,"f").get(t);if(r)r._handleMessage(e.params.result);else{let r=tf(this,Zh,"f").get(t);null==r&&(r=[],tf(this,Zh,"f").set(t,r)),r.push(e.params.result)}}}async _write(t){throw new Error("sub-classes must override this")}}qh=new WeakMap,Xh=new WeakMap,Yh=new WeakMap,Zh=new WeakMap;var af,cf=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},lf=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class uf extends of{constructor(t,e){super(e),af.set(this,void 0),cf(this,af,"string"==typeof t?new Gh(t):t,"f"),this.websocket.onopen=()=>{this._start()},this.websocket.onmessage=t=>{this._processMessage(t.data)}}get websocket(){return lf(this,af,"f")}async _write(t){this.websocket.send(t)}}function hf(t,e){if(null==e&&(e={}),"string"==typeof t&&t.match(/^https?:/))return new oh(t);if("string"==typeof t&&t.match(/^wss?:/)||(r=t)&&"function"==typeof r.send&&"function"==typeof r.close)return new uf(t);var r;const n=[];if("-"!==e.alchemy)try{n.push(new dh(t,e.alchemy))}catch(t){console.log(t)}if("-"!==e.ankr)try{n.push(new hh(t,e.ankr))}catch(t){console.log(t)}if("-"!==e.cloudflare)try{n.push(new ph(t))}catch(t){console.log(t)}if("-"!==e.etherscan)try{n.push(new wh(t,e.etherscan))}catch(t){console.log(t)}if("-"!==e.infura)try{let r,s=e.infura;"object"==typeof s&&(r=s.projectSecret,s=s.projectId),n.push(new mh(t,s,r))}catch(t){console.log(t)}if("-"!==e.pocket)try{let r,s,i=e.pocket;"object"==typeof i&&(s=!!i.loadBalancer,r=i.secretKey,i=i.appId),n.push(new vh(t,i,r,s))}catch(t){console.log(t)}if(0===n.length)throw new Error("TODO");return 1===n.length?n[0]:new jh(n)}af=new WeakMap;const ff=void 0;var df,pf,wf=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},gf=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mf extends Yc{constructor(t,e,n){super(t,t.provider);r(this,{args:e.decodeEventLog(n,t.data,t.topics),fragment:n,interface:e})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class yf extends Zc{constructor(t,e,r){super(r,e),df.set(this,void 0),wf(this,df,t,"f")}get logs(){return super.logs.map((t=>{const e=t.topics.length?gf(this,df,"f").getEvent(t.topics[0]):null;return e?new mf(t,gf(this,df,"f"),e):t}))}}df=new WeakMap;class bf extends Qc{constructor(t,e,r){super(r,e),pf.set(this,void 0),wf(this,pf,t,"f")}async wait(t){const e=await super.wait();return null==e?null:new yf(gf(this,pf,"f"),this.provider,e)}}pf=new WeakMap;class vf extends o{constructor(t,e,n,s,i){super(t,e,n);const o=new mf(i,t.interface,s);r(this,{args:t.interface.decodeEventLog(s,o.data,o.topics),fragment:s,log:o})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}const Ef=new T("@ethersproject/contract@6.0.0-beta.4");var Af,Tf=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},kf=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function Pf(t){return t&&"function"==typeof t.resolveName}class Nf{constructor(t,e,n){if(Af.set(this,void 0),r(this,{fragment:e}),e.inputs.length<n.length)throw new Error("too many arguments");const s=xf(t.runner,"resolveName"),i=Pf(s)?s:null;Tf(this,Af,async function(){const r=await Promise.all(e.inputs.map(((t,e)=>t.walkAsync(n[e],((t,e)=>"address"===t?Ps(e,i):e)))));return t.interface.encodeFilterTopics(e,r)}(),"f")}getTopicFilter(){return kf(this,Af,"f")}}function xf(t,e){return null==t?null:"function"==typeof t[e]?t:t.provider&&"function"==typeof t.provider[e]?t.provider:null}function Of(t){return null==t?null:t.provider||null}async function If(t){const e=function(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=le(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas, maxPriorityFeePerGas,value".split(/,/);for(const n in r)n in t&&null!=t[n]&&(e[n]=Wo.getBigInt(t[n],`request.${n}`));const n="type,nonce".split(/,/);for(const r in n)r in t&&null!=t[r]&&(e[r]=Wo.getNumber(t[r],`request.${r}`));return t.accessList&&(e.accessList=yc(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipReadEnabled=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}(_s.dereference(t,"overrides"));return e.to?Ef.throwArgumentError("cannot override to","overrides.to",e.to):e.data&&Ef.throwArgumentError("cannot override data","overrides.data",e.data),e.from&&(e.from=await Ps(e.from)),e}Af=new WeakMap;class Sf extends(function(){return Function}()){constructor(t,e){super(),r(this,{name:t.interface.getFunctionName(e),_contract:t,_key:e});return new Proxy(this,{apply:async(t,e,r)=>t.getFragment(...r).constant?await t.staticCall(...r):await t.send(...r)})}get fragment(){return this._contract.interface.getFunction(this._key)}getFragment(...t){return this._contract.interface.getFunction(this._key,t)}async populateTransaction(...e){const r=this.getFragment(...e);let n={};if(r.inputs.length+1===e.length&&(n=await If(e.pop())),r.inputs.length!==e.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const s=await async function(t,e,r){const n=xf(t,"resolveName"),s=Pf(n)?n:null;return await Promise.all(e.map(((t,e)=>t.walkAsync(r[e],((t,e)=>"address"===t?Ps(e,s):e)))))}(this._contract.runner,r.inputs,e);return Object.assign({},n,await t({to:this._contract.getAddress(),data:this._contract.interface.encodeFunctionData(r,s)}))}async staticCall(...t){const e=await this.staticCallResult(...t);return 1===e.length?e[0]:e}async send(...t){const e=this._contract.runner;if(!(r=e)||"function"!=typeof r.sendTransaction)return Ef.throwError("contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});var r;const n=await e.sendTransaction(await this.populateTransaction(...t)),s=Of(this._contract.runner);return new bf(this._contract.interface,s,n)}async estimateGas(...t){const e=xf(this._contract.runner,"estimateGas");return(r=e)&&"function"==typeof r.estimateGas?await e.estimateGas(await this.populateTransaction(...t)):Ef.throwError("contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"});var r}async staticCallResult(...t){const e=xf(this._contract.runner,"call");if(!(r=e)||"function"!=typeof r.call)return Ef.throwError("contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});var r;const n=this.getFragment(...t),s=await this.populateTransaction(...t);let i="0x";try{i=await e.call(s)}catch(t){if(u(t))throw this._contract.interface.makeError(n,t.data,s);throw t}return this._contract.interface.decodeFunctionResult(n,i)}}class Rf extends(function(){return Function}()){constructor(t,e){return super(),r(this,{name:t.interface.getEventName(e),_contract:t,_key:e}),new Proxy(this,{apply:async(e,r,n)=>new Nf(t,e.getFragment(...n),n)})}get fragment(){return this._contract.interface.getEvent(this._key)}getFragment(...t){return this._contract.interface.getEvent(this._key,t)}}const Bf=Symbol.for("_ethersInternal_contract"),_f=new WeakMap;function Cf(t){return _f.get(t[Bf])}async function Ff(t,e){let r,n;if(Array.isArray(e))r=t.interface.getEvent(e[0]),n=e;else if("string"==typeof e)r=t.interface.getEvent(e),n=[t.interface.getEventTopic(r)];else if((s=e)&&"object"==typeof s&&"getTopicFilter"in s&&"function"==typeof s.getTopicFilter&&s.fragment)r=e.fragment,n=await e.getTopicFilter();else{if(!("fragment"in e))throw console.log(e),new Error("TODO");r=e.fragment,n=[t.interface.getEventTopic(r)]}var s;n=n.map((t=>{return null==t?null:Array.isArray(t)?(e=t.map((t=>t.toLowerCase())),(e=Array.from(new Set(e).values())).sort(),e):t.toLowerCase();var e}));return{fragment:r,tag:n.map((t=>null==t?"null":Array.isArray(t)?t.join("|"):t)).join("&"),topics:n}}async function Uf(t,e){const{subs:r}=Cf(t);return r.get((await Ff(t,e)).tag)||null}async function Lf(t,e){const r=Of(t.runner);if(!r)return Ef.throwError("contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:"on"});const{fragment:n,tag:s,topics:i}=await Ff(t,e),{addr:o,subs:a}=Cf(t);let c=a.get(s);if(!c){const l={address:o||t,topics:i},u=r=>{const s=new vf(t,null,e,n,r);Mf(t,e,s.args,s)};let h=!1;c={tag:s,listeners:[],start:()=>{h||(r.on(l,u),h=!0)},stop:()=>{h&&(r.off(l,u),h=!1)}},a.set(s,c)}return c}let Df=Promise.resolve();async function Mf(t,e,r,n){try{await Df}catch(t){}const s=async function(t,e,r,n){await Df;const s=await Uf(t,e);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter((({listener:s,once:i})=>{const o=r.slice();n&&o.push(new vf(t,i?null:s,e,n.fragment,n.log));try{s.call(t,...o)}catch(t){}return!i})),i>0}(t,e,r,n);return Df=s,await s}const jf=["then"];class Gf{constructor(t,e,n=null,s){let i;r(this,{target:t,runner:n,interface:xo.from(e)}),Object.defineProperty(this,Bf,{value:{}});let o=null,a=null;if(s){const t=Of(n);a=new bf(this.interface,t,s)}let c=new Map;if("string"==typeof t)if(te(t))o=t,i=Promise.resolve(t);else{const e=xf(n,"resolveName");if(!Pf(e))throw Ef.makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});i=e.resolveName(t).then((t=>{if(null==t)throw new Error("TODO");return Cf(this).addr=t,t}))}else i=t.getAddress().then((t=>{if(null==t)throw new Error("TODO");return Cf(this).addr=t,t}));var l,u;l=this,u={addrPromise:i,addr:o,deployTx:a,subs:c},_f.set(l[Bf],u);const h=new Proxy({},{get:(t,e,r)=>{if(jf.indexOf(e)>=0)return Reflect.get(t,e,r);const n=String(e),s=this.getEvent(n);if(s)return s;throw new Error(`unknown contract event: ${n}`)}});return r(this,{filters:h}),new Proxy(this,{get:(t,e,r)=>{if(e in t||jf.indexOf(e)>=0)return Reflect.get(t,e,r);const n=String(e),s=t.getFunction(n);if(s)return s;throw new Error(`unknown contract method: ${n}`)}})}async getAddress(){return await Cf(this).addrPromise}async getDeployedCode(){const t=Of(this.runner);if(!t)return Ef.throwError("runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const e=await t.getCode(await this.getAddress());return"0x"===e?null:e}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(null!=await this.getDeployedCode())return this;const e=Of(this.runner);return null==e?Ef.throwError("contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}):new Promise(((t,r)=>{const n=async()=>{try{if(null!=await this.getDeployedCode())return t(this);e.once("block",n)}catch(t){r(t)}};n()}))}deploymentTransaction(){return Cf(this).deployTx}getFunction(t){return"string"!=typeof t&&(t=t.format()),new Sf(this,t)}getEvent(t){return"string"!=typeof t&&(t=t.format()),new Rf(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e=0,r="latest"){const{addr:n,addrPromise:s}=Cf(this),i=n||await s,{fragment:o,topics:a}=await Ff(this,t),c={address:i,topics:a,fromBlock:e,toBlock:r},l=Of(this.runner);return l?(await l.getLogs(c)).map((t=>new mf(t,this.interface,o))):Ef.throwError("contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"})}async on(t,e){const r=await Lf(this,t);return r.listeners.push({listener:e,once:!1}),r.start(),this}async once(t,e){const r=await Lf(this,t);return r.listeners.push({listener:e,once:!0}),r.start(),this}async emit(t,...e){return await Mf(this,t,e,null)}async listenerCount(t){if(t){const e=await Uf(this,t);return e?e.listeners.length:0}const{subs:e}=Cf(this);let r=0;for(const{listeners:t}of e.values())r+=t.length;return r}async listeners(t){if(t){const e=await Uf(this,t);return e?e.listeners.map((({listener:t})=>t)):[]}const{subs:e}=Cf(this);let r=[];for(const{listeners:t}of e.values())r=r.concat(t.map((({listener:t})=>t)));return r}async off(t,e){const r=await Uf(this,t);if(!r)return this;if(e){const t=r.listeners.map((({listener:t})=>t)).indexOf(e);t>=0&&r.listeners.splice(t,1)}return null!=e&&0!==r.listeners.length||(r.stop(),Cf(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){const e=await Uf(this,t);if(!e)return this;e.stop(),Cf(this).subs.delete(e.tag)}else{const{subs:t}=Cf(this);for(const{tag:e,stop:r}of t.values())r(),t.delete(e)}return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return await this.off(t,e)}static buildClass(t){return class extends Gf{constructor(e,r=null){super(e,t,r)}}}static from(t,e,r=null){return new this(t,e,r)}}class $f extends(function(){return Gf}()){}const zf=" !#$%&'()*+,-./<=>?@[]^_`{|}~",Wf=/^[a-z]*$/i;function Hf(t,e){let r=97;return t.reduce(((t,n)=>(n===e?r++:n.match(Wf)?t.push(String.fromCharCode(r)+n):(r=97,t.push(n)),t)),[])}function Vf(t){if("0"!==t[0])throw TypeError("unsupported auwl data");return function(t,e){for(let r=zf.length-1;r>=0;r--)t=t.split(zf[r]).join(e.substring(2*r,2*r+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((t,e,n,s)=>{if(n)for(let t=parseInt(n);t>=0;t--)r.push(";");else r.push(e.toLowerCase());return""}));if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return Hf(Hf(r,";"),":")}(t.substring(1+2*zf.length),t.substring(1,1+2*zf.length))}const Kf=new T("@ethersproject/wordlists@6.0.0-beta.2");class Jf{constructor(t){r(this,{locale:t})}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}}var qf,Xf,Yf,Zf,Qf,td=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},ed=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class rd extends Jf{constructor(t,e,r){super(t),qf.add(this),Xf.set(this,void 0),Yf.set(this,void 0),Zf.set(this,void 0),td(this,Xf,e,"f"),td(this,Yf,r,"f"),td(this,Zf,null,"f")}get _data(){return ed(this,Xf,"f")}_decodeWords(){return Vf(ed(this,Xf,"f"))}getWord(t){const e=ed(this,qf,"m",Qf).call(this);return(t<0||t>=e.length)&&Kf.throwArgumentError(`invalid word index: ${t}`,"index",t),e[t]}getWordIndex(t){return ed(this,qf,"m",Qf).call(this).indexOf(t)}}Xf=new WeakMap,Yf=new WeakMap,Zf=new WeakMap,qf=new WeakSet,Qf=function(){if(null==ed(this,Zf,"f")){const t=this._decodeWords();if(Oi(t.join("\n")+"\n")!==ed(this,Yf,"f"))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);td(this,Zf,t,"f")}return ed(this,Zf,"f")};const nd=new class extends rd{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}},sd=new T("@ethersproject/wallet@6.0.0-beta.8"),id=Object.freeze({en:nd});var od,ad=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},cd=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class ld extends rd{constructor(t,e,r,n){super(t,e,n),od.set(this,void 0),ad(this,od,r,"f")}get _accent(){return cd(this,od,"f")}_decodeWords(){return function(t,e){let r=Vf(t).join(",");return e.split(/,/g).forEach((t=>{const e=t.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);if(!e)throw new Error("internal error parsing accents");let n=0;const s=function(t,e){const r=(1<<t)-1,n=[];let s=0,i=0,o=0;for(let a=0;a<e.length;a++)for(s=s<<6|")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".indexOf(e[a]),i+=6;i>=t;){const e=s>>i-t;s&=(1<<i-t)-1,i-=t,0===e?o+=r:(n.push(e+o),o=0)}return n}(parseInt(e[3]),e[4]),i=parseInt(e[2]),o=new RegExp(`([${e[1]}])`,"g");r=r.replace(o,((t,e)=>(0==--s[n]&&(e=String.fromCharCode(e.charCodeAt(0),i),n++),e)))})),r.split(",")}(this._data,this._accent)}}function ud(t){return(1<<t)-1<<8-t&255}function hd(t,e=nd){sd.assertNormalize("NFKD"),null==e&&(e=nd);const r=e.split(t);(r.length%3!=0||r.length<12||r.length>24)&&sd.throwArgumentError("invalid mnemonic length","mnemonic","[ REDACTED ]");const n=ie(new Uint8Array(Math.ceil(11*r.length/8)));let s=0;for(let t=0;t<r.length;t++){let i=e.getWordIndex(r[t].normalize("NFKD"));-1===i&&sd.throwArgumentError(`invalid mnemonic word at index ${t}`,"mnemonic","[ REDACTED ]");for(let t=0;t<11;t++)i&1<<10-t&&(n[s>>3]|=1<<7-s%8),s++}const i=32*r.length/3,o=ud(r.length/3);return(ie(ts(n.slice(0,i/8)))[0]&o)!==(n[n.length-1]&o)&&sd.throwArgumentError("invalid mnemonic checksum","mnemonic","[ REDACTED ]"),le(n.slice(0,i/8))}function fd(t,e=nd){(t.length%4||t.length<16||t.length>32)&&sd.throwArgumentError("invalid entropy size","entropy","[ REDACTED ]"),null==e&&(e=nd);const r=[0];let n=11;for(let e=0;e<t.length;e++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[e],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[e]>>8-n,r.push(t[e]&((1<<8-n)-1&255)),n+=3);const s=t.length/4,i=parseInt(ts(t).substring(2,4),16)&ud(s);return r[r.length-1]<<=s,r[r.length-1]|=i>>8-s,e.join(r.map((t=>e.getWord(t))))}od=new WeakMap;const dd={};class pd{constructor(t,e,n,s,i){null==s&&(s=""),null==i&&(i=nd),sd.assertPrivate(t,dd,"Mnemonic"),r(this,{phrase:n,password:s,wordlist:i,entropy:e})}computeSeed(){const t=ei("mnemonic"+this.password,Xs.NFKD);return Sn(ei(this.phrase,Xs.NFKD),t,2048,64,"sha512")}static fromPhrase(t,e,r){const n=hd(t,r);return t=fd(sd.getBytes(n),r),new pd(dd,n,t,e,r)}static fromEntropy(t,e,r){const n=sd.getBytes(t,"entropy"),s=fd(n,r);return new pd(dd,le(n),s,e,r)}static entropyToPhrase(t,e){return fd(sd.getBytes(t,"entropy"),e)}static phraseToEntropy(t,e){return hd(t,e)}static isValidMnemonic(t,e){try{return hd(t,e),!0}catch(t){}return!1}}var wd,gd=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},md=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class yd extends Su{constructor(t,e){super(e),wd.set(this,void 0),gd(this,wd,t,"f");r(this,{address:bc(this.signingKey.publicKey)})}get signingKey(){return md(this,wd,"f")}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new yd(md(this,wd,"f"),t)}async signTransaction(e){const r=Object.assign({},e,await t({to:e.to?Ps(e.to,this.provider):void 0,from:e.from?Ps(e.from,this.provider):void 0}));null!=r.from&&(us(r.from)!==this.address&&sd.throwArgumentError("transaction from address mismatch","tx.from",e.from),delete r.from);const n=$c.from(r);return n.signature=this.signingKey.sign(n.unsignedHash),n.serialized}async signMessage(t){return this.signingKey.sign(Ui(t)).serialized}async signTypedData(t,e,r){const n=await uo.resolveNames(t,e,r,(async t=>{if(null==this.provider)return sd.throwError("cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:t}});const e=await this.provider.resolveName(t);return null==e?sd.throwError("unconfigured ENS name","UNCONFIGURED_NAME",{value:t}):e}));return this.signingKey.sign(uo.hash(n.domain,e,n.value)).serialized}}wd=new WeakMap;var bd,vd,Ed,Ad=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},Td=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r};const kd="m/44'/60'/0'/0/0",Pd=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Nd=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function xd(t,e){let r="";for(;t;)r="0123456789abcdef"[t%16]+r,t=Math.trunc(t/16);for(;r.length<2*e;)r="0"+r;return"0x"+r}function Od(t){const e=sd.getBytes(t);return Kt(he([e,de(ts(ts(e)),0,4)]))}const Id={};function Sd(t,e,r,n){const s=new Uint8Array(37);if(2147483648&t){if(null==n)return sd.throwError("cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"});s.set(ie(n),1)}else s.set(ie(r));for(let e=24;e>=0;e-=8)s[33+(e>>3)]=t>>24-e&255;const i=ie(Mr("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function Rd(t,e){const r=e.split("/");if(0===r.length||"m"===r[0]&&0!==t.depth)throw new Error("invalid path - "+e);"m"===r[0]&&r.shift();let n=t;for(let t=0;t<r.length;t++){const e=r[t];if(e.match(/^[0-9]+'$/)){const t=parseInt(e.substring(0,e.length-1));if(t>=2147483648)throw new Error("invalid path index - "+e);n=n.deriveChild(2147483648+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=2147483648)throw new Error("invalid path index - "+e);n=n.deriveChild(t)}}}return n}class Bd extends yd{constructor(t,e,n,s,i,o,a,c,l){super(e,l),sd.assertPrivate(t,Id,"HDNodeWallet"),r(this,{publicKey:e.compressedPublicKey});r(this,{parentFingerprint:n,fingerprint:de(Nn(ts(this.publicKey)),0,4),chainCode:s,path:i,index:o,depth:a}),r(this,{mnemonic:c})}connect(t){return new Bd(Id,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Od(he(["0x0488ADE4",xd(this.depth,1),this.parentFingerprint,xd(this.index,4),this.chainCode,he(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new _d(Id,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){const e=sd.getNumber(t,"index");if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(2147483647&e),2147483648&e&&(r+="'"));const{IR:n,IL:s}=Sd(e,this.chainCode,this.publicKey,this.privateKey),i=new gc(bt((mt(s)+BigInt(this.privateKey))%Nd,32));return new Bd(Id,i,this.fingerprint,le(n),r,e,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return Rd(this,t)}static fromSeed(t){return Ad(Bd,bd,"m",vd).call(Bd,t,null)}static fromPhrase(t,e="",r=kd,n=nd){r||(r=kd);const s=pd.fromPhrase(t,e,n);return Ad(Bd,bd,"m",vd).call(Bd,s.computeSeed(),s).derivePath(r)}static fromMnemonic(t,e=kd){return e||(e=kd),Ad(Bd,bd,"m",vd).call(Bd,t.computeSeed(),t).derivePath(e)}static fromExtendedKey(t){const e=ie(Jt(t));82===e.length&&Od(e.slice(0,78))===t||sd.throwArgumentError("invalid extended key","extendedKey","[ REDACTED ]");const r=e[4],n=le(e.slice(5,9)),s=parseInt(le(e.slice(9,13)).substring(2),16),i=le(e.slice(13,45)),o=e.slice(45,78);switch(le(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const t=le(o);return new _d(Id,bc(t),t,n,i,null,s,r,null)}case"0x0488ade4":case"0x04358394 ":if(0!==o[0])break;return new Bd(Id,new gc(o.slice(1)),n,i,null,s,r,null,null)}return sd.throwArgumentError("invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t="",e=kd,r=nd){e||(e=kd);const n=pd.fromEntropy(Cn(16),t,r);return Ad(Bd,bd,"m",vd).call(Bd,n.computeSeed(),n).derivePath(e)}}bd=Bd,vd=function(t,e){const r=sd.getBytes(t,"seed");if(r.length<16||r.length>64)throw new Error("invalid seed");const n=ie(Mr("sha512",Pd,r)),s=new gc(le(n.slice(0,32)));return new Bd(Id,s,"0x00000000",le(n.slice(32)),"m",0,0,e,null)};class _d extends Ru{constructor(t,e,n,s,i,o,a,c,l){super(e,l),sd.assertPrivate(t,Id,"HDNodeVoidWallet"),r(this,{publicKey:n});r(this,{publicKey:n,fingerprint:de(Nn(ts(n)),0,4),parentFingerprint:s,chainCode:i,path:o,index:a,depth:c})}connect(t){return new _d(Id,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Od(he(["0x0488B21E",xd(this.depth,1),this.parentFingerprint,xd(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(t){const e=sd.getNumber(t,"index");if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(2147483647&e),2147483648&e&&(r+="'"));const{IR:n,IL:s}=Sd(e,this.chainCode,this.publicKey,null),i=gc._addPoints(s,this.publicKey,!0),o=bc(i);return new _d(Id,o,i,this.fingerprint,le(n),r,e,this.depth+1,this.provider)}derivePath(t){return Rd(this,t)}}class Cd{constructor(t,e="",r="m/44'/60'/0'/0",n=nd){Ed.set(this,void 0),Td(this,Ed,Bd.fromPhrase(t,e,r,n),"f")}getSigner(t=0){return Ad(this,Ed,"f").deriveChild(t)}}function Fd(t){const e=sd.getNumber(t,"index");return(e<0||e>=2147483648)&&sd.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}
|
||
/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */Ed=new WeakMap;var Ud,Ld,Dd,Md=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},jd=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const Gd={16:10,24:12,32:14},$d=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],zd=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Wd=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Hd=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Vd=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Kd=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Jd=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],qd=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Xd=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Yd=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Zd=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Qd=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],tp=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],ep=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],rp=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function np(t){const e=[];for(let r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}class sp{constructor(t){if(Ud.set(this,void 0),Ld.set(this,void 0),Dd.set(this,void 0),!(this instanceof sp))throw Error("AES must be instanitated with `new`");Md(this,Ud,new Uint8Array(t),"f");const e=Gd[this.key.length];if(null==e)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");Md(this,Dd,[],"f"),Md(this,Ld,[],"f");for(let t=0;t<=e;t++)jd(this,Dd,"f").push([0,0,0,0]),jd(this,Ld,"f").push([0,0,0,0]);const r=4*(e+1),n=this.key.length/4,s=np(this.key);let i;for(let t=0;t<n;t++)i=t>>2,jd(this,Dd,"f")[i][t%4]=s[t],jd(this,Ld,"f")[e-i][t%4]=s[t];let o,a=0,c=n;for(;c<r;){if(o=s[n-1],s[0]^=zd[o>>16&255]<<24^zd[o>>8&255]<<16^zd[255&o]<<8^zd[o>>24&255]^$d[a]<<24,a+=1,8!=n)for(let t=1;t<n;t++)s[t]^=s[t-1];else{for(let t=1;t<n/2;t++)s[t]^=s[t-1];o=s[n/2-1],s[n/2]^=zd[255&o]^zd[o>>8&255]<<8^zd[o>>16&255]<<16^zd[o>>24&255]<<24;for(let t=n/2+1;t<n;t++)s[t]^=s[t-1]}let t,i,l=0;for(;l<n&&c<r;)t=c>>2,i=c%4,jd(this,Dd,"f")[t][i]=s[l],jd(this,Ld,"f")[e-t][i]=s[l++],c++}for(let t=1;t<e;t++)for(let e=0;e<4;e++)o=jd(this,Ld,"f")[t][e],jd(this,Ld,"f")[t][e]=Qd[o>>24&255]^tp[o>>16&255]^ep[o>>8&255]^rp[255&o]}get key(){return jd(this,Ud,"f").slice()}encrypt(t){if(16!=t.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const e=jd(this,Dd,"f").length-1,r=[0,0,0,0];let n=np(t);for(let t=0;t<4;t++)n[t]^=jd(this,Dd,"f")[0][t];for(let t=1;t<e;t++){for(let e=0;e<4;e++)r[e]=Hd[n[e]>>24&255]^Vd[n[(e+1)%4]>>16&255]^Kd[n[(e+2)%4]>>8&255]^Jd[255&n[(e+3)%4]]^jd(this,Dd,"f")[t][e];n=r.slice()}const s=new Uint8Array(16);let i=0;for(let t=0;t<4;t++)i=jd(this,Dd,"f")[e][t],s[4*t]=255&(zd[n[t]>>24&255]^i>>24),s[4*t+1]=255&(zd[n[(t+1)%4]>>16&255]^i>>16),s[4*t+2]=255&(zd[n[(t+2)%4]>>8&255]^i>>8),s[4*t+3]=255&(zd[255&n[(t+3)%4]]^i);return s}decrypt(t){if(16!=t.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const e=jd(this,Ld,"f").length-1,r=[0,0,0,0];let n=np(t);for(let t=0;t<4;t++)n[t]^=jd(this,Ld,"f")[0][t];for(let t=1;t<e;t++){for(let e=0;e<4;e++)r[e]=qd[n[e]>>24&255]^Xd[n[(e+3)%4]>>16&255]^Yd[n[(e+2)%4]>>8&255]^Zd[255&n[(e+1)%4]]^jd(this,Ld,"f")[t][e];n=r.slice()}const s=new Uint8Array(16);let i=0;for(let t=0;t<4;t++)i=jd(this,Ld,"f")[e][t],s[4*t]=255&(Wd[n[t]>>24&255]^i>>24),s[4*t+1]=255&(Wd[n[(t+3)%4]>>16&255]^i>>16),s[4*t+2]=255&(Wd[n[(t+2)%4]>>8&255]^i>>8),s[4*t+3]=255&(Wd[255&n[(t+1)%4]]^i);return s}}Ud=new WeakMap,Ld=new WeakMap,Dd=new WeakMap;class ip{constructor(t,e,r){if(r&&!(this instanceof r))throw new Error(`${t} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new sp(e)},name:{enumerable:!0,value:t}})}}var op,ap,cp=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},lp=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class up extends ip{constructor(t,e){if(super("ECC",t,up),op.set(this,void 0),ap.set(this,void 0),e){if(e.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");cp(this,op,new Uint8Array(e),"f")}else cp(this,op,new Uint8Array(16),"f");cp(this,ap,this.iv,"f")}get iv(){return new Uint8Array(lp(this,op,"f"))}encrypt(t){if(t.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){for(let e=0;e<16;e++)lp(this,ap,"f")[e]^=t[r+e];cp(this,ap,this.aes.encrypt(lp(this,ap,"f")),"f"),e.set(lp(this,ap,"f"),r)}return e}decrypt(t){if(t.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){const n=this.aes.decrypt(t.subarray(r,r+16));for(let s=0;s<16;s++)e[r+s]=n[s]^lp(this,ap,"f")[s],lp(this,ap,"f")[s]=t[r+s]}return e}}op=new WeakMap,ap=new WeakMap,window&&window.__classPrivateFieldSet,window&&window.__classPrivateFieldGet;var hp,fp,dp,pp=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},wp=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class gp extends ip{constructor(t,e){super("CTR",t,gp),hp.set(this,void 0),fp.set(this,void 0),dp.set(this,void 0),pp(this,dp,new Uint8Array(16),"f"),wp(this,dp,"f").fill(0),pp(this,hp,wp(this,dp,"f"),"f"),pp(this,fp,16,"f"),null==e&&(e=1),"number"==typeof e?this.setCounterValue(e):this.setCounterBytes(e)}get counter(){return new Uint8Array(wp(this,dp,"f"))}setCounterValue(t){if(!Number.isInteger(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let e=15;e>=0;--e)wp(this,dp,"f")[e]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(16!==t.length)throw new TypeError("invalid counter initial Uint8Array value length");wp(this,dp,"f").set(t)}increment(){for(let t=15;t>=0;t--){if(255!==wp(this,dp,"f")[t]){wp(this,dp,"f")[t]++;break}wp(this,dp,"f")[t]=0}}encrypt(t){var e,r;const n=new Uint8Array(t);for(let t=0;t<n.length;t++)16===wp(this,fp,"f")&&(pp(this,hp,this.aes.encrypt(wp(this,dp,"f")),"f"),pp(this,fp,0,"f"),this.increment()),n[t]^=wp(this,hp,"f")[(pp(this,fp,(r=wp(this,fp,"f"),e=r++,r),"f"),e)];return n}decrypt(t){return this.encrypt(t)}}function mp(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),ie(t)}function yp(t){return"string"==typeof t?ei(t,Xs.NFKC):ie(t)}function bp(t,e){const r=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);if(null==r)return sd.throwArgumentError("invalid path","path",e);const n=r[1],s=r[3],i="!"===r[4];let o=t;for(const t of n.toLowerCase().split(".")){if(Array.isArray(o)){if(!t.match(/^[0-9]+$/))break;o=o[parseInt(t)]}else if("object"==typeof o){let e=null;for(const r in o)if(r.toLowerCase()===t){e=o[r];break}o=e}else o=null;if(null==o)break}if(i&&null==o&&sd.throwArgumentError("missing required value","path",n),s&&null!=o){if("int"===s){if("string"==typeof o&&o.match(/^-?[0-9]+$/))return parseInt(o);if(Number.isSafeInteger(o))return o}if("number"===s&&"string"==typeof o&&o.match(/^-?[0-9.]*$/))return parseFloat(o);if("data"===s&&"string"==typeof o)return mp(o);if("array"===s&&Array.isArray(o))return o;if(s===typeof o)return o;sd.throwArgumentError(`wrong type found for ${s} `,"path",n)}return o}function vp(t){try{if(JSON.parse(t).encseed)return!0}catch(t){}return!1}function Ep(t,e){const r=JSON.parse(t),n=yp(e),s=us(bp(r,"ethaddr:string!")),i=mp(bp(r,"encseed:string!"));i&&i.length%16==0||sd.throwArgumentError("invalid encseed","json",t);const o=ie(Sn(n,n,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),c=i.slice(16),l=function(t){if(t.length<16)throw new TypeError("PKCS#7 invalid length");const e=t[t.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let n=0;n<e;n++)if(t[r+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(t.subarray(0,r))}(ie(new up(o,a).decrypt(c)));let u="";for(let t=0;t<l.length;t++)u+=String.fromCharCode(l[t]);return{address:s,privateKey:Oi(u)}}hp=new WeakMap,fp=new WeakMap,dp=new WeakMap,window&&window.__classPrivateFieldSet,window&&window.__classPrivateFieldGet;function Ap(t){try{const e=JSON.parse(t);if(3===(null!=e.version?parseInt(e.version):0))return!0}catch(t){}return!1}function Tp(t,e){const r=sd.getBytes(e),n=bp(t,"crypto.ciphertext:data!");if(le(an(he([r.slice(16,32),n]))).substring(2)!==bp(t,"crypto.mac:string!").toLowerCase())return sd.throwArgumentError("incorrect password","password","[ REDACTED ]");const s=function(t,e,r){if("aes-128-ctr"===bp(t,"crypto.cipher:string")){const n=bp(t,"crypto.cipherparams.iv:data!");return le(new gp(e,n).decrypt(r))}return sd.throwError("unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(t,r.slice(0,16),n),i=bc(s);if(t.address){let e=t.address.toLowerCase();"0x"!==e.substring(0,2)&&(e="0x"+e),us(e)!==i&&sd.throwArgumentError("keystore address/privateKey mismatch","address",t.address)}const o={address:i,privateKey:s};if("0.1"===bp(t,"x-ethers.version:string")){const e=r.slice(32,64),n=bp(t,"x-ethers.mnemonicCiphertext:data!"),s=bp(t,"x-ethers.mnemonicCounter:data!"),i=new gp(e,s);o.mnemonic={path:bp(t,"x-ethers.path:string")||"m/44'/60'/0'/0/0",locale:bp(t,"x-ethers.locale:string")||"en",entropy:le(ie(i.decrypt(n)))}}return o}function kp(t){const e=bp(t,"crypto.kdf:string");if(e&&"string"==typeof e){const r=function(t,e){return sd.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===e.toLowerCase()){const n=bp(t,"crypto.kdfparams.salt:data!"),s=bp(t,"crypto.kdfparams.n:int!"),i=bp(t,"crypto.kdfparams.r:int!"),o=bp(t,"crypto.kdfparams.p:int!");if(!s||!i||!o)return r("kdf",e);if(0!=(s&s-1))return r("N",s);const a=bp(t,"crypto.kdfparams.dklen:int!");return 32!==a?r("dklen",a):{name:"scrypt",salt:n,N:s,r:i,p:o,dkLen:64}}if("pbkdf2"===e.toLowerCase()){const e=bp(t,"crypto.kdfparams.salt:data!"),n=bp(t,"crypto.kdfparams.prf:string!"),s=n.split("-").pop();if("sha256"!==s&&"sha512"!==s)return r("prf",n);const i=bp(t,"crypto.kdfparams.c:int!"),o=bp(t,"crypto.kdfparams.dklen:int!");return 32!==o&&r("dklen",o),{name:"pbkdf2",salt:e,count:i,dkLen:o,algorithm:s}}}return sd.throwArgumentError("unsupported key-derivation function","kdf",e)}function Pp(t){return new Promise((e=>{setTimeout((()=>{e()}),t)}))}var Np,xp=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},Op=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function Ip(t){try{if(!t||!te(t.privateKey,32))return null;const e=t.privateKey;return gc.computePublicKey(e)!==t.publicKey?null:new gc(e)}catch(t){console.log(t)}return null}function Sp(t){return new Promise((e=>{setTimeout((()=>{e()}),t)}))}class Rp extends yd{constructor(t,e){let r=null,n=null;if("string"==typeof t&&(r=new gc(t)),null==r){const e=function(t){try{if(!t||!t.signingKey)return null;const e=Ip(t.signingKey);return null==e||bc(e.publicKey)!==t.address||t.mnemonic&&Bd.fromMnemonic(t.mnemonic).privateKey!==e.privateKey?null:t}catch(t){console.log(t)}return null}(t);e&&(r=e.signingKey,n=e.mnemonic||null)}if(null==r){const e=function(t){try{return null==t||"string"!=typeof t.phrase||"string"!=typeof t.password||null==t.wordlist?null:Bd.fromPhrase(t.phrase,t.password,null,t.wordlist)}catch(t){console.log(t)}return null}(t);e&&(r=e.signingKey,n=e.mnemonic||null)}null==r&&(r=Ip(t)),null==r&&sd.throwArgumentError("invalid key","key","[ REDACTED ]"),super(r,e),Np.set(this,void 0),xp(this,Np,n,"f")}get mnemonic(){return Op(this,Np,"f")}connect(t){return new Rp(this,t)}async encrypt(t,e,r){throw new Error("TODO")}encryptSync(t,e){throw new Error("TODO")}static async fromEncryptedJson(t,e,r){let n=null;if(Ap(t))n=await async function(t,e,r){const n=JSON.parse(t),s=yp(e),i=kp(n);if("pbkdf2"===i.name){r&&(r(0),await Pp(0));const{salt:t,count:e,dkLen:o,algorithm:a}=i,c=Sn(s,t,e,o,a);return r&&(r(1),await Pp(0)),Tp(n,c)}if("scrypt"===i.name){const{salt:t,N:e,r:o,p:a,dkLen:c}=i;return Tp(n,await Vn(s,t,e,o,a,c,r))}throw new Error("unreachable")}(t,e,r);else{if(!vp(t))return sd.throwArgumentError("invalid JSON wallet","json","[ REDACTED ]");r&&(r(0),await Sp(0)),n=Ep(t,e),r&&(r(1),await Sp(0))}const s=new Rp(n.privateKey);return s.address!==n.address&&sd.throwArgumentError("address/privateKey mismatch","json","[ REDACTED ]"),s}static fromEncryptedJsonSync(t,e){let r=null;if(Ap(t))r=function(t,e){const r=JSON.parse(t),n=yp(e),s=kp(r);if("pbkdf2"===s.name){const{salt:t,count:e,dkLen:i,algorithm:o}=s;return Tp(r,Sn(n,t,e,i,o))}if("scrypt"===s.name){const{salt:t,N:e,r:i,p:o,dkLen:a}=s;return Tp(r,Kn(n,t,e,i,o,a))}throw new Error("unreachable")}(t,e);else{if(!vp(t))return sd.throwArgumentError("invalid JSON wallet","json","[ REDACTED ]");r=Ep(t,e)}const n=new Rp(r.privateKey);return n.address!==r.address&&sd.throwArgumentError("address/privateKey mismatch","json","[ REDACTED ]"),n}static createRandom(t,e,r){return new Rp(pd.fromEntropy(Cn(16),e,r),t)}static fromMnemonic(t,e){return new Rp(t,e)}static fromPhrase(t,e,r="",n){return new Rp(pd.fromPhrase(t,r,n),e)}}Np=new WeakMap;const Bp="ethers@6.0.0-beta.9";var _p=Object.freeze({__proto__:null,Interface:xo,getAddress:us,getIcapAddress:hs,getCreateAddress:Es,getCreate2Address:As,isAddressable:Ts,isAddress:ks,resolveAddress:Ps,arrayify:ie,decodeBase64:ae,encodeBase64:ce,isHexString:te,isBytesLike:ee,concat:he,dataLength:fe,dataSlice:de,stripZerosLeft:pe,hexlify:le,quantity:ue,zeroPadBytes:me,zeroPadValue:ge,BaseContract:Gf,Contract:$f,ContractEventPayload:vf,ContractTransactionReceipt:yf,ContractTransactionResponse:bf,EventLog:mf,computeHmac:Mr,keccak256:an,ripemd160:Nn,sha256:ts,sha512:es,pbkdf2:Sn,scrypt:Vn,scryptSync:Kn,randomBytes:Cn,lock:rs,messagePrefix:Fi,id:Oi,hashMessage:Ui,isValidName:Bi,namehash:_i,dnsEncode:Ci,solidityPacked:Gi,solidityPackedKeccak256:$i,solidityPackedSha256:zi,TypedDataEncoder:uo,isError:l,isCallException:u,Logger:T,formatFixed:Ut,parseFixed:Lt,fromTwos:Tt,toTwos:kt,mask:Pt,toArray:vt,toBigInt:mt,toHex:bt,toNumber:yt,decodeBase58:Jt,encodeBase58:Kt,formatEther:Zt,parseEther:Qt,formatUnits:Xt,parseUnits:Yt,FixedFormat:Dt,FixedNumber:Mt,defineProperties:r,resolveProperties:t,getStore:a,setStore:c,dummyProvider:nl,getDefaultProvider:hf,showThrottleMessage:Cu,AbstractProvider:pu,UnmanagedSubscriber:uu,AbstractSigner:Su,VoidSigner:Ru,WrappedSigner:Bu,EnsResolver:ca,Formatter:ul,NetworkPlugin:hl,GasCostPlugin:fl,EnsPlugin:dl,MaxPriorityFeePlugin:pl,Network:vl,Block:Xc,FeeData:qc,Log:Yc,TransactionReceipt:Zc,TransactionResponse:Qc,FallbackProvider:jh,JsonRpcProvider:oh,JsonRpcSigner:sh,StaticJsonRpcProvider:ah,AlchemyProvider:dh,AnkrProvider:hh,CloudflareProvider:ph,EtherscanProvider:wh,InfuraProvider:mh,PocketProvider:vh,IpcSocketProvider:undefined,SocketProvider:of,WebSocketProvider:uf,encodeRlp:ws,decodeRlp:vs,Signature:Ea,SigningKey:gc,formatBytes32String:ai,parseBytes32String:ci,nameprep:bi,_toEscapedUtf8String:ni,toUtf8Bytes:ei,toUtf8CodePoints:oi,toUtf8String:ii,get UnicodeNormalizationForm(){return Xs},Utf8ErrorFuncs:Qs,get Utf8ErrorReason(){return Ys},accessListify:yc,computeAddress:bc,recoverAddress:vc,Transaction:$c,defaultPath:kd,getAccountPath:Fd,HDNodeWallet:Bd,HDNodeVoidWallet:_d,HDNodeWalletManager:Cd,Mnemonic:pd,Wallet:Rp,fetchData:zo,FetchRequest:Mo,FetchResponse:_o,wordlists:id,Wordlist:Jf,WordlistOwl:rd,WordlistOwlA:ld,version:"ethers@6.0.0-beta.9"});export{pu as AbstractProvider,Su as AbstractSigner,dh as AlchemyProvider,hh as AnkrProvider,Gf as BaseContract,Xc as Block,ph as CloudflareProvider,$f as Contract,vf as ContractEventPayload,yf as ContractTransactionReceipt,bf as ContractTransactionResponse,dl as EnsPlugin,ca as EnsResolver,wh as EtherscanProvider,mf as EventLog,jh as FallbackProvider,qc as FeeData,Mo as FetchRequest,_o as FetchResponse,Dt as FixedFormat,Mt as FixedNumber,ul as Formatter,fl as GasCostPlugin,_d as HDNodeVoidWallet,Bd as HDNodeWallet,Cd as HDNodeWalletManager,mh as InfuraProvider,xo as Interface,ff as IpcSocketProvider,oh as JsonRpcProvider,sh as JsonRpcSigner,Yc as Log,T as Logger,pl as MaxPriorityFeePlugin,pd as Mnemonic,vl as Network,hl as NetworkPlugin,vh as PocketProvider,Ea as Signature,gc as SigningKey,of as SocketProvider,ah as StaticJsonRpcProvider,$c as Transaction,Zc as TransactionReceipt,Qc as TransactionResponse,uo as TypedDataEncoder,Xs as UnicodeNormalizationForm,uu as UnmanagedSubscriber,Qs as Utf8ErrorFuncs,Ys as Utf8ErrorReason,Ru as VoidSigner,Rp as Wallet,uf as WebSocketProvider,Jf as Wordlist,rd as WordlistOwl,ld as WordlistOwlA,Bu as WrappedSigner,ni as _toEscapedUtf8String,yc as accessListify,ie as arrayify,bc as computeAddress,Mr as computeHmac,he as concat,fe as dataLength,de as dataSlice,Jt as decodeBase58,ae as decodeBase64,vs as decodeRlp,kd as defaultPath,r as defineProperties,Ci as dnsEncode,nl as dummyProvider,Kt as encodeBase58,ce as encodeBase64,ws as encodeRlp,_p as ethers,zo as fetchData,ai as formatBytes32String,Zt as formatEther,Ut as formatFixed,Xt as formatUnits,Tt as fromTwos,Fd as getAccountPath,us as getAddress,As as getCreate2Address,Es as getCreateAddress,hf as getDefaultProvider,hs as getIcapAddress,a as getStore,Ui as hashMessage,le as hexlify,Oi as id,ks as isAddress,Ts as isAddressable,ee as isBytesLike,u as isCallException,l as isError,te as isHexString,Bi as isValidName,an as keccak256,rs as lock,Pt as mask,Fi as messagePrefix,_i as namehash,bi as nameprep,ci as parseBytes32String,Qt as parseEther,Lt as parseFixed,Yt as parseUnits,Sn as pbkdf2,ue as quantity,Cn as randomBytes,vc as recoverAddress,Ps as resolveAddress,t as resolveProperties,Nn as ripemd160,Vn as scrypt,Kn as scryptSync,c as setStore,ts as sha256,es as sha512,Cu as showThrottleMessage,Gi as solidityPacked,$i as solidityPackedKeccak256,zi as solidityPackedSha256,pe as stripZerosLeft,vt as toArray,mt as toBigInt,bt as toHex,yt as toNumber,kt as toTwos,ei as toUtf8Bytes,oi as toUtf8CodePoints,ii as toUtf8String,Bp as version,id as wordlists,me as zeroPadBytes,ge as zeroPadValue};
|
||
//# sourceMappingURL=ethers.min.js.map
|