7 lines
320 KiB
JavaScript
7 lines
320 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ethers={})}(this,(function(t){"use strict";async function e(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 r(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 n(t,e,n,s){for(let i in e){let o=e[i];const a=s?s[i]:void 0;if(void 0!==a)o=a;else{const t=n?n[i]:null;t&&r(o,t)}Object.defineProperty(t,i,{enumerable:!0,value:o,writable:!1})}}var s,i=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},o=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 a{constructor(t,e,r){s.set(this,void 0),i(this,s,e,"f"),n(this,{emitter:t,filter:r})}async removeListener(){null!=o(this,s,"f")&&await this.emitter.off(this.filter,o(this,s,"f"))}}function c(t,e){return t[e]}function l(t,e,r){if(Object.isFrozen(t))throw new Error("frozen object is immuatable; cannot set "+e);t[e]=r}function u(t,e){return t&&t.code===e}function h(t){return u(t,"CALL_EXCEPTION")}s=new WeakMap;var f,d,p,g,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"}(g||(g={}));const m={debug:1,default:2,info:2,warning:3,error:4,off:5};let y=m.default,b=null;const v=["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 E(t,e,r){Object.defineProperty(t,e,{enumerable:!0,writable:!1,value:r})}const A=9007199254740991,k={};k.INVALID_ARGUMENT=TypeError,k.NUMERIC_FAULT=RangeError,k.BUFFER_OVERRUN=RangeError;class T{constructor(t){f.add(this),E(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(k[e]||Error)(t);if(E(n,"code",e),r)for(const t in r)E(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===v.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,f,"m",d).call(this,t,e,!1)}getBytesCopy(t,e){return w(this,f,"m",d).call(this,t,e,!0)}getNumber(t,e){switch(typeof t){case"bigint":return(t<-A||t>A)&&this.throwArgumentError("overflow",e||"value",t),Number(t);case"number":return Number.isInteger(t)?(t<-A||t>A)&&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<-A||t>A)&&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,f,"m",p).call(this,g.DEBUG,t)}info(...t){w(this,f,"m",p).call(this,g.INFO,t)}warn(...t){w(this,f,"m",p).call(this,g.WARNING,t)}static globalLogger(){return b||(b=new T("@ethersproject/logger@6.0.0-beta.7")),b}static setLogLevel(t){const e=m[t.toLowerCase()];null!=e?y=e:T.globalLogger().warn("invalid log level - "+t)}}f=new WeakSet,d=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)},p=function(t,e){const r=t.toLowerCase();null==m[r]&&this.throwArgumentError("invalid log level name","logLevel",t),y>m[r]||console.log.apply(console,e)},T.LogLevels=g;const P=new T("@ethersproject/abi@6.0.0-beta.3");var N,x,O,I,S,R,B,C=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 F(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"}(B||(B={}));const U="constant external internal payable private public pure view",L=F(U.split(" ")),D="constructor error event function struct",M=F(D.split(" ")),j="calldata memory storage payable indexed",G=F(j.split(" ")),$=F([D,j,"tuple returns",U].join(" ").split(" ")),z={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},W=new RegExp("^(\\s*)"),H=new RegExp("^([0-9]+)"),V=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),K=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))");class J{constructor(t){N.add(this),x.set(this,void 0),O.set(this,void 0),C(this,x,0,"f"),C(this,O,t.slice(),"f")}get offset(){return _(this,x,"f")}get length(){return _(this,O,"f").length-_(this,x,"f")}clone(){return new J(_(this,O,"f"))}reset(){C(this,x,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,N,"m",I).call(this,_(this,x,"f")+1,t.match+1);return C(this,x,t.match+1,"f"),e}popParams(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=[];for(;_(this,x,"f")<t.match-1;){const t=this.peek().linkNext;e.push(_(this,N,"m",I).call(this,_(this,x,"f")+1,t)),C(this,x,t,"f")}return C(this,x,t.match+1,"f"),e}peek(){if(_(this,x,"f")>=_(this,O,"f").length)throw new Error("out-of-bounds");return _(this,O,"f")[_(this,x,"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 C(this,x,(t=_(this,x,"f"),++t),"f"),e}toString(){const t=[];for(let e=_(this,x,"f");e<_(this,O,"f").length;e++){const r=_(this,O,"f")[e];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}}function q(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(W);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=z[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=P.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(V),a){if(c.text=a[1],i+=c.text.length,$.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(K)){c.type="TYPE";continue}c.type="ID"}else{if(a=o.match(H),!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 J(e.map((t=>Object.freeze(t))))}function X(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 Y(t,e){if(e.peekKeyword(M)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function Z(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 Q(t,e){return t.popParams().map((t=>at.fromTokens(t,e)))}function tt(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return P.getBigInt(t.pop().text);throw new Error("invalid gas")}return null}function et(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}x=new WeakMap,O=new WeakMap,N=new WeakSet,I=function(t=0,e=0){return new J(_(this,O,"f").slice(t,e).map((e=>Object.freeze(Object.assign({},e,{match:e.match-t,linkBack:e.linkBack-t,linkNext:e.linkNext-t})))))};const rt=new RegExp(/^(.*)\[([0-9]*)\]$/);function nt(t){const e=t.match(K);if(!e)return P.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)&&P.throwArgumentError("invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);(0===r||r>256||r%8)&&P.throwArgumentError("invalid numeric width","type",t)}return t}const st={},it=Symbol.for("_ethers_internal"),ot="_ParamTypeInternal";class at{constructor(t,e,r,s,i,o,a,c){if(S.add(this),P.assertPrivate(t,st,"ParamType"),Object.defineProperty(this,it,{value:ot}),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("");n(this,{name:e,type:r,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:c})}format(t=B.sighash){if(B[t]||P.throwArgumentError("invalid format type","format",t),t===B.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!==B.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===B.full?", ":",")+")"):e+=this.type,t!==B.sighash&&(!0===this.indexed&&(e+=" indexed"),t===B.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,S,"m",R).call(this,r,t,e,(t=>{n[0]=t})),r.length&&await Promise.all(r),n[0]}static from(t,e){if(at.isParamType(t))return t;if("string"==typeof t)return at.fromTokens(q(t),e);if(t instanceof J)return at.fromTokens(t,e);const r=t.name;!r||"string"==typeof r&&r.match(V)||P.throwArgumentError("invalid name","obj.name",r);let n=t.indexed;null!=n&&(e||P.throwArgumentError("parameter cannot be indexed","obj.indexed",t.indexed),n=!!n);let s=t.type,i=s.match(rt);if(i){const e=i[2],o=at.from({type:i[1],components:t.components});return new at(st,r,s,"array",n,null,e,o)}if("tuple("===s.substring(0,5)||"("===s[0]){const e=null!=t.components?t.components.map((t=>at.from(t))):null;return new at(st,r,s,"tuple",n,e,null,null)}return s=nt(t.type),new at(st,r,s,s,n,null,null,null)}static fromObject(t,e){throw new Error("@TODO")}static fromTokens(t,e){let r="",n="",s=null;Z(t,F(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(n="tuple",s=t.popParams().map((t=>at.from(t))),r=`tuple(${s.map((t=>t.format())).join(",")})`):(r=nt(t.popType("TYPE")),n=r);let i=null,o=null;for(;t.length&&t.peekType("BRACKET");){const e=t.pop();i=new at(st,"",r,n,null,s,o,i),o=e.value,r+=e.text,n="array",s=null}let a=null;if(Z(t,G).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 at(st,c,r,n,a,s,o,i)}static isParamType(t){return t&&t[it]===ot}}var ct;S=new WeakSet,R=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,S,"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],S,"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"}(ct||(ct={}));class lt{constructor(t,e,r){P.assertPrivate(t,st,"Fragment"),n(this,{type:e,inputs:r=Object.freeze(r.slice())})}static from(t){if("string"==typeof t)return this.fromString(t);if(t instanceof J)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 pt.fromObject(t);case"error":return ft.fromObject(t);case"event":return dt.fromObject(t);case"function":return gt.fromObject(t);case"struct":return wt.fromObject(t)}throw new Error("not implemented yet")}static fromString(t){try{lt.from(JSON.parse(t))}catch(t){}return lt.fromTokens(q(t))}static fromTokens(t){const e=t.popKeyword(M);switch(e){case"constructor":return pt.fromTokens(t);case"error":return ft.fromTokens(t);case"event":return dt.fromTokens(t);case"function":return gt.fromTokens(t);case"struct":return wt.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 ut extends lt{constructor(t,e,r,s){super(t,e,s),s=Object.freeze(s.slice()),n(this,{name:r})}}function ht(t,e){return"("+e.map((e=>e.format(t))).join(t===B.full?", ":",")+")"}class ft extends ut{constructor(t,e,r){super(t,ct.error,e,r)}format(t=B.sighash){if(B[t]||P.throwArgumentError("invalid format type","format",t),t===B.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return t!==B.sighash&&e.push("error"),e.push(this.name+ht(t,this.inputs)),e.join(" ")}static fromString(t){return ft.fromTokens(q(t))}static fromTokens(t){const e=Y("error",t),r=Q(t);return et(t),new ft(st,e,r)}}class dt extends ut{constructor(t,e,r,s){super(t,ct.event,e,r),n(this,{anonymous:s})}format(t=B.sighash){if(B[t]||P.throwArgumentError("invalid format type","format",t),t===B.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!==B.sighash&&e.push("event"),e.push(this.name+ht(t,this.inputs)),t!==B.sighash&&this.anonymous&&e.push("anonymous"),e.join(" ")}static fromString(t){return dt.fromTokens(q(t))}static fromTokens(t){const e=Y("event",t),r=Q(t,!0),n=!!Z(t,F(["anonymous"])).has("anonymous");return et(t),new dt(st,e,r,n)}}class pt extends lt{constructor(t,e,r,s,i){super(t,e,r),n(this,{payable:s,gas:i})}format(t=B.sighash){if(B[t]||P.throwArgumentError("invalid format type","format",t),t===B.sighash&&P.throwError("cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t===B.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${ht(t,this.inputs)}`];return e.push(this.payable?"payable":"nonpayable"),null!=this.gas&&e.push(`@${this.gas.toString()}`),e.join(" ")}static fromString(t){return pt.fromTokens(q(t))}static fromObject(t){throw new Error("TODO")}static fromTokens(t){Z(t,F(["constructor"]));const e=Q(t),r=!!Z(t,F(["payable"])).has("payable"),n=tt(t);return et(t),new pt(st,ct.constructor,e,r,n)}}class gt extends ut{constructor(t,e,r,s,i,o){super(t,ct.function,e,s);n(this,{constant:"view"===r||"pure"===r,gas:o,outputs:i=Object.freeze(i.slice()),payable:"payable"===r,stateMutability:r})}format(t=B.sighash){if(B[t]||P.throwArgumentError("invalid format type","format",t),t===B.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!==B.sighash&&e.push("function"),e.push(this.name+ht(t,this.inputs)),t!==B.sighash&&("nonpayable"!==this.stateMutability&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(ht(t,this.outputs))),null!=this.gas&&e.push(`@${this.gas.toString()}`)),e.join(" ")}static fromString(t){return gt.fromTokens(q(t))}static fromTokens(t){const e=Y("function",t),r=Q(t),n=function(t){let e=Z(t,L);return X(e,F("constant payable nonpayable".split(" "))),X(e,F("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=[];Z(t,F(["returns"])).has("returns")&&(s=Q(t));const i=tt(t);return et(t),new gt(st,e,n,r,s,i)}}class wt extends ut{format(){throw new Error("@TODO")}static fromString(t){return wt.fromTokens(q(t))}static fromTokens(t){const e=Y("struct",t),r=Q(t);return et(t),new wt(st,ct.struct,e,r)}}const mt=new T("@ethersproject/math@6.0.0-beta.3"),yt=9007199254740991,bt="0123456789abcdef",vt=BigInt(0);function Et(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=bt[r>>4],e+=bt[15&r];return BigInt(e)}return mt.getBigInt(t,"value")}function At(t){const e=Et(t);return(e<-yt||e>yt)&&mt.throwArgumentError("overflow","value",t),Number(e)}function kt(t,e){const r=mt.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=mt.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 Tt(t){const e=mt.getBigInt(t,"value");if(e<0)throw new Error("cannot convert negative value to hex");if(e===vt)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 Pt=BigInt(0),Nt=BigInt(1);function xt(t,e){const r=mt.getBigInt(t,"value"),n=BigInt(mt.getNumber(e,"width"));if(r>>n-Nt){return-((~r&(Nt<<n)-Nt)+Nt)}return r}function Ot(t,e){const r=mt.getBigInt(t,"value"),n=BigInt(mt.getNumber(e,"width"));if(r<Pt){return(~-r&(Nt<<n)-Nt)+Nt}return r}function It(t,e){const r=mt.getBigInt(t,"value"),n=mt.getBigInt(e,"bits");return r&(Nt<<n)-Nt}var St,Rt,Bt,Ct=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},_t=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 Ft={},Ut=BigInt(-1);function Lt(t,e,r,n){const s={fault:e,operation:r};return void 0!==n&&(s.value=n),mt.throwError(t,"NUMERIC_FAULT",s)}let Dt="0";for(;Dt.length<256;)Dt+=Dt;function Mt(t){return("number"!=typeof t||t<0||t>256||t%1)&&mt.throwArgumentError("invalid decimal length","decimals",t),BigInt("1"+Dt.substring(0,t))}function jt(t,e){null==e&&(e=18);let r=mt.getBigInt(t,"value");const n=Mt(mt.getNumber(e,"decimals")),s=String(n),i=r<0;i&&(r*=Ut);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 Gt(t,e){null==e&&(e=18);const r=Mt(mt.getNumber(e,"decimals"));"string"==typeof t&&t.match(/^-?[0-9.]+$/)||mt.throwArgumentError("invalid decimal value","value",t);const n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&mt.throwArgumentError("missing value","value",t);const s=t.split(".");s.length>2&&mt.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&&Lt("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*=Ut),a}class $t{constructor(t,e,r,n){t!==Ft&&mt.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=Mt(n),Object.freeze(this)}static from(t){if(t instanceof $t)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 mt.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&&mt.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&&mt.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&mt.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new $t(Ft,e,r,n)}}class zt{constructor(t,e,r,n){St.add(this),Rt.set(this,void 0),t!==Ft&&mt.throwError("cannot use FixedNumber constructor; use FixedNumber.from","UNSUPPORTED_OPERATION",{operation:"new FixedFormat"}),this.format=$t.from(n),Ct(this,Rt,r,"f"),this._isFixedNumber=!0,Object.freeze(this)}addUnsafe(t){_t(this,St,"m",Bt).call(this,t);const e=Gt(_t(this,Rt,"f"),this.format.decimals),r=Gt(_t(t,Rt,"f"),t.format.decimals);return zt.fromValue(e+r,this.format.decimals,this.format)}subUnsafe(t){_t(this,St,"m",Bt).call(this,t);const e=Gt(_t(this,Rt,"f"),this.format.decimals),r=Gt(_t(t,Rt,"f"),t.format.decimals);return zt.fromValue(e-r,this.format.decimals,this.format)}mulUnsafe(t){_t(this,St,"m",Bt).call(this,t);const e=Gt(_t(this,Rt,"f"),this.format.decimals),r=Gt(_t(t,Rt,"f"),t.format.decimals);return zt.fromValue(e*r/this.format._multiplier,this.format.decimals,this.format)}divUnsafe(t){_t(this,St,"m",Bt).call(this,t);const e=Gt(_t(this,Rt,"f"),this.format.decimals),r=Gt(_t(t,Rt,"f"),t.format.decimals);return zt.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=zt.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(Wt.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=zt.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(Wt.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)&&mt.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=zt.from("1"+Dt.substring(0,t),this.format),n=Ht.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===_t(this,Rt,"f")||"0"===_t(this,Rt,"f")}isNegative(){return"-"===_t(this,Rt,"f")[0]}toString(){return _t(this,Rt,"f")}toHexString(t){throw new Error("TODO")}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return zt.fromString(_t(this,Rt,"f"),t)}static fromValue(t,e=0,r="fixed"){return zt.fromString(jt(t,e),$t.from(r))}static fromString(t,e="fixed"){const r=$t.from(e),n=Gt(t,r.decimals);!r.signed&&n<0&&Lt("unsigned value cannot be negative","overflow","value",t);const s=r.signed?kt(Ot(n,r.width)):kt(n,r.width/8),i=jt(n,r.decimals);return new zt(Ft,s,i,r)}static fromBytes(t,e="fixed"){const r=mt.getBytes(t,"value"),n=$t.from(e);if(r.length>n.width/8)throw new Error("overflow");let s=Et(r);n.signed&&(s=xt(s,n.width));const i=kt(Ot(s,(n.signed?0:1)+n.width)),o=jt(s,n.decimals);return new zt(Ft,i,o,n)}static from(t,e){if("string"==typeof t)return zt.fromString(t,e);if(t instanceof Uint8Array)return zt.fromBytes(t,e);try{return zt.fromValue(t,0,e)}catch(t){if("INVALID_ARGUMENT"!==t.code)throw t}return mt.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}Rt=new WeakMap,St=new WeakSet,Bt=function(t){this.format.name!==t.format.name&&mt.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)};const Wt=zt.from(1),Ht=zt.from("0.5"),Vt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let Kt=null;function Jt(t){if(null==Kt){Kt={};for(let t=0;t<Vt.length;t++)Kt[Vt[t]]=BigInt(t)}const e=Kt[t];return null==e&&mt.throwArgumentError("invalid base58 value","letter",t),e}const qt=BigInt(0),Xt=BigInt(58);function Yt(t){let e=Et(mt.getBytes(t)),r="";for(;e;)r=Vt[Number(e%Xt)]+r,e/=Xt;return r}function Zt(t){let e=qt;for(let r=0;r<t.length;r++)e*=Xt,e+=Jt(t[r]);return kt(e)}const Qt=["wei","kwei","mwei","gwei","szabo","finney","ether"];function te(t,e){if("string"==typeof e){const t=Qt.indexOf(e);-1===t&&mt.throwArgumentError("invalid unit","unit",e),e=3*t}return jt(t,null!=e?e:18)}function ee(t,e){if("string"!=typeof t&&mt.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=Qt.indexOf(e);-1===t&&mt.throwArgumentError("invalid unit","unit",e),e=3*t}return Gt(t,null!=e?e:18)}function re(t){return te(t,18)}function ne(t){return ee(t,18)}function se(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 ie(t){return se(t,!0)||t instanceof Uint8Array}const oe=new T("@ethersproject/bytes@6.0.0-beta.3");let ae=null,ce=null;try{ae=BigInt("8"),ce=BigInt("255")}catch(t){console.log("Unsupported bigint",t)}function le(t){if(null==t&&oe.throwArgumentError("cannot arrayify nullish","data",t),"number"==typeof t){let e=oe.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(ae&&"bigint"==typeof t){const e=[];for(;t;)e.unshift(Number(t&ce)),t>>=ae;return 0===e.length&&e.push(0),new Uint8Array(e)}if((e=t)&&"function"==typeof e.toHexString)return le(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 ue(t){return ie(t)||oe.throwArgumentError("invalid BytesLike value","data",t),t instanceof Uint8Array?t:le(t)}function he(t){return new Uint8Array(Buffer.from(t,"base64"))}function fe(t){return Buffer.from(oe.getBytes(t,"data")).toString("base64")}const de="0123456789abcdef";function pe(t){const e=ue(t);let r="0x";for(let t=0;t<e.length;t++){const n=e[t];r+=de[(240&n)>>4]+de[15&n]}return r}function ge(t){let e=pe(le(t)).substring(2);for(;"0"===e.substring(0,1);)e=e.substring(1);return""===e&&(e="0"),"0x"+e}function we(t){return"0x"+t.map((t=>pe(t).substring(2))).join("")}function me(t){return se(t,!0)?(t.length-2)/2:ue(t).length}function ye(t,e,r){const n=ue(t);return null!=r&&r>n.length&&oe.throwError("cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),pe(n.slice(null==e?0:e,null==r?n.length:r))}function be(t){let e=pe(t).substring(2);for(;"00"==e.substring(0,2);)e=e.substring(2);return"0x"+e}function ve(t,e,r){const n=ue(t);e<n.length&&oe.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),pe(s)}function Ee(t,e){return ve(t,e,!0)}function Ae(t,e){return ve(t,e,!1)}var ke,Te,Pe,Ne,xe,Oe,Ie,Se,Re,Be,Ce,_e=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},Fe=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 Ue=32,Le=new Uint8Array(Ue),De=["then"],Me={};class je extends Array{constructor(t,e,r){return P.assertPrivate(t,Me,"Result"),super(...e),ke.add(this),Te.set(this,void 0),_e(this,Te,new Map,"f"),r&&r.forEach(((t,e)=>{null!=t&&(Fe(this,Te,"f").has(t)?Fe(this,Te,"f").get(t).push(e):Fe(this,Te,"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=P.getNumber(e,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const n=t[r];return n instanceof Error&&Fe(this,ke,"m",Pe).call(this,`index ${r}`,n),n}if(e in t||De.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=Fe(this,Te,"f").get(t);if(null!=e&&1===e.length){const r=this[e[0]];return r instanceof Error&&Fe(this,ke,"m",Pe).call(this,`property ${JSON.stringify(t)}`,r),r}throw new Error(`no named parameter: ${JSON.stringify(t)}`)}static fromItems(t,e){return new je(Me,t,e)}}function Ge(t){let e=Tt(t);return e.length>Ue&&P.throwError("value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Ue,offset:e.length}),e.length!==Ue&&(e=le(we([Le.slice(e.length%Ue),e]))),e}Te=new WeakMap,ke=new WeakSet,Pe=function(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r};class $e{constructor(t,e,r,s){n(this,{name:t,type:e,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){return P.throwArgumentError(t,this.localName,e)}}class ze{constructor(){Ne.add(this),xe.set(this,void 0),Oe.set(this,void 0),_e(this,xe,[],"f"),_e(this,Oe,0,"f")}get data(){return we(Fe(this,xe,"f"))}get length(){return Fe(this,Oe,"f")}appendWriter(t){return Fe(this,Ne,"m",Ie).call(this,le(t.data))}writeBytes(t){let e=le(t);const r=e.length%Ue;return r&&(e=le(we([e,Le.slice(r)]))),Fe(this,Ne,"m",Ie).call(this,e)}writeValue(t){return Fe(this,Ne,"m",Ie).call(this,Ge(t))}writeUpdatableValue(){const t=Fe(this,xe,"f").length;return Fe(this,xe,"f").push(Le),_e(this,Oe,Fe(this,Oe,"f")+Ue,"f"),e=>{Fe(this,xe,"f")[t]=Ge(e)}}}xe=new WeakMap,Oe=new WeakMap,Ne=new WeakSet,Ie=function(t){return Fe(this,xe,"f").push(t),_e(this,Oe,Fe(this,Oe,"f")+t.length,"f"),t.length};class We{constructor(t,e){Se.add(this),Re.set(this,void 0),Be.set(this,void 0),n(this,{allowLoose:!!e}),_e(this,Re,le(t),"f"),_e(this,Be,0,"f")}get data(){return pe(Fe(this,Re,"f"))}get dataLength(){return Fe(this,Re,"f").length}get consumed(){return Fe(this,Be,"f")}get bytes(){return new Uint8Array(Fe(this,Re,"f"))}subReader(t){return new We(Fe(this,Re,"f").slice(Fe(this,Be,"f")+t),this.allowLoose)}readBytes(t,e){let r=Fe(this,Se,"m",Ce).call(this,0,t,!!e);return _e(this,Be,Fe(this,Be,"f")+r.length,"f"),r.slice(0,t)}readValue(){return Et(this.readBytes(Ue))}readIndex(){return At(this.readBytes(Ue))}}Re=new WeakMap,Be=new WeakMap,Se=new WeakSet,Ce=function(t,e,r){let n=Math.ceil(e/Ue)*Ue;return Fe(this,Be,"f")+n>Fe(this,Re,"f").length&&(this.allowLoose&&r&&Fe(this,Be,"f")+e<=Fe(this,Re,"f").length?n=e:P.throwError("data out-of-bounds","BUFFER_OVERRUN",{buffer:le(Fe(this,Re,"f")),length:Fe(this,Re,"f").length,offset:Fe(this,Be,"f")+n})),Fe(this,Re,"f").slice(Fe(this,Be,"f"),Fe(this,Be,"f")+n)};
|
||
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||
const He=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ve=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ke=(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 Je=(()=>{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 qe(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 Je(),n+=t)}}function Xe(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 Ye(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Ze(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Ye(t.outputLen),Ye(t.blockLen)}class Qe{clone(){return this._cloneInto()}}function tr(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 er(t){const e=e=>t().update(Xe(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}class rr extends Qe{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Ze(t);const r=Xe(e);if(this.iHash=t.create(),!(this.iHash instanceof Qe))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 nr=(t,e,r)=>new rr(t,e).update(r).digest();function sr(t,e,r,n){const{c:s,dkLen:i,DK:o,PRF:a,PRFSalt:c}=function(t,e,r,n){Ze(t);const s=tr({dkLen:32,asyncTick:10},n),{c:i,dkLen:o,asyncTick:a}=s;if(Ye(i),Ye(o),Ye(a),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Xe(e),l=Xe(r),u=new Uint8Array(o),h=nr.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=Ve(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)}nr.create=(t,e)=>new rr(t,e);class ir extends Qe{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=Ve(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=Xe(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=Ve(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=Ve(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 or=(t,e,r)=>t&e^~t&r,ar=(t,e,r)=>t&e^t&r^e&r,cr=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]),lr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ur=new Uint32Array(64);class hr extends ir{constructor(){super(64,32,8,!1),this.A=0|lr[0],this.B=0|lr[1],this.C=0|lr[2],this.D=0|lr[3],this.E=0|lr[4],this.F=0|lr[5],this.G=0|lr[6],this.H=0|lr[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)ur[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=ur[t-15],r=ur[t-2],n=Ke(e,7)^Ke(e,18)^e>>>3,s=Ke(r,17)^Ke(r,19)^r>>>10;ur[t]=s+ur[t-7]+n+ur[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+(Ke(o,6)^Ke(o,11)^Ke(o,25))+or(o,a,c)+cr[t]+ur[t]|0,u=(Ke(r,2)^Ke(r,13)^Ke(r,22))+ar(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(){ur.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const fr=er((()=>new hr)),dr=BigInt(2**32-1),pr=BigInt(32);function gr(t,e=!1){return e?{h:Number(t&dr),l:Number(t>>pr&dr)}:{h:0|Number(t>>pr&dr),l:0|Number(t&dr)}}function wr(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}=gr(t[s],e);[r[s],n[s]]=[i,o]}return[r,n]}const mr=(t,e,r)=>t>>>r,yr=(t,e,r)=>t<<32-r|e>>>r,br=(t,e,r)=>t>>>r|e<<32-r,vr=(t,e,r)=>t<<32-r|e>>>r,Er=(t,e,r)=>t<<64-r|e>>>r-32,Ar=(t,e,r)=>t>>>r-32|e<<64-r;function kr(t,e,r,n){const s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:0|s}}const Tr=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Pr=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Nr=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),xr=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0,Or=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0),Ir=(t,e,r,n,s,i)=>e+r+n+s+i+(t/2**32|0)|0,[Sr,Rr]=wr(["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)))),Br=new Uint32Array(80),Cr=new Uint32Array(80);class _r extends ir{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:g}=this;return[t,e,r,n,s,i,o,a,c,l,u,h,f,d,p,g]}set(t,e,r,n,s,i,o,a,c,l,u,h,f,d,p,g){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|g}process(t,e){for(let r=0;r<16;r++,e+=4)Br[r]=t.getUint32(e),Cr[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Br[t-15],r=0|Cr[t-15],n=br(e,r,1)^br(e,r,8)^mr(e,0,7),s=vr(e,r,1)^vr(e,r,8)^yr(e,r,7),i=0|Br[t-2],o=0|Cr[t-2],a=br(i,o,19)^Er(i,o,61)^mr(i,0,6),c=vr(i,o,19)^Ar(i,o,61)^yr(i,o,6),l=Nr(s,c,Cr[t-7],Cr[t-16]),u=xr(l,n,a,Br[t-7],Br[t-16]);Br[t]=0|u,Cr[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:g,Hh:w,Hl:m}=this;for(let t=0;t<80;t++){const e=br(u,h,14)^br(u,h,18)^Er(u,h,41),y=vr(u,h,14)^vr(u,h,18)^Ar(u,h,41),b=u&f^~u&p,v=Or(m,y,h&d^~h&g,Rr[t],Cr[t]),E=Ir(v,w,e,b,Sr[t],Br[t]),A=0|v,k=br(r,n,28)^Er(r,n,34)^Er(r,n,39),T=vr(r,n,28)^Ar(r,n,34)^Ar(r,n,39),P=r&s^r&o^s&o,N=n&i^n&a^i&a;w=0|p,m=0|g,p=0|f,g=0|d,f=0|u,d=0|h,({h:u,l:h}=kr(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=Tr(A,T,N);r=Pr(x,E,k,P),n=0|x}({h:r,l:n}=kr(0|this.Ah,0|this.Al,0|r,0|n)),({h:s,l:i}=kr(0|this.Bh,0|this.Bl,0|s,0|i)),({h:o,l:a}=kr(0|this.Ch,0|this.Cl,0|o,0|a)),({h:c,l:l}=kr(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:h}=kr(0|this.Eh,0|this.El,0|u,0|h)),({h:f,l:d}=kr(0|this.Fh,0|this.Fl,0|f,0|d)),({h:p,l:g}=kr(0|this.Gh,0|this.Gl,0|p,0|g)),({h:w,l:m}=kr(0|this.Hh,0|this.Hl,0|w,0|m)),this.set(r,n,s,i,o,a,c,l,u,h,f,d,p,g,w,m)}roundClean(){Br.fill(0),Cr.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 Fr extends _r{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 Ur extends _r{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 Lr=er((()=>new _r));er((()=>new Fr)),er((()=>new Ur));const Dr=new T("@ethersproject/crypto@6.0.0-beta.2");const Mr=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 jr=Mr.crypto||Mr.msCrypto;function Gr(t){switch(t){case"sha256":return fr.create();case"sha512":return Lr.create()}return Dr.throwArgumentError("invalid hashing algorithm name","algorithm",t)}let $r=!1;const zr=function(t,e,r){return"0x"+function(t,e){const r={sha256:fr,sha512:Lr}[t];return null==r?Dr.throwArgumentError("invalid hmac algorithm","algorithm",t):nr.create(r,e)}(t,e).update(r).digest("hex")};let Wr=zr;function Hr(t,e,r){const n=Dr.getBytes(e,"key"),s=Dr.getBytes(r,"data");return pe(Wr(t,n,s))}Hr._=zr,Hr.lock=function(){$r=!0},Hr.register=function(t){if($r)throw new Error("computeHmac is locked");Wr=t},Object.freeze(Hr);const[Vr,Kr,Jr]=[[],[],[]],qr=BigInt(0),Xr=BigInt(1),Yr=BigInt(2),Zr=BigInt(7),Qr=BigInt(256),tn=BigInt(113);for(let t=0,e=Xr,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],Vr.push(2*(5*n+r)),Kr.push((t+1)*(t+2)/2%64);let s=qr;for(let t=0;t<7;t++)e=(e<<Xr^(e>>Zr)*tn)%Qr,e&Yr&&(s^=Xr<<(Xr<<BigInt(t))-Xr);Jr.push(s)}const[en,rn]=wr(Jr,!0),nn=(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),sn=(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 on extends Qe{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,Ye(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=He(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=nn(i,o,1)^r[n],c=sn(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=Kr[r],i=nn(e,s,n),o=sn(e,s,n),a=Vr[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]^=en[n],t[1]^=rn[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=Xe(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 Ye(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 on(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 an=(t,e,r)=>er((()=>new on(e,t,r)));an(6,144,28),an(6,136,32),an(6,104,48),an(6,72,64),an(1,144,28);const cn=an(1,136,32);an(1,104,48),an(1,72,64);const ln=(t,e,r)=>function(t){const e=(e,r)=>t(r).update(Xe(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}(((n={})=>new on(e,t,void 0!==n.dkLen?n.dkLen:r,!0)));ln(31,168,16),ln(31,136,32);let un=!1;const hn=function(t){return cn(t)};let fn=hn;function dn(t){const e=Dr.getBytes(t,"data");return pe(fn(e))}dn._=hn,dn.lock=function(){un=!0},dn.register=function(t){if(un)throw new TypeError("keccak256 is locked");fn=t},Object.freeze(dn);const pn=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),gn=Uint8Array.from({length:16},((t,e)=>e)),wn=gn.map((t=>(9*t+5)%16));let mn=[gn],yn=[wn];for(let t=0;t<4;t++)for(let e of[mn,yn])e.push(e[t].map((t=>pn[t])));const bn=[[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))),vn=mn.map(((t,e)=>t.map((t=>bn[e][t])))),En=yn.map(((t,e)=>t.map((t=>bn[e][t])))),An=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),kn=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Tn=(t,e)=>t<<e|t>>>32-e;function Pn(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 Nn=new Uint32Array(16);class xn extends ir{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)Nn[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=An[t],d=kn[t],p=mn[t],g=yn[t],w=vn[t],m=En[t];for(let e=0;e<16;e++){const n=Tn(r+Pn(t,s,o,c)+Nn[p[e]]+f,w[e])+u|0;r=u,u=c,c=0|Tn(o,10),o=s,s=n}for(let t=0;t<16;t++){const r=Tn(n+Pn(e,i,a,l)+Nn[g[t]]+d,m[t])+h|0;n=h,h=l,l=0|Tn(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(){Nn.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const On=er((()=>new xn));let In=!1;const Sn=function(t){return On(t)};let Rn=Sn;function Bn(t){const e=Dr.getBytes(t,"data");return pe(Rn(e))}Bn._=Sn,Bn.lock=function(){In=!0},Bn.register=function(t){if(In)throw new TypeError("ripemd160 is locked");Rn=t},Object.freeze(Bn);let Cn=!1;const _n=function(t,e,r,n,s){return function(t,e,r,n,s){const i={sha256:fr,sha512:Lr}[s];return null==i?Dr.throwArgumentError("invalid pbkdf2 algorithm","algorithm",s):sr(i,t,e,{c:r,dkLen:n})}(t,e,r,n,s)};let Fn=_n;function Un(t,e,r,n,s){const i=Dr.getBytes(t,"password"),o=Dr.getBytes(e,"salt");return pe(Fn(i,o,r,n,s))}Un._=_n,Un.lock=function(){Cn=!0},Un.register=function(t){if(Cn)throw new Error("pbkdf2 is locked");Fn=t},Object.freeze(Un);let Ln=!1;const Dn=function(t){return new Uint8Array(function(t){if(null==jr)return Dr.throwError("platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});(t<=0||t>1024||t%1||t!=t)&&Dr.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return jr.getRandomValues(e),e}(t))};let Mn=Dn;function jn(t){return Mn(t)}jn._=Dn,jn.lock=function(){Ln=!0},jn.register=function(t){if(Ln)throw new Error("random is locked");Mn=t},Object.freeze(jn);const Gn=(t,e)=>t<<e|t>>>32-e;function $n(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++],g=t[e++]^r[n++],w=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,k=a,T=c,P=l,N=u,x=h,O=f,I=d,S=p,R=g,B=w,C=m,_=y,F=b,U=v,L=E;for(let t=0;t<8;t+=2)N^=Gn(A+_|0,7),S^=Gn(N+A|0,9),_^=Gn(S+N|0,13),A^=Gn(_+S|0,18),R^=Gn(x+k|0,7),F^=Gn(R+x|0,9),k^=Gn(F+R|0,13),x^=Gn(k+F|0,18),U^=Gn(B+O|0,7),T^=Gn(U+B|0,9),O^=Gn(T+U|0,13),B^=Gn(O+T|0,18),P^=Gn(L+C|0,7),I^=Gn(P+L|0,9),C^=Gn(I+P|0,13),L^=Gn(C+I|0,18),k^=Gn(A+P|0,7),T^=Gn(k+A|0,9),P^=Gn(T+k|0,13),A^=Gn(P+T|0,18),O^=Gn(x+N|0,7),I^=Gn(O+x|0,9),N^=Gn(I+O|0,13),x^=Gn(N+I|0,18),C^=Gn(B+R|0,7),S^=Gn(C+B|0,9),R^=Gn(S+C|0,13),B^=Gn(R+S|0,18),_^=Gn(L+U|0,7),F^=Gn(_+L|0,9),U^=Gn(F+_|0,13),L^=Gn(U+F|0,18);s[i++]=o+A|0,s[i++]=a+k|0,s[i++]=c+T|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++]=g+R|0,s[i++]=w+B|0,s[i++]=m+C|0,s[i++]=y+_|0,s[i++]=b+F|0,s[i++]=v+U|0,s[i++]=E+L|0}function zn(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)$n(r,o,t,e,r,i),n>0&&(o+=16),$n(r,i,t,e+=16,r,o)}function Wn(t,e,r){const n=tr({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:s,r:i,p:o,dkLen:a,asyncTick:c,maxmem:l,onProgress:u}=n;if(Ye(s),Ye(i),Ye(o),Ye(a),Ye(c),Ye(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=sr(fr,t,e,{c:1,dkLen:h*o}),g=He(p),w=He(new Uint8Array(h*s)),m=He(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:w,B32:g,B:p,tmp:m,blockMixCb:y,asyncTick:c}}function Hn(t,e,r,n,s){const i=sr(fr,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),s.fill(0),i}let Vn=!1,Kn=!1;const Jn=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}=Wn(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 qe(n-1,d,(t=>{zn(c,r,c,r+=a,s),f()})),zn(c,(n-1)*a,l,e,s),f(),await qe(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];zn(h,0,l,e,s),f()}))}return Hn(t,o,u,c,h)}(t,e,{N:r,r:n,p:s,dkLen:i,onProgress:o})},qn=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}=Wn(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++)zn(c,e,c,e+=a,s),f();zn(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];zn(h,0,l,e,s),f()}}return Hn(t,o,u,c,h)}(t,e,{N:r,r:n,p:s,dkLen:i})};let Xn=Jn,Yn=qn;async function Zn(t,e,r,n,s,i,o){const a=Dr.getBytes(t,"passwd"),c=Dr.getBytes(e,"salt");return pe(await Xn(a,c,r,n,s,i,o))}function Qn(t,e,r,n,s,i){const o=Dr.getBytes(t,"passwd"),a=Dr.getBytes(e,"salt");return pe(Yn(o,a,r,n,s,i))}Zn._=Jn,Zn.lock=function(){Kn=!0},Zn.register=function(t){if(Kn)throw new Error("scrypt is locked");Xn=t},Object.freeze(Zn),Qn._=qn,Qn.lock=function(){Vn=!0},Qn.register=function(t){if(Vn)throw new Error("scryptSync is locked");Yn=t},Object.freeze(Qn);const ts=function(t){return Gr("sha256").update(t).digest()},es=function(t){return Gr("sha512").update(t).digest()};let rs=ts,ns=es,ss=!1,is=!1;function os(t){const e=Dr.getBytes(t,"data");return pe(rs(e))}function as(t){const e=Dr.getBytes(t,"data");return pe(ns(e))}function cs(){Hr.lock(),dn.lock(),Un.lock(),jn.lock(),Bn.lock(),Zn.lock(),Qn.lock(),os.lock(),as.lock()}os._=ts,os.lock=function(){ss=!0},os.register=function(t){if(ss)throw new Error("sha256 is locked");rs=t},Object.freeze(os),as._=es,as.lock=function(){is=!0},as.register=function(t){if(is)throw new Error("sha512 is locked");ns=t},Object.freeze(os);const ls=new T("@ethersproject/address@6.0.0-beta.2"),us=BigInt(0),hs=BigInt(36);function fs(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=le(dn(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 ds={};for(let t=0;t<10;t++)ds[String(t)]=String(t);for(let t=0;t<26;t++)ds[String.fromCharCode(65+t)]=String(10+t);function ps(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>ds[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 gs=function(){const t={};for(let e=0;e<36;e++){t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e)}return t}();function ws(t){if("string"!=typeof t&&ls.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){"0x"!==t.substring(0,2)&&(t="0x"+t);const e=fs(t);return t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&ls.throwArgumentError("bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){t.substring(2,4)!==ps(t)&&ls.throwArgumentError("bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=us;for(let r=0;r<t.length;r++)e=e*hs+gs[t[r]];return e}(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return fs("0x"+e)}return ls.throwArgumentError("invalid address","address",t)}function ms(t){let e=BigInt(ws(t)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+ps("XE00"+e)+e}const ys=new T("@ethersproject/rlp@6.0.0-beta.2");function bs(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function vs(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(vs(t))})),e.length<=55)return e.unshift(192+e.length),e;const r=bs(e.length);return r.unshift(247+r.length),r.concat(e)}const e=Array.prototype.slice.call(ys.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=bs(e.length);return r.unshift(183+r.length),r.concat(e)}const Es="0123456789abcdef";function As(t){let e="0x";for(const r of vs(t))e+=Es[r>>4],e+=Es[15&r];return e}function ks(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Ts(t,e,r){let n=0;for(let s=0;s<r;s++)n=256*n+t[e+s];return n}function Ps(t,e,r,n){const s=[];for(;r<e+1+n;){const i=Ns(t,r);s.push(i.result),(r+=i.consumed)>e+1+n&&ys.throwError("child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:s}}function Ns(t,e){0===t.length&&ys.throwError("data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=e=>{e>t.length&&ys.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=Ts(t,e+1,n);return r(e+1+n+s),Ps(t,e,e+1+n,n+s)}if(t[e]>=192){const n=t[e]-192;return r(e+1+n),Ps(t,e,e+1,n)}if(t[e]>=184){const n=t[e]-183;r(e+1+n);const s=Ts(t,e+1,n);r(e+1+n+s);return{consumed:1+n+s,result:pe(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:pe(t.slice(e+1,e+1+n))}}return{consumed:1,result:ks(t[e])}}function xs(t){const e=ys.getBytes(t,"data"),r=Ns(e,0);return r.consumed!==e.length&&ys.throwArgumentError("unexpected junk after rlp payload","data",t),r.result}function Os(t){const e=ws(t.from);let r=ls.getBigInt(t.nonce,"tx.nonce").toString(16);return r="0"===r?"0x":r.length%2?"0x0"+r:"0x"+r,ws(ye(dn(As([e,r])),12))}function Is(t,e,r){const n=ws(t),s=ls.getBytes(e,"salt"),i=ls.getBytes(r,"initCodeHash");return 32!==s.length&&ls.throwArgumentError("salt must be 32 bytes","salt",e),32!==i.length&&ls.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ws(ye(dn(we(["0xff",n,s,i])),12))}function Ss(t){return t&&"function"==typeof t.getAddress}function Rs(t){try{return ws(t),!0}catch(t){}return!1}async function Bs(t,e){if("string"==typeof t){if(t.match(/^0x[0-9a-f]{40}$/i))return ws(t);if(null==e)return ls.throwError("ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"});const r=await e.resolveName(t);return null==r||"0x0000000000000000000000000000000000000000"===r?ls.throwError("unconfigured name","UNCONFIGURED_NAME",{value:t}):ws(r)}if(Ss(t)){const e=await t.getAddress();return null==e&&ls.throwArgumentError("addressable resolved to null","target",t),ws(e)}return ls.throwArgumentError("unsupported addressable value","target",t)}var Cs,_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},Fs=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 Us={};function Ls(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new js(Us,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function Ds(t,e){return new js(Us,`bytes${e||""}`,t,{size:e})}const Ms=Symbol.for("_ethers_typed");class js{constructor(t,e,r,s=null){if(Cs.set(this,void 0),t!==Us)throw new Error("private constructor");n(this,{_typedSymbol:Ms,type:e,value:r}),_s(this,Cs,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 Fs(this,Cs,"f")}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===Fs(this,Cs,"f")?-1:!1===Fs(this,Cs,"f")?this.value.length:null}static from(t,e){return new js(Us,t,e)}static uint8(t){return Ls(t,8)}static uint16(t){return Ls(t,16)}static uint24(t){return Ls(t,24)}static uint32(t){return Ls(t,32)}static uint40(t){return Ls(t,40)}static uint48(t){return Ls(t,46)}static uint56(t){return Ls(t,56)}static uint64(t){return Ls(t,64)}static uint72(t){return Ls(t,72)}static uint80(t){return Ls(t,80)}static uint88(t){return Ls(t,88)}static uint96(t){return Ls(t,96)}static uint104(t){return Ls(t,104)}static uint112(t){return Ls(t,112)}static uint120(t){return Ls(t,120)}static uint128(t){return Ls(t,128)}static uint136(t){return Ls(t,136)}static uint144(t){return Ls(t,144)}static uint152(t){return Ls(t,152)}static uint160(t){return Ls(t,160)}static uint168(t){return Ls(t,168)}static uint176(t){return Ls(t,176)}static uint184(t){return Ls(t,184)}static uint192(t){return Ls(t,192)}static uint200(t){return Ls(t,200)}static uint208(t){return Ls(t,208)}static uint216(t){return Ls(t,216)}static uint224(t){return Ls(t,224)}static uint232(t){return Ls(t,232)}static uint240(t){return Ls(t,240)}static uint248(t){return Ls(t,248)}static uint256(t){return Ls(t,256)}static uint(t){return Ls(t,256)}static int8(t){return Ls(t,-8)}static int16(t){return Ls(t,-16)}static int24(t){return Ls(t,-24)}static int32(t){return Ls(t,-32)}static int40(t){return Ls(t,-40)}static int48(t){return Ls(t,-46)}static int56(t){return Ls(t,-56)}static int64(t){return Ls(t,-64)}static int72(t){return Ls(t,-72)}static int80(t){return Ls(t,-80)}static int88(t){return Ls(t,-88)}static int96(t){return Ls(t,-96)}static int104(t){return Ls(t,-104)}static int112(t){return Ls(t,-112)}static int120(t){return Ls(t,-120)}static int128(t){return Ls(t,-128)}static int136(t){return Ls(t,-136)}static int144(t){return Ls(t,-144)}static int152(t){return Ls(t,-152)}static int160(t){return Ls(t,-160)}static int168(t){return Ls(t,-168)}static int176(t){return Ls(t,-176)}static int184(t){return Ls(t,-184)}static int192(t){return Ls(t,-192)}static int200(t){return Ls(t,-200)}static int208(t){return Ls(t,-208)}static int216(t){return Ls(t,-216)}static int224(t){return Ls(t,-224)}static int232(t){return Ls(t,-232)}static int240(t){return Ls(t,-240)}static int248(t){return Ls(t,-248)}static int256(t){return Ls(t,-256)}static int(t){return Ls(t,-256)}static bytes(t){return Ds(t)}static bytes1(t){return Ds(t,1)}static bytes2(t){return Ds(t,2)}static bytes3(t){return Ds(t,3)}static bytes4(t){return Ds(t,4)}static bytes5(t){return Ds(t,5)}static bytes6(t){return Ds(t,6)}static bytes7(t){return Ds(t,7)}static bytes8(t){return Ds(t,8)}static bytes9(t){return Ds(t,9)}static bytes10(t){return Ds(t,10)}static bytes11(t){return Ds(t,11)}static bytes12(t){return Ds(t,12)}static bytes13(t){return Ds(t,13)}static bytes14(t){return Ds(t,14)}static bytes15(t){return Ds(t,15)}static bytes16(t){return Ds(t,16)}static bytes17(t){return Ds(t,17)}static bytes18(t){return Ds(t,18)}static bytes19(t){return Ds(t,19)}static bytes20(t){return Ds(t,20)}static bytes21(t){return Ds(t,21)}static bytes22(t){return Ds(t,22)}static bytes23(t){return Ds(t,23)}static bytes24(t){return Ds(t,24)}static bytes25(t){return Ds(t,25)}static bytes26(t){return Ds(t,26)}static bytes27(t){return Ds(t,27)}static bytes28(t){return Ds(t,28)}static bytes29(t){return Ds(t,29)}static bytes30(t){return Ds(t,30)}static bytes31(t){return Ds(t,31)}static bytes32(t){return Ds(t,32)}static address(t){return new js(Us,"address",t)}static bool(t){return new js(Us,"bool",!!t)}static string(t){return new js(Us,"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 js(Us,"overrides",Object.assign({},t))}static isTyped(t){return t&&t._typedSymbol===Ms}static dereference(t,e){if(js.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}}Cs=new WeakMap;class Gs extends $e{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let r=js.dereference(e,"string");try{r=ws(r)}catch(t){return this._throwError(t.message,e)}return t.writeValue(r)}decode(t){return ws(kt(t.readValue(),20))}}class $s extends $e{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 zs(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||P.throwError("cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:r}),t[n]&&P.throwError("cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:r}),t[n]=!0,r[n]}))}else P.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&P.throwArgumentError("types/value length mismatch","tuple",r);let s=new ze,i=new ze,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 Ws(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(u(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(u(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)})),je.fromItems(r,n)}class Hs extends $e{constructor(t,e,r){super("array",t.type+"["+(e>=0?e:"")+"]",r,-1===e||t.dynamic),n(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=js.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)),P.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 zs(t,s,r)}decode(t){let e=this.length;-1===e&&(e=t.readIndex(),e*Ue>t.dataLength&&P.throwError("insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*Ue,length:t.dataLength}));let r=[];for(let t=0;t<e;t++)r.push(new $s(this.coder));return Ws(t,r)}}class Vs extends $e{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const r=js.dereference(e,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}}class Ks extends $e{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=le(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readIndex(),!0)}}class Js extends Ks{constructor(t){super("bytes",t)}decode(t){return pe(super.decode(t))}}class qs extends $e{constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),n(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let r=le(js.dereference(e,this.type));return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return pe(t.readBytes(this.size))}}const Xs=new Uint8Array([]);class Ys extends $e{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes(Xs)}decode(t){return t.readBytes(0),null}}const Zs=BigInt(0),Qs=BigInt(1),ti=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ei extends $e{constructor(t,e,r){const s=(e?"int":"uint")+8*t;super(s,s,r,!1),n(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let r=P.getBigInt(js.dereference(e,this.type)),n=It(ti,256);if(this.signed){let t=It(n,8*this.size-1);(r>t||r<-(t+Qs))&&this._throwError("value out-of-bounds",e)}else(r<Zs||r>It(n,8*this.size))&&this._throwError("value out-of-bounds",e);return r=It(Ot(r,8*this.size),8*this.size),this.signed&&(r=Ot(xt(r,8*this.size),256)),t.writeValue(r)}decode(t){let e=It(t.readValue(),8*this.size);return this.signed&&(e=xt(e,8*this.size)),e}}const ri=new T("@ethersproject/strings@6.0.0-beta.2");var ni,si;function ii(e,r,n,s,i){if(e===t.Utf8ErrorReason.BAD_PREFIX||e===t.Utf8ErrorReason.UNEXPECTED_CONTINUE){let t=0;for(let e=r+1;e<n.length&&n[e]>>6==2;e++)t++;return t}return e===t.Utf8ErrorReason.OVERRUN?n.length-r-1:0}t.UnicodeNormalizationForm=void 0,(ni=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})).current="",ni.NFC="NFC",ni.NFD="NFD",ni.NFKC="NFKC",ni.NFKD="NFKD",t.Utf8ErrorReason=void 0,(si=t.Utf8ErrorReason||(t.Utf8ErrorReason={})).UNEXPECTED_CONTINUE="unexpected continuation byte",si.BAD_PREFIX="bad codepoint prefix",si.OVERRUN="string overrun",si.MISSING_CONTINUE="missing continuation byte",si.OUT_OF_RANGE="out of UTF-8 range",si.UTF16_SURROGATE="UTF-16 surrogate",si.OVERLONG="overlong representation";const oi=Object.freeze({error:function(t,e,r,n,s){return ri.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:ii,replace:function(e,r,n,s,i){return e===t.Utf8ErrorReason.OVERLONG?(s.push(null!=i?i:-1),0):(s.push(65533),ii(e,r,n))}});function ai(e,r){null==r&&(r=oi.error);const n=ri.getBytes(e,"bytes"),s=[];let i=0;for(;i<n.length;){const e=n[i++];if(e>>7==0){s.push(e);continue}let o=null,a=null;if(192==(224&e))o=1,a=127;else if(224==(240&e))o=2,a=2047;else{if(240!=(248&e)){i+=r(128==(192&e)?t.Utf8ErrorReason.UNEXPECTED_CONTINUE:t.Utf8ErrorReason.BAD_PREFIX,i-1,n,s);continue}o=3,a=65535}if(i-1+o>=n.length){i+=r(t.Utf8ErrorReason.OVERRUN,i-1,n,s);continue}let c=e&(1<<8-o-1)-1;for(let e=0;e<o;e++){let e=n[i];if(128!=(192&e)){i+=r(t.Utf8ErrorReason.MISSING_CONTINUE,i,n,s),c=null;break}c=c<<6|63&e,i++}null!==c&&(c>1114111?i+=r(t.Utf8ErrorReason.OUT_OF_RANGE,i-1-o,n,s,c):c>=55296&&c<=57343?i+=r(t.Utf8ErrorReason.UTF16_SURROGATE,i-1-o,n,s,c):c<=a?i+=r(t.Utf8ErrorReason.OVERLONG,i-1-o,n,s,c):s.push(c))}return s}function ci(e,r=t.UnicodeNormalizationForm.current){r!=t.UnicodeNormalizationForm.current&&(ri.assertNormalize(r),e=e.normalize(r));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const s=e.charCodeAt(t);if(t>=e.length||56320!=(64512&s))throw new Error("invalid utf-8 string");const i=65536+((1023&r)<<10)+(1023&s);n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return new Uint8Array(n)}function li(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function ui(t,e){return'"'+ai(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?li(t):li(55296+((t-=65536)>>10&1023))+li(56320+(1023&t))})).join("")+'"'}function hi(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function fi(t,e){return hi(ai(t,e))}function di(e,r=t.UnicodeNormalizationForm.current){return ai(ci(e,r))}function pi(t){const e=ci(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Ae(e,32)}function gi(t){const e=ri.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 fi(e.slice(0,r))}function wi(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 mi(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 yi(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 bi=mi("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"),vi="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),Ei=[{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}],Ai=wi("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"),ki=wi("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"),Ti=wi("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})),Pi=mi("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 Ni(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let r=di(e);var n;n=r.map((t=>{if(vi.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){const e=yi(t,Ei);if(e){if(null==e.s)throw new Error("should not happenl bad range");return[t+e.s]}const r=Ai[t];if(r)return r;const n=ki[t];return n?[t+n[0]]:Ti[t]||null}(t);return e||[t]})),r=n.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),r=di(hi(r),t.UnicodeNormalizationForm.NFKC),r.forEach((t=>{yi(t,Pi)&&ri.throwArgumentError("STRINGPREP_CONTAINS_PROHIBITED","value",e)})),r.forEach((t=>{yi(t,bi)&&ri.throwArgumentError("STRINGPREP_CONTAINS_UNASSIGNED","value",e)}));let s=hi(r);return"-"!==s.substring(0,1)&&"--"!==s.substring(2,4)&&"-"!==s.substring(s.length-1)||ri.throwArgumentError("invalid hyphen","value",e),s.length>63&&ri.throwArgumentError("too long","value",e),s}class xi extends Ks{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,ci(js.dereference(e,"string")))}decode(t){return fi(super.decode(t))}}class Oi extends $e{constructor(t,e){let r=!1;const s=[];t.forEach((t=>{t.dynamic&&(r=!0),s.push(t.type)}));super("tuple","tuple("+s.join(",")+")",e,r),n(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=js.dereference(e,"tuple");return zs(t,this.coders,r)}decode(t){return Ws(t,this.coders)}}var Ii,Si,Ri=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 Bi=new RegExp(/^bytes([0-9]*)$/),Ci=new RegExp(/^(u?int)([0-9]*)$/);Ii=new WeakSet,Si=function t(e){if(e.isArray())return new Hs(Ri(this,Ii,"m",t).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Oi(e.components.map((e=>Ri(this,Ii,"m",t).call(this,e))),e.name);switch(e.baseType){case"address":return new Gs(e.name);case"bool":return new Vs(e.name);case"string":return new xi(e.name);case"bytes":return new Js(e.name);case"":return new Ys(e.name)}let r=e.type.match(Ci);if(r){let t=parseInt(r[2]||"256");return(0===t||t>256||t%8!=0)&&P.throwArgumentError("invalid "+r[1]+" bit length","param",e),new ei(t/8,"int"===r[1],e.name)}if(r=e.type.match(Bi),r){let t=parseInt(r[1]);return(0===t||t>32)&&P.throwArgumentError("invalid bytes length","param",e),new qs(t,e.name)}return P.throwArgumentError("invalid type","type",e.type)};const _i=new class{constructor(){Ii.add(this)}getDefaultValue(t){const e=t.map((t=>Ri(this,Ii,"m",Si).call(this,at.from(t))));return new Oi(e,"_").defaultValue()}encode(t,e){P.assertArgumentCount(e.length,t.length,"types/values length mismatch");const r=t.map((t=>Ri(this,Ii,"m",Si).call(this,at.from(t)))),n=new Oi(r,"_"),s=new ze;return n.encode(s,e),s.data}decode(t,e,r){const n=t.map((t=>Ri(this,Ii,"m",Si).call(this,at.from(t))));return new Oi(n,"_").decode(new We(e,r))}};function Fi(t){return dn(ci(t))}const Ui=new T("@ethersproject/hash@6.0.0-beta.7"),Li=new Uint8Array(32);Li.fill(0);const Di=new RegExp("^((.*)\\.)?([^.]+)$");function Mi(t){try{const e=t.split(".");for(let t=0;t<e.length;t++)if(0===Ni(e[t]).length)throw new Error("empty");return!0}catch(t){}return!1}function ji(t){"string"!=typeof t&&Ui.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Li;for(;e.length;){const n=e.match(Di);if(null==n||""===n[2])return Ui.throwArgumentError("invalid ENS name; missing component","name",t);r=dn(we([r,dn(ci(Ni(n[3])))])),e=n[2]||""}return pe(r)}function Gi(t){return"string"!=typeof t&&Ui.throwArgumentError("invalid DNS name; not a string","name",t),""===t?"0x00":we(t.split(".").map((e=>{""===e&&Ui.throwArgumentError("invalid DNS name; missing component","name",t);const r=ci("_"+Ni(e));return r[0]=r.length-1,r})))+"00"}const $i="Ethereum Signed Message:\n";function zi(t){return"string"==typeof t&&(t=ci(t)),dn(we([ci($i),ci(String(t.length)),t]))}const Wi=new RegExp("^bytes([0-9]+)$"),Hi=new RegExp("^(u?int)([0-9]*)$"),Vi=new RegExp("^(.*)\\[([0-9]*)\\]$");function Ki(t,e,r){switch(t){case"address":return r?Ui.getBytes(Ee(e,32)):Ui.getBytes(e);case"string":return ci(e);case"bytes":return Ui.getBytes(e);case"bool":return e=e?"0x01":"0x00",r?Ui.getBytes(Ee(e,32)):Ui.getBytes(e)}let n=t.match(Hi);if(n){let s=parseInt(n[2]||"256");return n[2]&&String(s)!==n[2]||s%8!=0||0===s||s>256?Ui.throwArgumentError("invalid number type","type",t):(r&&(s=256),e=Ot(e,s),Ui.getBytes(Ee(Tt(e),s/8)))}if(n=t.match(Wi),n){const s=parseInt(n[1]);return String(s)!==n[1]||0===s||s>32?Ui.throwArgumentError("invalid bytes type","type",t):me(e)!==s?Ui.throwArgumentError(`invalid value for ${t}`,"value",e):r?Ui.getBytes(Ae(e,32)):e}if(n=t.match(Vi),n&&Array.isArray(e)){const r=n[1];parseInt(n[2]||String(e.length))!=e.length&&Ui.throwArgumentError(`invalid array length for ${t}`,"value",e);const s=[];return e.forEach((function(t){s.push(Ki(r,t,!0))})),Ui.getBytes(we(s))}return Ui.throwArgumentError("invalid type","type",t)}function Ji(t,e){t.length!=e.length&&Ui.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach((function(t,n){r.push(Ki(t,e[n]))})),pe(we(r))}function qi(t,e){return dn(Ji(t,e))}function Xi(t,e){return os(Ji(t,e))}var Yi,Zi,Qi,to,eo,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},no=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 so=new Uint8Array(32);so.fill(0);const io=BigInt(-1),oo=BigInt(0),ao=BigInt(1),co=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const lo=kt(ao,32),uo=kt(oo,32),ho={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},fo=["name","version","chainId","verifyingContract","salt"];function po(t){return function(e){return"string"!=typeof e&&Ui.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const go={name:po("name"),version:po("version"),chainId:function(t){return Ui.getBigInt(t,"domain.chainId")},verifyingContract:function(t){try{return ws(t).toLowerCase()}catch(t){}return Ui.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ui.getBytes(t,"domain.salt");return 32!==e.length&&Ui.throwArgumentError('invalid domain value "salt"',"domain.salt",t),pe(e)}};function wo(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))&&Ui.throwArgumentError("invalid numeric width","type",t);const s=It(co,r?n-1:n),i=r?(s+ao)*io:oo;return function(e){const r=Ui.getBigInt(e,"value");return(r<i||r>s)&&Ui.throwArgumentError(`value out-of-bounds for ${t}`,"value",r),kt(Ot(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))&&Ui.throwArgumentError("invalid bytes width","type",t),function(e){return le(e).length!==r&&Ui.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=le(t),r=e.length%32;return r?we([e,so.slice(r)]):pe(e)}(e)}}}switch(t){case"address":return function(t){return Ee(ws(t),32)};case"bool":return function(t){return t?lo:uo};case"bytes":return function(t){return dn(t)};case"string":return function(t){return Fi(t)}}return null}function mo(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class yo{constructor(t){Yi.add(this),Zi.set(this,void 0),Qi.set(this,void 0),to.set(this,void 0),ro(this,Zi,JSON.stringify(t),"f"),ro(this,Qi,new Map,"f"),ro(this,to,new Map,"f");const e=new Map,r=new Map,s=new Map;Object.keys(t).forEach((t=>{e.set(t,new Set),r.set(t,[]),s.set(t,new Set)}));for(const n in t){const s=new Set;for(const i of t[n]){s.has(i.name)&&Ui.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",t),s.add(i.name);const o=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;o===n&&Ui.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t);wo(o)||(r.has(o)||Ui.throwArgumentError(`unknown type ${JSON.stringify(o)}`,"types",t),r.get(o).push(n),e.get(n).add(o))}}const i=Array.from(r.keys()).filter((t=>0===r.get(t).length));0===i.length?Ui.throwArgumentError("missing primary type","types",t):i.length>1&&Ui.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),n(this,{primaryType:i[0]}),function n(i,o){o.has(i)&&Ui.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),o.add(i);for(const t of e.get(i))if(r.has(t)){n(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(),no(this,Qi,"f").set(e,mo(e,t[e])+n.map((e=>mo(e,t[e]))).join(""))}}get types(){return JSON.parse(no(this,Zi,"f"))}getEncoder(t){let e=no(this,to,"f").get(t);return e||(e=no(this,Yi,"m",eo).call(this,t),no(this,to,"f").set(t,e)),e}encodeType(t){const e=no(this,Qi,"f").get(t);return e||Ui.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t)}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return dn(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(wo(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&&Ui.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)),{}):Ui.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new yo(t)}static getPrimaryType(t){return yo.from(t).primaryType}static hashStruct(t,e,r){return yo.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=ho[r];n||Ui.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>fo.indexOf(t.name)-fo.indexOf(e.name))),yo.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return we(["0x1901",yo.hashDomain(t),yo.from(e).hash(r)])}static hash(t,e,r){return dn(yo.encode(t,e,r))}static async resolveNames(t,e,r,n){t=Object.assign({},t);const s={};t.verifyingContract&&!se(t.verifyingContract,20)&&(s[t.verifyingContract]="0x");const i=yo.from(e);i.visit(r,((t,e)=>("address"!==t||se(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){yo.hashDomain(t);const n={},s=[];fo.forEach((e=>{const r=t[e];null!=r&&(n[e]=go[e](r),s.push({name:e,type:ho[e]}))}));const i=yo.from(e),o=Object.assign({},e);return o.EIP712Domain?Ui.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 pe(Ui.getBytes(e));if(t.match(/^u?int/))return Ui.getBigInt(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Ui.throwArgumentError("invalid string","value",e),e}return Ui.throwArgumentError("unsupported type","type",t)}))}}}Zi=new WeakMap,Qi=new WeakMap,to=new WeakMap,Yi=new WeakSet,eo=function(t){{const e=wo(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&&Ui.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let s=e.map(r);return no(this,Qi,"f").has(t)&&(s=s.map(dn)),dn(we(s))}}const r=this.types[t];if(r){const e=Fi(no(this,Qi,"f").get(t));return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return no(this,Qi,"f").has(r)?dn(n):n}));return n.unshift(e),we(n)}}return Ui.throwArgumentError(`unknown type: ${t}`,"type",t)};var bo,vo,Eo,Ao,ko,To,Po,No=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},xo=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 Oo{constructor(t,e,r){const s=t.name,i=t.format();n(this,{fragment:t,name:s,signature:i,topic:e,args:r})}}class Io{constructor(t,e,r,s){const i=t.name,o=t.format();n(this,{fragment:t,name:i,args:r,signature:o,selector:e,value:s})}}class So{constructor(t,e,r){const s=t.name,i=t.format();n(this,{fragment:t,name:s,args:r,signature:i,selector:e})}}class Ro{constructor(t){n(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!(!t||!t._isIndexed)}}const Bo={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"},Co={"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&&Bo[t.toString()]&&(e=Bo[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};class _o{constructor(t){bo.add(this),vo.set(this,void 0),Eo.set(this,void 0),Ao.set(this,void 0),ko.set(this,void 0);let e=[];e="string"==typeof t?JSON.parse(t):t,No(this,Ao,new Map,"f"),No(this,vo,new Map,"f"),No(this,Eo,new Map,"f"),n(this,{fragments:Object.freeze(e.map((t=>lt.from(t))).filter((t=>null!=t)))}),No(this,ko,this.getAbiCoder(),"f"),this.fragments.forEach((t=>{let e;switch(t.type){case"constructor":return this.deploy?void P.warn("duplicate definition - constructor"):void n(this,{deploy:t});case"function":e=xo(this,Ao,"f");break;case"event":e=xo(this,Eo,"f");break;case"error":e=xo(this,vo,"f");break;default:return}const r=t.format();e.has(r)?P.warn("duplicate definition - "+r):e.set(r,t)})),this.deploy||n(this,{deploy:pt.fromString("constructor()")})}format(t){t||(t=B.full),t===B.sighash&&P.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===B.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}getAbiCoder(){return _i}getFunctionName(t){return xo(this,bo,"m",To).call(this,t,null,!1).name}getFunction(t,e){return xo(this,bo,"m",To).call(this,t,e||null,!0)}getEventName(t){return xo(this,bo,"m",Po).call(this,t,null,!1).name}getEvent(t,e){return xo(this,bo,"m",Po).call(this,t,e||null,!0)}getError(t,e){if(se(t)){const e=t.toLowerCase();for(const t of xo(this,vo,"f").values())if(e===this.getSelector(t))return t;P.throwArgumentError("no matching error","selector",t)}if(-1===t.indexOf("(")){const e=[];for(const[r,n]of xo(this,vo,"f"))r.split("(")[0]===t&&e.push(n);return 0===e.length?P.throwArgumentError("no matching error","name",t):e.length>1&&P.throwArgumentError("multiple matching errors","name",t),e[0]}const r=xo(this,vo,"f").get(ft.fromString(t).format());return r||P.throwArgumentError("no matching error","signature",t)}getSelector(t){return ye(Fi(t.format()),0,4)}getEventTopic(t){return Fi(t.format())}_decodeParams(t,e){return xo(this,ko,"f").decode(t,e)}_encodeParams(t,e){return xo(this,ko,"f").encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),ye(e,0,4)!==this.getSelector(t)&&P.throwArgumentError(`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,ye(e,4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),we([this.getSelector(t),this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),ye(e,0,4)!==this.getSelector(t)&&P.throwArgumentError(`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,ye(e,4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),we([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=le(e);if(n.length%32==0)try{return xo(this,ko,"f").decode(t.outputs,n)}catch(t){r="could not decode result data"}return P.throwError(r,"BAD_DATA",{value:pe(n),info:{method:t.name,signature:t.format()}})}makeError(t,e,r){"string"==typeof t&&(t=this.getFunction(t));const n=P.getBytes(e);let s,i,o,a;if(r)try{s=xo(this,ko,"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=pe(n.slice(0,4)),e=Co[t];if(e)try{o=e.name,a=e.signature,i=xo(this,ko,"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=xo(this,ko,"f").decode(e.inputs,n.slice(4))}catch(t){c=`custom error: ${a} (coult not decode error data)`}}catch(t){console.log(t)}}}return P.makeError("call revert exception","CALL_EXCEPTION",{data:pe(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)),pe(xo(this,ko,"f").encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&P.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?Fi(e):"bytes"===t.type?dn(pe(e)):("address"===t.type&&xo(this,ko,"f").encode(["address"],[e]),Ee(pe(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?P.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&&P.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&&P.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(Fi(o));else if("bytes"===t.type)r.push(dn(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(xo(this,ko,"f").encode([t.type],[o]))}else n.push(t),s.push(o)})),{data:xo(this,ko,"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);se(r[0],32)&&r[0].toLowerCase()===e||P.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(at.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?xo(this,ko,"f").decode(n,we(r)):null,a=xo(this,ko,"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 Ro(null);else if(i[e])r=new Ro(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)})),je.fromItems(c,l)}parseTransaction(t){const e=P.getBytes(t.data,"tx.data"),r=P.getBigInt(null!=t.value?t.value:0,"tx.value"),n=this.getFunction(pe(e.slice(0,4)));if(!n)return null;const s=xo(this,ko,"f").decode(n.inputs,e.slice(4));return new Io(n,this.getSelector(n),s,r)}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Oo(e,this.getEventTopic(e),this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=pe(t),r=this.getError(ye(e,0,4));if(!r)return null;const n=xo(this,ko,"f").decode(r.inputs,ye(e,4));return new So(r,this.getSelector(r),n)}static from(t){return t instanceof _o?t:"string"==typeof t?new _o(JSON.parse(t)):"function"==typeof t.format?new _o(t.format(B.json)):new _o(t)}}vo=new WeakMap,Eo=new WeakMap,Ao=new WeakMap,ko=new WeakMap,bo=new WeakSet,To=function(t,e,r){if(se(t)){const e=t.toLowerCase();for(const t of xo(this,Ao,"f").values())if(e===this.getSelector(t))return t;P.throwArgumentError("no matching function","selector",t)}if(-1===t.indexOf("(")){const n=[];for(const[e,r]of xo(this,Ao,"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;js.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(js.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)P.throwArgumentError("no matching function","name",t);else if(n.length>1&&r){const e=n.map((t=>JSON.stringify(t.format()))).join(", ");P.throwArgumentError(`multiple matching functions (i.e. ${e})`,"name",t)}return n[0]}const n=xo(this,Ao,"f").get(gt.fromString(t).format());return n||P.throwArgumentError("no matching function","signature",t)},Po=function(t,e,r){if(se(t)){const e=t.toLowerCase();for(const t of xo(this,Eo,"f").values())if(e===this.getEventTopic(t))return t;P.throwArgumentError("no matching event","eventTopic",t)}if(-1===t.indexOf("(")){const n=[];for(const[e,r]of xo(this,Eo,"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(js.isTyped(e[s])&&e[s].type!==r[s].baseType){n.splice(t,1);break}}}return 0===n.length?P.throwArgumentError("no matching event","name",t):n.length>1&&r&&P.throwArgumentError("multiple matching events","name",t),n[0]}const n=xo(this,Eo,"f").get(dt.fromString(t).format());return n||P.throwArgumentError("no matching event","signature",t)};const Fo=new T("@ethersproject/web@6.0.0-beta.6");var Uo,Lo,Do=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},Mo=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 jo{constructor(t,e,r,n,s){Uo.set(this,void 0),Lo.set(this,void 0),Do(this,Uo,{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"),Do(this,Lo,{message:""},"f")}toString(){const t=c(Mo(this,Uo,"f"),"body");return`<Response status=${this.statusCode} body=${t?pe(t):"null"}>`}get statusCode(){return c(Mo(this,Uo,"f"),"statusCode")}get statusMessage(){return c(Mo(this,Uo,"f"),"statusMessage")}get headers(){return c(Mo(this,Uo,"f"),"headers")}get body(){const t=c(Mo(this,Uo,"f"),"body");return null==t?null:new Uint8Array(t)}get bodyText(){try{const t=c(Mo(this,Uo,"f"),"body");return null==t?"":fi(t)}catch(t){return Fo.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 Fo.throwError("response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[(Uo=new WeakMap,Lo=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 jo(599,r,this.headers,this.body,c(Mo(this,Uo,"f"),"request")||void 0);return Do(n,Lo,{message:t,error:e},"f"),n}throwThrottleError(t,e){null==e&&(e=1e3),("number"!=typeof e||!Number.isInteger(e)||e<0)&&Fo.throwArgumentError("invalid stall timeout","stall",e);const r=new Error(t||"throttling requests");throw n(r,{stall:e,throttle:!0}),r}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return null!=c(Mo(this,Uo,"f"),"body")}get request(){return c(Mo(this,Uo,"f"),"request")}ok(){return""===Mo(this,Lo,"f").message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:e}=Mo(this,Lo,"f");""===t&&(t=`server response ${this.statusCode} ${this.statusMessage}`),Fo.throwError(t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:e})}}async function Go(t,e){const r=t.url.split(":")[0].toLowerCase();"http"!==r&&"https"!==r&&Fo.throwError(`unsupported protocol ${r}`,"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),t.credentials&&!t.allowInsecureAuthentication&&Fo.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 jo(s.status,s.statusText,i,o,t)}var $o,zo=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},Wo=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 Ho(t,e,r){if(typeof t!==e)throw new Error(`invalid ${r}`);return t}class Vo{constructor(t){$o.set(this,void 0),zo(this,$o,{allowInsecure:!1,gzip:!1,headers:{},method:"",timeout:300,url:Ho(t,"string","url")},"f")}get url(){return c(Wo(this,$o,"f"),"url")}set url(t){l(Wo(this,$o,"f"),"url",Ho(t,"string","url"))}get body(){const t=c(Wo(this,$o,"f"),"body");return null==t?null:this.isFrozen()?new Uint8Array(t):t}set body(t){if(null==t)l(Wo(this,$o,"f"),"body",void 0),l(Wo(this,$o,"f"),"bodyType",void 0);else if("string"==typeof t)l(Wo(this,$o,"f"),"body",ci(t)),l(Wo(this,$o,"f"),"bodyType","text/plain");else if(t instanceof Uint8Array)l(Wo(this,$o,"f"),"body",t),l(Wo(this,$o,"f"),"bodyType","application/octet-stream");else{if("object"!=typeof t)throw new Error("invalid body");l(Wo(this,$o,"f"),"body",ci(JSON.stringify(t))),l(Wo(this,$o,"f"),"bodyType","application/json")}}hasBody(){return null!=c(Wo(this,$o,"f"),"body")}get method(){const t=c(Wo(this,$o,"f"),"method");return t?t.toUpperCase():this.body?"POST":"GET"}set method(t){null==t&&(t=""),l(Wo(this,$o,"f"),"method",Ho(t,"string","method"))}get headers(){const t=Object.assign({},c(Wo(this,$o,"f"),"headers")),e=c(Wo(this,$o,"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=c(Wo(this,$o,"f"),"headers");l(Wo(this,$o,"f"),"headers",r),r[Ho(t,"string","key").toLowerCase()]=String(e)}clearHeaders(){l(Wo(this,$o,"f"),"headers",{})}[($o=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 c(Wo(this,$o,"f"),"creds")||null}setCredentials(t,e){t.match(/:/)&&Fo.throwArgumentError("invalid basic authentication username","username","[REDACTED]"),l(Wo(this,$o,"f"),"creds",`${t}:${e}`)}get allowGzip(){return c(Wo(this,$o,"f"),"gzip")}set allowGzip(t){l(Wo(this,$o,"f"),"gzip",!!t)}get allowInsecureAuthentication(){return!!c(Wo(this,$o,"f"),"allowInsecure")}set allowInsecureAuthentication(t){l(Wo(this,$o,"f"),"allowInsecure",Ho(t,"boolean","allowInsecureAuthentication"))}get timeout(){return c(Wo(this,$o,"f"),"timeout")}set timeout(t){if((t=Ho(t,"number","timeout"))<=0)throw new Error("invalid timerout");l(Wo(this,$o,"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 Fo.throwError("unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});const n=new Vo(t);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,l(Wo(n,$o,"f"),"body",c(Wo(this,$o,"f"),"body")),l(Wo(n,$o,"f"),"headers",Object.assign({},c(Wo(this,$o,"f"),"headers"))),l(Wo(n,$o,"f"),"bodyType",c(Wo(this,$o,"f"),"bodyType")),n}clone(){const t=new Vo(this.url);l(Wo(t,$o,"f"),"method",c(Wo(this,$o,"f"),"method"));const e=c(Wo(this,$o,"f"),"body");return l(Wo(t,$o,"f"),"body",null==e?void 0:new Uint8Array(e)),l(Wo(t,$o,"f"),"bodyType",c(Wo(this,$o,"f"),"bodyType")),l(Wo(t,$o,"f"),"headers",Object.assign({},c(Wo(this,$o,"f"),"headers"))),l(Wo(t,$o,"f"),"creds",c(Wo(this,$o,"f"),"creds")),this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),t}freeze(){const t=c(Wo(this,$o,"f"),"body");return null!=t&&l(Wo(this,$o,"f"),"body",new Uint8Array(t)),Object.freeze(Wo(this,$o,"f").headers),Object.freeze(Wo(this,$o,"f")),this}isFrozen(){return Object.isFrozen(Wo(this,$o,"f"))}}async function Ko(t){return new Promise((e=>{setTimeout(e,t)}))}function Jo(){return(new Date).getTime()}let qo=!1;async function Xo(t){const e="string"==typeof t?{request:new Vo(t)}:t instanceof Vo?{request:t}:Object.assign({},t);if(null==e.request)return Fo.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]?he(t[3]):ci(t[3].replace(/%([0-9a-f][0-9a-f])/gi,((t,e)=>String.fromCharCode(parseInt(e,16)))));return new jo(200,"OK",e,n,r.clone())}catch(t){return new jo(400,"BAD REQUEST (invalid base64 encoded data)",{},null,r.clone())}return new jo(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 Fo.throwArgumentError("invalid throttleLimit","connection",t);const s=null!=e.throttleSlotInterval?e.throttleSlotInterval:100;if(!Number.isInteger(s)||n<0)return Fo.throwArgumentError("invalid throttleSlotInterval","connection",t);const i=null!=e.throttleRetry?e.throttleRetry:null;if(i&&"function"!=typeof i)return Fo.throwArgumentError("invalid throttleRetry callback","connection",t);const o=e.preflightRequest||null;if(o&&"function"!=typeof o)return Fo.throwArgumentError("invalid preflightRequest callback","connection",t);const a=e.processResponse||null;if(a&&"function"!=typeof a)return Fo.throwArgumentError("invalid processResponse callback","connection",t);const c=Jo();let l=null;for(let t=0;t<n;t++){let e=r.clone();o&&(e=(await o(e.freeze())).clone());if(Jo()-c<0)return Fo.throwError("timeout","TIMEOUT",{operation:"request",reason:"timeout",request:e});if(l=await Go(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 Ko(parseInt(e)):await Ko(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 Ko(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")}Xo.lock=function(){qo=!0},Xo.setGateway=function(t){},Xo.setIpfsGateway=function(t){qo&&Fo.throwError("gateways are locked","UNSUPPORTED_OPERATION",{operation:"setIpfsGateway"})},Xo.setArGateway=function(t){qo&&Fo.throwError("gateways are locked","UNSUPPORTED_OPERATION",{operation:"setArGateway"})};const Yo=new T("@ethersproject/providers@6.0.0-beta.8");var Zo,Qo,ta,ea=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},ra=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 na=BigInt(1),sa=new Uint8Array([]),ia="0x0000000000000000000000000000000000000000000000000000000000000000";function oa(t,e){if("0x"===t)return null;const r=At(ye(t,e,e+32)),n=At(ye(t,r,r+32));return ye(t,r+32,r+32+n)}function aa(t,e){try{const r=oa(t,e);if(null!=r)return fi(r)}catch(t){}return null}function ca(t){const e=Tt(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 la(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function ua(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(sa),r+=32;for(let n=0;n<t.length;n++){const s=Yo.getBytes(t[n]);e[n]=ca(r),e.push(ca(s.length)),e.push(la(s)),r+=32+32*Math.ceil(s.length/32)}return we(e)}function ha(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Yo.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class fa{constructor(t){n(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 da=new RegExp("^(ipfs)://(.*)$","i"),pa=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),da,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class ga{constructor(t,e,r){Qo.set(this,void 0),n(this,{provider:t,address:e,name:r}),ea(this,Qo,null,"f")}async supportsWildcard(){return ra(this,Qo,"f")||ea(this,Qo,this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>Yo.getBigInt(t)===na)).catch((t=>{if("CALL_EXCEPTION"===t.code)return!1;throw ea(this,Qo,null,"f"),t})),"f"),await ra(this,Qo,"f")}async _fetch(t,e="0x"){const r=we([t,ji(this.name),e]),n={to:this.address,enableCcipRead:!0,data:r};let s=!1;await this.supportsWildcard()&&(s=!0,n.data=we(["0x9061b923",ua([Gi(this.name),r])]));try{let t=await this.provider.call(n);return Yo.getBytes(t).length%32==4?Yo.throwError("resolver threw error","CALL_EXCEPTION",{transaction:n,data:t}):s?oa(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===ia)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 fa&&r.supportsCoinType(t)){e=r;break}if(null==e)return null;const r=oa(await this._fetch("0xf1cb7e06",ca(t))||"0x",0);if(null==r||"0x"===r)return null;const n=await e.encodeAddress(t,r);return null!=n?n:Yo.throwError("invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){let e=ci(t);const r=Yo.getBytes(we([ca(64),ca(e.length),e])),n=oa(await this._fetch("0x59d1d43c",la(r))||"0x",0);return null==n||"0x"===n?null:fi(n)}async getContentHash(){const t=oa(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}://${Yt("0x"+e[2])}`}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);return r&&64===r[1].length?`bzz://${r[1]}`:Yo.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<pa.length;r++){const n=e.match(pa[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=ha(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=ca(o[1]);if("erc721"===s){const e=a.callAddress(await this.provider.call({to:c,data:we(["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=Yo.getBigInt(await this.provider.call({to:c,data:we(["0x00fdd58e",Ee(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:we([r,l])};let h=aa(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}",pe(l).substring(2)),t.push({type:"metadata-url-expanded",value:h})),h.match(/^ipfs:/i)&&(h=ha(h)),t.push({type:"metadata-url",value:h});let f={};const d=await Xo(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:pe(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(da))throw t.push({type:"!imageUrl-ipfs",value:p}),new Error("!imageUrl-ipfs");t.push({type:"imageUrl-ipfs",value:p}),p=ha(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 ra(ga,Zo,"m",ta).call(ga,t,r);if(null!=n){const s=new ga(t,n,e);return r===e||await s.supportsWildcard()?s:null}r=r.split(".").slice(1).join(".")}}}Zo=ga,Qo=new WeakMap,ta=async function(t,e){const r=await t.getNetwork(),n=r.getPlugin("org.ethers.plugins.ens");if(!n)return Yo.throwError("network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getResolver",info:{network:r.name}});try{const s=await t.call({to:n.address,data:we(["0x0178b8bf",ji(e)]),enableCcipRead:!0}),i=r.formatter.callAddress(s);return i===ye(ia,0,20)?null:i}catch(t){throw t}return null};const wa=new T("@ethersproject/signing-key@6.0.0-beta.2");var ma,ya=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},ba=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 va=BigInt(0),Ea=BigInt(1),Aa=BigInt(2),ka=BigInt(27),Ta=BigInt(28),Pa=BigInt(35),Na={},xa="0x0000000000000000000000000000000000000000000000000000000000000000";class Oa{constructor(t,e,r,n){ma.set(this,void 0),wa.assertPrivate(t,Na,"Signature"),ya(this,ma,{r:e,s:r,v:n,networkV:null},"f")}get r(){return c(ba(this,ma,"f"),"r")}set r(t){32!==me(t)&&wa.throwArgumentError("invalid r","value",t),l(ba(this,ma,"f"),"r",pe(t))}get s(){return c(ba(this,ma,"f"),"s")}set s(t){32!==me(t)?wa.throwArgumentError("invalid r","value",t):128&wa.getBytes(t)[0]&&wa.throwArgumentError("non-canonical s","value",t),l(ba(this,ma,"f"),"s",pe(t))}get v(){return c(ba(this,ma,"f"),"v")}set v(t){const e=wa.getNumber(t,"value");if(27!==e&&28!==e)throw new Error("@TODO");l(ba(this,ma,"f"),"v",e)}get networkV(){return c(ba(this,ma,"f"),"networkV")}get legacyChainId(){const t=this.networkV;return null==t?null:Oa.getChainId(t)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const t=wa.getBytes(this.s);return this.yParity&&(t[0]|=128),pe(t)}get compactSerialized(){return we([this.r,this.yParityAndS])}get serialized(){return we([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[(ma=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 Oa(Na,this.r,this.s,this.v);return this.networkV&&l(ba(t,ma,"f"),"networkV",this.networkV),t}freeze(){return Object.freeze(ba(this,ma,"f")),this}isFrozen(){return Object.isFrozen(ba(this,ma,"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 Oa(Na,xa,xa,27)}static getChainId(t){const e=wa.getBigInt(t,"v");return e==ka||e==Ta?va:(e<Pa&&wa.throwArgumentError("invalid EIP-155 v","v",t),(e-Pa)/Aa)}static getChainIdV(t,e){return wa.getBigInt(t)*Aa+BigInt(35+e-27)}static getNormalizedV(t){const e=wa.getBigInt(t);return e==va?27:e==Ea?28:e&Ea?27:28}static from(t){const e=e=>wa.throwArgumentError(e,"signature",t);if("string"==typeof t){const r=wa.getBytes(t,"signature");if(64===r.length){const t=pe(r.slice(0,32)),e=r.slice(32,64),n=128&e[0]?28:27;return e[0]&=127,new Oa(Na,t,pe(e),n)}if(65!==me(t)){const n=pe(t.slice(0,32)),s=r.slice(32,64);128&s[0]&&e("non-canonical s");const i=Oa.getNormalizedV(r[64]);return new Oa(Na,n,pe(s),i)}return e("invlaid raw signature length")}if(t instanceof Oa)return t.clone();const r=t.r;null==r&&e("missing r"),se(r,32)||e("invalid r");const n=function(t,r){if(null!=t)return se(t,32)||e("invalid s"),t;if(null!=r){se(r,32)||e("invalid yParityAndS");const t=wa.getBytes(r);return t[0]&=127,pe(t)}return e("missing s")}(t.s,t.yParityAndS);128&wa.getBytes(n)[0]&&e("non-canonical s");const{networkV:s,v:i}=function(t,r,n){if(null!=t){const e=wa.getBigInt(t);return{networkV:e>=Pa?e:void 0,v:Oa.getNormalizedV(e)}}if(null!=r)return se(r,32)||e("invalid yParityAndS"),{v:128&wa.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 Oa(Na,r,n,i);return s&&l(ba(o,ma,"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 Ia=BigInt(0),Sa=BigInt(1),Ra=BigInt(2),Ba=BigInt(3),Ca=BigInt(8),_a=Ra**BigInt(256),Fa={a:Ia,b:BigInt(7),P:_a-Ra**BigInt(32)-BigInt(977),n:_a-BigInt("432420386565659656852420866394968145599"),h:Sa,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function Ua(t){const{a:e,b:r}=Fa,n=ec(t*t),s=ec(n*t);return ec(s+e*t+r)}const La=Fa.a===Ia;class Da{constructor(t,e,r){this.x=t,this.y=e,this.z=r}static fromAffine(t){if(!(t instanceof ja))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new Da(t.x,t.y,Sa)}static toAffineBatch(t){const e=function(t,e=Fa.P){const r=new Array(t.length),n=nc(t.reduce(((t,n,s)=>n===Ia?t:(r[s]=t,ec(t*n,e))),Sa),e);return t.reduceRight(((t,n,s)=>n===Ia?t:(r[s]=ec(t*r[s],e),ec(t*n,e))),n),r}(t.map((t=>t.z)));return t.map(((t,r)=>t.toAffine(e[r])))}static normalizeZ(t){return Da.toAffineBatch(t).map(Da.fromAffine)}equals(t){if(!(t instanceof Da))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:s,y:i,z:o}=t,a=ec(n**Ra),c=ec(o**Ra),l=ec(e*c),u=ec(s*a),h=ec(ec(r*o)*c),f=ec(ec(i*n)*a);return l===u&&h===f}negate(){return new Da(this.x,ec(-this.y),this.z)}double(){const{x:t,y:e,z:r}=this,n=ec(t**Ra),s=ec(e**Ra),i=ec(s**Ra),o=ec(Ra*(ec((t+s)**Ra)-n-i)),a=ec(Ba*n),c=ec(a**Ra),l=ec(c-Ra*o),u=ec(a*(o-l)-Ca*i),h=ec(Ra*e*r);return new Da(l,u,h)}add(t){if(!(t instanceof Da))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:s,y:i,z:o}=t;if(s===Ia||i===Ia)return this;if(e===Ia||r===Ia)return t;const a=ec(n**Ra),c=ec(o**Ra),l=ec(e*c),u=ec(s*a),h=ec(ec(r*o)*c),f=ec(ec(i*n)*a),d=ec(u-l),p=ec(f-h);if(d===Ia)return p===Ia?this.double():Da.ZERO;const g=ec(d**Ra),w=ec(d*g),m=ec(l*g),y=ec(p**Ra-w-Ra*m),b=ec(p*(m-y)-h*w),v=ec(n*o*d);return new Da(y,b,v)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){let e=tc(t);const r=Da.ZERO;if(e===Ia)return r;if(e===Sa)return this;if(!La){let t=r,n=this;for(;e>Ia;)e&Sa&&(t=t.add(n)),n=n.double(),e>>=Sa;return t}let{k1neg:n,k1:s,k2neg:i,k2:o}=oc(e),a=r,c=r,l=this;for(;s>Ia||o>Ia;)s&Sa&&(a=a.add(l)),o&Sa&&(c=c.add(l)),l=l.double(),s>>=Sa,o>>=Sa;return n&&(a=a.negate()),i&&(c=c.negate()),c=new Da(ec(c.x*Fa.beta),c.y,c.z),a.add(c)}precomputeWindow(t){const e=La?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(Da.BASE)&&(e=ja.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&&Ma.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=Da.normalizeZ(n),Ma.set(e,n)));let s=Da.ZERO,i=Da.ZERO;const o=1+(La?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+=Sa),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=tc(t);if(La){const{k1neg:t,k1:i,k2neg:o,k2:a}=oc(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 Da(ec(u.x*Fa.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 Da.normalizeZ([r,n])[0]}toAffine(t=nc(this.z)){const{x:e,y:r,z:n}=this,s=t,i=ec(s*s),o=ec(i*s),a=ec(e*i),c=ec(r*o);if(ec(n*s)!==Sa)throw new Error("invZ was invalid");return new ja(a,c)}}Da.BASE=new Da(Fa.Gx,Fa.Gy,Sa),Da.ZERO=new Da(Ia,Sa,Ia);const Ma=new WeakMap;class ja{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,Ma.delete(this)}static fromCompressedHex(t){const e=32===t.length,r=Za(e?t:t.subarray(1));if(!lc(r))throw new Error("Point is not on curve");let n=function(t){const{P:e}=Fa,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=rc(l,Ba)*l%e,h=rc(u,Ba)*l%e,f=rc(h,Ra)*c%e,d=rc(f,n)*f%e,p=rc(d,s)*d%e,g=rc(p,o)*p%e,w=rc(g,a)*g%e,m=rc(w,o)*p%e,y=rc(m,Ba)*l%e,b=rc(y,i)*d%e,v=rc(b,r)*c%e;return rc(v,Ra)}(Ua(r));const s=(n&Sa)===Sa;if(e)s&&(n=ec(-n));else{1==(1&t[0])!==s&&(n=ec(-n))}const i=new ja(r,n);return i.assertValidity(),i}static fromUncompressedHex(t){const e=Za(t.subarray(1,33)),r=Za(t.subarray(33,65)),n=new ja(e,r);return n.assertValidity(),n}static fromHex(t){const e=Qa(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 ja.BASE.multiply(hc(t))}static fromSignature(t,e,r){const n=function(t){const{n:e}=Fa,r=8*t.length-256;let n=Za(t);r>0&&(n>>=BigInt(r));n>=e&&(n-=e);return n}(t=Qa(t)),{r:s,s:i}=function(t){if(t instanceof za)return t.assertValidity(),t;try{return za.fromDER(t)}catch(e){return za.fromCompact(t)}}(e);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");if(n===Ia)throw new Error("Cannot recover signature: msgHash cannot be 0");const o=1&r?"03":"02",a=ja.fromHex(o+Ja(s)),{n:c}=Fa,l=nc(s,c),u=ec(-n*l,c),h=ec(i*l,c),f=ja.BASE.multiplyAndAddUnsafe(a,u,h);if(!f)throw new Error("Cannot recover signature: point at infinify");return f.assertValidity(),f}toRawBytes(t=!1){return Ya(this.toHex(t))}toHex(t=!1){const e=Ja(this.x);if(t){return`${this.y&Sa?"03":"02"}${e}`}return`04${e}${Ja(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(!lc(e)||!lc(r))throw new Error(t);const n=ec(r*r);if(ec(n-Ua(e))!==Ia)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new ja(this.x,ec(-this.y))}double(){return Da.fromAffine(this).double().toAffine()}add(t){return Da.fromAffine(this).add(Da.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return Da.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,e,r){const n=Da.fromAffine(this).multiply(e),s=Da.fromAffine(t).multiplyUnsafe(r),i=n.add(s);return i.equals(Da.ZERO)?void 0:i.toAffine()}}function Ga(t){return Number.parseInt(t[0],16)>=8?"00"+t:t}function $a(t){if(t.length<2||2!==t[0])throw new Error(`Invalid signature integer tag: ${Ka(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:Za(r),left:t.subarray(e+2)}}ja.BASE=new ja(Fa.Gx,Fa.Gy),ja.ZERO=new ja(Ia,Ia);class za{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromCompact(t){const e=Ha(t),r="Signature.fromCompact";if("string"!=typeof t&&!e)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=e?Ka(t):t;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new za(Xa(n.slice(0,64)),Xa(n.slice(64,128)))}static fromDER(t){const e=Ha(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: ${Ka(t)}`);if(t[1]!==t.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:r}=$a(t.subarray(2)),{data:n,left:s}=$a(r);if(s.length)throw new Error(`Invalid signature: left bytes after parsing: ${Ka(s)}`);return{r:e,s:n}}(e?t:Ya(t));return new za(r,n)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:e}=this;if(!cc(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!cc(e))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=Fa.n>>Sa;return this.s>t}normalizeS(){return this.hasHighS()?new za(this.r,Fa.n-this.s):this}toDERRawBytes(t=!1){return Ya(this.toDERHex(t))}toDERHex(t=!1){const e=Ga(qa(this.s));if(t)return e;const r=Ga(qa(this.r)),n=qa(r.length/2),s=qa(e.length/2);return`30${qa(r.length/2+e.length/2+4)}02${n}${r}02${s}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return Ya(this.toCompactHex())}toCompactHex(){return Ja(this.r)+Ja(this.s)}}function Wa(...t){if(!t.every(Ha))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 Ha(t){return t instanceof Uint8Array}const Va=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function Ka(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let r=0;r<t.length;r++)e+=Va[t[r]];return e}function Ja(t){if(t>_a)throw new Error("Expected number < 2^256");return t.toString(16).padStart(64,"0")}function qa(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function Xa(t){if("string"!=typeof t)throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt(`0x${t}`)}function Ya(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 Za(t){return Xa(Ka(t))}function Qa(t){return t instanceof Uint8Array?Uint8Array.from(t):Ya(t)}function tc(t){if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)return BigInt(t);if("bigint"==typeof t&&cc(t))return t;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function ec(t,e=Fa.P){const r=t%e;return r>=Ia?r:e+r}function rc(t,e){const{P:r}=Fa;let n=t;for(;e-- >Ia;)n*=n,n%=r;return n}function nc(t,e=Fa.P){if(t===Ia||e<=Ia)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=ec(t,e),n=e,s=Ia,i=Sa;for(;r!==Ia;){const t=n%r,e=s-i*(n/r);n=r,r=t,s=i,i=e}if(n!==Sa)throw new Error("invert: does not exist");return ec(s,e)}const sc=(t,e)=>(t+e/Ra)/e,ic=Ra**BigInt(128);function oc(t){const{n:e}=Fa,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Sa*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,o=sc(i*t,e),a=sc(-n*t,e);let c=ec(t-o*r-a*s,e),l=ec(-o*n-a*i,e);const u=c>ic,h=l>ic;if(u&&(c=e-c),h&&(l=e-l),c>ic||l>ic)throw new Error("splitScalarEndo: Endomorphism failed, k="+t);return{k1neg:u,k1:c,k2neg:h,k2:l}}class ac{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...t){return bc.hmacSha256(this.k,...t)}hmacSync(...t){if("function"!=typeof bc.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const e=bc.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 cc(t){return Ia<t&&t<Fa.n}function lc(t){return Ia<t&&t<Fa.P}function uc(t,e,r){const n=Za(t);if(!cc(n))return;const{n:s}=Fa,i=ja.BASE.multiply(n),o=ec(i.x,s);if(o===Ia)return;const a=ec(nc(n,s)*ec(e+r*o,s),s);if(a===Ia)return;const c=new za(o,a);return{sig:c,recovery:(i.x===c.r?0:2)|Number(i.y&Sa)}}function hc(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=Xa(t)}else{if(!Ha(t))throw new TypeError("Expected valid private key");if(32!==t.length)throw new Error("Expected 32 bytes of private key");e=Za(t)}if(!cc(e))throw new Error("Expected private key: 0 < key < n");return e}function fc(t){const e=Ha(t),r="string"==typeof t,n=(e||r)&&t.length;return e?33===n||65===n:r?66===n||130===n:t instanceof ja}function dc(t,e,r=!1){if(fc(t))throw new TypeError("getSharedSecret: first arg must be private key");if(!fc(e))throw new TypeError("getSharedSecret: second arg must be public key");const n=(s=e)instanceof ja?(s.assertValidity(),s):ja.fromHex(s);var s;return n.assertValidity(),n.multiply(hc(t)).toRawBytes(r)}function pc(t){return Za(t.length>32?t.slice(0,32):t)}function gc(t){const e=pc(t),r=ec(e,Fa.n);return wc(r<Ia?e:r)}function wc(t){if("bigint"!=typeof t)throw new Error("Expected bigint");return Ya(Ja(t))}function mc(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=Qa(t),s=hc(e),i=[wc(s),gc(n)];if(null!=r){!0===r&&(r=bc.randomBytes(32));const t=Qa(r);if(32!==t.length)throw new Error("sign: Expected 32 bytes of extra data");i.push(t)}return{seed:Wa(...i),m:pc(n),d:s}}(t,e,r.extraEntropy);let o;const a=new ac;for(a.reseedSync(n);!(o=uc(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)}ja.BASE._setWindowSize(8);const yc={node:undefined,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},bc={isValidPrivateKey(t){try{return hc(t),!0}catch(t){return!1}},hashToPrivateKey:t=>{if((t=Qa(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const e=ec(Za(t),Fa.n);if(e===Ia||e===Sa)throw new Error("Invalid private key");return function(t){return Ya(Ja(t))}(e)},randomBytes:(t=32)=>{if(yc.web)return yc.web.getRandomValues(new Uint8Array(t));throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>bc.hashToPrivateKey(bc.randomBytes(40)),bytesToHex:Ka,mod:ec,sha256:async t=>{if(yc.web){const e=await yc.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(yc.web){const r=await yc.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=Wa(...e),s=await yc.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=ja.BASE){const r=e===ja.BASE?e:new ja(e.x,e.y);return r._setWindowSize(t),r.multiply(Ba),r}};var vc,Ec=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},Ac=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)};bc.hmacSha256Sync=function(t,...e){return le(Hr("sha256",t,we(e)))};class kc{constructor(t){vc.set(this,void 0),wa.assertArgument(32===me(t),"invalid private key length","privateKey","[REDACTED]"),Ec(this,vc,pe(t),"f")}get privateKey(){return Ac(this,vc,"f")}get publicKey(){return kc.computePublicKey(Ac(this,vc,"f"))}get compressedPublicKey(){return kc.computePublicKey(Ac(this,vc,"f"),!0)}sign(t){wa.assertArgument(32===me(t),"invalid digest length","digest",t);const[e,r]=mc(le(t),le(Ac(this,vc,"f")),{recovered:!0,canonical:!0}),n=za.fromHex(e);return Oa.from({r:kt("0x"+n.r.toString(16),32),s:kt("0x"+n.s.toString(16),32),v:r?28:27}).freeze()}computeShardSecret(t){const e=kc.computePublicKey(t);return pe(dc(le(Ac(this,vc,"f")),e))}static computePublicKey(t,e){let r=wa.getBytes(t,"key");if(32===r.length){return pe(function(t,e=!1){return ja.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 pe(ja.fromHex(r).toRawBytes(e))}static recoverPublicKey(t,e){const r=Oa.from(e),n=za.fromCompact(le(we([r.r,r.s]))).toDERRawBytes(),s=function(t,e,r,n=!1){return ja.fromSignature(t,e,r).toRawBytes(n)}(le(t),n,r.yParity);return null!=s?pe(s):wa.throwArgumentError("invalid signautre for digest","signature",e)}static _addPoints(t,e,r){const n=ja.fromHex(kc.computePublicKey(t).substring(2)),s=ja.fromHex(kc.computePublicKey(e).substring(2));return"0x"+n.add(s).toHex(!!r)}}function Tc(t,e){return{address:ws(t),storageKeys:(e||[]).map(((t,e)=>{if(32!==me(t))throw new Error("");return t.toLowerCase()}))}}function Pc(t){if(Array.isArray(t))return t.map(((t,e)=>{if(Array.isArray(t)){if(t.length>2)throw new Error("");return Tc(t[0],t[1])}return Tc(t.address,t.storageKeys)}));const e=Object.keys(t).map((e=>{const r=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return Tc(e,Object.keys(r).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function Nc(t){return ws(dn("0x"+kc.computePublicKey(t,!1).substring(4)).substring(26))}function xc(t,e){return Nc(kc.recoverPublicKey(t,e))}vc=new WeakMap;const Oc=new T("@ethersproject/transaction@6.0.0-beta.2");var Ic,Sc=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},Rc=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 Bc=BigInt(0),Cc=BigInt(2),_c=BigInt(27),Fc=BigInt(28),Uc=BigInt(35),Lc=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Dc(t){return"0x"===t?null:ws(t)}function Mc(t,e){try{return pe(t)}catch(r){return Oc.throwArgumentError("invalid data",e,t)}}function jc(t,e){try{return Pc(t)}catch(r){return Oc.throwArgumentError("invalid accessList",e,t)}}function Gc(t,e){return"0x"===t?0:Oc.getNumber(t,e)}function $c(t,e){if("0x"===t)return Bc;const r=Oc.getBigInt(t,e);return r>Lc&&Oc.throwArgumentError("value exceeds uint size",e,r),r}function zc(t,e){const r=Oc.getBigInt(t,"value"),n=Tt(r);return n.length>32&&Oc.throwArgumentError("value too large",`tx.${e}`,r),n}function Wc(t){return Pc(t).map((t=>[t.address,t.storageKeys]))}function Hc(t,e){const r=[zc(t.nonce||0,"nonce"),zc(t.gasPrice||0,"gasPrice"),zc(t.gasLimit||0,"gasLimit"),null!=t.to?ws(t.to):"0x",zc(t.value||0,"value"),t.data||"0x"];let n=Bc;if(null!=t.chainId)n=Oc.getBigInt(t.chainId,"tx.chainId"),e&&null!=e.networkV&&e.legacyChainId!==n&&Oc.throwArgumentError("tx.chainId/sig.v mismatch","sig",e);else if(e){const t=e.legacyChainId;null!=t&&(n=t)}if(!e)return n!==Bc&&(r.push(Tt(n)),r.push("0x"),r.push("0x")),As(r);let s=BigInt(27+e.yParity);return n!==Bc?s=Oa.getChainIdV(n,e.v):BigInt(e.v)!==s&&Oc.throwArgumentError("tx.chainId/sig.v mismatch","sig",e),r.push(Tt(s)),r.push(Tt(e.r)),r.push(Tt(e.s)),As(r)}function Vc(t,e,r){let n;try{if(n=Gc(e[0],"yParity"),0!==n&&1!==n)throw new Error("bad yParity")}catch(t){return Oc.throwArgumentError("invalid yParity","yParity",e[0])}const s=Ee(e[1],32),i=Ee(e[2],32),o=Oa.from({r:s,s:i,yParity:n});t.signature=o}function Kc(t,e){const r=[zc(t.chainId||0,"chainId"),zc(t.nonce||0,"nonce"),zc(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),zc(t.maxFeePerGas||0,"maxFeePerGas"),zc(t.gasLimit||0,"gasLimit"),null!=t.to?ws(t.to):"0x",zc(t.value||0,"value"),t.data||"0x",Wc(t.accessList||[])];return e&&(r.push(zc(e.yParity,"yParity")),r.push(Tt(e.r)),r.push(Tt(e.s))),we(["0x02",As(r)])}function Jc(t,e){const r=[zc(t.chainId||0,"chainId"),zc(t.nonce||0,"nonce"),zc(t.gasPrice||0,"gasPrice"),zc(t.gasLimit||0,"gasLimit"),null!=t.to?ws(t.to):"0x",zc(t.value||0,"value"),t.data||"0x",Wc(t.accessList||[])];return e&&(r.push(zc(e.yParity,"recoveryParam")),r.push(Tt(e.r)),r.push(Tt(e.s))),we(["0x01",As(r)])}class qc{constructor(){Ic.set(this,void 0),Sc(this,Ic,{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 c(Rc(this,Ic,"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:l(Rc(this,Ic,"f"),"type",null);break;case 0:case"legacy":l(Rc(this,Ic,"f"),"type",0);break;case 1:case"berlin":case"eip-2930":l(Rc(this,Ic,"f"),"type",1);break;case 2:case"london":case"eip-1559":l(Rc(this,Ic,"f"),"type",2);break;default:throw new Error("unsupported transaction type")}}get to(){return c(Rc(this,Ic,"f"),"to")}set to(t){l(Rc(this,Ic,"f"),"to",null==t?null:ws(t))}get nonce(){return c(Rc(this,Ic,"f"),"nonce")}set nonce(t){l(Rc(this,Ic,"f"),"nonce",Oc.getNumber(t,"value"))}get gasLimit(){return c(Rc(this,Ic,"f"),"gasLimit")}set gasLimit(t){l(Rc(this,Ic,"f"),"gasLimit",Oc.getBigInt(t))}get gasPrice(){const t=c(Rc(this,Ic,"f"),"gasPrice");return null!=t||0!==this.type&&1!==this.type?t:Bc}set gasPrice(t){l(Rc(this,Ic,"f"),"gasPrice",null==t?null:Oc.getBigInt(t,"gasPrice"))}get maxPriorityFeePerGas(){const t=c(Rc(this,Ic,"f"),"maxPriorityFeePerGas");return null==t&&2===this.type?Bc:t}set maxPriorityFeePerGas(t){l(Rc(this,Ic,"f"),"maxPriorityFeePerGas",null==t?null:Oc.getBigInt(t,"maxPriorityFeePerGas"))}get maxFeePerGas(){const t=c(Rc(this,Ic,"f"),"maxFeePerGas");return null==t&&2===this.type?Bc:t}set maxFeePerGas(t){l(Rc(this,Ic,"f"),"maxFeePerGas",null==t?null:Oc.getBigInt(t,"maxFeePerGas"))}get data(){return c(Rc(this,Ic,"f"),"data")}set data(t){l(Rc(this,Ic,"f"),"data",pe(t))}get value(){return c(Rc(this,Ic,"f"),"value")}set value(t){l(Rc(this,Ic,"f"),"value",Oc.getBigInt(t,"value"))}get chainId(){return c(Rc(this,Ic,"f"),"chainId")}set chainId(t){l(Rc(this,Ic,"f"),"chainId",Oc.getBigInt(t))}get signature(){return c(Rc(this,Ic,"f"),"sig")||null}set signature(t){l(Rc(this,Ic,"f"),"sig",null==t?null:Oa.from(t))}get accessList(){const t=c(Rc(this,Ic,"f"),"accessList")||null;return null!=t||1!==this.type&&2!==this.type?t:[]}set accessList(t){l(Rc(this,Ic,"f"),"accessList",null==t?null:Pc(t))}get hash(){if(null==this.signature)throw new Error("cannot hash unsigned transaction; maybe you meant .unsignedHash");return dn(this.serialized)}get unsignedHash(){return dn(this.unsignedSerialized)}get from(){return null==this.signature?null:xc(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 Hc(this,this.signature);case 1:return Jc(this,this.signature);case 2:return Kc(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 Hc(this);case 1:return Jc(this);case 2:return Kc(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 qc.from(this)}freeze(){return Rc(this,Ic,"f").sig&&(Rc(this,Ic,"f").sig=Rc(this,Ic,"f").sig.clone().freeze()),Rc(this,Ic,"f").accessList&&(Rc(this,Ic,"f").accessList=Object.freeze(Rc(this,Ic,"f").accessList.map((t=>(Object.freeze(t.storageKeys),Object.freeze(t)))))),Object.freeze(Rc(this,Ic,"f")),this}isFrozen(){return Object.isFrozen(Rc(this,Ic,"f"))}static from(t){if("string"==typeof t){const e=le(t);if(e[0]>=127)return qc.from(function(t){const e=xs(t);if(!Array.isArray(e)||9!==e.length&&6!==e.length)return Oc.throwArgumentError("invalid field count for legacy transaction","data",t);const r={type:0,nonce:Gc(e[0],"nonce"),gasPrice:$c(e[1],"gasPrice"),gasLimit:$c(e[2],"gasLimit"),to:Dc(e[3]),value:$c(e[4],"value"),data:Mc(e[5],"dta"),chainId:Bc};if(6===e.length)return r;const n=$c(e[6],"v"),s=$c(e[7],"r"),i=$c(e[8],"s");if(s===Bc&&i===Bc)r.chainId=n;else{let s=(n-Uc)/Cc;s<Bc&&(s=Bc),r.chainId=s,s===Bc&&(n<_c||n>Fc)&&Oc.throwArgumentError("non-canonical legacy v","v",e[6]),r.signature=Oa.from({r:Ee(e[7],32),s:Ee(e[8],32),v:n}),r.hash=dn(t)}return r}(e));switch(e[0]){case 1:return qc.from(function(t){const e=xs(Oc.getBytes(t).slice(1));(!Array.isArray(e)||8!==e.length&&11!==e.length)&&Oc.throwArgumentError("invalid field count for transaction type: 1","data",pe(t));const r={type:1,chainId:$c(e[0],"chainId"),nonce:Gc(e[1],"nonce"),gasPrice:$c(e[2],"gasPrice"),gasLimit:$c(e[3],"gasLimit"),to:Dc(e[4]),value:$c(e[5],"value"),data:Mc(e[6],"data"),accessList:jc(e[7],"accessList")};return 8===e.length||(r.hash=dn(t),Vc(r,e.slice(8))),r}(e));case 2:return qc.from(function(t){const e=xs(Oc.getBytes(t).slice(1));(!Array.isArray(e)||9!==e.length&&12!==e.length)&&Oc.throwArgumentError("invalid field count for transaction type: 2","data",pe(t));const r=$c(e[2],"maxPriorityFeePerGas"),n=$c(e[3],"maxFeePerGas"),s={type:2,chainId:$c(e[0],"chainId"),nonce:Gc(e[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:$c(e[4],"gasLimit"),to:Dc(e[5]),value:$c(e[6],"value"),data:Mc(e[7],"data"),accessList:jc(e[8],"accessList")};return 9===e.length||(s.hash=dn(t),Vc(s,e.slice(9))),s}(e))}throw new Error("unsupported transaction type")}const e=new qc;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=Oa.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}}Ic=new WeakMap;var Xc,Yc,Zc=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},Qc=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 tl(t){return null==t?null:t}function el(t){return null==t?null:t.toString()}class rl{constructor(t,e,r){n(this,{gasPrice:tl(t),maxFeePerGas:tl(e),maxPriorityFeePerGas:tl(r)})}toJSON(){const{gasPrice:t,maxFeePerGas:e,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:el(t),maxFeePerGas:el(e),maxPriorityFeePerGas:el(r)}}}class nl{constructor(t,e){Xc.set(this,void 0),null==e&&(e=ul),Zc(this,Xc,Object.freeze(t.transactions.map((t=>{if("string"!=typeof t&&t.provider!==e)throw new Error("provider mismatch");return t}))),"f"),n(this,{provider:e,hash:tl(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:tl(t.baseFeePerGas)})}get transactions(){return Qc(this,Xc,"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:el(t),difficulty:el(e),extraData:r,gasLimit:el(n),gasUsed:el(s),hash:i,miner:o,nonce:a,number:c,parentHash:l,timestamp:u,transactions:h}}[(Xc=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 sl{constructor(t,e){null==e&&(e=ul),this.provider=e;const r=Object.freeze(t.topics.slice());n(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,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 il{constructor(t,e){Yc.set(this,void 0),null==e&&(e=ul),Zc(this,Yc,Object.freeze(t.logs.map((t=>{if(e!==t.provider)throw new Error("provider mismatch");return t}))),"f"),n(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 Qc(this,Yc,"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:el(this.cumulativeGasUsed),from:e,gasPrice:el(this.gasPrice),gasUsed:el(this.gasUsed),hash:n,index:s,logs:c,logsBloom:a,root:h,status:u,to:t}}get length(){return this.logs.length}[(Yc=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 cl(this)}reorderedEvent(t){return t&&!t.isMined()?Yo.throwError("unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}):al(this,t)}}class ol{constructor(t,e){null==e&&(e=ul),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:el(this.chainId),data:c,from:o,gasLimit:el(this.gasLimit),gasPrice:el(this.gasPrice),hash:n,maxFeePerGas:el(this.maxFeePerGas),maxPriorityFeePerGas:el(this.maxPriorityFeePerGas),nonce:a,signature:l,to:i,index:r,type:s,value:el(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()?cl(this):Yo.throwError("unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"})}reorderedEvent(t){return this.isMined()?t&&!t.isMined()?Yo.throwError("unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}):al(this,t):Yo.throwError("unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"})}}function al(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function cl(t){return{orphan:"drop-transaction",tx:t}}function ll(){throw new Error("this provider should not be used")}const ul=new class{get provider(){return this}async getNetwork(){return ll()}async getFeeData(){return ll()}async estimateGas(t){return ll()}async call(t){return ll()}async resolveName(t){return ll()}async getBlockNumber(){return ll()}async getBalanceOf(t,e){return ll()}async getTransactionCountOf(t,e){return ll()}async getCode(t,e){return ll()}async getStorageAt(t,e,r){return ll()}async broadcastTransaction(t){return ll()}async getBlock(t){return ll()}async getBlockWithTransactions(t){return ll()}async getTransaction(t){return ll()}async getTransactionReceipt(t){return ll()}async getLogs(t){return ll()}async lookupAddress(t){return ll()}async waitForTransaction(t,e,r){return ll()}async waitForBlock(t){return ll()}async on(t,e){return ll()}async once(t,e){return ll()}async emit(t,...e){return ll()}async listenerCount(t){return ll()}async listeners(t){return ll()}async off(t,e){return ll()}async removeAllListeners(t){return ll()}async addListener(t,e){return ll()}async removeListener(t,e){return ll()}};var hl,fl,dl=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},pl=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 gl=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function wl(t){if("string"!=typeof t)throw new Error("invalid string");return t}class ml{constructor(){hl.set(this,void 0),fl.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);dl(this,hl,{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"),dl(this,fl,this.object({number:i,hash:this.allowNull(s,null),timestamp:i,parentHash:s,nonce:this.allowNull(wl,"0x0000000000000000"),difficulty:e,gasLimit:e,gasUsed:e,miner:this.allowNull(t,"0x0000000000000000000000000000000000000000"),extraData:wl,baseFeePerGas:this.allowNull(e)}),"f")}address(t){return ws(t)}callAddress(t){return 32===me(t)&&"0x000000000000000000000000"===ye(t,0,12)||Yo.throwArgumentError("invalid call address","value",t),this.address(ye(t,12))}contractAddress(t){return Os({from:this.address(t.from),nonce:Yo.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||se(t)&&me(t)<32?ge(t):Yo.throwArgumentError("invalid blockTag","value",t)}block(t,e){const r=pl(this,fl,"f").call(this,t);return r.transactions=t.transactions.map((t=>this.hash(t))),new nl(r,e)}blockWithTransactions(t,e){throw new Error}transactionRequest(t,e){return pl(this,hl,"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=pl(this,hl,"f").transactionResponse(t);const r=Oa.from({r:t.r,s:t.s,v:t.v});return t.signature=r,null==t.chainId&&(t.chainId=r.legacyChainId),new ol(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 sl(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 Yo.throwError("invalid alt-root-status","BAD_DATA",{value:r.root});if(null!=r.status&&r.status!==t)return Yo.throwError("alt-root-status/status mismatch","BAD_DATA",{value:{root:r.root,status:r.status}});r.status=t,delete r.root}else if(!se(r.root,32))return Yo.throwError("invalid receipt root hash","BAD_DATA",{value:r.root});return new il(r,e)}topics(t){return pl(this,hl,"f").topics(t)}filter(t){return pl(this,hl,"f").filter(t)}filterLog(t){return console.log("ME",t),null}transaction(t){throw new Error}accessList(t){return Pc(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 Yo.getBigInt(t,"value")}uint256(t){const e=this.bigNumber(t);return(e<0||e>gl)&&Yo.throwArgumentError("invalid uint256","value",t),e}boolean(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}return Yo.throwArgumentError(`invalid boolean; ${JSON.stringify(t)}`,"value",t)}_hexstring(t){return null==t&&(t=!1),function(e){if(se(e,t))return e.toLowerCase();throw new Error("bad hexstring")}}data(t){return null==me(t)&&Yo.throwArgumentError("","value",t),t}hash(t){return 32!==me(t)&&Yo.throwArgumentError("","value",t),pl(this,hl,"f").data(t)}number(t){return Yo.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";Yo.throwError(`invalid value for value.${s} (${e})`,"BAD_DATA",{value:r})}}return n}}storageSlot(t){return kt(Yo.getBigInt(t),32)}}hl=new WeakMap,fl=new WeakMap;class yl{constructor(t){n(this,{name:t})}clone(){return new yl(this.name)}validate(t){return this}}class bl extends yl{constructor(t=0,e){super(`org.ethers.plugins.gas-cost#${t||0}`);const r={effectiveBlock:t};function s(t,n){let s=(e||{})[t];null==s&&(s=n),"number"!=typeof s&&Yo.throwArgumentError(`invalud value for ${t}`,"costs",e),r[t]=s}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),n(this,r)}clone(){return new bl(this.effectiveBlock,this)}}class vl extends yl{constructor(t,e){super("org.ethers.plugins.ens"),n(this,{address:t||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==e?1:e})}clone(){return new vl(this.address,this.targetNetwork)}validate(t){return t.formatter.address(this.address),this}}class El extends yl{constructor(t){super("org.ethers.plugins.max-priority-fee"),n(this,{priorityFee:Yo.getBigInt(t)})}async getPriorityFee(t){return this.priorityFee}clone(){return new El(this.priorityFee)}}var Al,kl=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},Tl=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 Pl=new Map,Nl=new ml;class xl{constructor(t,e,r){Al.set(this,void 0);const n=Yo.getBigInt(e);null==r&&(r=Nl);const s=new Map;kl(this,Al,{name:t,chainId:n,formatter:r,plugins:s},"f")}toJSON(){return{name:this.name,chainId:this.chainId}}get name(){return c(Tl(this,Al,"f"),"name")}set name(t){l(Tl(this,Al,"f"),"name",t)}get chainId(){return c(Tl(this,Al,"f"),"chainId")}set chainId(t){l(Tl(this,Al,"f"),"chainId",Yo.getBigInt(t,"chainId"))}get formatter(){return c(Tl(this,Al,"f"),"formatter")}set formatter(t){l(Tl(this,Al,"f"),"formatter",t)}get plugins(){return Array.from(Tl(this,Al,"f").plugins.values())}attachPlugin(t){if(this.isFrozen())throw new Error("frozen");if(Tl(this,Al,"f").plugins.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return Tl(this,Al,"f").plugins.set(t.name,t.validate(this)),this}getPlugin(t){return Tl(this,Al,"f").plugins.get(t)||null}getPlugins(t){return this.plugins.filter((e=>e.name.split("#")[0]===t))}clone(){const t=new xl(this.name,this.chainId,this.formatter);return this.plugins.forEach((e=>{t.attachPlugin(e.clone())})),t}freeze(){return Object.freeze(Tl(this,Al,"f")),this}isFrozen(){return Object.isFrozen(Tl(this,Al,"f"))}computeIntrinsicGas(t){const e=this.getPlugin("org.ethers.gas-cost")||new bl;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 xl.from("homestead");if("number"==typeof t&&(t=BigInt(t)),"string"==typeof t||"bigint"==typeof t){const e=Pl.get(t);if(e)return e();if("bigint"==typeof t)return new xl("unknown",t);Yo.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||Yo.throwArgumentError("invalid network object name or chainId","network",t);const e=new xl(t.name,t.chainId);return(t.ensAddress||null!=t.ensNetwork)&&e.attachPlugin(new vl(t.ensAddress,t.ensNetwork)),e}return Yo.throwArgumentError("invalid network","network",t)}static register(t,e){"number"==typeof t&&(t=BigInt(t));const r=Pl.get(t);r&&Yo.throwArgumentError(`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),Pl.set(t,e)}}Al=new WeakMap;var Ol,Il,Sl,Rl,Bl,Cl,_l,Fl,Ul,Ll,Dl,Ml,jl,Gl,$l,zl,Wl=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},Hl=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 Vl(t){return JSON.parse(JSON.stringify(t))}class Kl{constructor(t){Ol.add(this),Il.set(this,void 0),Sl.set(this,void 0),Rl.set(this,void 0),Bl.set(this,void 0),Wl(this,Il,t,"f"),Wl(this,Sl,null,"f"),Wl(this,Rl,4e3,"f"),Wl(this,Bl,-2,"f")}get pollingInterval(){return Hl(this,Rl,"f")}set pollingInterval(t){Wl(this,Rl,t,"f")}start(){if(Hl(this,Sl,"f"))throw new Error("subscriber already running");Hl(this,Ol,"m",Cl).call(this),Wl(this,Sl,Hl(this,Il,"f")._setTimeout(Hl(this,Ol,"m",Cl).bind(this),Hl(this,Rl,"f")),"f")}stop(){if(!Hl(this,Sl,"f"))throw new Error("subscriber not running");Hl(this,Il,"f")._clearTimeout(Hl(this,Sl,"f")),Wl(this,Sl,null,"f")}pause(t){this.stop(),t&&Wl(this,Bl,-2,"f")}resume(){this.start()}}Il=new WeakMap,Sl=new WeakMap,Rl=new WeakMap,Bl=new WeakMap,Ol=new WeakSet,Cl=async function t(){const e=await Hl(this,Il,"f").getBlockNumber();if(-2!==Hl(this,Bl,"f")){if(e!==Hl(this,Bl,"f")){for(let t=Hl(this,Bl,"f")+1;t<=e;t++)Hl(this,Il,"f").emit("block",t);Wl(this,Bl,e,"f")}Wl(this,Sl,Hl(this,Il,"f")._setTimeout(Hl(this,Ol,"m",t).bind(this),Hl(this,Rl,"f")),"f")}else Wl(this,Bl,e,"f")};class Jl{constructor(t){_l.set(this,void 0),Fl.set(this,void 0),Wl(this,_l,t,"f"),Wl(this,Fl,(t=>{this._poll(t,Hl(this,_l,"f"))}),"f")}async _poll(t,e){throw new Error("sub-classes must override this")}start(){Hl(this,Fl,"f").call(this,-2),Hl(this,_l,"f").on("block",Hl(this,Fl,"f"))}stop(){Hl(this,_l,"f").off("block",Hl(this,Fl,"f"))}pause(t){this.stop()}resume(){this.start()}}_l=new WeakMap,Fl=new WeakMap;class ql extends Jl{constructor(t,e){super(t),Ul.set(this,void 0),Wl(this,Ul,Vl(e),"f")}async _poll(t,e){throw new Error("@TODO")}}Ul=new WeakMap;class Xl extends Jl{constructor(t,e){super(t),Ll.set(this,void 0),Wl(this,Ll,e,"f")}async _poll(t,e){const r=await e.getTransactionReceipt(Hl(this,Ll,"f"));r&&e.emit(Hl(this,Ll,"f"),r)}}Ll=new WeakMap;class Yl{constructor(t,e){Dl.add(this),Ml.set(this,void 0),jl.set(this,void 0),Gl.set(this,void 0),$l.set(this,void 0),Wl(this,Ml,t,"f"),Wl(this,jl,Vl(e),"f"),Wl(this,Gl,Hl(this,Dl,"m",zl).bind(this),"f"),Wl(this,$l,-2,"f")}start(){-2===Hl(this,$l,"f")&&Hl(this,Ml,"f").getBlockNumber().then((t=>{Wl(this,$l,t,"f")})),Hl(this,Ml,"f").on("block",Hl(this,Gl,"f"))}stop(){Hl(this,Ml,"f").off("block",Hl(this,Gl,"f"))}pause(t){this.stop(),t&&Wl(this,$l,-2,"f")}resume(){this.start()}}Ml=new WeakMap,jl=new WeakMap,Gl=new WeakMap,$l=new WeakMap,Dl=new WeakSet,zl=async function(t){if(-2===Hl(this,$l,"f"))return;const e=Vl(Hl(this,jl,"f"));e.fromBlock=Hl(this,$l,"f")+1,e.toBlock=t;const r=await Hl(this,Ml,"f").getLogs(e);if(0!==r.length){Wl(this,$l,t,"f");for(const t of r)Hl(this,Ml,"f").emit(Hl(this,jl,"f"),t)}else Hl(this,$l,"f")<t-60&&Wl(this,$l,t-60,"f")};var Zl,Ql,tu,eu,ru,nu,su,iu,ou,au,cu,lu,uu,hu,fu,du=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},pu=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 gu=BigInt(2);function wu(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 mu{constructor(t){n(this,{name:t})}start(){}stop(){}pause(t){}resume(){}}function yu(t){return(t=Array.from(new Set(t).values())).sort(),t}async function bu(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(se(t,32)){const e=t.toLowerCase();return{type:"transaction",tag:wu("tx",{hash:e}),hash:e}}if(t.orphan){const e=t;return{type:"orphan",tag:wu("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)?yu(t.map((t=>t.toLowerCase()))):t.toLowerCase()))};if(r.address){const t=[],s=[],i=r=>{se(r)?t.push(r):s.push((async()=>{t.push(await Bs(r,e))})())};Array.isArray(r.address)?r.address.forEach(i):i(r.address),s.length&&await Promise.all(s),n.address=yu(t.map((t=>t.toLowerCase())))}return{filter:n,tag:wu("event",n),type:"event"}}return Yo.throwArgumentError("unknown ProviderEvent","event",t)}function vu(){return(new Date).getTime()}class Eu{constructor(t){if(Zl.add(this),Ql.set(this,void 0),tu.set(this,void 0),eu.set(this,void 0),ru.set(this,void 0),nu.set(this,void 0),su.set(this,void 0),iu.set(this,void 0),ou.set(this,void 0),au.set(this,void 0),"any"===t)du(this,nu,!0,"f"),du(this,ru,null,"f");else if(t){const e=xl.from(t);du(this,nu,!1,"f"),du(this,ru,Promise.resolve(e),"f"),setTimeout((()=>{this.emit("network",e,null)}),0)}else du(this,nu,!1,"f"),du(this,ru,null,"f");du(this,su,new Map,"f"),du(this,Ql,new Map,"f"),du(this,tu,new Map,"f"),du(this,eu,null,"f"),du(this,iu,0,"f"),du(this,ou,new Map,"f"),du(this,au,!1,"f")}get provider(){return this}get plugins(){return Array.from(pu(this,tu,"f").values())}attachPlugin(t){if(pu(this,tu,"f").get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return pu(this,tu,"f").set(t.name,t.validate(this)),this}getPlugin(t){return pu(this,tu,"f").get(t)||null}set disableCcipRead(t){du(this,au,!!t,"f")}get disableCcipRead(){return pu(this,au,"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 Vo(a);-1===o.indexOf("{data}")&&(c.body={data:s,sender:n});let l="unknown error";const u=await Xo(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 Yo.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 Yo.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 Yo.throwError("sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){return Yo.throwError(`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){return Yo.getNumber(await pu(this,Zl,"m",cu).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==pu(this,ru,"f")){const t=this._detectNetwork().then((t=>(this.emit("network",t,null),t)),(e=>{throw pu(this,ru,"f")===t&&du(this,ru,null,"f"),e}));return du(this,ru,t,"f"),await t}const t=pu(this,ru,"f"),[e,r]=await Promise.all([t,this._detectNetwork()]);return e.chainId!==r.chainId&&(pu(this,nu,"f")?(this.emit("network",r,e),pu(this,ru,"f")===t&&du(this,ru,Promise.resolve(r),"f")):Yo.throwError(`network changed: ${e.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),e.clone().freeze()}async getFeeData(){const{block:t,gasPrice:r}=await e({block:this.getBlock("latest"),gasPrice:(async()=>{try{const t=await pu(this,Zl,"m",cu).call(this,{method:"getGasPrice"});return Yo.getBigInt(t,"%response")}catch(t){}return null})()});let n=null,s=null;if(t&&t.baseFeePerGas){s=BigInt("1500000000");const e=(await this.getNetwork()).getPlugin("org.ethers.plugins.max-priority-fee");e&&(s=await e.getPriorityFee(this)),n=t.baseFeePerGas*gu+s}return new rl(r,n,s)}async _getTransaction(t){const r=await this.getNetwork(),n=Object.assign({},t,await e({to:t.to?Bs(t.to,this):void 0,from:t.from?Bs(t.from,this):void 0}));return r.formatter.transactionRequest(n)}async estimateGas(t){const e=await this._getTransaction(t);return Yo.getBigInt(await pu(this,Zl,"m",cu).call(this,{method:"estimateGas",transaction:e}),"%response")}async call(t){const{tx:r,blockTag:n}=await e({tx:this._getTransaction(t),blockTag:this._getBlockTag(t.blockTag)});return pu(this,Zl,"m",lu).call(this,r,n,t.enableCcipRead?0:-1)}async getBalanceOf(t,r){const{address:n,blockTag:s}=await e({address:Bs(t),blockTag:this._getBlockTag(r)});return Yo.getBigInt(await pu(this,Zl,"m",cu).call(this,{method:"getBalance",address:n,blockTag:s}),"%response")}async getTransactionCountOf(t,r){const{address:n,blockTag:s}=await e({address:Bs(t),blockTag:this._getBlockTag(r)});return Yo.getNumber(await pu(this,Zl,"m",cu).call(this,{method:"getTransactionCount",address:n,blockTag:s}),"%response")}async getCode(t,r){const{address:n,blockTag:s}=await e({address:Bs(t),blockTag:this._getBlockTag(r)});return pe(await pu(this,Zl,"m",cu).call(this,{method:"getCode",address:n,blockTag:s}))}async getStorageAt(t,r,n){const s=Yo.getBigInt(r),{address:i,blockTag:o}=await e({address:Bs(t),blockTag:this._getBlockTag(n)});return pe(await pu(this,Zl,"m",cu).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 pu(this,Zl,"m",uu).call(this,t,!1);return null==r?null:e.block(r,this)}async getBlockWithTransactions(t){const e=(await this.getNetwork()).formatter,r=pu(this,Zl,"m",uu).call(this,t,!0);return null==r?null:e.blockWithTransactions(r,this)}async getTransaction(t){const e=(await this.getNetwork()).formatter,r=await pu(this,Zl,"m",cu).call(this,{method:"getTransaction",hash:t});return e.transactionResponse(r,this)}async getTransactionReceipt(t){const e=(await this.getNetwork()).formatter,r=await pu(this,Zl,"m",cu).call(this,{method:"getTransactionReceipt",hash:t});if(null==r)return null;if(null==r.gasPrice&&null==r.effectiveGasPrice){const e=await pu(this,Zl,"m",cu).call(this,{method:"getTransaction",hash:t});r.effectiveGasPrice=e.gasPrice}return e.receipt(r,this)}async _getFilter(t){const r=(t.topics||[]).map((t=>null==t?null:Array.isArray(t)?yu(t.map((t=>t.toLowerCase()))):t.toLowerCase())),n="blockHash"in t?t.blockHash:void 0,s={};t.address&&(Array.isArray(t.address)?s.address=Promise.all(t.address.map((t=>Bs(t,this)))):s.address=Bs(t.address,this));const i=e=>{null!=t[e]&&(s[e]=this._getBlockTag(t[e]))};i("fromBlock"),i("toBlock");const o=await e(s);if(Array.isArray(o.address)&&o.address.sort(),o.topics=r,n){if(t.fromBlock||t.toBlock)throw new Error("invalid filter");o.blockHash=n}return o}async getLogs(t){const{network:r,filter:n}=await e({network:this.getNetwork(),filter:this._getFilter(t)});return(await pu(this,Zl,"m",cu).call(this,{method:"getLogs",filter:n})).map((t=>r.formatter.log(t,this)))}_getProvider(t){return Yo.throwError("provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await ga.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?Yo.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(Yo.makeError("timeout","TIMEOUT",{reason:"timeout"})))}),r)),o(await this.getBlockNumber())}))}async waitForBlock(t){throw new Error}_clearTimeout(t){const e=pu(this,ou,"f").get(t);e&&(e.timer&&clearTimeout(e.timer),pu(this,ou,"f").delete(t))}_setTimeout(t,e=0){var r,n;const s=(du(this,iu,(n=pu(this,iu,"f"),r=n++,n),"f"),r),i=()=>{pu(this,ou,"f").delete(s),t()};if(this.paused)pu(this,ou,"f").set(s,{timer:null,func:i,time:e});else{const t=setTimeout(i,e);pu(this,ou,"f").set(s,{timer:t,func:i,time:vu()})}return s}_forEachSubscriber(t){for(const e of pu(this,Ql,"f").values())t(e.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"network":return new mu(t.type);case"block":return new Kl(this);case"event":return new Yl(this,t.filter);case"transaction":return new Xl(this,t.hash);case"orphan":return new ql(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,e){for(const r of pu(this,Ql,"f").values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=e,r.started&&e.start(),null!=pu(this,eu,"f")&&e.pause(pu(this,eu,"f"));break}}async on(t,e){const r=await pu(this,Zl,"m",fu).call(this,t);return r.listeners.push({listener:e,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=pu(this,eu,"f")&&r.subscriber.pause(pu(this,eu,"f"))),this}async once(t,e){const r=await pu(this,Zl,"m",fu).call(this,t);return r.listeners.push({listener:e,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=pu(this,eu,"f")&&r.subscriber.pause(pu(this,eu,"f"))),this}async emit(t,...e){const r=await pu(this,Zl,"m",hu).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 a(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 pu(this,Zl,"m",hu).call(this,t);return e?e.listeners.length:0}let e=0;for(const{listeners:t}of pu(this,Ql,"f").values())e+=t.length;return e}async listeners(t){if(t){const e=await pu(this,Zl,"m",hu).call(this,t);return e?e.listeners.map((({listener:t})=>t)):[]}let e=[];for(const{listeners:t}of pu(this,Ql,"f").values())e=e.concat(t.map((({listener:t})=>t)));return e}async off(t,e){const r=await pu(this,Zl,"m",hu).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(),pu(this,Ql,"f").delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:e,started:r,subscriber:n}=await pu(this,Zl,"m",fu).call(this,t);r&&n.stop(),pu(this,Ql,"f").delete(e)}else for(const[t,{started:e,subscriber:r}]of pu(this,Ql,"f"))e&&r.stop(),pu(this,Ql,"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 pu(this,ou,"f").keys())this._clearTimeout(t)}get paused(){return null!=pu(this,eu,"f")}pause(t){if(null!=pu(this,eu,"f")){if(pu(this,eu,"f")==!!t)return;return Yo.throwError("cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((e=>e.pause(t))),du(this,eu,!!t,"f");for(const t of pu(this,ou,"f").values())t.timer&&clearTimeout(t.timer),t.time=vu()-t.time}resume(){if(null!=pu(this,eu,"f")){this._forEachSubscriber((t=>t.resume())),du(this,eu,null,"f");for(const t of pu(this,ou,"f").values()){let e=t.time;e<0&&(e=0),t.time=vu(),setTimeout(t.func,e)}}}}function Au(t,e){try{const r=ku(t,e);if(r)return fi(r)}catch(t){}return null}function ku(t,e){if("0x"===t)return null;try{const r=Yo.getNumber(ye(t,e,e+32)),n=Yo.getNumber(ye(t,r,r+32));return ye(t,r+32,r+32+n)}catch(t){}return null}function Tu(t){const e=Tt(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 Pu(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}Ql=new WeakMap,tu=new WeakMap,eu=new WeakMap,ru=new WeakMap,nu=new WeakMap,su=new WeakMap,iu=new WeakMap,ou=new WeakMap,au=new WeakMap,Zl=new WeakSet,cu=async function(t){const e=wu(t.method,t);let r=pu(this,su,"f").get(e);return r||(r=this._perform(t),pu(this,su,"f").set(e,r),setTimeout((()=>{pu(this,su,"f").get(e)===r&&pu(this,su,"f").delete(e)}),250)),await r},lu=async function t(e,r,n){n>=10&&Yo.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 pe(await this._perform({method:"call",transaction:s,blockTag:r}))}catch(e){if(!this.disableCcipRead&&h(e)&&n>=0&&"latest"===r&&null!=s.to&&"0x556f1830"===ye(e.data,0,4)){const i=e.data,o=await Bs(s.to,this);let a;try{a=function(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};if(me(t)<160)throw new Error("insufficient OffchainLookup data");const r=ye(t,0,32);if(ye(r,0,12)!==ye(Ou,0,12))throw new Error("corrupt OffchainLookup sender");e.sender=ye(r,12);try{const r=[],n=Yo.getNumber(ye(t,32,64)),s=Yo.getNumber(ye(t,n,n+32)),i=ye(t,n+32);for(let t=0;t<s;t++){const e=Au(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=ku(t,64);if(null==r)throw new Error("abort");e.calldata=r}catch(t){throw new Error("corrupt OffchainLookup calldata")}if(ye(t,100,128)!==ye(Ou,0,28))throw new Error("corrupt OffchainLookup callbaackSelector");e.selector=ye(t,96,100);try{const r=ku(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}(ye(e.data,4))}catch(t){return Yo.throwError(t.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:i}})}if(a.sender.toLowerCase()!==o.toLowerCase())return Yo.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?Yo.throwError("CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:e.data,errorArgs:a.errorArgs}}):pu(this,Zl,"m",t).call(this,{to:o,data:we([a.selector,xu([c,a.extraData])])},r,n+1)}throw e}},uu=async function(t,e){const r=(await this.getNetwork()).formatter;return se(t,32)?await pu(this,Zl,"m",cu).call(this,{method:"getBlock",blockHash:t,includeTransactions:e}):await pu(this,Zl,"m",cu).call(this,{method:"getBlock",blockTag:r.blockTag(t),includeTransactions:e})},hu=async function(t,e){let r=await bu(t,this);return"event"===r.type&&e&&e.length>0&&!0===e[0].removed&&(r=await bu({orphan:"drop-log",log:e[0]},this)),pu(this,Ql,"f").get(r.tag)||null},fu=async function(t){const e=await bu(t,this),r=e.tag;let n=pu(this,Ql,"f").get(r);if(!n){n={subscriber:this._getSubscriber(e),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},pu(this,Ql,"f").set(r,n)}return n};const Nu=new Uint8Array([]);function xu(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(Nu),r+=32;for(let n=0;n<t.length;n++){const s=Yo.getBytes(t[n]);e[n]=Tu(r),e.push(Tu(s.length)),e.push(Pu(s)),r+=32+32*Math.ceil(s.length/32)}return we(e)}const Ou="0x0000000000000000000000000000000000000000000000000000000000000000";var Iu,Su,Ru,Bu,Cu,_u,Fu=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)},Uu=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 Lu{constructor(t){Iu.add(this),n(this,{provider:t||null})}async getBalance(t){return Fu(this,Iu,"m",Su).call(this,"getBalance").getBalanceOf(await this.getAddress(),t)}async getTransactionCount(t){return Fu(this,Iu,"m",Su).call(this,"getTransactionCount").getTransactionCountOf(await this.getAddress(),t)}async estimateGas(t){return Fu(this,Iu,"m",Su).call(this,"estimateGas").estimateGas(await Fu(this,Iu,"m",Ru).call(this,t))}async call(t){return Fu(this,Iu,"m",Su).call(this,"call").call(await Fu(this,Iu,"m",Ru).call(this,t))}async populateTransaction(t){const r=Fu(this,Iu,"m",Su).call(this,"populateTransaction");let n=Object.assign({},t);if(null!=n.to&&(n.to=r.resolveName(n.to).then((t=>null==t?Yo.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:Yo.throwArgumentError("transaction from mismatch","tx.from",e)))}return null==n.nonce&&(n.nonce=this.getTransactionCount()),n=e(n),null==n.gasLimit&&(n.gasLimit=r.estimateGas(n)),n=e(n),await e(n)}async resolveName(t){const e=Fu(this,Iu,"m",Su).call(this,"resolveName");return await e.resolveName(t)}async sendTransaction(t){const e=Fu(this,Iu,"m",Su).call(this,"sendTransaction"),r=qc.from(await this.populateTransaction(t));return await e.broadcastTransaction(await this.signTransaction(r))}}Iu=new WeakSet,Su=function(t){return this.provider?this.provider:Yo.throwError("missing provider","UNSUPPORTED_OPERATION",{operation:t})},Ru=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()||Yo.throwArgumentError("transaction from mismatch","tx.from",r),t.from=e})))}return await Promise.all(e),t};class Du extends Lu{constructor(t,e){super(e),Bu.add(this),n(this,{address:t})}async getAddress(){return this.address}connect(t){return new Du(this.address,t)}async signTransaction(t){Fu(this,Bu,"m",Cu).call(this,"transactions","signTransaction")}async signMessage(t){Fu(this,Bu,"m",Cu).call(this,"messages","signMessage")}async signTypedData(t,e,r){Fu(this,Bu,"m",Cu).call(this,"typed-data","signTypedData")}}Bu=new WeakSet,Cu=function(t,e){return Yo.throwError(`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:e})};class Mu extends Lu{constructor(t){super(t.provider),_u.set(this,void 0),Uu(this,_u,t,"f")}async getAddress(){return await Fu(this,_u,"f").getAddress()}connect(t){return new Mu(Fu(this,_u,"f").connect(t))}async signTransaction(t){return await Fu(this,_u,"f").signTransaction(t)}async sendTransaction(t){return await Fu(this,_u,"f").sendTransaction(t)}async signMessage(t){return await Fu(this,_u,"f").signMessage(t)}async signTypedData(t,e,r){return await Fu(this,_u,"f").signTypedData(t,e,r)}}_u=new WeakMap;const ju=new Set;function Gu(t){ju.has(t)||(ju.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 $u,zu,Wu,Hu,Vu,Ku,Ju,qu,Xu=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},Yu=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 Zu{constructor(t){$u.add(this),zu.set(this,void 0),Wu.set(this,void 0),Hu.set(this,void 0),Vu.set(this,void 0),Xu(this,zu,t,"f"),Xu(this,Wu,null,"f"),Xu(this,Hu,Yu(this,$u,"m",Ku).bind(this),"f"),Xu(this,Vu,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(){Yu(this,$u,"m",Ku).call(this,-2)}stop(){Yu(this,$u,"m",Ju).call(this),Yu(this,zu,"f").off("block",Yu(this,Hu,"f"))}pause(t){t&&Yu(this,$u,"m",Ju).call(this),Yu(this,zu,"f").off("block",Yu(this,Hu,"f"))}resume(){this.start()}}zu=new WeakMap,Wu=new WeakMap,Hu=new WeakMap,Vu=new WeakMap,$u=new WeakSet,Ku=async function(t){try{null==Yu(this,Wu,"f")&&Xu(this,Wu,this._subscribe(Yu(this,zu,"f")),"f");const t=await Yu(this,Wu,"f");if(null==t)return void Yu(this,zu,"f")._recoverSubscriber(this,this._recover(Yu(this,zu,"f")));const e=await Yu(this,zu,"f").getNetwork();if(Yu(this,Vu,"f")||Xu(this,Vu,e,"f"),Yu(this,Vu,"f").chainId!==e.chainId)throw new Error("chaid changed");const r=await Yu(this,zu,"f").send("eth_getFilterChanges",[t]);await this._emitResults(Yu(this,zu,"f"),r)}catch(t){console.log("@TODO",t)}Yu(this,zu,"f").once("block",Yu(this,Hu,"f"))},Ju=function(){const t=Yu(this,Wu,"f");t&&(Xu(this,Wu,null,"f"),t.then((t=>{Yu(this,zu,"f").send("eth_uninstallFilter",[t])})))};class Qu extends Zu{constructor(t,e){var r;super(t),qu.set(this,void 0),Xu(this,qu,(r=e,JSON.parse(JSON.stringify(r))),"f")}_recover(t){return new Yl(t,Yu(this,qu,"f"))}async _subscribe(t){const e=await t.send("eth_newFilter",[Yu(this,qu,"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(Yu(this,qu,"f"),e)}}}qu=new WeakMap;class th extends Zu{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 eh,rh,nh,sh,ih=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},oh=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 ah="bigint,boolean,function,number,string,symbol".split(/,/g);function ch(t){if(null==t||ah.indexOf(typeof t)>=0)return t;if("function"==typeof t.getAddress)return t;if(Array.isArray(t))return t.map(ch);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 lh(t){return t?t.toLowerCase():t}const uh={polling:!1,batchMaxSize:1<<20,batchStallTime:250};class hh{constructor(t,e){n(this,{provider:t,address:e})}connect(t){return Yo.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=ch(t),r=[];if(e.from){const n=e.from;r.push((async()=>{const r=await Bs(n,this.provider);null!=r&&r.toLowerCase()===this.address.toLowerCase()||Yo.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 Bs(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=ch(t);if(e.from){const r=await Bs(e.from,this.provider);if(null==r||r.toLowerCase()!==this.address.toLowerCase())return Yo.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?ci(t):t;return await this.provider.send("personal_sign",[pe(e),this.address.toLowerCase()])}async signTypedData(t,e,r){const n=ch(r),s=await yo.resolveNames(t,e,n,(async t=>{const e=await Bs(t);return null==e?Yo.throwArgumentError("TypedData does not support null address","value",t):e}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(yo.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?ci(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),pe(e)])}}class fh extends Eu{constructor(t){super(t),eh.set(this,void 0),rh.set(this,void 0),ih(this,eh,1,"f"),ih(this,rh,Object.assign({},uh),"f")}_getOptions(t){return oh(this,rh,"f")[t]}_setOptions(t){for(const e in t){const r=e,n=t[r];if(typeof n!=typeof oh(this,rh,"f")[r])return Yo.throwArgumentError("invalid option value",`options.${r}`,n)}for(const e in t){const r=e;oh(this,rh,"f")[r]=t[r]}}prepareRequest(t,e){var r,n;return{method:t,params:e,id:(ih(this,eh,(n=oh(this,eh,"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 hh(this,r[t])}t=e.formatter.address(t);for(const t of r)if(e.formatter.address(t)===t)return new hh(this,t);throw new Error("invalid account")}async _detectNetwork(){return xl.from(Yo.getBigInt(await this._perform({method:"chainId"})))}_getSubscriber(t){return"pending"===t.type?new th(this):"event"===t.type?new Qu(this,t.filter):"orphan"===t.type&&"drop-log"===t.filter.orphan?new mu("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]=ge(t[r])})),["from","to","data"].forEach((r=>{null!=t[r]&&(e[r]=pe(t[r]))})),t.accessList&&(e.accessList=Pc(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:[lh(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[lh(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[lh(t.address),t.blockTag]};case"getStorageAt":return{method:"eth_getStorageAt",args:[lh(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(lh):t.filter.address=lh(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,e,r){if("eth_call"===t){const t=gh(r);return t?Yo.makeError("execution reverted during JSON-RPC call","CALL_EXCEPTION",{data:t.data,transaction:e[0]}):Yo.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 wh(t,e),e}(r));return n.match(/insufficient funds|base fee exceeds gas limit/)?Yo.makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:e[0]}):n.match(/nonce/)&&n.match(/too low/)?Yo.makeError("nonce has already been used","NONCE_EXPIRED",{transaction:e[0]}):n.match(/replacement transaction/)&&n.match(/underpriced/)?Yo.makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:e[0]}):n.match(/only replay-protected/)?Yo.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/)?Yo.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&&Yo.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)}}eh=new WeakMap,rh=new WeakMap;class dh extends fh{constructor(t,e){null==t&&(t="http://localhost:8545"),super(e),nh.set(this,void 0),sh.set(this,void 0),"string"==typeof t?ih(this,nh,{request:new Vo(t)},"f"):(ih(this,nh,Object.assign({},t),"f"),oh(this,nh,"f").request=oh(this,nh,"f").request.clone()),ih(this,sh,4e3,"f")}async send(t,e){var r;r=e,e=JSON.parse(JSON.stringify(r));const n=Object.assign({},oh(this,nh,"f"));n.request=n.request.clone(),n.request.body=this.prepareRequest(t,e);const s=await Xo(n);s.assertOk();const i=s.bodyJson;return"error"in i?Yo.throwError("error from JSON-RPC","UNKNOWN_ERROR",{result:i}):i.result}get pollingInterval(){return oh(this,sh,"f")}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");ih(this,sh,t,"f"),this._forEachSubscriber((t=>{(function(t){return t&&"number"==typeof t.pollingInterval})(t)&&(t.pollingInterval=oh(this,sh,"f"))}))}}nh=new WeakMap,sh=new WeakMap;class ph extends dh{constructor(t,e){super(t,e),n(this,{network:e})}async _detectNetwork(){return this.network}}function gh(t){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")&&se(t.data))return{message:t.message,data:t.data};if("object"==typeof t){for(const e in t){const r=gh(t[e]);if(r)return r}return null}if("string"==typeof t)try{return gh(JSON.parse(t))}catch(t){}return null}function wh(t,e){if(null!=t){if("string"==typeof t.message&&e.push(t.message),"object"==typeof t)for(const r in t)wh(t[r],e);if("string"==typeof t)try{return wh(JSON.parse(t),e)}catch(t){}}}const mh="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class yh extends ph{constructor(t="homestead",e){const r=xl.from(t);null==e&&(e=mh);super(yh.getConnection(r,e),r),n(this,{apiKey:e}),super._setOptions({polling:!0})}_getProvider(t){try{return new yh(t,this.apiKey)}catch(t){}return super._getProvider(t)}static getConnection(t,e){null==e&&(e=mh);const r=new Vo(`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 Yo.throwArgumentError("unsupported network","network",t)}(t.name)}/${e}`);r.allowGzip=!0;return{request:r,throttleRetry:async(t,r,n)=>(e===mh&&Gu("AnkrProvider"),!0)}}isCommunityResource(){return this.apiKey===mh}}const bh="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class vh extends ph{constructor(t="homestead",e){const r=xl.from(t);null==e&&(e=bh),super(vh.getConnection(r,e),r),n(this,{apiKey:e})}_getProvider(t){try{return new vh(t,this.apiKey)}catch(t){}return super._getProvider(t)}isCommunityResource(){return this.apiKey===bh}static getConnection(t,e){null==e&&(e=bh);const r=new Vo(`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 Yo.throwArgumentError("unsupported network","network",t)}(t.name)}/v2/${e}`);r.allowGzip=!0;return{request:r,throttleRetry:async(t,r,n)=>(e===bh&&Gu("alchemy"),!0)}}}class Eh extends ph{constructor(t="homestead"){const e=xl.from(t);if("homestead"!==e.name)return Yo.throwArgumentError("unsupported network","network",t);super("https://cloudflare-eth.com/",e)}}const Ah="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB",kh="org.ethers.plugins.etherscan";class Th extends Eu{constructor(t,e){super();const r=xl.from(t);if(null==e){const t=r.getPlugin(kh);e=t?t.communityApiKey:Ah}n(this,{apiKey:e,network:r}),this.getBaseUrl()}getBaseUrl(){const t=this.network.getPlugin(kh);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 Yo.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 Vo(n),o={request:i,throttleSlotInterval:1e3,processResponse:async(e,r)=>{const n=r.hasBody()?JSON.parse(fi(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 Xo(o);if(a.assertOk(),!a.hasBody())throw new Error;const c=JSON.parse(fi(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]?ge(pe(n)):"accessList"===r?"["+this.network.formatter.accessList(n).map((t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`)).join(",")+"]":pe(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"}):Yo.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(kh);return t?t.communityApiKey===this.apiKey:Ah===this.apiKey}}const Ph="84842078b09946638c03157f83405213";class Nh extends ph{constructor(t="homestead",e,r){const s=xl.from(t);null==e&&(e=Ph),null==r&&(r=null);super(Nh.getConnection(s,e,r),s),n(this,{projectId:e,projectSecret:r})}_getProvider(t){try{return new Nh(t,this.projectId,this.projectSecret)}catch(t){}return super._getProvider(t)}static getConnection(t,e,r){null==e&&(e=Ph),null==r&&(r=null);const n=new Vo(`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 Yo.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===Ph&&Gu("InfuraProvider"),!0)}}isCommunityResource(){return this.projectId===Ph}}const xh={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};function Oh(t,e,r,n){n=!!n;let s=!1,i=e;return null==i?(i=xh[t.name],null==i&&Yo.throwArgumentError("network does not support default applicationId","applicationId",e),n=!0,s=!0):i===xh[t.name]&&(n=!0,s=!0),null==r&&(r=null),{applicationId:i,applicationSecretKey:r,community:s,loadBalancer:n}}class Ih extends ph{constructor(t="homestead",e,r,s){const i=xl.from(t),{applicationId:o,applicationSecretKey:a,loadBalancer:c}=Oh(i,e,r,s);super(Ih.getConnection(i,o,a,c),i),n(this,{applicationId:o,applicationSecretKey:a,loadBalancer:c})}static getConnection(t,e,r,n){const{applicationId:s,applicationSecretKey:i,community:o,loadBalancer:a}=Oh(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 Yo.throwArgumentError("unsupported network","network",t)}(t.name)}/v1/`;a&&(c+="lb/"),c+=s;const l=new Vo(c);l.allowGzip=!0,i&&l.setCredentials("",i);return{request:l,throttleRetry:async(t,e,r)=>(o&&Gu("PocketProvider"),!0)}}isCommunityResource(){return this.applicationId===xh[this.network.name]}}var Sh,Rh,Bh,Ch,_h,Fh,Uh,Lh,Dh,Mh=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},jh=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 Gh=BigInt("1"),$h=BigInt("2");function zh(){return(new Date).getTime()}const Wh={stallTimeout:400,priority:1,weight:1},Hh={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};function Vh(t,e,r){switch(r.method){case"chainId":case"getGasPrice":case"getBalance":case"estimateGas":return Yo.getBigInt(e).toString();case"getBlockNumber":case"getTransactionCount":return Yo.getNumber(e).toString();case"getCode":case"getStorageAt":case"call":return pe(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 Yo.throwError("unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${JSON.stringify(r.method)})`})}function Kh(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 Jh(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]+Gh)/$h}class qh extends Eu{constructor(t,e){super(e),Sh.add(this),Rh.set(this,void 0),Bh.set(this,void 0),Ch.set(this,void 0),Mh(this,Rh,t.map((t=>t instanceof Eu?Object.assign({provider:t},Wh,Hh):Object.assign({},Wh,t,Hh))),"f"),Mh(this,Bh,-2,"f"),Mh(this,Ch,null,"f"),this.quorum=2,this.eventQuorum=1,this.eventWorkers=1,this.quorum>jh(this,Rh,"f").reduce(((t,e)=>t+e.weight),0)&&Yo.throwArgumentError("quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return jh(this,Rh,"f").slice()}async _detectNetwork(){return xl.from(Yo.getBigInt(await this._perform({method:"chainId"}))).freeze()}async _perform(t){await jh(this,Sh,"m",Uh).call(this);const e=new Set;for(let r=0;r<this.quorum;r++)jh(this,Sh,"m",Fh).call(this,e,t);const r=jh(this,Sh,"m",Dh).call(this,e,t);for(const t of e)t.done=!0;return r}}Rh=new WeakMap,Bh=new WeakMap,Ch=new WeakMap,Sh=new WeakSet,_h=function(t){const e=jh(this,Rh,"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},Fh=function(t,e){const r=jh(this,Sh,"m",_h).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=zh();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=zh()-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},Uh=async function(){let t=jh(this,Ch,"f");if(!t){const e=[];jh(this,Rh,"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()})())})),Mh(this,Ch,t=(async()=>{await Promise.all(e);let t=null;for(const e of jh(this,Rh,"f")){const r=e._network;null==t?t=r.chainId:r.chainId!==t&&Yo.throwError("cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})(),"f")}await t},Lh=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:Vh(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===jh(this,Bh,"f")){const t=Math.ceil(Yo.getNumber(Jh(jh(this,Rh,"f").map((t=>({result:t.blockNumber,normal:Yo.getNumber(t.blockNumber).toString(),weight:t.weight})))),"%internal"));Mh(this,Bh,t,"f")}const t=function(t,e){if(1===t)return Yo.getNumber(Jh(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=Yo.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>jh(this,Bh,"f")&&Mh(this,Bh,t,"f"),jh(this,Bh,"f")}case"getGasPrice":case"estimateGas":return Jh(r);case"getBlock":return"blockTag"in e&&"pending"===e.blockTag?r[0].result:Kh(this.quorum,r);case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"getTransaction":case"getTransactionReceipt":case"getLogs":case"call":return Kh(this.quorum,r);case"sendTransaction":throw new Error("TODO")}return Yo.throwError("unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${JSON.stringify(e.method)})`})}},Dh=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 jh(this,Sh,"m",Lh).call(this,e,r);if(void 0!==i){if(i instanceof Error)throw i;return i}for(let t=0;t<s;t++)jh(this,Sh,"m",Fh).call(this,e,r);if(0===n.length)throw new Error("quorum not met");return await Promise.race(n),await jh(this,Sh,"m",t).call(this,e,r)};const Xh=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 Yh,Zh,Qh,tf,ef,rf,nf,sf,of,af,cf,lf=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},uf=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 hf{constructor(t,e){Yh.set(this,void 0),Zh.set(this,void 0),Qh.set(this,void 0),tf.set(this,void 0),ef.set(this,void 0),lf(this,Yh,t,"f"),lf(this,Zh,JSON.stringify(e),"f"),lf(this,Qh,null,"f"),lf(this,tf,null,"f"),lf(this,ef,null,"f")}get filter(){return JSON.parse(uf(this,Zh,"f"))}start(){lf(this,Qh,uf(this,Yh,"f").send("eth_subscribe",this.filter).then((t=>(uf(this,Yh,"f")._register(t,this),t))),"f")}stop(){uf(this,Qh,"f").then((t=>{uf(this,Yh,"f").send("eth_unsubscribe",[t])})),lf(this,Qh,null,"f")}pause(t){t||Yo.throwError("preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),lf(this,tf,!!t,"f")}resume(){lf(this,tf,null,"f")}_handleMessage(t){if(null!=uf(this,Qh,"f")&&null===uf(this,tf,"f")){let e=uf(this,ef,"f");e=null==e?this._emit(uf(this,Yh,"f"),t):e.then((async()=>{await this._emit(uf(this,Yh,"f"),t)})),lf(this,ef,e.then((()=>{uf(this,ef,"f")===e&&lf(this,ef,null,"f")})),"f")}}async _emit(t,e){throw new Error("sub-classes must implemente this; _emit")}}Yh=new WeakMap,Zh=new WeakMap,Qh=new WeakMap,tf=new WeakMap,ef=new WeakMap;class ff extends hf{constructor(t){super(t,["newHeads"])}async _emit(t,e){t.emit("block",parseInt(e.number))}}class df extends hf{constructor(t){super(t,["newPendingTransactions"])}async _emit(t,e){t.emit("pending",e)}}class pf extends hf{constructor(t,e){super(t,["logs",e]),rf.set(this,void 0),nf.set(this,void 0),lf(this,rf,JSON.stringify(e),"f"),lf(this,nf,t.getNetwork().then((t=>t.formatter)),"f")}get logFilter(){return JSON.parse(uf(this,rf,"f"))}async _emit(t,e){const r=await uf(this,nf,"f");t.emit(uf(this,rf,"f"),r.log(e,t))}}rf=new WeakMap,nf=new WeakMap;class gf extends fh{constructor(t){super(t),sf.set(this,void 0),of.set(this,void 0),af.set(this,void 0),cf.set(this,void 0),lf(this,sf,new Map,"f"),lf(this,of,!1,"f"),lf(this,af,new Map,"f"),lf(this,cf,new Map,"f")}_getSubscriber(t){switch(t.type){case"close":return new mu("close");case"block":return new ff(this);case"pending":return new df(this);case"event":return new pf(this,t.filter);case"orphan":if("drop-log"===t.filter.orphan)return new mu("drop-log")}return super._getSubscriber(t)}_register(t,e){uf(this,af,"f").set(t,e);const r=uf(this,cf,"f").get(t);if(r){for(const t of r)e._handleMessage(t);uf(this,cf,"f").delete(t)}}async send(t,e){const r=this.prepareRequest(t,e),n=new Promise(((t,e)=>{uf(this,sf,"f").set(r.id,{payload:r,resolve:t,reject:e})}));return uf(this,of,"f")&&await this._write(JSON.stringify(r)),await n}async _start(){if(!uf(this,of,"f")){lf(this,of,!0,"f");for(const{payload:t}of uf(this,sf,"f").values())await this._write(JSON.stringify(t))}}async _processMessage(t){const e=JSON.parse(t);if("id"in e){const t=uf(this,sf,"f").get(e.id);if(!t)return void console.log("Weird... Response for not a thing we sent");if(uf(this,sf,"f").delete(e.id),"error"in e){const{message:r,code:n,data:s}=e.error,i=Yo.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=uf(this,af,"f").get(t);if(r)r._handleMessage(e.params.result);else{let r=uf(this,cf,"f").get(t);null==r&&(r=[],uf(this,cf,"f").set(t,r)),r.push(e.params.result)}}}async _write(t){throw new Error("sub-classes must override this")}}sf=new WeakMap,of=new WeakMap,af=new WeakMap,cf=new WeakMap;var wf,mf=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},yf=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 bf extends gf{constructor(t,e){super(e),wf.set(this,void 0),mf(this,wf,"string"==typeof t?new Xh(t):t,"f"),this.websocket.onopen=()=>{this._start()},this.websocket.onmessage=t=>{this._processMessage(t.data)}}get websocket(){return yf(this,wf,"f")}async _write(t){this.websocket.send(t)}}function vf(t,e){if(null==e&&(e={}),"string"==typeof t&&t.match(/^https?:/))return new dh(t);if("string"==typeof t&&t.match(/^wss?:/)||(r=t)&&"function"==typeof r.send&&"function"==typeof r.close)return new bf(t);var r;const n=[];if("-"!==e.alchemy)try{n.push(new vh(t,e.alchemy))}catch(t){console.log(t)}if("-"!==e.ankr)try{n.push(new yh(t,e.ankr))}catch(t){console.log(t)}if("-"!==e.cloudflare)try{n.push(new Eh(t))}catch(t){console.log(t)}if("-"!==e.etherscan)try{n.push(new Th(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 Nh(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 Ih(t,i,r,s))}catch(t){console.log(t)}if(0===n.length)throw new Error("TODO");return 1===n.length?n[0]:new qh(n)}wf=new WeakMap;const Ef=void 0;var Af,kf,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},Pf=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 Nf extends sl{constructor(t,e,r){super(t,t.provider);n(this,{args:e.decodeEventLog(r,t.data,t.topics),fragment:r,interface:e})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class xf extends il{constructor(t,e,r){super(r,e),Af.set(this,void 0),Tf(this,Af,t,"f")}get logs(){return super.logs.map((t=>{const e=t.topics.length?Pf(this,Af,"f").getEvent(t.topics[0]):null;return e?new Nf(t,Pf(this,Af,"f"),e):t}))}}Af=new WeakMap;class Of extends ol{constructor(t,e,r){super(r,e),kf.set(this,void 0),Tf(this,kf,t,"f")}async wait(t){const e=await super.wait();return null==e?null:new xf(Pf(this,kf,"f"),this.provider,e)}}kf=new WeakMap;class If extends a{constructor(t,e,r,s,i){super(t,e,r);const o=new Nf(i,t.interface,s);n(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 Sf=new T("@ethersproject/contract@6.0.0-beta.4");var Rf,Bf=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},Cf=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 _f(t){return t&&"function"==typeof t.resolveName}class Ff{constructor(t,e,r){if(Rf.set(this,void 0),n(this,{fragment:e}),e.inputs.length<r.length)throw new Error("too many arguments");const s=Uf(t.runner,"resolveName"),i=_f(s)?s:null;Bf(this,Rf,async function(){const n=await Promise.all(e.inputs.map(((t,e)=>t.walkAsync(r[e],((t,e)=>"address"===t?Bs(e,i):e)))));return t.interface.encodeFilterTopics(e,n)}(),"f")}getTopicFilter(){return Cf(this,Rf,"f")}}function Uf(t,e){return null==t?null:"function"==typeof t[e]?t:t.provider&&"function"==typeof t.provider[e]?t.provider:null}function Lf(t){return null==t?null:t.provider||null}async function Df(t){const e=function(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=pe(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas, maxPriorityFeePerGas,value".split(/,/);for(const n in r)n in t&&null!=t[n]&&(e[n]=Yo.getBigInt(t[n],`request.${n}`));const n="type,nonce".split(/,/);for(const r in n)r in t&&null!=t[r]&&(e[r]=Yo.getNumber(t[r],`request.${r}`));return t.accessList&&(e.accessList=Pc(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipReadEnabled=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}(js.dereference(t,"overrides"));return e.to?Sf.throwArgumentError("cannot override to","overrides.to",e.to):e.data&&Sf.throwArgumentError("cannot override data","overrides.data",e.data),e.from&&(e.from=await Bs(e.from)),e}Rf=new WeakMap;class Mf extends(function(){return Function}()){constructor(t,e){super(),n(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(...t){const r=this.getFragment(...t);let n={};if(r.inputs.length+1===t.length&&(n=await Df(t.pop())),r.inputs.length!==t.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=Uf(t,"resolveName"),s=_f(n)?n:null;return await Promise.all(e.map(((t,e)=>t.walkAsync(r[e],((t,e)=>"address"===t?Bs(e,s):e)))))}(this._contract.runner,r.inputs,t);return Object.assign({},n,await e({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 Sf.throwError("contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});var r;const n=await e.sendTransaction(await this.populateTransaction(...t)),s=Lf(this._contract.runner);return new Of(this._contract.interface,s,n)}async estimateGas(...t){const e=Uf(this._contract.runner,"estimateGas");return(r=e)&&"function"==typeof r.estimateGas?await e.estimateGas(await this.populateTransaction(...t)):Sf.throwError("contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"});var r}async staticCallResult(...t){const e=Uf(this._contract.runner,"call");if(!(r=e)||"function"!=typeof r.call)return Sf.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(h(t))throw this._contract.interface.makeError(n,t.data,s);throw t}return this._contract.interface.decodeFunctionResult(n,i)}}class jf extends(function(){return Function}()){constructor(t,e){return super(),n(this,{name:t.interface.getEventName(e),_contract:t,_key:e}),new Proxy(this,{apply:async(e,r,n)=>new Ff(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 Gf=Symbol.for("_ethersInternal_contract"),$f=new WeakMap;function zf(t){return $f.get(t[Gf])}async function Wf(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 Hf(t,e){const{subs:r}=zf(t);return r.get((await Wf(t,e)).tag)||null}async function Vf(t,e){const r=Lf(t.runner);if(!r)return Sf.throwError("contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:"on"});const{fragment:n,tag:s,topics:i}=await Wf(t,e),{addr:o,subs:a}=zf(t);let c=a.get(s);if(!c){const l={address:o||t,topics:i},u=r=>{const s=new If(t,null,e,n,r);Jf(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 Kf=Promise.resolve();async function Jf(t,e,r,n){try{await Kf}catch(t){}const s=async function(t,e,r,n){await Kf;const s=await Hf(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 If(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 Kf=s,await s}const qf=["then"];class Xf{constructor(t,e,r=null,s){let i;n(this,{target:t,runner:r,interface:_o.from(e)}),Object.defineProperty(this,Gf,{value:{}});let o=null,a=null;if(s){const t=Lf(r);a=new Of(this.interface,t,s)}let c=new Map;if("string"==typeof t)if(se(t))o=t,i=Promise.resolve(t);else{const e=Uf(r,"resolveName");if(!_f(e))throw Sf.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 zf(this).addr=t,t}))}else i=t.getAddress().then((t=>{if(null==t)throw new Error("TODO");return zf(this).addr=t,t}));var l,u;l=this,u={addrPromise:i,addr:o,deployTx:a,subs:c},$f.set(l[Gf],u);const h=new Proxy({},{get:(t,e,r)=>{if(qf.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 n(this,{filters:h}),new Proxy(this,{get:(t,e,r)=>{if(e in t||qf.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 zf(this).addrPromise}async getDeployedCode(){const t=Lf(this.runner);if(!t)return Sf.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=Lf(this.runner);return null==e?Sf.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 zf(this).deployTx}getFunction(t){return"string"!=typeof t&&(t=t.format()),new Mf(this,t)}getEvent(t){return"string"!=typeof t&&(t=t.format()),new jf(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e=0,r="latest"){const{addr:n,addrPromise:s}=zf(this),i=n||await s,{fragment:o,topics:a}=await Wf(this,t),c={address:i,topics:a,fromBlock:e,toBlock:r},l=Lf(this.runner);return l?(await l.getLogs(c)).map((t=>new Nf(t,this.interface,o))):Sf.throwError("contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"})}async on(t,e){const r=await Vf(this,t);return r.listeners.push({listener:e,once:!1}),r.start(),this}async once(t,e){const r=await Vf(this,t);return r.listeners.push({listener:e,once:!0}),r.start(),this}async emit(t,...e){return await Jf(this,t,e,null)}async listenerCount(t){if(t){const e=await Hf(this,t);return e?e.listeners.length:0}const{subs:e}=zf(this);let r=0;for(const{listeners:t}of e.values())r+=t.length;return r}async listeners(t){if(t){const e=await Hf(this,t);return e?e.listeners.map((({listener:t})=>t)):[]}const{subs:e}=zf(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 Hf(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(),zf(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){const e=await Hf(this,t);if(!e)return this;e.stop(),zf(this).subs.delete(e.tag)}else{const{subs:t}=zf(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 Xf{constructor(e,r=null){super(e,t,r)}}}static from(t,e,r=null){return new this(t,e,r)}}class Yf extends(function(){return Xf}()){}const Zf=" !#$%&'()*+,-./<=>?@[]^_`{|}~",Qf=/^[a-z]*$/i;function td(t,e){let r=97;return t.reduce(((t,n)=>(n===e?r++:n.match(Qf)?t.push(String.fromCharCode(r)+n):(r=97,t.push(n)),t)),[])}function ed(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 td(td(r,";"),":")}(t.substring(1+2*Zf.length),t.substring(1,1+2*Zf.length))}const rd=new T("@ethersproject/wordlists@6.0.0-beta.2");class nd{constructor(t){n(this,{locale:t})}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}}var sd,id,od,ad,cd,ld=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},ud=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 hd extends nd{constructor(t,e,r){super(t),sd.add(this),id.set(this,void 0),od.set(this,void 0),ad.set(this,void 0),ld(this,id,e,"f"),ld(this,od,r,"f"),ld(this,ad,null,"f")}get _data(){return ud(this,id,"f")}_decodeWords(){return ed(ud(this,id,"f"))}getWord(t){const e=ud(this,sd,"m",cd).call(this);return(t<0||t>=e.length)&&rd.throwArgumentError(`invalid word index: ${t}`,"index",t),e[t]}getWordIndex(t){return ud(this,sd,"m",cd).call(this).indexOf(t)}}id=new WeakMap,od=new WeakMap,ad=new WeakMap,sd=new WeakSet,cd=function(){if(null==ud(this,ad,"f")){const t=this._decodeWords();if(Fi(t.join("\n")+"\n")!==ud(this,od,"f"))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);ld(this,ad,t,"f")}return ud(this,ad,"f")};const fd=new class extends hd{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")}},dd=new T("@ethersproject/wallet@6.0.0-beta.8"),pd=Object.freeze({en:fd});var gd,wd=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 hd{constructor(t,e,r,n){super(t,e,n),gd.set(this,void 0),wd(this,gd,r,"f")}get _accent(){return md(this,gd,"f")}_decodeWords(){return function(t,e){let r=ed(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 bd(t){return(1<<t)-1<<8-t&255}function vd(t,e=fd){dd.assertNormalize("NFKD"),null==e&&(e=fd);const r=e.split(t);(r.length%3!=0||r.length<12||r.length>24)&&dd.throwArgumentError("invalid mnemonic length","mnemonic","[ REDACTED ]");const n=le(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&&dd.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=bd(r.length/3);return(le(os(n.slice(0,i/8)))[0]&o)!==(n[n.length-1]&o)&&dd.throwArgumentError("invalid mnemonic checksum","mnemonic","[ REDACTED ]"),pe(n.slice(0,i/8))}function Ed(t,e=fd){(t.length%4||t.length<16||t.length>32)&&dd.throwArgumentError("invalid entropy size","entropy","[ REDACTED ]"),null==e&&(e=fd);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(os(t).substring(2,4),16)&bd(s);return r[r.length-1]<<=s,r[r.length-1]|=i>>8-s,e.join(r.map((t=>e.getWord(t))))}gd=new WeakMap;const Ad={};class kd{constructor(t,e,r,s,i){null==s&&(s=""),null==i&&(i=fd),dd.assertPrivate(t,Ad,"Mnemonic"),n(this,{phrase:r,password:s,wordlist:i,entropy:e})}computeSeed(){const e=ci("mnemonic"+this.password,t.UnicodeNormalizationForm.NFKD);return Un(ci(this.phrase,t.UnicodeNormalizationForm.NFKD),e,2048,64,"sha512")}static fromPhrase(t,e,r){const n=vd(t,r);return t=Ed(dd.getBytes(n),r),new kd(Ad,n,t,e,r)}static fromEntropy(t,e,r){const n=dd.getBytes(t,"entropy"),s=Ed(n,r);return new kd(Ad,pe(n),s,e,r)}static entropyToPhrase(t,e){return Ed(dd.getBytes(t,"entropy"),e)}static phraseToEntropy(t,e){return vd(t,e)}static isValidMnemonic(t,e){try{return vd(t,e),!0}catch(t){}return!1}}var Td,Pd=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},Nd=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 xd extends Lu{constructor(t,e){super(e),Td.set(this,void 0),Pd(this,Td,t,"f");n(this,{address:Nc(this.signingKey.publicKey)})}get signingKey(){return Nd(this,Td,"f")}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new xd(Nd(this,Td,"f"),t)}async signTransaction(t){const r=Object.assign({},t,await e({to:t.to?Bs(t.to,this.provider):void 0,from:t.from?Bs(t.from,this.provider):void 0}));null!=r.from&&(ws(r.from)!==this.address&&dd.throwArgumentError("transaction from address mismatch","tx.from",t.from),delete r.from);const n=qc.from(r);return n.signature=this.signingKey.sign(n.unsignedHash),n.serialized}async signMessage(t){return this.signingKey.sign(zi(t)).serialized}async signTypedData(t,e,r){const n=await yo.resolveNames(t,e,r,(async t=>{if(null==this.provider)return dd.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?dd.throwError("unconfigured ENS name","UNCONFIGURED_NAME",{value:t}):e}));return this.signingKey.sign(yo.hash(n.domain,e,n.value)).serialized}}Td=new WeakMap;var Od,Id,Sd,Rd=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)},Bd=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 Cd="m/44'/60'/0'/0/0",_d=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Fd=2147483648,Ud=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function Ld(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 Dd(t){const e=dd.getBytes(t);return Yt(we([e,ye(os(os(e)),0,4)]))}const Md={};function jd(t,e,r,n){const s=new Uint8Array(37);if(t&Fd){if(null==n)return dd.throwError("cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"});s.set(le(n),1)}else s.set(le(r));for(let e=24;e>=0;e-=8)s[33+(e>>3)]=t>>24-e&255;const i=le(Hr("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function Gd(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>=Fd)throw new Error("invalid path index - "+e);n=n.deriveChild(Fd+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=Fd)throw new Error("invalid path index - "+e);n=n.deriveChild(t)}}}return n}class $d extends xd{constructor(t,e,r,s,i,o,a,c,l){super(e,l),dd.assertPrivate(t,Md,"HDNodeWallet"),n(this,{publicKey:e.compressedPublicKey});n(this,{parentFingerprint:r,fingerprint:ye(Bn(os(this.publicKey)),0,4),chainCode:s,path:i,index:o,depth:a}),n(this,{mnemonic:c})}connect(t){return new $d(Md,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 Dd(we(["0x0488ADE4",Ld(this.depth,1),this.parentFingerprint,Ld(this.index,4),this.chainCode,we(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new zd(Md,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){const e=dd.getNumber(t,"index");if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(2147483647&e),e&Fd&&(r+="'"));const{IR:n,IL:s}=jd(e,this.chainCode,this.publicKey,this.privateKey),i=new kc(kt((Et(s)+BigInt(this.privateKey))%Ud,32));return new $d(Md,i,this.fingerprint,pe(n),r,e,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return Gd(this,t)}static fromSeed(t){return Rd($d,Od,"m",Id).call($d,t,null)}static fromPhrase(t,e="",r=Cd,n=fd){r||(r=Cd);const s=kd.fromPhrase(t,e,n);return Rd($d,Od,"m",Id).call($d,s.computeSeed(),s).derivePath(r)}static fromMnemonic(t,e=Cd){return e||(e=Cd),Rd($d,Od,"m",Id).call($d,t.computeSeed(),t).derivePath(e)}static fromExtendedKey(t){const e=le(Zt(t));82===e.length&&Dd(e.slice(0,78))===t||dd.throwArgumentError("invalid extended key","extendedKey","[ REDACTED ]");const r=e[4],n=pe(e.slice(5,9)),s=parseInt(pe(e.slice(9,13)).substring(2),16),i=pe(e.slice(13,45)),o=e.slice(45,78);switch(pe(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const t=pe(o);return new zd(Md,Nc(t),t,n,i,null,s,r,null)}case"0x0488ade4":case"0x04358394 ":if(0!==o[0])break;return new $d(Md,new kc(o.slice(1)),n,i,null,s,r,null,null)}return dd.throwArgumentError("invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t="",e=Cd,r=fd){e||(e=Cd);const n=kd.fromEntropy(jn(16),t,r);return Rd($d,Od,"m",Id).call($d,n.computeSeed(),n).derivePath(e)}}Od=$d,Id=function(t,e){const r=dd.getBytes(t,"seed");if(r.length<16||r.length>64)throw new Error("invalid seed");const n=le(Hr("sha512",_d,r)),s=new kc(pe(n.slice(0,32)));return new $d(Md,s,"0x00000000",pe(n.slice(32)),"m",0,0,e,null)};class zd extends Du{constructor(t,e,r,s,i,o,a,c,l){super(e,l),dd.assertPrivate(t,Md,"HDNodeVoidWallet"),n(this,{publicKey:r});n(this,{publicKey:r,fingerprint:ye(Bn(os(r)),0,4),parentFingerprint:s,chainCode:i,path:o,index:a,depth:c})}connect(t){return new zd(Md,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 Dd(we(["0x0488B21E",Ld(this.depth,1),this.parentFingerprint,Ld(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(t){const e=dd.getNumber(t,"index");if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(2147483647&e),e&Fd&&(r+="'"));const{IR:n,IL:s}=jd(e,this.chainCode,this.publicKey,null),i=kc._addPoints(s,this.publicKey,!0),o=Nc(i);return new zd(Md,o,i,this.fingerprint,pe(n),r,e,this.depth+1,this.provider)}derivePath(t){return Gd(this,t)}}class Wd{constructor(t,e="",r="m/44'/60'/0'/0",n=fd){Sd.set(this,void 0),Bd(this,Sd,$d.fromPhrase(t,e,r,n),"f")}getSigner(t=0){return Rd(this,Sd,"f").deriveChild(t)}}function Hd(t){const e=dd.getNumber(t,"index");return(e<0||e>=Fd)&&dd.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. */Sd=new WeakMap;var Vd,Kd,Jd,qd=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},Xd=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 Yd={16:10,24:12,32:14},Zd=[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],Qd=[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],tp=[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],ep=[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],rp=[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],np=[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],sp=[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],ip=[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],op=[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],ap=[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],cp=[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],lp=[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],up=[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],hp=[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],fp=[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 dp(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 pp{constructor(t){if(Vd.set(this,void 0),Kd.set(this,void 0),Jd.set(this,void 0),!(this instanceof pp))throw Error("AES must be instanitated with `new`");qd(this,Vd,new Uint8Array(t),"f");const e=Yd[this.key.length];if(null==e)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");qd(this,Jd,[],"f"),qd(this,Kd,[],"f");for(let t=0;t<=e;t++)Xd(this,Jd,"f").push([0,0,0,0]),Xd(this,Kd,"f").push([0,0,0,0]);const r=4*(e+1),n=this.key.length/4,s=dp(this.key);let i;for(let t=0;t<n;t++)i=t>>2,Xd(this,Jd,"f")[i][t%4]=s[t],Xd(this,Kd,"f")[e-i][t%4]=s[t];let o,a=0,c=n;for(;c<r;){if(o=s[n-1],s[0]^=Qd[o>>16&255]<<24^Qd[o>>8&255]<<16^Qd[255&o]<<8^Qd[o>>24&255]^Zd[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]^=Qd[255&o]^Qd[o>>8&255]<<8^Qd[o>>16&255]<<16^Qd[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,Xd(this,Jd,"f")[t][i]=s[l],Xd(this,Kd,"f")[e-t][i]=s[l++],c++}for(let t=1;t<e;t++)for(let e=0;e<4;e++)o=Xd(this,Kd,"f")[t][e],Xd(this,Kd,"f")[t][e]=lp[o>>24&255]^up[o>>16&255]^hp[o>>8&255]^fp[255&o]}get key(){return Xd(this,Vd,"f").slice()}encrypt(t){if(16!=t.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const e=Xd(this,Jd,"f").length-1,r=[0,0,0,0];let n=dp(t);for(let t=0;t<4;t++)n[t]^=Xd(this,Jd,"f")[0][t];for(let t=1;t<e;t++){for(let e=0;e<4;e++)r[e]=ep[n[e]>>24&255]^rp[n[(e+1)%4]>>16&255]^np[n[(e+2)%4]>>8&255]^sp[255&n[(e+3)%4]]^Xd(this,Jd,"f")[t][e];n=r.slice()}const s=new Uint8Array(16);let i=0;for(let t=0;t<4;t++)i=Xd(this,Jd,"f")[e][t],s[4*t]=255&(Qd[n[t]>>24&255]^i>>24),s[4*t+1]=255&(Qd[n[(t+1)%4]>>16&255]^i>>16),s[4*t+2]=255&(Qd[n[(t+2)%4]>>8&255]^i>>8),s[4*t+3]=255&(Qd[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=Xd(this,Kd,"f").length-1,r=[0,0,0,0];let n=dp(t);for(let t=0;t<4;t++)n[t]^=Xd(this,Kd,"f")[0][t];for(let t=1;t<e;t++){for(let e=0;e<4;e++)r[e]=ip[n[e]>>24&255]^op[n[(e+3)%4]>>16&255]^ap[n[(e+2)%4]>>8&255]^cp[255&n[(e+1)%4]]^Xd(this,Kd,"f")[t][e];n=r.slice()}const s=new Uint8Array(16);let i=0;for(let t=0;t<4;t++)i=Xd(this,Kd,"f")[e][t],s[4*t]=255&(tp[n[t]>>24&255]^i>>24),s[4*t+1]=255&(tp[n[(t+3)%4]>>16&255]^i>>16),s[4*t+2]=255&(tp[n[(t+2)%4]>>8&255]^i>>8),s[4*t+3]=255&(tp[255&n[(t+1)%4]]^i);return s}}Vd=new WeakMap,Kd=new WeakMap,Jd=new WeakMap;class gp{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 pp(e)},name:{enumerable:!0,value:t}})}}var wp,mp,yp=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},bp=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 vp extends gp{constructor(t,e){if(super("ECC",t,vp),wp.set(this,void 0),mp.set(this,void 0),e){if(e.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");yp(this,wp,new Uint8Array(e),"f")}else yp(this,wp,new Uint8Array(16),"f");yp(this,mp,this.iv,"f")}get iv(){return new Uint8Array(bp(this,wp,"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++)bp(this,mp,"f")[e]^=t[r+e];yp(this,mp,this.aes.encrypt(bp(this,mp,"f")),"f"),e.set(bp(this,mp,"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]^bp(this,mp,"f")[s],bp(this,mp,"f")[s]=t[r+s]}return e}}wp=new WeakMap,mp=new WeakMap,window&&window.__classPrivateFieldSet,window&&window.__classPrivateFieldGet;var Ep,Ap,kp,Tp=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},Pp=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 Np extends gp{constructor(t,e){super("CTR",t,Np),Ep.set(this,void 0),Ap.set(this,void 0),kp.set(this,void 0),Tp(this,kp,new Uint8Array(16),"f"),Pp(this,kp,"f").fill(0),Tp(this,Ep,Pp(this,kp,"f"),"f"),Tp(this,Ap,16,"f"),null==e&&(e=1),"number"==typeof e?this.setCounterValue(e):this.setCounterBytes(e)}get counter(){return new Uint8Array(Pp(this,kp,"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)Pp(this,kp,"f")[e]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(16!==t.length)throw new TypeError("invalid counter initial Uint8Array value length");Pp(this,kp,"f").set(t)}increment(){for(let t=15;t>=0;t--){if(255!==Pp(this,kp,"f")[t]){Pp(this,kp,"f")[t]++;break}Pp(this,kp,"f")[t]=0}}encrypt(t){var e,r;const n=new Uint8Array(t);for(let t=0;t<n.length;t++)16===Pp(this,Ap,"f")&&(Tp(this,Ep,this.aes.encrypt(Pp(this,kp,"f")),"f"),Tp(this,Ap,0,"f"),this.increment()),n[t]^=Pp(this,Ep,"f")[(Tp(this,Ap,(r=Pp(this,Ap,"f"),e=r++,r),"f"),e)];return n}decrypt(t){return this.encrypt(t)}}function xp(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),le(t)}function Op(e){return"string"==typeof e?ci(e,t.UnicodeNormalizationForm.NFKC):le(e)}function Ip(t,e){const r=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);if(null==r)return dd.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&&dd.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 xp(o);if("array"===s&&Array.isArray(o))return o;if(s===typeof o)return o;dd.throwArgumentError(`wrong type found for ${s} `,"path",n)}return o}function Sp(t){try{if(JSON.parse(t).encseed)return!0}catch(t){}return!1}function Rp(t,e){const r=JSON.parse(t),n=Op(e),s=ws(Ip(r,"ethaddr:string!")),i=xp(Ip(r,"encseed:string!"));i&&i.length%16==0||dd.throwArgumentError("invalid encseed","json",t);const o=le(Un(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))}(le(new vp(o,a).decrypt(c)));let u="";for(let t=0;t<l.length;t++)u+=String.fromCharCode(l[t]);return{address:s,privateKey:Fi(u)}}Ep=new WeakMap,Ap=new WeakMap,kp=new WeakMap,window&&window.__classPrivateFieldSet,window&&window.__classPrivateFieldGet;function Bp(t){try{const e=JSON.parse(t);if(3===(null!=e.version?parseInt(e.version):0))return!0}catch(t){}return!1}function Cp(t,e){const r=dd.getBytes(e),n=Ip(t,"crypto.ciphertext:data!");if(pe(dn(we([r.slice(16,32),n]))).substring(2)!==Ip(t,"crypto.mac:string!").toLowerCase())return dd.throwArgumentError("incorrect password","password","[ REDACTED ]");const s=function(t,e,r){if("aes-128-ctr"===Ip(t,"crypto.cipher:string")){const n=Ip(t,"crypto.cipherparams.iv:data!");return pe(new Np(e,n).decrypt(r))}return dd.throwError("unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(t,r.slice(0,16),n),i=Nc(s);if(t.address){let e=t.address.toLowerCase();"0x"!==e.substring(0,2)&&(e="0x"+e),ws(e)!==i&&dd.throwArgumentError("keystore address/privateKey mismatch","address",t.address)}const o={address:i,privateKey:s};if("0.1"===Ip(t,"x-ethers.version:string")){const e=r.slice(32,64),n=Ip(t,"x-ethers.mnemonicCiphertext:data!"),s=Ip(t,"x-ethers.mnemonicCounter:data!"),i=new Np(e,s);o.mnemonic={path:Ip(t,"x-ethers.path:string")||"m/44'/60'/0'/0/0",locale:Ip(t,"x-ethers.locale:string")||"en",entropy:pe(le(i.decrypt(n)))}}return o}function _p(t){const e=Ip(t,"crypto.kdf:string");if(e&&"string"==typeof e){const r=function(t,e){return dd.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===e.toLowerCase()){const n=Ip(t,"crypto.kdfparams.salt:data!"),s=Ip(t,"crypto.kdfparams.n:int!"),i=Ip(t,"crypto.kdfparams.r:int!"),o=Ip(t,"crypto.kdfparams.p:int!");if(!s||!i||!o)return r("kdf",e);if(0!=(s&s-1))return r("N",s);const a=Ip(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=Ip(t,"crypto.kdfparams.salt:data!"),n=Ip(t,"crypto.kdfparams.prf:string!"),s=n.split("-").pop();if("sha256"!==s&&"sha512"!==s)return r("prf",n);const i=Ip(t,"crypto.kdfparams.c:int!"),o=Ip(t,"crypto.kdfparams.dklen:int!");return 32!==o&&r("dklen",o),{name:"pbkdf2",salt:e,count:i,dkLen:o,algorithm:s}}}return dd.throwArgumentError("unsupported key-derivation function","kdf",e)}function Fp(t){return new Promise((e=>{setTimeout((()=>{e()}),t)}))}var Up,Lp=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},Dp=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 Mp(t){try{if(!t||!se(t.privateKey,32))return null;const e=t.privateKey;return kc.computePublicKey(e)!==t.publicKey?null:new kc(e)}catch(t){console.log(t)}return null}function jp(t){return new Promise((e=>{setTimeout((()=>{e()}),t)}))}class Gp extends xd{constructor(t,e){let r=null,n=null;if("string"==typeof t&&(r=new kc(t)),null==r){const e=function(t){try{if(!t||!t.signingKey)return null;const e=Mp(t.signingKey);return null==e||Nc(e.publicKey)!==t.address||t.mnemonic&&$d.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:$d.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=Mp(t)),null==r&&dd.throwArgumentError("invalid key","key","[ REDACTED ]"),super(r,e),Up.set(this,void 0),Lp(this,Up,n,"f")}get mnemonic(){return Dp(this,Up,"f")}connect(t){return new Gp(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(Bp(t))n=await async function(t,e,r){const n=JSON.parse(t),s=Op(e),i=_p(n);if("pbkdf2"===i.name){r&&(r(0),await Fp(0));const{salt:t,count:e,dkLen:o,algorithm:a}=i,c=Un(s,t,e,o,a);return r&&(r(1),await Fp(0)),Cp(n,c)}if("scrypt"===i.name){const{salt:t,N:e,r:o,p:a,dkLen:c}=i;return Cp(n,await Zn(s,t,e,o,a,c,r))}throw new Error("unreachable")}(t,e,r);else{if(!Sp(t))return dd.throwArgumentError("invalid JSON wallet","json","[ REDACTED ]");r&&(r(0),await jp(0)),n=Rp(t,e),r&&(r(1),await jp(0))}const s=new Gp(n.privateKey);return s.address!==n.address&&dd.throwArgumentError("address/privateKey mismatch","json","[ REDACTED ]"),s}static fromEncryptedJsonSync(t,e){let r=null;if(Bp(t))r=function(t,e){const r=JSON.parse(t),n=Op(e),s=_p(r);if("pbkdf2"===s.name){const{salt:t,count:e,dkLen:i,algorithm:o}=s;return Cp(r,Un(n,t,e,i,o))}if("scrypt"===s.name){const{salt:t,N:e,r:i,p:o,dkLen:a}=s;return Cp(r,Qn(n,t,e,i,o,a))}throw new Error("unreachable")}(t,e);else{if(!Sp(t))return dd.throwArgumentError("invalid JSON wallet","json","[ REDACTED ]");r=Rp(t,e)}const n=new Gp(r.privateKey);return n.address!==r.address&&dd.throwArgumentError("address/privateKey mismatch","json","[ REDACTED ]"),n}static createRandom(t,e,r){return new Gp(kd.fromEntropy(jn(16),e,r),t)}static fromMnemonic(t,e){return new Gp(t,e)}static fromPhrase(t,e,r="",n){return new Gp(kd.fromPhrase(t,r,n),e)}}Up=new WeakMap;const $p="ethers@6.0.0-beta.9";var zp=Object.freeze({__proto__:null,Interface:_o,getAddress:ws,getIcapAddress:ms,getCreateAddress:Os,getCreate2Address:Is,isAddressable:Ss,isAddress:Rs,resolveAddress:Bs,arrayify:le,decodeBase64:he,encodeBase64:fe,isHexString:se,isBytesLike:ie,concat:we,dataLength:me,dataSlice:ye,stripZerosLeft:be,hexlify:pe,quantity:ge,zeroPadBytes:Ae,zeroPadValue:Ee,BaseContract:Xf,Contract:Yf,ContractEventPayload:If,ContractTransactionReceipt:xf,ContractTransactionResponse:Of,EventLog:Nf,computeHmac:Hr,keccak256:dn,ripemd160:Bn,sha256:os,sha512:as,pbkdf2:Un,scrypt:Zn,scryptSync:Qn,randomBytes:jn,lock:cs,messagePrefix:$i,id:Fi,hashMessage:zi,isValidName:Mi,namehash:ji,dnsEncode:Gi,solidityPacked:Ji,solidityPackedKeccak256:qi,solidityPackedSha256:Xi,TypedDataEncoder:yo,isError:u,isCallException:h,Logger:T,formatFixed:jt,parseFixed:Gt,fromTwos:xt,toTwos:Ot,mask:It,toArray:Tt,toBigInt:Et,toHex:kt,toNumber:At,decodeBase58:Zt,encodeBase58:Yt,formatEther:re,parseEther:ne,formatUnits:te,parseUnits:ee,FixedFormat:$t,FixedNumber:zt,defineProperties:n,resolveProperties:e,getStore:c,setStore:l,dummyProvider:ul,getDefaultProvider:vf,showThrottleMessage:Gu,AbstractProvider:Eu,UnmanagedSubscriber:mu,AbstractSigner:Lu,VoidSigner:Du,WrappedSigner:Mu,EnsResolver:ga,Formatter:ml,NetworkPlugin:yl,GasCostPlugin:bl,EnsPlugin:vl,MaxPriorityFeePlugin:El,Network:xl,Block:nl,FeeData:rl,Log:sl,TransactionReceipt:il,TransactionResponse:ol,FallbackProvider:qh,JsonRpcProvider:dh,JsonRpcSigner:hh,StaticJsonRpcProvider:ph,AlchemyProvider:vh,AnkrProvider:yh,CloudflareProvider:Eh,EtherscanProvider:Th,InfuraProvider:Nh,PocketProvider:Ih,IpcSocketProvider:Ef,SocketProvider:gf,WebSocketProvider:bf,encodeRlp:As,decodeRlp:xs,Signature:Oa,SigningKey:kc,formatBytes32String:pi,parseBytes32String:gi,nameprep:Ni,_toEscapedUtf8String:ui,toUtf8Bytes:ci,toUtf8CodePoints:di,toUtf8String:fi,get UnicodeNormalizationForm(){return t.UnicodeNormalizationForm},Utf8ErrorFuncs:oi,get Utf8ErrorReason(){return t.Utf8ErrorReason},accessListify:Pc,computeAddress:Nc,recoverAddress:xc,Transaction:qc,defaultPath:Cd,getAccountPath:Hd,HDNodeWallet:$d,HDNodeVoidWallet:zd,HDNodeWalletManager:Wd,Mnemonic:kd,Wallet:Gp,fetchData:Xo,FetchRequest:Vo,FetchResponse:jo,wordlists:pd,Wordlist:nd,WordlistOwl:hd,WordlistOwlA:yd,version:$p});t.AbstractProvider=Eu,t.AbstractSigner=Lu,t.AlchemyProvider=vh,t.AnkrProvider=yh,t.BaseContract=Xf,t.Block=nl,t.CloudflareProvider=Eh,t.Contract=Yf,t.ContractEventPayload=If,t.ContractTransactionReceipt=xf,t.ContractTransactionResponse=Of,t.EnsPlugin=vl,t.EnsResolver=ga,t.EtherscanProvider=Th,t.EventLog=Nf,t.FallbackProvider=qh,t.FeeData=rl,t.FetchRequest=Vo,t.FetchResponse=jo,t.FixedFormat=$t,t.FixedNumber=zt,t.Formatter=ml,t.GasCostPlugin=bl,t.HDNodeVoidWallet=zd,t.HDNodeWallet=$d,t.HDNodeWalletManager=Wd,t.InfuraProvider=Nh,t.Interface=_o,t.IpcSocketProvider=Ef,t.JsonRpcProvider=dh,t.JsonRpcSigner=hh,t.Log=sl,t.Logger=T,t.MaxPriorityFeePlugin=El,t.Mnemonic=kd,t.Network=xl,t.NetworkPlugin=yl,t.PocketProvider=Ih,t.Signature=Oa,t.SigningKey=kc,t.SocketProvider=gf,t.StaticJsonRpcProvider=ph,t.Transaction=qc,t.TransactionReceipt=il,t.TransactionResponse=ol,t.TypedDataEncoder=yo,t.UnmanagedSubscriber=mu,t.Utf8ErrorFuncs=oi,t.VoidSigner=Du,t.Wallet=Gp,t.WebSocketProvider=bf,t.Wordlist=nd,t.WordlistOwl=hd,t.WordlistOwlA=yd,t.WrappedSigner=Mu,t._toEscapedUtf8String=ui,t.accessListify=Pc,t.arrayify=le,t.computeAddress=Nc,t.computeHmac=Hr,t.concat=we,t.dataLength=me,t.dataSlice=ye,t.decodeBase58=Zt,t.decodeBase64=he,t.decodeRlp=xs,t.defaultPath=Cd,t.defineProperties=n,t.dnsEncode=Gi,t.dummyProvider=ul,t.encodeBase58=Yt,t.encodeBase64=fe,t.encodeRlp=As,t.ethers=zp,t.fetchData=Xo,t.formatBytes32String=pi,t.formatEther=re,t.formatFixed=jt,t.formatUnits=te,t.fromTwos=xt,t.getAccountPath=Hd,t.getAddress=ws,t.getCreate2Address=Is,t.getCreateAddress=Os,t.getDefaultProvider=vf,t.getIcapAddress=ms,t.getStore=c,t.hashMessage=zi,t.hexlify=pe,t.id=Fi,t.isAddress=Rs,t.isAddressable=Ss,t.isBytesLike=ie,t.isCallException=h,t.isError=u,t.isHexString=se,t.isValidName=Mi,t.keccak256=dn,t.lock=cs,t.mask=It,t.messagePrefix=$i,t.namehash=ji,t.nameprep=Ni,t.parseBytes32String=gi,t.parseEther=ne,t.parseFixed=Gt,t.parseUnits=ee,t.pbkdf2=Un,t.quantity=ge,t.randomBytes=jn,t.recoverAddress=xc,t.resolveAddress=Bs,t.resolveProperties=e,t.ripemd160=Bn,t.scrypt=Zn,t.scryptSync=Qn,t.setStore=l,t.sha256=os,t.sha512=as,t.showThrottleMessage=Gu,t.solidityPacked=Ji,t.solidityPackedKeccak256=qi,t.solidityPackedSha256=Xi,t.stripZerosLeft=be,t.toArray=Tt,t.toBigInt=Et,t.toHex=kt,t.toNumber=At,t.toTwos=Ot,t.toUtf8Bytes=ci,t.toUtf8CodePoints=di,t.toUtf8String=fi,t.version=$p,t.wordlists=pd,t.zeroPadBytes=Ae,t.zeroPadValue=Ee,Object.defineProperty(t,"__esModule",{value:!0})}));
|
||
//# sourceMappingURL=ethers.umd.min.js.map
|