@dcl/auth-site 0.1.3-7185275586.commit-45ab7f1 → 0.1.3-7185986421.commit-d3956c6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -66,7 +66,7 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
|
|
|
66
66
|
*
|
|
67
67
|
* @license MIT
|
|
68
68
|
*/const Ele="startTransition",Vk=Noe[Ele];function xle(t){let{basename:e,children:r,future:n,window:i}=t,a=Ze.useRef();a.current==null&&(a.current=Due({window:i,v5Compat:!0}));let s=a.current,[o,c]=Ze.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},f=Ze.useCallback(h=>{u&&Vk?Vk(()=>c(h)):c(h)},[c,u]);return Ze.useLayoutEffect(()=>s.listen(f),[s,f]),Ze.createElement(wle,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:s})}var Gk;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Gk||(Gk={}));var Kk;(function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Kk||(Kk={}));const rK="6.8.0";function Ale(t,e,r){const n=e.split("|").map(a=>a.trim());for(let a=0;a<n.length;a++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=t,i}async function _a(t){const e=Object.keys(t);return(await Promise.all(e.map(n=>Promise.resolve(t[n])))).reduce((n,i,a)=>(n[e[a]]=i,n),{})}function Qt(t,e,r){for(let n in e){let i=e[n];const a=r?r[n]:null;a&&Ale(i,a,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function zp(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(zp).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n<t.length;n++)r+=e[t[n]>>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return zp(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${zp(r)}: ${zp(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function wo(t,e){return t&&t.code===e}function w8(t){return wo(t,"CALL_EXCEPTION")}function Ni(t,e,r){let n=t;{const a=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${zp(r)}`);for(const s in r){if(s==="shortMessage")continue;const o=r[s];a.push(s+"="+zp(o))}}a.push(`code=${e}`),a.push(`version=${rK}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Qt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Qt(i,{shortMessage:n}),i}function it(t,e,r,n){if(!t)throw Ni(e,r,n)}function Ne(t,e,r,n){it(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function nK(t,e,r){r==null&&(r=""),r&&(r=": "+r),it(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),it(t<=e,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Sle=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const r=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(r!==n)throw new Error("broken")}t.push(e)}catch{}return t},[]);function iK(t){it(Sle.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function kf(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),it(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function aK(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a<n.length;a++)n[a]=parseInt(t.substring(i,i+2),16),i+=2;return n}Ne(!1,"invalid BytesLike value",e||"value",t)}function qt(t,e){return aK(t,e,!1)}function Pa(t,e){return aK(t,e,!0)}function ai(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function sK(t){return ai(t,!0)||t instanceof Uint8Array}const Wk="0123456789abcdef";function _t(t){const e=qt(t);let r="0x";for(let n=0;n<e.length;n++){const i=e[n];r+=Wk[(i&240)>>4]+Wk[i&15]}return r}function Bn(t){return"0x"+t.map(e=>_t(e).substring(2)).join("")}function l0(t){return ai(t,!0)?(t.length-2)/2:qt(t).length}function zn(t,e,r){const n=qt(t);return r!=null&&r>n.length&&it(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),_t(n.slice(e??0,r??n.length))}function oK(t,e,r){const n=qt(t);it(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),_t(i)}function bh(t,e){return oK(t,e,!0)}function Ile(t,e){return oK(t,e,!1)}const Px=BigInt(0),ic=BigInt(1),Vp=9007199254740991;function wE(t,e){const r=Tx(t,"value"),n=BigInt(jr(e,"width"));if(it(r>>n===Px,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-ic){const i=(ic<<n)-ic;return-((~r&i)+ic)}return r}function cK(t,e){let r=rr(t,"value");const n=BigInt(jr(e,"width")),i=ic<<n-ic;if(r<Px){r=-r,it(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const a=(ic<<n)-ic;return(~r&a)+ic}else it(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return r}function Ld(t,e){const r=Tx(t,"value"),n=BigInt(jr(e,"bits"));return r&(ic<<n)-ic}function rr(t,e){switch(typeof t){case"bigint":return t;case"number":return Ne(Number.isInteger(t),"underflow",e||"value",t),Ne(t>=-Vp&&t<=Vp,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){Ne(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}Ne(!1,"invalid BigNumberish value",e||"value",t)}function Tx(t,e){const r=rr(t,e);return it(r>=Px,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const Qk="0123456789abcdef";function Zb(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=Qk[r>>4],e+=Qk[r&15];return BigInt(e)}return rr(t)}function jr(t,e){switch(typeof t){case"bigint":return Ne(t>=-Vp&&t<=Vp,"overflow",e||"value",t),Number(t);case"number":return Ne(Number.isInteger(t),"underflow",e||"value",t),Ne(t>=-Vp&&t<=Vp,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return jr(BigInt(t),e)}catch(r){Ne(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}Ne(!1,"invalid numeric value",e||"value",t)}function Ole(t){return jr(Zb(t))}function Zu(t,e){let n=Tx(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=jr(e,"width");for(it(i*2>=n.length,`value exceeds width (${i} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length<i*2;)n="0"+n}return"0x"+n}function gs(t){const e=Tx(t,"value");if(e===Px)return new Uint8Array([]);let r=e.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let i=0;i<n.length;i++){const a=i*2;n[i]=parseInt(r.substring(a,a+2),16)}return n}function Gp(t){let e=_t(sK(t)?t:gs(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const XC="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let Sw=null;function Ple(t){if(Sw==null){Sw={};for(let r=0;r<XC.length;r++)Sw[XC[r]]=BigInt(r)}const e=Sw[t];return Ne(e!=null,"invalid base58 value","letter",t),e}const Tle=BigInt(0),ZC=BigInt(58);function uK(t){let e=Zb(qt(t)),r="";for(;e;)r=XC[Number(e%ZC)]+r,e/=ZC;return r}function Cle(t){let e=Tle;for(let r=0;r<t.length;r++)e*=ZC,e+=Ple(t[r]);return e}function Rle(t){t=atob(t);const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return qt(e)}function Nle(t){const e=qt(t);let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}var E0;class lK{constructor(e,r,n){Be(this,"filter");Be(this,"emitter");Qe(this,E0,void 0);Te(this,E0,r),Qt(this,{emitter:e,filter:n})}async removeListener(){W(this,E0)!=null&&await this.emitter.off(this.filter,W(this,E0))}}E0=new WeakMap;function Dle(t,e,r,n,i){Ne(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function fK(t,e,r,n,i){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let a=0;for(let s=e+1;s<r.length&&r[s]>>6===2;s++)a++;return a}return t==="OVERRUN"?r.length-e-1:0}function Mle(t,e,r,n,i){return t==="OVERLONG"?(Ne(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),fK(t,e,r))}const $le=Object.freeze({error:Dle,ignore:fK,replace:Mle});function kle(t,e){e==null&&(e=$le.error);const r=qt(t,"bytes"),n=[];let i=0;for(;i<r.length;){const a=r[i++];if(!(a>>7)){n.push(a);continue}let s=null,o=null;if((a&224)===192)s=1,o=127;else if((a&240)===224)s=2,o=2047;else if((a&248)===240)s=3,o=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+s>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=a&(1<<8-s-1)-1;for(let u=0;u<s;u++){let f=r[i];if((f&192)!=128){i+=e("MISSING_CONTINUE",i,r,n),c=null;break}c=c<<6|f&63,i++}if(c!==null){if(c>1114111){i+=e("OUT_OF_RANGE",i-1-s,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-s,r,n,c);continue}if(c<=o){i+=e("OVERLONG",i-1-s,r,n,c);continue}n.push(c)}}return n}function Wa(t,e){e!=null&&(iK(e),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const a=t.charCodeAt(n);Ne(n<t.length&&(a&64512)===56320,"invalid surrogate pair","str",t);const s=65536+((i&1023)<<10)+(a&1023);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function Lle(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function _8(t,e){return Lle(kle(t,e))}function dK(t){async function e(r,n){const i=r.url.split(":")[0].toLowerCase();it(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),it(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(n){const h=new AbortController;a=h.signal,n.addListener(()=>{h.abort()})}const s={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:a},o=await fetch(r.url,s),c={};o.headers.forEach((h,m)=>{c[m.toLowerCase()]=h});const u=await o.arrayBuffer(),f=u==null?null:new Uint8Array(u);return{statusCode:o.status,statusMessage:o.statusText,headers:c,body:f}}return e}const jle=12,Ule=250;let Yk=dK();const Fle=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Ble=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let NS=!1;async function hK(t,e){try{const r=t.match(Fle);if(!r)throw new Error("invalid data");return new bf(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?Rle(r[3]):Hle(r[3]))}catch{return new bf(599,"BAD REQUEST (invalid data: URI)",{},null,new Of(t))}}function pK(t){async function e(r,n){try{const i=r.match(Ble);if(!i)throw new Error("invalid link");return new Of(`${t}${i[2]}`)}catch{return new bf(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Of(r))}}return e}const Iw={data:hK,ipfs:pK("https://gateway.ipfs.io/ipfs/")},gK=new WeakMap;var Hd,ql;class qle{constructor(e){Qe(this,Hd,void 0);Qe(this,ql,void 0);Te(this,Hd,[]),Te(this,ql,!1),gK.set(e,()=>{if(!W(this,ql)){Te(this,ql,!0);for(const r of W(this,Hd))setTimeout(()=>{r()},0);Te(this,Hd,[])}})}addListener(e){it(!W(this,ql),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),W(this,Hd).push(e)}get cancelled(){return W(this,ql)}checkSignal(){it(!this.cancelled,"cancelled","CANCELLED",{})}}Hd=new WeakMap,ql=new WeakMap;function Ow(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var x0,A0,Yo,Su,S0,I0,Fi,Cs,Iu,zd,Vd,Gd,Pc,Ou,Hl,Kd,Gy;const nx=class nx{constructor(e){Qe(this,Kd);Qe(this,x0,void 0);Qe(this,A0,void 0);Qe(this,Yo,void 0);Qe(this,Su,void 0);Qe(this,S0,void 0);Qe(this,I0,void 0);Qe(this,Fi,void 0);Qe(this,Cs,void 0);Qe(this,Iu,void 0);Qe(this,zd,void 0);Qe(this,Vd,void 0);Qe(this,Gd,void 0);Qe(this,Pc,void 0);Qe(this,Ou,void 0);Qe(this,Hl,void 0);Te(this,I0,String(e)),Te(this,x0,!1),Te(this,A0,!0),Te(this,Yo,{}),Te(this,Su,""),Te(this,S0,3e5),Te(this,Ou,{slotInterval:Ule,maxAttempts:jle}),Te(this,Hl,null)}get url(){return W(this,I0)}set url(e){Te(this,I0,String(e))}get body(){return W(this,Fi)==null?null:new Uint8Array(W(this,Fi))}set body(e){if(e==null)Te(this,Fi,void 0),Te(this,Cs,void 0);else if(typeof e=="string")Te(this,Fi,Wa(e)),Te(this,Cs,"text/plain");else if(e instanceof Uint8Array)Te(this,Fi,e),Te(this,Cs,"application/octet-stream");else if(typeof e=="object")Te(this,Fi,Wa(JSON.stringify(e))),Te(this,Cs,"application/json");else throw new Error("invalid body")}hasBody(){return W(this,Fi)!=null}get method(){return W(this,Su)?W(this,Su):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),Te(this,Su,String(e).toUpperCase())}get headers(){const e=Object.assign({},W(this,Yo));return W(this,Iu)&&(e.authorization=`Basic ${Nle(Wa(W(this,Iu)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&W(this,Cs)&&(e["content-type"]=W(this,Cs)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){W(this,Yo)[String(e).toLowerCase()]=String(r)}clearHeaders(){Te(this,Yo,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return W(this,Iu)||null}setCredentials(e,r){Ne(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),Te(this,Iu,`${e}:${r}`)}get allowGzip(){return W(this,A0)}set allowGzip(e){Te(this,A0,!!e)}get allowInsecureAuthentication(){return!!W(this,x0)}set allowInsecureAuthentication(e){Te(this,x0,!!e)}get timeout(){return W(this,S0)}set timeout(e){Ne(e>=0,"timeout must be non-zero","timeout",e),Te(this,S0,e)}get preflightFunc(){return W(this,zd)||null}set preflightFunc(e){Te(this,zd,e)}get processFunc(){return W(this,Vd)||null}set processFunc(e){Te(this,Vd,e)}get retryFunc(){return W(this,Gd)||null}set retryFunc(e){Te(this,Gd,e)}get getUrlFunc(){return W(this,Hl)||Yk}set getUrlFunc(e){Te(this,Hl,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${W(this,Fi)?_t(W(this,Fi)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(W(this,Ou).slotInterval=e.slotInterval),e.maxAttempts!=null&&(W(this,Ou).maxAttempts=e.maxAttempts)}send(){return it(W(this,Pc)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),Te(this,Pc,new qle(this)),ct(this,Kd,Gy).call(this,0,Jk()+this.timeout,0,this,new bf(0,"",{},null,this))}cancel(){it(W(this,Pc)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=gK.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();it(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new nx(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,Te(i,Yo,Object.assign({},W(this,Yo))),W(this,Fi)&&Te(i,Fi,new Uint8Array(W(this,Fi))),Te(i,Cs,W(this,Cs)),i}clone(){const e=new nx(this.url);return Te(e,Su,W(this,Su)),W(this,Fi)&&Te(e,Fi,W(this,Fi)),Te(e,Cs,W(this,Cs)),Te(e,Yo,Object.assign({},W(this,Yo))),Te(e,Iu,W(this,Iu)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),Te(e,zd,W(this,zd)),Te(e,Vd,W(this,Vd)),Te(e,Gd,W(this,Gd)),Te(e,Hl,W(this,Hl)),e}static lockConfig(){NS=!0}static getGateway(e){return Iw[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(NS)throw new Error("gateways locked");Iw[e]=r}static registerGetUrl(e){if(NS)throw new Error("gateways locked");Yk=e}static createGetUrlFunc(e){return dK()}static createDataGateway(){return hK}static createIpfsGatewayFunc(e){return pK(e)}};x0=new WeakMap,A0=new WeakMap,Yo=new WeakMap,Su=new WeakMap,S0=new WeakMap,I0=new WeakMap,Fi=new WeakMap,Cs=new WeakMap,Iu=new WeakMap,zd=new WeakMap,Vd=new WeakMap,Gd=new WeakMap,Pc=new WeakMap,Ou=new WeakMap,Hl=new WeakMap,Kd=new WeakSet,Gy=async function(e,r,n,i,a){var f,h,m;if(e>=W(this,Ou).maxAttempts)return a.makeServerError("exceeded maximum retry limit");it(Jk()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await zle(n);let s=this.clone();const o=(s.url.split(":")[0]||"").toLowerCase();if(o in Iw){const y=await Iw[o](s.url,Ow(W(i,Pc)));if(y instanceof bf){let w=y;if(this.processFunc){Ow(W(i,Pc));try{w=await this.processFunc(s,w)}catch(v){(v.throttle==null||typeof v.stall!="number")&&w.makeServerError("error in post-processing function",v).assertOk()}}return w}s=y}this.preflightFunc&&(s=await this.preflightFunc(s));const c=await this.getUrlFunc(s,Ow(W(i,Pc)));let u=new bf(c.statusCode,c.statusMessage,c.headers,c.body,i);if(u.statusCode===301||u.statusCode===302){try{const y=u.headers.location||"";return ct(f=s.redirect(y),Kd,Gy).call(f,e+1,r,0,i,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(s,u,e))){const y=u.headers["retry-after"];let w=W(this,Ou).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof y=="string"&&y.match(/^[1-9][0-9]*$/)&&(w=parseInt(y)),ct(h=s.clone(),Kd,Gy).call(h,e+1,r,w,i,u)}if(this.processFunc){Ow(W(i,Pc));try{u=await this.processFunc(s,u)}catch(y){(y.throttle==null||typeof y.stall!="number")&&u.makeServerError("error in post-processing function",y).assertOk();let w=W(this,Ou).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return y.stall>=0&&(w=y.stall),ct(m=s.clone(),Kd,Gy).call(m,e+1,r,w,i,u)}}return u};let Of=nx;var _b,Eb,xb,Jo,O0,Wd;const TD=class TD{constructor(e,r,n,i,a){Qe(this,_b,void 0);Qe(this,Eb,void 0);Qe(this,xb,void 0);Qe(this,Jo,void 0);Qe(this,O0,void 0);Qe(this,Wd,void 0);Te(this,_b,e),Te(this,Eb,r),Te(this,xb,Object.keys(n).reduce((s,o)=>(s[o.toLowerCase()]=String(n[o]),s),{})),Te(this,Jo,i==null?null:new Uint8Array(i)),Te(this,O0,a||null),Te(this,Wd,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${W(this,Jo)?_t(W(this,Jo)):"null"}>`}get statusCode(){return W(this,_b)}get statusMessage(){return W(this,Eb)}get headers(){return Object.assign({},W(this,xb))}get body(){return W(this,Jo)==null?null:new Uint8Array(W(this,Jo))}get bodyText(){try{return W(this,Jo)==null?"":_8(W(this,Jo))}catch{it(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{it(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,r){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new TD(599,n,this.headers,this.body,W(this,O0)||void 0);return Te(i,Wd,{message:e,error:r}),i}throwThrottleError(e,r){r==null?r=-1:Ne(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Qt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return W(this,Jo)!=null}get request(){return W(this,O0)}ok(){return W(this,Wd).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=W(this,Wd);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),it(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r})}};_b=new WeakMap,Eb=new WeakMap,xb=new WeakMap,Jo=new WeakMap,O0=new WeakMap,Wd=new WeakMap;let bf=TD;function Jk(){return new Date().getTime()}function Hle(t){return Wa(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function zle(t){return new Promise(e=>setTimeout(e,t))}const Vle=BigInt(-1),zo=BigInt(0),Kp=BigInt(1),Gle=BigInt(5),gp={};let f0="0000";for(;f0.length<80;)f0+=f0;function dd(t){let e=f0;for(;e.length<t;)e+=e;return BigInt("1"+e.substring(0,t))}function $m(t,e,r){const n=BigInt(e.width);if(e.signed){const i=Kp<<n-Kp;it(r==null||t>=-i&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t>zo?t=wE(Ld(t,n),n):t=-wE(Ld(-t,n),n)}else{const i=Kp<<n;it(r==null||t>=0&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t=(t%i+i)%i&i-Kp}return t}function DS(t){typeof t=="number"&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")e=!1;else{const a=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Ne(a,"invalid fixed format","format",t),e=a[1]!=="u",r=parseInt(a[2]),n=parseInt(a[3])}}else if(t){const a=t,s=(o,c,u)=>a[o]==null?u:(Ne(typeof a[o]===c,"invalid fixed format ("+o+" not "+c+")","format."+o,a[o]),a[o]);e=s("signed","boolean",e),r=s("width","number",r),n=s("decimals","number",n)}Ne(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),Ne(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function Kle(t,e){let r="";t<zo&&(r="-",t*=Vle);let n=t.toString();if(e===0)return r+n;for(;n.length<=e;)n=f0+n;const i=n.length-e;for(n=n.substring(0,i)+"."+n.substring(i);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return r+n}var Xo,Pn,ja,Pu,Ad,Zo,vu,Ab,tR,Sb,rR,Ib,nR,Ob,iR;const Ul=class Ul{constructor(e,r,n){Qe(this,Pu);Qe(this,Zo);Qe(this,Ab);Qe(this,Sb);Qe(this,Ib);Qe(this,Ob);Be(this,"format");Qe(this,Xo,void 0);Qe(this,Pn,void 0);Qe(this,ja,void 0);Be(this,"_value");kf(e,gp,"FixedNumber"),Te(this,Pn,r),Te(this,Xo,n);const i=Kle(r,n.decimals);Qt(this,{format:n.name,_value:i}),Te(this,ja,dd(n.decimals))}get signed(){return W(this,Xo).signed}get width(){return W(this,Xo).width}get decimals(){return W(this,Xo).decimals}get value(){return W(this,Pn)}addUnsafe(e){return ct(this,Ab,tR).call(this,e)}add(e){return ct(this,Ab,tR).call(this,e,"add")}subUnsafe(e){return ct(this,Sb,rR).call(this,e)}sub(e){return ct(this,Sb,rR).call(this,e,"sub")}mulUnsafe(e){return ct(this,Ib,nR).call(this,e)}mul(e){return ct(this,Ib,nR).call(this,e,"mul")}mulSignal(e){ct(this,Pu,Ad).call(this,e);const r=W(this,Pn)*W(e,Pn);return it(r%W(this,ja)===zo,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),ct(this,Zo,vu).call(this,r/W(this,ja),"mulSignal")}divUnsafe(e){return ct(this,Ob,iR).call(this,e)}div(e){return ct(this,Ob,iR).call(this,e,"div")}divSignal(e){it(W(e,Pn)!==zo,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),ct(this,Pu,Ad).call(this,e);const r=W(this,Pn)*W(this,ja);return it(r%W(e,Pn)===zo,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),ct(this,Zo,vu).call(this,r/W(e,Pn),"divSignal")}cmp(e){let r=this.value,n=e.value;const i=this.decimals-e.decimals;return i>0?n*=dd(i):i<0&&(r*=dd(-i)),r<n?-1:r>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=W(this,Pn);return W(this,Pn)<zo&&(e-=W(this,ja)-Kp),e=W(this,Pn)/W(this,ja)*W(this,ja),ct(this,Zo,vu).call(this,e,"floor")}ceiling(){let e=W(this,Pn);return W(this,Pn)>zo&&(e+=W(this,ja)-Kp),e=W(this,Pn)/W(this,ja)*W(this,ja),ct(this,Zo,vu).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=Gle*dd(r-1);let i=this.value+n;const a=dd(r);return i=i/a*a,$m(i,W(this,Xo),"round"),new Ul(gp,i,W(this,Xo))}isZero(){return W(this,Pn)===zo}isNegative(){return W(this,Pn)<zo}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Ul.fromString(this.toString(),e)}static fromValue(e,r,n){const i=r==null?0:jr(r),a=DS(n);let s=rr(e,"value");const o=i-a.decimals;if(o>0){const c=dd(o);it(s%c===zo,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=c}else o<0&&(s*=dd(-o));return $m(s,a,"fromValue"),new Ul(gp,s,a)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);Ne(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=DS(r);let a=n[2]||"0",s=n[3]||"";for(;s.length<i.decimals;)s+=f0;it(s.substring(i.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),s=s.substring(0,i.decimals);const o=BigInt(n[1]+a+s);return $m(o,i,"fromString"),new Ul(gp,o,i)}static fromBytes(e,r){let n=Zb(qt(e,"value"));const i=DS(r);return i.signed&&(n=wE(n,i.width)),$m(n,i,"fromBytes"),new Ul(gp,n,i)}};Xo=new WeakMap,Pn=new WeakMap,ja=new WeakMap,Pu=new WeakSet,Ad=function(e){Ne(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)},Zo=new WeakSet,vu=function(e,r){return e=$m(e,W(this,Xo),r),new Ul(gp,e,W(this,Xo))},Ab=new WeakSet,tR=function(e,r){return ct(this,Pu,Ad).call(this,e),ct(this,Zo,vu).call(this,W(this,Pn)+W(e,Pn),r)},Sb=new WeakSet,rR=function(e,r){return ct(this,Pu,Ad).call(this,e),ct(this,Zo,vu).call(this,W(this,Pn)-W(e,Pn),r)},Ib=new WeakSet,nR=function(e,r){return ct(this,Pu,Ad).call(this,e),ct(this,Zo,vu).call(this,W(this,Pn)*W(e,Pn)/W(this,ja),r)},Ob=new WeakSet,iR=function(e,r){return it(W(e,Pn)!==zo,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),ct(this,Pu,Ad).call(this,e),ct(this,Zo,vu).call(this,W(this,Pn)*W(this,ja)/W(e,Pn),r)};let eR=Ul;function Wle(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Xk(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function Zk(t,e,r,n){const i=[];for(;r<e+1+n;){const a=mK(t,r);i.push(a.result),r+=a.consumed,it(r<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:i}}function mK(t,e){it(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=n=>{it(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=Xk(t,e+1,n);return r(e+1+n+i),Zk(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),Zk(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=Xk(t,e+1,n);r(e+1+n+i);const a=_t(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:a}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=_t(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:Wle(t[e])}}function E8(t){const e=qt(t,"data"),r=mK(e,0);return Ne(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function e9(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function yK(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(a){n=n.concat(yK(a))}),n.length<=55)return n.unshift(192+n.length),n;const i=e9(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(qt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=e9(e.length);return r.unshift(183+r.length),r.concat(e)}const t9="0123456789abcdef";function Jv(t){let e="0x";for(const r of yK(t))e+=t9[r>>4],e+=t9[r&15];return e}const Qle=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Yle(t,e){let r=18;if(typeof e=="string"){const n=Qle.indexOf(e);Ne(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=jr(e,"unit"));return eR.fromValue(t,r,{decimals:r,width:512}).toString()}function Jle(t){return Yle(t,18)}function Xle(t){const e=qt(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=_t(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const Va=32,aR=new Uint8Array(Va),Zle=["then"],Pw={};function km(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}var zl;const Dv=class Dv extends Array{constructor(...r){const n=r[0];let i=r[1],a=(r[2]||[]).slice(),s=!0;n!==Pw&&(i=r,a=[],s=!1);super(i.length);Qe(this,zl,void 0);i.forEach((c,u)=>{this[u]=c});const o=a.reduce((c,u)=>(typeof u=="string"&&c.set(u,(c.get(u)||0)+1),c),new Map);if(Te(this,zl,Object.freeze(i.map((c,u)=>{const f=a[u];return f!=null&&o.get(f)===1?f:null}))),!!s)return Object.freeze(this),new Proxy(this,{get:(c,u,f)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const m=jr(u,"%index");if(m<0||m>=this.length)throw new RangeError("out of result range");const y=c[m];return y instanceof Error&&km(`index ${m}`,y),y}if(Zle.indexOf(u)>=0)return Reflect.get(c,u,f);const h=c[u];if(h instanceof Function)return function(...m){return h.apply(this===f?c:this,m)};if(!(u in c))return c.getValue.apply(this===f?c:this,[u])}return Reflect.get(c,u,f)}})}toArray(){const r=[];return this.forEach((n,i)=>{n instanceof Error&&km(`index ${i}`,n),r.push(n)}),r}toObject(){return W(this,zl).reduce((r,n,i)=>(it(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in r||(r[n]=this.getValue(n)),r),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=[],a=[];for(let s=r;s<n;s++)i.push(this[s]),a.push(W(this,zl)[s]);return new Dv(Pw,i,a)}filter(r,n){const i=[],a=[];for(let s=0;s<this.length;s++){const o=this[s];o instanceof Error&&km(`index ${s}`,o),r.call(n,o,s,this)&&(i.push(o),a.push(W(this,zl)[s]))}return new Dv(Pw,i,a)}map(r,n){const i=[];for(let a=0;a<this.length;a++){const s=this[a];s instanceof Error&&km(`index ${a}`,s),i.push(r.call(n,s,a,this))}return i}getValue(r){const n=W(this,zl).indexOf(r);if(n===-1)return;const i=this[n];return i instanceof Error&&km(`property ${JSON.stringify(r)}`,i.error),i}static fromItems(r,n){return new Dv(Pw,r,n)}};zl=new WeakMap;let _E=Dv;function r9(t){let e=gs(t);return it(e.length<=Va,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Va,offset:e.length}),e.length!==Va&&(e=Pa(Bn([aR.slice(e.length%Va),e]))),e}class al{constructor(e,r,n,i){Be(this,"name");Be(this,"type");Be(this,"localName");Be(this,"dynamic");Qt(this,{name:e,type:r,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,r){Ne(!1,e,this.localName,r)}}var Tu,Qd,P0,__;class sR{constructor(){Qe(this,P0);Qe(this,Tu,void 0);Qe(this,Qd,void 0);Te(this,Tu,[]),Te(this,Qd,0)}get data(){return Bn(W(this,Tu))}get length(){return W(this,Qd)}appendWriter(e){return ct(this,P0,__).call(this,Pa(e.data))}writeBytes(e){let r=Pa(e);const n=r.length%Va;return n&&(r=Pa(Bn([r,aR.slice(n)]))),ct(this,P0,__).call(this,r)}writeValue(e){return ct(this,P0,__).call(this,r9(e))}writeUpdatableValue(){const e=W(this,Tu).length;return W(this,Tu).push(aR),Te(this,Qd,W(this,Qd)+Va),r=>{W(this,Tu)[e]=r9(r)}}}Tu=new WeakMap,Qd=new WeakMap,P0=new WeakSet,__=function(e){return W(this,Tu).push(e),Te(this,Qd,W(this,Qd)+e.length),e.length};var Rs,lo,ix,vK;const CD=class CD{constructor(e,r){Qe(this,ix);Be(this,"allowLoose");Qe(this,Rs,void 0);Qe(this,lo,void 0);Qt(this,{allowLoose:!!r}),Te(this,Rs,Pa(e)),Te(this,lo,0)}get data(){return _t(W(this,Rs))}get dataLength(){return W(this,Rs).length}get consumed(){return W(this,lo)}get bytes(){return new Uint8Array(W(this,Rs))}subReader(e){return new CD(W(this,Rs).slice(W(this,lo)+e),this.allowLoose)}readBytes(e,r){let n=ct(this,ix,vK).call(this,0,e,!!r);return Te(this,lo,W(this,lo)+n.length),n.slice(0,e)}readValue(){return Zb(this.readBytes(Va))}readIndex(){return Ole(this.readBytes(Va))}};Rs=new WeakMap,lo=new WeakMap,ix=new WeakSet,vK=function(e,r,n){let i=Math.ceil(r/Va)*Va;return W(this,lo)+i>W(this,Rs).length&&(this.allowLoose&&n&&W(this,lo)+r<=W(this,Rs).length?i=r:it(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Pa(W(this,Rs)),length:W(this,Rs).length,offset:W(this,lo)+i})),W(this,Rs).slice(W(this,lo),W(this,lo)+i)};let oR=CD;function Ds(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function x8(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function bK(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ds(t.outputLen),Ds(t.blockLen)}function pg(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function wK(t,e){x8(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const MS=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _K=t=>t instanceof Uint8Array,E_=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),x_=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),_c=(t,e)=>t<<32-e|t>>>e,efe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!efe)throw new Error("Non little-endian hardware is not supported");const tfe=async()=>{};async function n9(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);const a=Date.now()-n;a>=0&&a<e||(await tfe(),n+=a)}}function rfe(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function gg(t){if(typeof t=="string"&&(t=rfe(t)),!_K(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function nfe(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!_K(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class A8{clone(){return this._cloneInto()}}const ife={}.toString;function EK(t,e){if(e!==void 0&&ife.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function Cx(t){const e=n=>t().update(gg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function afe(t=32){if(MS&&typeof MS.getRandomValues=="function")return MS.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}let xK=class extends A8{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,bK(e);const n=gg(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let s=0;s<a.length;s++)a[s]^=54;this.iHash.update(a),this.oHash=e.create();for(let s=0;s<a.length;s++)a[s]^=106;this.oHash.update(a),a.fill(0)}update(e){return pg(this),this.iHash.update(e),this}digestInto(e){pg(this),x8(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:a,blockLen:s,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=a,e.blockLen=s,e.outputLen=o,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const Rx=(t,e,r)=>new xK(t,e).update(r).digest();Rx.create=(t,e)=>new xK(t,e);function sfe(t,e,r,n){bK(t);const i=EK({dkLen:32,asyncTick:10},n),{c:a,dkLen:s,asyncTick:o}=i;if(Ds(a),Ds(s),Ds(o),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=gg(e),u=gg(r),f=new Uint8Array(s),h=Rx.create(t,c),m=h._cloneInto().update(u);return{c:a,dkLen:s,asyncTick:o,DK:f,PRF:h,PRFSalt:m}}function ofe(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function S8(t,e,r,n){const{c:i,dkLen:a,DK:s,PRF:o,PRFSalt:c}=sfe(t,e,r,n);let u;const f=new Uint8Array(4),h=x_(f),m=new Uint8Array(o.outputLen);for(let y=1,w=0;w<a;y++,w+=o.outputLen){const v=s.subarray(w,w+o.outputLen);h.setInt32(0,y,!1),(u=c._cloneInto(u)).update(f).digestInto(m),v.set(m.subarray(0,v.length));for(let g=1;g<i;g++){o._cloneInto(u).update(m).digestInto(m);for(let _=0;_<v.length;_++)v[_]^=m[_]}}return ofe(o,c,s,u,m)}function cfe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),c=n?4:0,u=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+u,o,n)}let I8=class extends A8{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=x_(this.buffer)}update(e){pg(this);const{view:r,buffer:n,blockLen:i}=this;e=gg(e);const a=e.length;for(let s=0;s<a;){const o=Math.min(i-this.pos,a-s);if(o===i){const c=x_(e);for(;i<=a-s;s+=i)this.process(c,s);continue}n.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){pg(this),wK(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:a}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let h=s;h<i;h++)r[h]=0;cfe(n,i-8,BigInt(this.length*8),a),this.process(n,0);const o=x_(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)o.setUint32(4*h,f[h],a)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:a,destroyed:s,pos:o}=this;return e.length=i,e.pos=o,e.finished=a,e.destroyed=s,i%r&&e.buffer.set(n),e}};const ufe=(t,e,r)=>t&e^~t&r,lfe=(t,e,r)=>t&e^t&r^e&r,ffe=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]),Sl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Il=new Uint32Array(64);let dfe=class extends I8{constructor(){super(64,32,8,!1),this.A=Sl[0]|0,this.B=Sl[1]|0,this.C=Sl[2]|0,this.D=Sl[3]|0,this.E=Sl[4]|0,this.F=Sl[5]|0,this.G=Sl[6]|0,this.H=Sl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:a,F:s,G:o,H:c}=this;return[e,r,n,i,a,s,o,c]}set(e,r,n,i,a,s,o,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=a|0,this.F=s|0,this.G=o|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Il[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){const m=Il[h-15],y=Il[h-2],w=_c(m,7)^_c(m,18)^m>>>3,v=_c(y,17)^_c(y,19)^y>>>10;Il[h]=v+Il[h-7]+w+Il[h-16]|0}let{A:n,B:i,C:a,D:s,E:o,F:c,G:u,H:f}=this;for(let h=0;h<64;h++){const m=_c(o,6)^_c(o,11)^_c(o,25),y=f+m+ufe(o,c,u)+ffe[h]+Il[h]|0,v=(_c(n,2)^_c(n,13)^_c(n,22))+lfe(n,i,a)|0;f=u,u=c,c=o,o=s+y|0,s=a,a=i,i=n,n=y+v|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,a,s,o,c,u,f)}roundClean(){Il.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Vg=Cx(()=>new dfe),Tw=BigInt(2**32-1),cR=BigInt(32);function AK(t,e=!1){return e?{h:Number(t&Tw),l:Number(t>>cR&Tw)}:{h:Number(t>>cR&Tw)|0,l:Number(t&Tw)|0}}function SK(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:a,l:s}=AK(t[i],e);[r[i],n[i]]=[a,s]}return[r,n]}const hfe=(t,e)=>BigInt(t>>>0)<<cR|BigInt(e>>>0),pfe=(t,e,r)=>t>>>r,gfe=(t,e,r)=>t<<32-r|e>>>r,mfe=(t,e,r)=>t>>>r|e<<32-r,yfe=(t,e,r)=>t<<32-r|e>>>r,vfe=(t,e,r)=>t<<64-r|e>>>r-32,bfe=(t,e,r)=>t>>>r-32|e<<64-r,wfe=(t,e)=>e,_fe=(t,e)=>t,IK=(t,e,r)=>t<<r|e>>>32-r,OK=(t,e,r)=>e<<r|t>>>32-r,PK=(t,e,r)=>e<<r-32|t>>>64-r,TK=(t,e,r)=>t<<r-32|e>>>64-r;function Efe(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const xfe=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Afe=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Sfe=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Ife=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Ofe=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Pfe=(t,e,r,n,i,a)=>e+r+n+i+a+(t/2**32|0)|0,Tfe={fromBig:AK,split:SK,toBig:hfe,shrSH:pfe,shrSL:gfe,rotrSH:mfe,rotrSL:yfe,rotrBH:vfe,rotrBL:bfe,rotr32H:wfe,rotr32L:_fe,rotlSH:IK,rotlSL:OK,rotlBH:PK,rotlBL:TK,add:Efe,add3L:xfe,add3H:Afe,add4L:Sfe,add4H:Ife,add5H:Pfe,add5L:Ofe},Hr=Tfe,[Cfe,Rfe]=(()=>Hr.split(["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))))(),Ol=new Uint32Array(80),Pl=new Uint32Array(80);class Nfe extends I8{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:e,Al:r,Bh:n,Bl:i,Ch:a,Cl:s,Dh:o,Dl:c,Eh:u,El:f,Fh:h,Fl:m,Gh:y,Gl:w,Hh:v,Hl:g}=this;return[e,r,n,i,a,s,o,c,u,f,h,m,y,w,v,g]}set(e,r,n,i,a,s,o,c,u,f,h,m,y,w,v,g){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=a|0,this.Cl=s|0,this.Dh=o|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=h|0,this.Fl=m|0,this.Gh=y|0,this.Gl=w|0,this.Hh=v|0,this.Hl=g|0}process(e,r){for(let S=0;S<16;S++,r+=4)Ol[S]=e.getUint32(r),Pl[S]=e.getUint32(r+=4);for(let S=16;S<80;S++){const A=Ol[S-15]|0,I=Pl[S-15]|0,E=Hr.rotrSH(A,I,1)^Hr.rotrSH(A,I,8)^Hr.shrSH(A,I,7),p=Hr.rotrSL(A,I,1)^Hr.rotrSL(A,I,8)^Hr.shrSL(A,I,7),O=Ol[S-2]|0,N=Pl[S-2]|0,F=Hr.rotrSH(O,N,19)^Hr.rotrBH(O,N,61)^Hr.shrSH(O,N,6),V=Hr.rotrSL(O,N,19)^Hr.rotrBL(O,N,61)^Hr.shrSL(O,N,6),de=Hr.add4L(p,V,Pl[S-7],Pl[S-16]),ve=Hr.add4H(de,E,F,Ol[S-7],Ol[S-16]);Ol[S]=ve|0,Pl[S]=de|0}let{Ah:n,Al:i,Bh:a,Bl:s,Ch:o,Cl:c,Dh:u,Dl:f,Eh:h,El:m,Fh:y,Fl:w,Gh:v,Gl:g,Hh:_,Hl:b}=this;for(let S=0;S<80;S++){const A=Hr.rotrSH(h,m,14)^Hr.rotrSH(h,m,18)^Hr.rotrBH(h,m,41),I=Hr.rotrSL(h,m,14)^Hr.rotrSL(h,m,18)^Hr.rotrBL(h,m,41),E=h&y^~h&v,p=m&w^~m&g,O=Hr.add5L(b,I,p,Rfe[S],Pl[S]),N=Hr.add5H(O,_,A,E,Cfe[S],Ol[S]),F=O|0,V=Hr.rotrSH(n,i,28)^Hr.rotrBH(n,i,34)^Hr.rotrBH(n,i,39),de=Hr.rotrSL(n,i,28)^Hr.rotrBL(n,i,34)^Hr.rotrBL(n,i,39),ve=n&a^n&o^a&o,U=i&s^i&c^s&c;_=v|0,b=g|0,v=y|0,g=w|0,y=h|0,w=m|0,{h,l:m}=Hr.add(u|0,f|0,N|0,F|0),u=o|0,f=c|0,o=a|0,c=s|0,a=n|0,s=i|0;const L=Hr.add3L(F,de,U);n=Hr.add3H(L,N,V,ve),i=L|0}({h:n,l:i}=Hr.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:a,l:s}=Hr.add(this.Bh|0,this.Bl|0,a|0,s|0),{h:o,l:c}=Hr.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:u,l:f}=Hr.add(this.Dh|0,this.Dl|0,u|0,f|0),{h,l:m}=Hr.add(this.Eh|0,this.El|0,h|0,m|0),{h:y,l:w}=Hr.add(this.Fh|0,this.Fl|0,y|0,w|0),{h:v,l:g}=Hr.add(this.Gh|0,this.Gl|0,v|0,g|0),{h:_,l:b}=Hr.add(this.Hh|0,this.Hl|0,_|0,b|0),this.set(n,i,a,s,o,c,u,f,h,m,y,w,v,g,_,b)}roundClean(){Ol.fill(0),Pl.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)}}const O8=Cx(()=>new Nfe);function Dfe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const i9=Dfe(),a9=i9.crypto||i9.msCrypto;function Mfe(t){switch(t){case"sha256":return Vg.create();case"sha512":return O8.create()}Ne(!1,"invalid hashing algorithm name","algorithm",t)}function $fe(t,e){const r={sha256:Vg,sha512:O8}[t];return Ne(r!=null,"invalid hmac algorithm","algorithm",t),Rx.create(r,e)}function kfe(t,e,r,n,i){const a={sha256:Vg,sha512:O8}[i];return Ne(a!=null,"invalid pbkdf2 algorithm","algorithm",i),S8(a,t,e,{c:r,dkLen:n})}function Lfe(t){it(a9!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),Ne(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return a9.getRandomValues(e),e}let CK=!1;const RK=function(t,e,r){return $fe(t,e).update(r).digest()};let NK=RK;function Gg(t,e,r){const n=qt(e,"key"),i=qt(r,"data");return _t(NK(t,n,i))}Gg._=RK;Gg.lock=function(){CK=!0};Gg.register=function(t){if(CK)throw new Error("computeHmac is locked");NK=t};Object.freeze(Gg);const[DK,MK,$K]=[[],[],[]],jfe=BigInt(0),Lm=BigInt(1),Ufe=BigInt(2),Ffe=BigInt(7),Bfe=BigInt(256),qfe=BigInt(113);for(let t=0,e=Lm,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],DK.push(2*(5*n+r)),MK.push((t+1)*(t+2)/2%64);let i=jfe;for(let a=0;a<7;a++)e=(e<<Lm^(e>>Ffe)*qfe)%Bfe,e&Ufe&&(i^=Lm<<(Lm<<BigInt(a))-Lm);$K.push(i)}const[Hfe,zfe]=SK($K,!0),s9=(t,e,r)=>r>32?PK(t,e,r):IK(t,e,r),o9=(t,e,r)=>r>32?TK(t,e,r):OK(t,e,r);function Vfe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const o=(s+8)%10,c=(s+2)%10,u=r[c],f=r[c+1],h=s9(u,f,1)^r[o],m=o9(u,f,1)^r[o+1];for(let y=0;y<50;y+=10)t[s+y]^=h,t[s+y+1]^=m}let i=t[2],a=t[3];for(let s=0;s<24;s++){const o=MK[s],c=s9(i,a,o),u=o9(i,a,o),f=DK[s];i=t[f],a=t[f+1],t[f]=c,t[f+1]=u}for(let s=0;s<50;s+=10){for(let o=0;o<10;o++)r[o]=t[s+o];for(let o=0;o<10;o++)t[s+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=Hfe[n],t[1]^=zfe[n]}r.fill(0)}class P8 extends A8{constructor(e,r,n,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ds(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=E_(this.state)}keccak(){Vfe(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){pg(this);const{blockLen:r,state:n}=this;e=gg(e);const i=e.length;for(let a=0;a<i;){const s=Math.min(r-this.pos,i-a);for(let o=0;o<s;o++)n[this.pos++]^=e[a++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){pg(this,!1),x8(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,a=e.length;i<a;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,a-i);e.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ds(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(wK(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:a,enableXOF:s}=this;return e||(e=new P8(r,n,i,s,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}}const Gfe=(t,e,r)=>Cx(()=>new P8(e,t,r)),Kfe=Gfe(1,136,256/8);let kK=!1;const LK=function(t){return Kfe(t)};let jK=LK;function Fn(t){const e=qt(t,"data");return _t(jK(e))}Fn._=LK;Fn.lock=function(){kK=!0};Fn.register=function(t){if(kK)throw new TypeError("keccak256 is locked");jK=t};Object.freeze(Fn);const Wfe=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),UK=Uint8Array.from({length:16},(t,e)=>e),Qfe=UK.map(t=>(9*t+5)%16);let T8=[UK],C8=[Qfe];for(let t=0;t<4;t++)for(let e of[T8,C8])e.push(e[t].map(r=>Wfe[r]));const FK=[[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)),Yfe=T8.map((t,e)=>t.map(r=>FK[e][r])),Jfe=C8.map((t,e)=>t.map(r=>FK[e][r])),Xfe=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Zfe=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Cw=(t,e)=>t<<e|t>>>32-e;function c9(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const Rw=new Uint32Array(16);class ede extends I8{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:a}=this;return[e,r,n,i,a]}set(e,r,n,i,a){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=a|0}process(e,r){for(let y=0;y<16;y++,r+=4)Rw[y]=e.getUint32(r,!0);let n=this.h0|0,i=n,a=this.h1|0,s=a,o=this.h2|0,c=o,u=this.h3|0,f=u,h=this.h4|0,m=h;for(let y=0;y<5;y++){const w=4-y,v=Xfe[y],g=Zfe[y],_=T8[y],b=C8[y],S=Yfe[y],A=Jfe[y];for(let I=0;I<16;I++){const E=Cw(n+c9(y,a,o,u)+Rw[_[I]]+v,S[I])+h|0;n=h,h=u,u=Cw(o,10)|0,o=a,a=E}for(let I=0;I<16;I++){const E=Cw(i+c9(w,s,c,f)+Rw[b[I]]+g,A[I])+m|0;i=m,m=f,f=Cw(c,10)|0,c=s,s=E}}this.set(this.h1+o+f|0,this.h2+u+m|0,this.h3+h+i|0,this.h4+n+s|0,this.h0+a+c|0)}roundClean(){Rw.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const tde=Cx(()=>new ede);let BK=!1;const qK=function(t){return tde(t)};let HK=qK;function Kg(t){const e=qt(t,"data");return _t(HK(e))}Kg._=qK;Kg.lock=function(){BK=!0};Kg.register=function(t){if(BK)throw new TypeError("ripemd160 is locked");HK=t};Object.freeze(Kg);let zK=!1;const VK=function(t,e,r,n,i){return kfe(t,e,r,n,i)};let GK=VK;function Lf(t,e,r,n,i){const a=qt(t,"password"),s=qt(e,"salt");return _t(GK(a,s,r,n,i))}Lf._=VK;Lf.lock=function(){zK=!0};Lf.register=function(t){if(zK)throw new Error("pbkdf2 is locked");GK=t};Object.freeze(Lf);let KK=!1;const WK=function(t){return new Uint8Array(Lfe(t))};let QK=WK;function Ku(t){return QK(t)}Ku._=WK;Ku.lock=function(){KK=!0};Ku.register=function(t){if(KK)throw new Error("randomBytes is locked");QK=t};Object.freeze(Ku);const hn=(t,e)=>t<<e|t>>>32-e;function u9(t,e,r,n,i,a){let s=t[e++]^r[n++],o=t[e++]^r[n++],c=t[e++]^r[n++],u=t[e++]^r[n++],f=t[e++]^r[n++],h=t[e++]^r[n++],m=t[e++]^r[n++],y=t[e++]^r[n++],w=t[e++]^r[n++],v=t[e++]^r[n++],g=t[e++]^r[n++],_=t[e++]^r[n++],b=t[e++]^r[n++],S=t[e++]^r[n++],A=t[e++]^r[n++],I=t[e++]^r[n++],E=s,p=o,O=c,N=u,F=f,V=h,de=m,ve=y,U=w,L=v,Q=g,ne=_,j=b,B=S,H=A,M=I;for(let q=0;q<8;q+=2)F^=hn(E+j|0,7),U^=hn(F+E|0,9),j^=hn(U+F|0,13),E^=hn(j+U|0,18),L^=hn(V+p|0,7),B^=hn(L+V|0,9),p^=hn(B+L|0,13),V^=hn(p+B|0,18),H^=hn(Q+de|0,7),O^=hn(H+Q|0,9),de^=hn(O+H|0,13),Q^=hn(de+O|0,18),N^=hn(M+ne|0,7),ve^=hn(N+M|0,9),ne^=hn(ve+N|0,13),M^=hn(ne+ve|0,18),p^=hn(E+N|0,7),O^=hn(p+E|0,9),N^=hn(O+p|0,13),E^=hn(N+O|0,18),de^=hn(V+F|0,7),ve^=hn(de+V|0,9),F^=hn(ve+de|0,13),V^=hn(F+ve|0,18),ne^=hn(Q+L|0,7),U^=hn(ne+Q|0,9),L^=hn(U+ne|0,13),Q^=hn(L+U|0,18),j^=hn(M+H|0,7),B^=hn(j+M|0,9),H^=hn(B+j|0,13),M^=hn(H+B|0,18);i[a++]=s+E|0,i[a++]=o+p|0,i[a++]=c+O|0,i[a++]=u+N|0,i[a++]=f+F|0,i[a++]=h+V|0,i[a++]=m+de|0,i[a++]=y+ve|0,i[a++]=w+U|0,i[a++]=v+L|0,i[a++]=g+Q|0,i[a++]=_+ne|0,i[a++]=b+j|0,i[a++]=S+B|0,i[a++]=A+H|0,i[a++]=I+M|0}function d0(t,e,r,n,i){let a=n+0,s=n+16*i;for(let o=0;o<16;o++)r[s+o]=t[e+(2*i-1)*16+o];for(let o=0;o<i;o++,a+=16,e+=16)u9(r,s,t,e,r,a),o>0&&(s+=16),u9(r,a,t,e+=16,r,s)}function YK(t,e,r){const n=EK({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:a,p:s,dkLen:o,asyncTick:c,maxmem:u,onProgress:f}=n;if(Ds(i),Ds(a),Ds(s),Ds(o),Ds(c),Ds(u),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");const h=128*a,m=h/4;if(i<=1||i&i-1||i>=2**(h/8)||i>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(s<0||s>(2**32-1)*32/h)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(o<0||o>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const y=h*(i+s);if(y>u)throw new Error(`Scrypt: parameters too large, ${y} (128 * r * (N + p)) > ${u} (maxmem)`);const w=S8(Vg,t,e,{c:1,dkLen:h*s}),v=E_(w),g=E_(new Uint8Array(h*i)),_=E_(new Uint8Array(h));let b=()=>{};if(f){const S=2*i*s,A=Math.max(Math.floor(S/1e4),1);let I=0;b=()=>{I++,f&&(!(I%A)||I===S)&&f(I/S)}}return{N:i,r:a,p:s,dkLen:o,blockSize32:m,V:g,B32:v,B:w,tmp:_,blockMixCb:b,asyncTick:c}}function JK(t,e,r,n,i){const a=S8(Vg,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),a}function rde(t,e,r){const{N:n,r:i,p:a,dkLen:s,blockSize32:o,V:c,B32:u,B:f,tmp:h,blockMixCb:m}=YK(t,e,r);for(let y=0;y<a;y++){const w=o*y;for(let v=0;v<o;v++)c[v]=u[w+v];for(let v=0,g=0;v<n-1;v++)d0(c,g,c,g+=o,i),m();d0(c,(n-1)*o,u,w,i),m();for(let v=0;v<n;v++){const g=u[w+o-16]%n;for(let _=0;_<o;_++)h[_]=u[w+_]^c[g*o+_];d0(h,0,u,w,i),m()}}return JK(t,s,f,c,h)}async function nde(t,e,r){const{N:n,r:i,p:a,dkLen:s,blockSize32:o,V:c,B32:u,B:f,tmp:h,blockMixCb:m,asyncTick:y}=YK(t,e,r);for(let w=0;w<a;w++){const v=o*w;for(let _=0;_<o;_++)c[_]=u[v+_];let g=0;await n9(n-1,y,()=>{d0(c,g,c,g+=o,i),m()}),d0(c,(n-1)*o,u,v,i),m(),await n9(n,y,()=>{const _=u[v+o-16]%n;for(let b=0;b<o;b++)h[b]=u[v+b]^c[_*o+b];d0(h,0,u,v,i),m()})}return JK(t,s,f,c,h)}let XK=!1,ZK=!1;const eW=async function(t,e,r,n,i,a,s){return await nde(t,e,{N:r,r:n,p:i,dkLen:a,onProgress:s})},tW=function(t,e,r,n,i,a){return rde(t,e,{N:r,r:n,p:i,dkLen:a})};let rW=eW,nW=tW;async function Wg(t,e,r,n,i,a,s){const o=qt(t,"passwd"),c=qt(e,"salt");return _t(await rW(o,c,r,n,i,a,s))}Wg._=eW;Wg.lock=function(){ZK=!0};Wg.register=function(t){if(ZK)throw new Error("scrypt is locked");rW=t};Object.freeze(Wg);function Qg(t,e,r,n,i,a){const s=qt(t,"passwd"),o=qt(e,"salt");return _t(nW(s,o,r,n,i,a))}Qg._=tW;Qg.lock=function(){XK=!0};Qg.register=function(t){if(XK)throw new Error("scryptSync is locked");nW=t};Object.freeze(Qg);const iW=function(t){return Mfe("sha256").update(t).digest()};let aW=iW,sW=!1;function uc(t){const e=qt(t,"data");return _t(aW(e))}uc._=iW;uc.lock=function(){sW=!0};uc.register=function(t){if(sW)throw new Error("sha256 is locked");aW=t};Object.freeze(uc);Object.freeze(uc);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oW=BigInt(0),Nx=BigInt(1),ide=BigInt(2),Dx=t=>t instanceof Uint8Array,ade=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function mg(t){if(!Dx(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=ade[t[r]];return e}function cW(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function R8(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function yg(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let n=0;n<r.length;n++){const i=n*2,a=t.slice(i,i+2),s=Number.parseInt(a,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[n]=s}return r}function dh(t){return R8(mg(t))}function N8(t){if(!Dx(t))throw new Error("Uint8Array expected");return R8(mg(Uint8Array.from(t).reverse()))}function vg(t,e){return yg(t.toString(16).padStart(e*2,"0"))}function D8(t,e){return vg(t,e).reverse()}function sde(t){return yg(cW(t))}function Wo(t,e,r){let n;if(typeof e=="string")try{n=yg(e)}catch(a){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${a}`)}else if(Dx(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function Xv(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!Dx(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function ode(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function cde(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ude(t){let e;for(e=0;t>oW;t>>=Nx,e+=1);return e}function lde(t,e){return t>>BigInt(e)&Nx}const fde=(t,e,r)=>t|(r?Nx:oW)<<BigInt(e),M8=t=>(ide<<BigInt(t-1))-Nx,$S=t=>new Uint8Array(t),l9=t=>Uint8Array.from(t);function uW(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=$S(t),i=$S(t),a=0;const s=()=>{n.fill(1),i.fill(0),a=0},o=(...h)=>r(i,n,...h),c=(h=$S())=>{i=o(l9([0]),h),n=o(),h.length!==0&&(i=o(l9([1]),h),n=o())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const m=[];for(;h<e;){n=o();const y=n.slice();m.push(y),h+=n.length}return Xv(...m)};return(h,m)=>{s(),c(h);let y;for(;!(y=m(u()));)c();return s(),y}}const dde={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function e1(t,e,r={}){const n=(i,a,s)=>{const o=dde[a];if(typeof o!="function")throw new Error(`Invalid validator "${a}", expected function`);const c=t[i];if(!(s&&c===void 0)&&!o(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${a}`)};for(const[i,a]of Object.entries(e))n(i,a,!1);for(const[i,a]of Object.entries(r))n(i,a,!0);return t}const hde=Object.freeze(Object.defineProperty({__proto__:null,bitGet:lde,bitLen:ude,bitMask:M8,bitSet:fde,bytesToHex:mg,bytesToNumberBE:dh,bytesToNumberLE:N8,concatBytes:Xv,createHmacDrbg:uW,ensureBytes:Wo,equalBytes:ode,hexToBytes:yg,hexToNumber:R8,numberToBytesBE:vg,numberToBytesLE:D8,numberToHexUnpadded:cW,numberToVarBytesBE:sde,utf8ToBytes:cde,validateObject:e1},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const qi=BigInt(0),bi=BigInt(1),Id=BigInt(2),pde=BigInt(3),uR=BigInt(4),f9=BigInt(5),d9=BigInt(8);BigInt(9);BigInt(16);function fs(t,e){const r=t%e;return r>=qi?r:e+r}function gde(t,e,r){if(r<=qi||e<qi)throw new Error("Expected power/modulo > 0");if(r===bi)return qi;let n=bi;for(;e>qi;)e&bi&&(n=n*t%r),t=t*t%r,e>>=bi;return n}function Xs(t,e,r){let n=t;for(;e-- >qi;)n*=n,n%=r;return n}function lR(t,e){if(t===qi||e<=qi)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=fs(t,e),n=e,i=qi,a=bi;for(;r!==qi;){const o=n/r,c=n%r,u=i-a*o;n=r,r=c,i=a,a=u}if(n!==bi)throw new Error("invert: does not exist");return fs(i,e)}function mde(t){const e=(t-bi)/Id;let r,n,i;for(r=t-bi,n=0;r%Id===qi;r/=Id,n++);for(i=Id;i<t&&gde(i,e,t)!==t-bi;i++);if(n===1){const s=(t+bi)/uR;return function(c,u){const f=c.pow(u,s);if(!c.eql(c.sqr(f),u))throw new Error("Cannot find square root");return f}}const a=(r+bi)/Id;return function(o,c){if(o.pow(c,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let u=n,f=o.pow(o.mul(o.ONE,i),r),h=o.pow(c,a),m=o.pow(c,r);for(;!o.eql(m,o.ONE);){if(o.eql(m,o.ZERO))return o.ZERO;let y=1;for(let v=o.sqr(m);y<u&&!o.eql(v,o.ONE);y++)v=o.sqr(v);const w=o.pow(f,bi<<BigInt(u-y-1));f=o.sqr(w),h=o.mul(h,w),m=o.mul(m,f),u=y}return h}}function yde(t){if(t%uR===pde){const e=(t+bi)/uR;return function(n,i){const a=n.pow(i,e);if(!n.eql(n.sqr(a),i))throw new Error("Cannot find square root");return a}}if(t%d9===f9){const e=(t-f9)/d9;return function(n,i){const a=n.mul(i,Id),s=n.pow(a,e),o=n.mul(i,s),c=n.mul(n.mul(o,Id),s),u=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return mde(t)}const vde=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function bde(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=vde.reduce((n,i)=>(n[i]="function",n),e);return e1(t,r)}function wde(t,e,r){if(r<qi)throw new Error("Expected power > 0");if(r===qi)return t.ONE;if(r===bi)return e;let n=t.ONE,i=e;for(;r>qi;)r&bi&&(n=t.mul(n,i)),i=t.sqr(i),r>>=bi;return n}function _de(t,e){const r=new Array(e.length),n=e.reduce((a,s,o)=>t.is0(s)?a:(r[o]=a,t.mul(a,s)),t.ONE),i=t.inv(n);return e.reduceRight((a,s,o)=>t.is0(s)?a:(r[o]=t.mul(a,r[o]),t.mul(a,s)),i),r}function lW(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ede(t,e,r=!1,n={}){if(t<=qi)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=lW(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=yde(t),o=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:M8(i),ZERO:qi,ONE:bi,create:c=>fs(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return qi<=c&&c<t},is0:c=>c===qi,isOdd:c=>(c&bi)===bi,neg:c=>fs(-c,t),eql:(c,u)=>c===u,sqr:c=>fs(c*c,t),add:(c,u)=>fs(c+u,t),sub:(c,u)=>fs(c-u,t),mul:(c,u)=>fs(c*u,t),pow:(c,u)=>wde(o,c,u),div:(c,u)=>fs(c*lR(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>lR(c,t),sqrt:n.sqrt||(c=>s(o,c)),invertBatch:c=>_de(o,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>r?D8(c,a):vg(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return r?N8(c):dh(c)}});return Object.freeze(o)}function fW(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function dW(t){const e=fW(t);return e+Math.ceil(e/2)}function xde(t,e,r=!1){const n=t.length,i=fW(e),a=dW(e);if(n<16||n<a||n>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${n}`);const s=r?dh(t):N8(t),o=fs(s,e-bi)+bi;return r?D8(o,i):vg(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ade=BigInt(0),kS=BigInt(1);function Sde(t,e){const r=(i,a)=>{const s=a.negate();return i?s:a},n=i=>{const a=Math.ceil(e/i)+1,s=2**(i-1);return{windows:a,windowSize:s}};return{constTimeNegate:r,unsafeLadder(i,a){let s=t.ZERO,o=i;for(;a>Ade;)a&kS&&(s=s.add(o)),o=o.double(),a>>=kS;return s},precomputeWindow(i,a){const{windows:s,windowSize:o}=n(a),c=[];let u=i,f=u;for(let h=0;h<s;h++){f=u,c.push(f);for(let m=1;m<o;m++)f=f.add(u),c.push(f);u=f.double()}return c},wNAF(i,a,s){const{windows:o,windowSize:c}=n(i);let u=t.ZERO,f=t.BASE;const h=BigInt(2**i-1),m=2**i,y=BigInt(i);for(let w=0;w<o;w++){const v=w*c;let g=Number(s&h);s>>=y,g>c&&(g-=m,s+=kS);const _=v,b=v+Math.abs(g)-1,S=w%2!==0,A=g<0;g===0?f=f.add(r(S,a[_])):u=u.add(r(A,a[b]))}return{p:u,f}},wNAFCached(i,a,s,o){const c=i._WINDOW_SIZE||1;let u=a.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&a.set(i,o(u))),this.wNAF(c,u,s)}}}function hW(t){return bde(t.Fp),e1(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...lW(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ide(t){const e=hW(t);e1(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Ode,hexToBytes:Pde}=hde,jd={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=jd;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Ode(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=jd,r=typeof t=="string"?Pde(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=jd._parseInt(r.subarray(2)),{d:s,l:o}=jd._parseInt(a);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const f=u.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),a=n.length/2,s=i.length/2,o=r(a),c=r(s);return`30${r(s+a+4)}02${c}${i}02${o}${n}`}},Fu=BigInt(0),go=BigInt(1);BigInt(2);const h9=BigInt(3);BigInt(4);function Tde(t){const e=Ide(t),{Fp:r}=e,n=e.toBytes||((w,v,g)=>{const _=v.toAffine();return Xv(Uint8Array.from([4]),r.toBytes(_.x),r.toBytes(_.y))}),i=e.fromBytes||(w=>{const v=w.subarray(1),g=r.fromBytes(v.subarray(0,r.BYTES)),_=r.fromBytes(v.subarray(r.BYTES,2*r.BYTES));return{x:g,y:_}});function a(w){const{a:v,b:g}=e,_=r.sqr(w),b=r.mul(_,w);return r.add(r.add(b,r.mul(w,v)),g)}if(!r.eql(r.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function s(w){return typeof w=="bigint"&&Fu<w&&w<e.n}function o(w){if(!s(w))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(w){const{allowedPrivateKeyLengths:v,nByteLength:g,wrapPrivateKey:_,n:b}=e;if(v&&typeof w!="bigint"){if(w instanceof Uint8Array&&(w=mg(w)),typeof w!="string"||!v.includes(w.length))throw new Error("Invalid key");w=w.padStart(g*2,"0")}let S;try{S=typeof w=="bigint"?w:dh(Wo("private key",w,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof w}`)}return _&&(S=fs(S,b)),o(S),S}const u=new Map;function f(w){if(!(w instanceof h))throw new Error("ProjectivePoint expected")}class h{constructor(v,g,_){if(this.px=v,this.py=g,this.pz=_,v==null||!r.isValid(v))throw new Error("x required");if(g==null||!r.isValid(g))throw new Error("y required");if(_==null||!r.isValid(_))throw new Error("z required")}static fromAffine(v){const{x:g,y:_}=v||{};if(!v||!r.isValid(g)||!r.isValid(_))throw new Error("invalid affine point");if(v instanceof h)throw new Error("projective point not allowed");const b=S=>r.eql(S,r.ZERO);return b(g)&&b(_)?h.ZERO:new h(g,_,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(v){const g=r.invertBatch(v.map(_=>_.pz));return v.map((_,b)=>_.toAffine(g[b])).map(h.fromAffine)}static fromHex(v){const g=h.fromAffine(i(Wo("pointHex",v)));return g.assertValidity(),g}static fromPrivateKey(v){return h.BASE.multiply(c(v))}_setWindowSize(v){this._WINDOW_SIZE=v,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:v,y:g}=this.toAffine();if(!r.isValid(v)||!r.isValid(g))throw new Error("bad point: x or y not FE");const _=r.sqr(g),b=a(v);if(!r.eql(_,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:v}=this.toAffine();if(r.isOdd)return!r.isOdd(v);throw new Error("Field doesn't support isOdd")}equals(v){f(v);const{px:g,py:_,pz:b}=this,{px:S,py:A,pz:I}=v,E=r.eql(r.mul(g,I),r.mul(S,b)),p=r.eql(r.mul(_,I),r.mul(A,b));return E&&p}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:v,b:g}=e,_=r.mul(g,h9),{px:b,py:S,pz:A}=this;let I=r.ZERO,E=r.ZERO,p=r.ZERO,O=r.mul(b,b),N=r.mul(S,S),F=r.mul(A,A),V=r.mul(b,S);return V=r.add(V,V),p=r.mul(b,A),p=r.add(p,p),I=r.mul(v,p),E=r.mul(_,F),E=r.add(I,E),I=r.sub(N,E),E=r.add(N,E),E=r.mul(I,E),I=r.mul(V,I),p=r.mul(_,p),F=r.mul(v,F),V=r.sub(O,F),V=r.mul(v,V),V=r.add(V,p),p=r.add(O,O),O=r.add(p,O),O=r.add(O,F),O=r.mul(O,V),E=r.add(E,O),F=r.mul(S,A),F=r.add(F,F),O=r.mul(F,V),I=r.sub(I,O),p=r.mul(F,N),p=r.add(p,p),p=r.add(p,p),new h(I,E,p)}add(v){f(v);const{px:g,py:_,pz:b}=this,{px:S,py:A,pz:I}=v;let E=r.ZERO,p=r.ZERO,O=r.ZERO;const N=e.a,F=r.mul(e.b,h9);let V=r.mul(g,S),de=r.mul(_,A),ve=r.mul(b,I),U=r.add(g,_),L=r.add(S,A);U=r.mul(U,L),L=r.add(V,de),U=r.sub(U,L),L=r.add(g,b);let Q=r.add(S,I);return L=r.mul(L,Q),Q=r.add(V,ve),L=r.sub(L,Q),Q=r.add(_,b),E=r.add(A,I),Q=r.mul(Q,E),E=r.add(de,ve),Q=r.sub(Q,E),O=r.mul(N,L),E=r.mul(F,ve),O=r.add(E,O),E=r.sub(de,O),O=r.add(de,O),p=r.mul(E,O),de=r.add(V,V),de=r.add(de,V),ve=r.mul(N,ve),L=r.mul(F,L),de=r.add(de,ve),ve=r.sub(V,ve),ve=r.mul(N,ve),L=r.add(L,ve),V=r.mul(de,L),p=r.add(p,V),V=r.mul(Q,L),E=r.mul(U,E),E=r.sub(E,V),V=r.mul(U,de),O=r.mul(Q,O),O=r.add(O,V),new h(E,p,O)}subtract(v){return this.add(v.negate())}is0(){return this.equals(h.ZERO)}wNAF(v){return y.wNAFCached(this,u,v,g=>{const _=r.invertBatch(g.map(b=>b.pz));return g.map((b,S)=>b.toAffine(_[S])).map(h.fromAffine)})}multiplyUnsafe(v){const g=h.ZERO;if(v===Fu)return g;if(o(v),v===go)return this;const{endo:_}=e;if(!_)return y.unsafeLadder(this,v);let{k1neg:b,k1:S,k2neg:A,k2:I}=_.splitScalar(v),E=g,p=g,O=this;for(;S>Fu||I>Fu;)S&go&&(E=E.add(O)),I&go&&(p=p.add(O)),O=O.double(),S>>=go,I>>=go;return b&&(E=E.negate()),A&&(p=p.negate()),p=new h(r.mul(p.px,_.beta),p.py,p.pz),E.add(p)}multiply(v){o(v);let g=v,_,b;const{endo:S}=e;if(S){const{k1neg:A,k1:I,k2neg:E,k2:p}=S.splitScalar(g);let{p:O,f:N}=this.wNAF(I),{p:F,f:V}=this.wNAF(p);O=y.constTimeNegate(A,O),F=y.constTimeNegate(E,F),F=new h(r.mul(F.px,S.beta),F.py,F.pz),_=O.add(F),b=N.add(V)}else{const{p:A,f:I}=this.wNAF(g);_=A,b=I}return h.normalizeZ([_,b])[0]}multiplyAndAddUnsafe(v,g,_){const b=h.BASE,S=(I,E)=>E===Fu||E===go||!I.equals(b)?I.multiplyUnsafe(E):I.multiply(E),A=S(this,g).add(S(v,_));return A.is0()?void 0:A}toAffine(v){const{px:g,py:_,pz:b}=this,S=this.is0();v==null&&(v=S?r.ONE:r.inv(b));const A=r.mul(g,v),I=r.mul(_,v),E=r.mul(b,v);if(S)return{x:r.ZERO,y:r.ZERO};if(!r.eql(E,r.ONE))throw new Error("invZ was invalid");return{x:A,y:I}}isTorsionFree(){const{h:v,isTorsionFree:g}=e;if(v===go)return!0;if(g)return g(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:v,clearCofactor:g}=e;return v===go?this:g?g(h,this):this.multiplyUnsafe(e.h)}toRawBytes(v=!0){return this.assertValidity(),n(h,this,v)}toHex(v=!0){return mg(this.toRawBytes(v))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const m=e.nBitLength,y=Sde(h,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:s}}function Cde(t){const e=hW(t);return e1(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Rde(t){const e=Cde(t),{Fp:r,n}=e,i=r.BYTES+1,a=2*r.BYTES+1;function s(L){return Fu<L&&L<r.ORDER}function o(L){return fs(L,n)}function c(L){return lR(L,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:h,isWithinCurveOrder:m}=Tde({...e,toBytes(L,Q,ne){const j=Q.toAffine(),B=r.toBytes(j.x),H=Xv;return ne?H(Uint8Array.from([Q.hasEvenY()?2:3]),B):H(Uint8Array.from([4]),B,r.toBytes(j.y))},fromBytes(L){const Q=L.length,ne=L[0],j=L.subarray(1);if(Q===i&&(ne===2||ne===3)){const B=dh(j);if(!s(B))throw new Error("Point is not on curve");const H=h(B);let M=r.sqrt(H);const q=(M&go)===go;return(ne&1)===1!==q&&(M=r.neg(M)),{x:B,y:M}}else if(Q===a&&ne===4){const B=r.fromBytes(j.subarray(0,r.BYTES)),H=r.fromBytes(j.subarray(r.BYTES,2*r.BYTES));return{x:B,y:H}}else throw new Error(`Point of length ${Q} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}}),y=L=>mg(vg(L,e.nByteLength));function w(L){const Q=n>>go;return L>Q}function v(L){return w(L)?o(-L):L}const g=(L,Q,ne)=>dh(L.slice(Q,ne));class _{constructor(Q,ne,j){this.r=Q,this.s=ne,this.recovery=j,this.assertValidity()}static fromCompact(Q){const ne=e.nByteLength;return Q=Wo("compactSignature",Q,ne*2),new _(g(Q,0,ne),g(Q,ne,2*ne))}static fromDER(Q){const{r:ne,s:j}=jd.toSig(Wo("DER",Q));return new _(ne,j)}assertValidity(){if(!m(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Q){return new _(this.r,this.s,Q)}recoverPublicKey(Q){const{r:ne,s:j,recovery:B}=this,H=p(Wo("msgHash",Q));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const M=B===2||B===3?ne+e.n:ne;if(M>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const q=B&1?"03":"02",k=u.fromHex(q+y(M)),$=c(M),G=o(-H*$),pe=o(j*$),Y=u.BASE.multiplyAndAddUnsafe(k,G,pe);if(!Y)throw new Error("point at infinify");return Y.assertValidity(),Y}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return yg(this.toDERHex())}toDERHex(){return jd.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return yg(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}const b={isValidPrivateKey(L){try{return f(L),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const L=dW(e.n);return xde(e.randomBytes(L),e.n)},precompute(L=8,Q=u.BASE){return Q._setWindowSize(L),Q.multiply(BigInt(3)),Q}};function S(L,Q=!0){return u.fromPrivateKey(L).toRawBytes(Q)}function A(L){const Q=L instanceof Uint8Array,ne=typeof L=="string",j=(Q||ne)&&L.length;return Q?j===i||j===a:ne?j===2*i||j===2*a:L instanceof u}function I(L,Q,ne=!0){if(A(L))throw new Error("first arg must be private key");if(!A(Q))throw new Error("second arg must be public key");return u.fromHex(Q).multiply(f(L)).toRawBytes(ne)}const E=e.bits2int||function(L){const Q=dh(L),ne=L.length*8-e.nBitLength;return ne>0?Q>>BigInt(ne):Q},p=e.bits2int_modN||function(L){return o(E(L))},O=M8(e.nBitLength);function N(L){if(typeof L!="bigint")throw new Error("bigint expected");if(!(Fu<=L&&L<O))throw new Error(`bigint expected < 2^${e.nBitLength}`);return vg(L,e.nByteLength)}function F(L,Q,ne=V){if(["recovered","canonical"].some(ce=>ce in ne))throw new Error("sign() legacy options not supported");const{hash:j,randomBytes:B}=e;let{lowS:H,prehash:M,extraEntropy:q}=ne;H==null&&(H=!0),L=Wo("msgHash",L),M&&(L=Wo("prehashed msgHash",j(L)));const k=p(L),$=f(Q),G=[N($),N(k)];if(q!=null){const ce=q===!0?B(r.BYTES):q;G.push(Wo("extraEntropy",ce))}const pe=Xv(...G),Y=k;function te(ce){const T=E(ce);if(!m(T))return;const le=c(T),ze=u.BASE.multiply(T).toAffine(),et=o(ze.x);if(et===Fu)return;const yt=o(le*o(Y+et*$));if(yt===Fu)return;let vt=(ze.x===et?0:2)|Number(ze.y&go),gt=yt;return H&&w(yt)&&(gt=v(yt),vt^=1),new _(et,gt,vt)}return{seed:pe,k2sig:te}}const V={lowS:e.lowS,prehash:!1},de={lowS:e.lowS,prehash:!1};function ve(L,Q,ne=V){const{seed:j,k2sig:B}=F(L,Q,ne),H=e;return uW(H.hash.outputLen,H.nByteLength,H.hmac)(j,B)}u.BASE._setWindowSize(8);function U(L,Q,ne,j=de){var ze;const B=L;if(Q=Wo("msgHash",Q),ne=Wo("publicKey",ne),"strict"in j)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:M}=j;let q,k;try{if(typeof B=="string"||B instanceof Uint8Array)try{q=_.fromDER(B)}catch(et){if(!(et instanceof jd.Err))throw et;q=_.fromCompact(B)}else if(typeof B=="object"&&typeof B.r=="bigint"&&typeof B.s=="bigint"){const{r:et,s:yt}=B;q=new _(et,yt)}else throw new Error("PARSE");k=u.fromHex(ne)}catch(et){if(et.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&q.hasHighS())return!1;M&&(Q=e.hash(Q));const{r:$,s:G}=q,pe=p(Q),Y=c(G),te=o(pe*Y),ce=o($*Y),T=(ze=u.BASE.multiplyAndAddUnsafe(k,te,ce))==null?void 0:ze.toAffine();return T?o(T.x)===$:!1}return{CURVE:e,getPublicKey:S,getSharedSecret:I,sign:ve,verify:U,ProjectivePoint:u,Signature:_,utils:b}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Nde(t){return{hash:t,hmac:(e,...r)=>Rx(t,e,nfe(...r)),randomBytes:afe}}function Dde(t,e){const r=n=>Rde({...t,...Nde(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pW=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),p9=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Mde=BigInt(1),fR=BigInt(2),g9=(t,e)=>(t+e/fR)/e;function $de(t){const e=pW,r=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),s=BigInt(23),o=BigInt(44),c=BigInt(88),u=t*t*t%e,f=u*u*t%e,h=Xs(f,r,e)*f%e,m=Xs(h,r,e)*f%e,y=Xs(m,fR,e)*u%e,w=Xs(y,i,e)*y%e,v=Xs(w,a,e)*w%e,g=Xs(v,o,e)*v%e,_=Xs(g,c,e)*g%e,b=Xs(_,o,e)*v%e,S=Xs(b,r,e)*f%e,A=Xs(S,s,e)*w%e,I=Xs(A,n,e)*u%e,E=Xs(I,fR,e);if(!dR.eql(dR.sqr(E),t))throw new Error("Cannot find square root");return E}const dR=Ede(pW,void 0,void 0,{sqrt:$de}),kl=Dde({a:BigInt(0),b:BigInt(7),Fp:dR,n:p9,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=p9,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Mde*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,s=BigInt("0x100000000000000000000000000000000"),o=g9(a*t,e),c=g9(-n*t,e);let u=fs(t-o*r-c*i,e),f=fs(-o*n-c*a,e);const h=u>s,m=f>s;if(h&&(u=e-u),m&&(f=e-f),u>s||f>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:u,k2neg:m,k2:f}}}},Vg);BigInt(0);kl.ProjectivePoint;const hR="0x0000000000000000000000000000000000000000",m9="0x0000000000000000000000000000000000000000000000000000000000000000",kde=`Ethereum Signed Message:
|
|
69
|
-
`,y9=BigInt(0),v9=BigInt(1),b9=BigInt(2),w9=BigInt(27),_9=BigInt(28),Nw=BigInt(35),mp={};function E9(t){return bh(gs(t),32)}var T0,C0,R0,Yd;const Vo=class Vo{constructor(e,r,n,i){Qe(this,T0,void 0);Qe(this,C0,void 0);Qe(this,R0,void 0);Qe(this,Yd,void 0);kf(e,mp,"Signature"),Te(this,T0,r),Te(this,C0,n),Te(this,R0,i),Te(this,Yd,null)}get r(){return W(this,T0)}set r(e){Ne(l0(e)===32,"invalid r","value",e),Te(this,T0,_t(e))}get s(){return W(this,C0)}set s(e){Ne(l0(e)===32,"invalid s","value",e);const r=_t(e);Ne(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),Te(this,C0,r)}get v(){return W(this,R0)}set v(e){const r=jr(e,"value");Ne(r===27||r===28,"invalid v","v",e),Te(this,R0,r)}get networkV(){return W(this,Yd)}get legacyChainId(){const e=this.networkV;return e==null?null:Vo.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=qt(this.s);return this.yParity&&(e[0]|=128),_t(e)}get compactSerialized(){return Bn([this.r,this.yParityAndS])}get serialized(){return Bn([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Vo(mp,this.r,this.s,this.v);return this.networkV&&Te(e,Yd,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=rr(e,"v");return r==w9||r==_9?y9:(Ne(r>=Nw,"invalid EIP-155 v","v",e),(r-Nw)/b9)}static getChainIdV(e,r){return rr(e)*b9+BigInt(35+r-27)}static getNormalizedV(e){const r=rr(e);return r===y9||r===w9?27:r===v9||r===_9?28:(Ne(r>=Nw,"invalid v","v",e),r&v9?27:28)}static from(e){function r(u,f){Ne(u,f,"signature",e)}if(e==null)return new Vo(mp,m9,m9,27);if(typeof e=="string"){const u=qt(e,"signature");if(u.length===64){const f=_t(u.slice(0,32)),h=u.slice(32,64),m=h[0]&128?28:27;return h[0]&=127,new Vo(mp,f,_t(h),m)}if(u.length===65){const f=_t(u.slice(0,32)),h=u.slice(32,64);r((h[0]&128)===0,"non-canonical s");const m=Vo.getNormalizedV(u[64]);return new Vo(mp,f,_t(h),m)}r(!1,"invalid raw signature length")}if(e instanceof Vo)return e.clone();const n=e.r;r(n!=null,"missing r");const i=E9(n),a=function(u,f){if(u!=null)return E9(u);if(f!=null){r(ai(f,32),"invalid yParityAndS");const h=qt(f);return h[0]&=127,_t(h)}r(!1,"missing s")}(e.s,e.yParityAndS);r((qt(a)[0]&128)==0,"non-canonical s");const{networkV:s,v:o}=function(u,f,h){if(u!=null){const m=rr(u);return{networkV:m>=Nw?m:void 0,v:Vo.getNormalizedV(m)}}if(f!=null)return r(ai(f,32),"invalid yParityAndS"),{v:qt(f)[0]&128?28:27};if(h!=null){switch(jr(h,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Vo(mp,i,a,o);return s&&Te(c,Yd,s),r(e.yParity==null||jr(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};T0=new WeakMap,C0=new WeakMap,R0=new WeakMap,Yd=new WeakMap;let lc=Vo;var Cu;const Cd=class Cd{constructor(e){Qe(this,Cu,void 0);Ne(l0(e)===32,"invalid private key","privateKey","[REDACTED]"),Te(this,Cu,_t(e))}get privateKey(){return W(this,Cu)}get publicKey(){return Cd.computePublicKey(W(this,Cu))}get compressedPublicKey(){return Cd.computePublicKey(W(this,Cu),!0)}sign(e){Ne(l0(e)===32,"invalid digest length","digest",e);const r=kl.sign(Pa(e),Pa(W(this,Cu)),{lowS:!0});return lc.from({r:Zu(r.r,32),s:Zu(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Cd.computePublicKey(e);return _t(kl.getSharedSecret(Pa(W(this,Cu)),qt(r),!1))}static computePublicKey(e,r){let n=qt(e,"key");if(n.length===32){const a=kl.getPublicKey(n,!!r);return _t(a)}if(n.length===64){const a=new Uint8Array(65);a[0]=4,a.set(n,1),n=a}const i=kl.ProjectivePoint.fromHex(n);return _t(i.toRawBytes(r))}static recoverPublicKey(e,r){Ne(l0(e)===32,"invalid digest length","digest",e);const n=lc.from(r);let i=kl.Signature.fromCompact(Pa(Bn([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const a=i.recoverPublicKey(Pa(e));return Ne(a!=null,"invalid signautre for digest","signature",r),"0x"+a.toHex(!1)}static addPoints(e,r,n){const i=kl.ProjectivePoint.fromHex(Cd.computePublicKey(e).substring(2)),a=kl.ProjectivePoint.fromHex(Cd.computePublicKey(r).substring(2));return"0x"+i.add(a).toHex(!!n)}};Cu=new WeakMap;let Vc=Cd;const Lde=BigInt(0),jde=BigInt(36);function x9(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=qt(Fn(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const $8={};for(let t=0;t<10;t++)$8[String(t)]=String(t);for(let t=0;t<26;t++)$8[String.fromCharCode(65+t)]=String(10+t);const A9=15;function Ude(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>$8[n]).join("");for(;e.length>=A9;){let n=e.substring(0,A9);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const Fde=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function Bde(t){t=t.toLowerCase();let e=Lde;for(let r=0;r<t.length;r++)e=e*jde+Fde[t[r]];return e}function sn(t){if(Ne(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=x9(t);return Ne(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Ne(t.substring(2,4)===Ude(t),"bad icap checksum","address",t);let e=Bde(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return x9("0x"+e)}Ne(!1,"invalid address","address",t)}function qde(t){const e=sn(t.from);let n=rr(t.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,sn(zn(Fn(Jv([e,n])),12))}function gW(t){return t&&typeof t.getAddress=="function"}async function LS(t,e){const r=await e;return(r==null||r==="0x0000000000000000000000000000000000000000")&&(it(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),Ne(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),sn(r)}function sa(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?sn(t):(it(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),LS(t,e.resolveName(t)));if(gW(t))return LS(t,t.getAddress());if(t&&typeof t.then=="function")return LS(t,t);Ne(!1,"unsupported addressable value","target",t)}const wu={};function jt(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new Ra(wu,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function pn(t,e){return new Ra(wu,`bytes${e||""}`,t,{size:e})}const S9=Symbol.for("_ethers_typed");var Jd;const Eu=class Eu{constructor(e,r,n,i){Be(this,"type");Be(this,"value");Qe(this,Jd,void 0);Be(this,"_typedSymbol");i==null&&(i=null),kf(wu,e,"Typed"),Qt(this,{_typedSymbol:S9,type:r,value:n}),Te(this,Jd,i),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return W(this,Jd)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return W(this,Jd)===!0?-1:W(this,Jd)===!1?this.value.length:null}static from(e,r){return new Eu(wu,e,r)}static uint8(e){return jt(e,8)}static uint16(e){return jt(e,16)}static uint24(e){return jt(e,24)}static uint32(e){return jt(e,32)}static uint40(e){return jt(e,40)}static uint48(e){return jt(e,48)}static uint56(e){return jt(e,56)}static uint64(e){return jt(e,64)}static uint72(e){return jt(e,72)}static uint80(e){return jt(e,80)}static uint88(e){return jt(e,88)}static uint96(e){return jt(e,96)}static uint104(e){return jt(e,104)}static uint112(e){return jt(e,112)}static uint120(e){return jt(e,120)}static uint128(e){return jt(e,128)}static uint136(e){return jt(e,136)}static uint144(e){return jt(e,144)}static uint152(e){return jt(e,152)}static uint160(e){return jt(e,160)}static uint168(e){return jt(e,168)}static uint176(e){return jt(e,176)}static uint184(e){return jt(e,184)}static uint192(e){return jt(e,192)}static uint200(e){return jt(e,200)}static uint208(e){return jt(e,208)}static uint216(e){return jt(e,216)}static uint224(e){return jt(e,224)}static uint232(e){return jt(e,232)}static uint240(e){return jt(e,240)}static uint248(e){return jt(e,248)}static uint256(e){return jt(e,256)}static uint(e){return jt(e,256)}static int8(e){return jt(e,-8)}static int16(e){return jt(e,-16)}static int24(e){return jt(e,-24)}static int32(e){return jt(e,-32)}static int40(e){return jt(e,-40)}static int48(e){return jt(e,-48)}static int56(e){return jt(e,-56)}static int64(e){return jt(e,-64)}static int72(e){return jt(e,-72)}static int80(e){return jt(e,-80)}static int88(e){return jt(e,-88)}static int96(e){return jt(e,-96)}static int104(e){return jt(e,-104)}static int112(e){return jt(e,-112)}static int120(e){return jt(e,-120)}static int128(e){return jt(e,-128)}static int136(e){return jt(e,-136)}static int144(e){return jt(e,-144)}static int152(e){return jt(e,-152)}static int160(e){return jt(e,-160)}static int168(e){return jt(e,-168)}static int176(e){return jt(e,-176)}static int184(e){return jt(e,-184)}static int192(e){return jt(e,-192)}static int200(e){return jt(e,-200)}static int208(e){return jt(e,-208)}static int216(e){return jt(e,-216)}static int224(e){return jt(e,-224)}static int232(e){return jt(e,-232)}static int240(e){return jt(e,-240)}static int248(e){return jt(e,-248)}static int256(e){return jt(e,-256)}static int(e){return jt(e,-256)}static bytes1(e){return pn(e,1)}static bytes2(e){return pn(e,2)}static bytes3(e){return pn(e,3)}static bytes4(e){return pn(e,4)}static bytes5(e){return pn(e,5)}static bytes6(e){return pn(e,6)}static bytes7(e){return pn(e,7)}static bytes8(e){return pn(e,8)}static bytes9(e){return pn(e,9)}static bytes10(e){return pn(e,10)}static bytes11(e){return pn(e,11)}static bytes12(e){return pn(e,12)}static bytes13(e){return pn(e,13)}static bytes14(e){return pn(e,14)}static bytes15(e){return pn(e,15)}static bytes16(e){return pn(e,16)}static bytes17(e){return pn(e,17)}static bytes18(e){return pn(e,18)}static bytes19(e){return pn(e,19)}static bytes20(e){return pn(e,20)}static bytes21(e){return pn(e,21)}static bytes22(e){return pn(e,22)}static bytes23(e){return pn(e,23)}static bytes24(e){return pn(e,24)}static bytes25(e){return pn(e,25)}static bytes26(e){return pn(e,26)}static bytes27(e){return pn(e,27)}static bytes28(e){return pn(e,28)}static bytes29(e){return pn(e,29)}static bytes30(e){return pn(e,30)}static bytes31(e){return pn(e,31)}static bytes32(e){return pn(e,32)}static address(e){return new Eu(wu,"address",e)}static bool(e){return new Eu(wu,"bool",!!e)}static bytes(e){return new Eu(wu,"bytes",e)}static string(e){return new Eu(wu,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Eu(wu,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===S9}static dereference(e,r){if(Eu.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};Jd=new WeakMap;let Ra=Eu;class Hde extends al{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Ra.dereference(r,"string");try{n=sn(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return sn(Zu(e.readValue(),20))}}class zde extends al{constructor(r){super(r.name,r.type,"_",r.dynamic);Be(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function mW(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(u=>{const f=u.localName;return it(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),it(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),c[f]=!0,r[f]})}else Ne(!1,"invalid tuple value","tuple",r);Ne(e.length===n.length,"types/value length mismatch","tuple",r);let i=new sR,a=new sR,s=[];e.forEach((c,u)=>{let f=n[u];if(c.dynamic){let h=a.length;c.encode(a,f);let m=i.writeUpdatableValue();s.push(y=>{m(y+h)})}else c.encode(i,f)}),s.forEach(c=>{c(i.length)});let o=t.appendWriter(i);return o+=t.appendWriter(a),o}function yW(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(a=>{let s=null;if(a.dynamic){let o=t.readIndex(),c=i.subReader(o);try{s=a.decode(c)}catch(u){if(wo(u,"BUFFER_OVERRUN"))throw u;s=u,s.baseType=a.name,s.name=a.localName,s.type=a.type}}else try{s=a.decode(t)}catch(o){if(wo(o,"BUFFER_OVERRUN"))throw o;s=o,s.baseType=a.name,s.name=a.localName,s.type=a.type}if(s==null)throw new Error("investigate");r.push(s),n.push(a.localName||null)}),_E.fromItems(r,n)}class Vde extends al{constructor(r,n,i){const a=r.type+"["+(n>=0?n:"")+"]",s=n===-1||r.dynamic;super("array",a,i,s);Be(this,"coder");Be(this,"length");Qt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;i<this.length;i++)n.push(r);return n}encode(r,n){const i=Ra.dereference(n,"array");Array.isArray(i)||this._throwError("expected array value",i);let a=this.length;a===-1&&(a=i.length,r.writeValue(i.length)),nK(i.length,a,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let o=0;o<i.length;o++)s.push(this.coder);return mW(r,s,i)}decode(r){let n=this.length;n===-1&&(n=r.readIndex(),it(n*Va<=r.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:r.bytes,offset:n*Va,length:r.dataLength}));let i=[];for(let a=0;a<n;a++)i.push(new zde(this.coder));return yW(r,i)}}class Gde extends al{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){const n=Ra.dereference(r,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class vW extends al{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=Pa(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class Kde extends vW{constructor(e){super("bytes",e)}decode(e){return _t(super.decode(e))}}class Wde extends al{constructor(r,n){let i="bytes"+String(r);super(i,i,n,!1);Be(this,"size");Qt(this,{size:r},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(r,n){let i=Pa(Ra.dereference(n,this.type));return i.length!==this.size&&this._throwError("incorrect data length",n),r.writeBytes(i)}decode(r){return _t(r.readBytes(this.size))}}const Qde=new Uint8Array([]);class Yde extends al{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes(Qde)}decode(e){return e.readBytes(0),null}}const Jde=BigInt(0),Xde=BigInt(1),Zde=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ehe extends al{constructor(r,n,i){const a=(n?"int":"uint")+r*8;super(a,a,i,!1);Be(this,"size");Be(this,"signed");Qt(this,{size:r,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(r,n){let i=rr(Ra.dereference(n,this.type)),a=Ld(Zde,Va*8);if(this.signed){let s=Ld(a,this.size*8-1);(i>s||i<-(s+Xde))&&this._throwError("value out-of-bounds",n),i=cK(i,8*Va)}else(i<Jde||i>Ld(a,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=Ld(r.readValue(),this.size*8);return this.signed&&(n=wE(n,this.size*8)),n}}class the extends vW{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Wa(Ra.dereference(r,"string")))}decode(e){return _8(super.decode(e))}}class Dw extends al{constructor(r,n){let i=!1;const a=[];r.forEach(o=>{o.dynamic&&(i=!0),a.push(o.type)});const s="tuple("+a.join(",")+")";super("tuple",s,n,i);Be(this,"coders");Qt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,a)=>{const s=a.localName;return s&&(i[s]||(i[s]=0),i[s]++),i},{});return this.coders.forEach((i,a)=>{let s=i.localName;!s||n[s]!==1||(s==="length"&&(s="_length"),r[s]==null&&(r[s]=r[a]))}),Object.freeze(r)}encode(r,n){const i=Ra.dereference(n,"tuple");return mW(r,this.coders,i)}decode(r){return yW(r,this.coders)}}function el(t){return Fn(Wa(t))}var rhe="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/M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RoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const I9=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),O9=4;function nhe(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,a=[0,1];for(let I=1;I<n;I++)a.push(i+=r());let s=r(),o=e;e+=s;let c=0,u=0;function f(){return c==0&&(u=u<<8|t[e++],c=8),u>>--c&1}const h=31,m=2**h,y=m>>>1,w=y>>1,v=m-1;let g=0;for(let I=0;I<h;I++)g=g<<1|f();let _=[],b=0,S=m;for(;;){let I=Math.floor(((g-b+1)*i-1)/S),E=0,p=n;for(;p-E>1;){let F=E+p>>>1;I<a[F]?p=F:E=F}if(E==0)break;_.push(E);let O=b+Math.floor(S*a[E]/i),N=b+Math.floor(S*a[E+1]/i)-1;for(;!((O^N)&y);)g=g<<1&v|f(),O=O<<1&v,N=N<<1&v|1;for(;O&~N&w;)g=g&y|g<<1&v>>>1|f(),O=O<<1^y,N=(N^y)<<1|y|1;b=O,S=1+N-O}let A=n-4;return _.map(I=>{switch(I-A){case 3:return A+65792+(t[o++]<<16|t[o++]<<8|t[o++]);case 2:return A+256+(t[o++]<<8|t[o++]);case 1:return A+t[o++];default:return I-1}})}function ihe(t){let e=0;return()=>t[e++]}function bW(t){return ihe(nhe(ahe(t)))}function ahe(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,a=0,s=0,o=0;i<r;i++)o=o<<6|e[t.charCodeAt(i)],s+=6,s>=8&&(n[a++]=o>>(s-=8));return n}function she(t){return t&1?~t>>1:t>>1}function ohe(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=she(e());return r}function Zv(t,e=0){let r=[];for(;;){let n=t(),i=t();if(!i)break;e+=n;for(let a=0;a<i;a++)r.push(e+a);e+=i+1}return r}function wW(t){return eb(()=>{let e=Zv(t);if(e.length)return e})}function _W(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(che(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(uhe(r,t))}return e.flat()}function eb(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function EW(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)ohe(t,r).forEach((a,s)=>n[s].push(a));return n}function che(t,e){let r=1+e(),n=e(),i=eb(e);return EW(i.length,1+t,e).flatMap((s,o)=>{let[c,...u]=s;return Array(i[o]).fill().map((f,h)=>{let m=h*n;return[c+h*r,u.map(y=>y+m)]})})}function uhe(t,e){let r=1+e();return EW(r,1+t,e).map(i=>[i[0],i.slice(1)])}function lhe(t){let e=[],r=Zv(t);return i(n([]),[]),e;function n(a){let s=t(),o=eb(()=>{let c=Zv(t).map(u=>r[u]);if(c.length)return n(c)});return{S:s,B:o,Q:a}}function i({S:a,B:s},o,c){if(!(a&4&&c===o[o.length-1])){a&2&&(c=o[o.length-1]),a&1&&e.push(o);for(let u of s)for(let f of u.Q)i(u,[...o,f],c)}}}function fhe(t){return t.toString(16).toUpperCase().padStart(2,"0")}function xW(t){return`{${fhe(t)}}`}function dhe(t){let e=[];for(let r=0,n=t.length;r<n;){let i=t.codePointAt(r);r+=i<65536?1:2,e.push(i)}return e}function bg(t){let r=t.length;if(r<4096)return String.fromCodePoint(...t);let n=[];for(let i=0;i<r;)n.push(String.fromCodePoint(...t.slice(i,i+=4096)));return n.join("")}function hhe(t,e){let r=t.length,n=r-e.length;for(let i=0;n==0&&i<r;i++)n=t[i]-e[i];return n}var phe="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26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6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const tb=44032,EE=4352,xE=4449,AE=4519,AW=19,SW=21,wg=28,SE=SW*wg,ghe=AW*SE,mhe=tb+ghe,yhe=EE+AW,vhe=xE+SW,bhe=AE+wg;function Ky(t){return t>>24&255}function IW(t){return t&16777215}let pR,P9,gR,A_;function whe(){let t=bW(phe);pR=new Map(wW(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),P9=new Set(Zv(t)),gR=new Map,A_=new Map;for(let[e,r]of _W(t)){if(!P9.has(e)&&r.length==2){let[n,i]=r,a=A_.get(n);a||(a=new Map,A_.set(n,a)),a.set(i,e)}gR.set(e,r.reverse())}}function OW(t){return t>=tb&&t<mhe}function _he(t,e){if(t>=EE&&t<yhe&&e>=xE&&e<vhe)return tb+(t-EE)*SE+(e-xE)*wg;if(OW(t)&&e>AE&&e<bhe&&(t-tb)%wg==0)return t+(e-AE);{let r=A_.get(t);return r&&(r=r.get(e),r)?r:-1}}function PW(t){pR||whe();let e=[],r=[],n=!1;function i(a){let s=pR.get(a);s&&(n=!0,a|=s),e.push(a)}for(let a of t)for(;;){if(a<128)e.push(a);else if(OW(a)){let s=a-tb,o=s/SE|0,c=s%SE/wg|0,u=s%wg;i(EE+o),i(xE+c),u>0&&i(AE+u)}else{let s=gR.get(a);s?r.push(...s):i(a)}if(!r.length)break;a=r.pop()}if(n&&e.length>1){let a=Ky(e[0]);for(let s=1;s<e.length;s++){let o=Ky(e[s]);if(o==0||a<=o){a=o;continue}let c=s-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(a=Ky(e[--c]),a<=o))break}a=Ky(e[s])}}return e}function Ehe(t){let e=[],r=[],n=-1,i=0;for(let a of t){let s=Ky(a),o=IW(a);if(n==-1)s==0?n=o:e.push(o);else if(i>0&&i>=s)s==0?(e.push(n,...r),r.length=0,n=o):r.push(o),i=s;else{let c=_he(n,o);c>=0?n=c:i==0&&s==0?(e.push(n),n=o):(r.push(o),i=s)}}return n>=0&&e.push(n,...r),e}function TW(t){return PW(t).map(IW)}function xhe(t){return Ehe(PW(t))}const T9=45,CW=".",RW=65039,NW=1,Wp=t=>Array.from(t);function rb(t,e){return t.P.has(e)||t.Q.has(e)}class Ahe extends Array{get is_emoji(){return!0}}let mR,DW,Ud,yR,MW,h0,jS,Cp,$W,C9,vR;function k8(){if(mR)return;let t=bW(rhe);const e=()=>Zv(t),r=()=>new Set(e());mR=new Map(_W(t)),DW=r(),Ud=e(),yR=new Set(e().map(f=>Ud[f])),Ud=new Set(Ud),MW=r(),r();let n=wW(t),i=t();const a=()=>new Set(e().flatMap(f=>n[f]).concat(e()));h0=eb(f=>{let h=eb(t).map(m=>m+96);if(h.length){let m=f>=i;h[0]-=32,h=bg(h),m&&(h=`Restricted[${h}]`);let y=a(),w=a(),v=!t();return{N:h,P:y,Q:w,M:v,R:m}}}),jS=r(),Cp=new Map;let s=e().concat(Wp(jS)).sort((f,h)=>f-h);s.forEach((f,h)=>{let m=t(),y=s[h]=m?s[h-m]:{V:[],M:new Map};y.V.push(f),jS.has(f)||Cp.set(f,y)});for(let{V:f,M:h}of new Set(Cp.values())){let m=[];for(let w of f){let v=h0.filter(_=>rb(_,w)),g=m.find(({G:_})=>v.some(b=>_.has(b)));g||(g={G:new Set,V:[]},m.push(g)),g.V.push(w),v.forEach(_=>g.G.add(_))}let y=m.flatMap(w=>Wp(w.G));for(let{G:w,V:v}of m){let g=new Set(y.filter(_=>!w.has(_)));for(let _ of v)h.set(_,g)}}let o=new Set,c=new Set;const u=f=>o.has(f)?c.add(f):o.add(f);for(let f of h0){for(let h of f.P)u(h);for(let h of f.Q)u(h)}for(let f of o)!Cp.has(f)&&!c.has(f)&&Cp.set(f,NW);$W=new Set(Wp(o).concat(Wp(TW(o)))),C9=lhe(t).map(f=>Ahe.from(f)).sort(hhe),vR=new Map;for(let f of C9){let h=[vR];for(let m of f){let y=h.map(w=>{let v=w.get(m);return v||(v=new Map,w.set(m,v)),v});m===RW?h.push(...y):h=y}for(let m of h)m.V=f}}function L8(t){return(kW(t)?"":`${j8(Mx([t]))} `)+xW(t)}function j8(t){return`"${t}"`}function She(t){if(t.length>=4&&t[2]==T9&&t[3]==T9)throw new Error(`invalid label extension: "${bg(t.slice(0,4))}"`)}function Ihe(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function Ohe(t){let e=t[0],r=I9.get(e);if(r)throw bv(`leading ${r}`);let n=t.length,i=-1;for(let a=1;a<n;a++){e=t[a];let s=I9.get(e);if(s){if(i==a)throw bv(`${r} + ${s}`);i=a+1,r=s}}if(i==n)throw bv(`trailing ${r}`)}function Mx(t,e=xW){let r=[];Phe(t[0])&&r.push("◌");let n=0,i=t.length;for(let a=0;a<i;a++){let s=t[a];kW(s)&&(r.push(bg(t.slice(n,a))),r.push(e(s)),n=a+1)}return r.push(bg(t.slice(n,i))),r.join("")}function Phe(t){return k8(),Ud.has(t)}function kW(t){return k8(),MW.has(t)}function The(t){return Dhe(Che(t,xhe,khe))}function Che(t,e,r){if(!t)return[];k8();let n=0;return t.split(CW).map(i=>{let a=dhe(i),s={input:a,offset:n};n+=a.length+1;try{let o=s.tokens=$he(a,e,r),c=o.length,u;if(!c)throw new Error("empty label");let f=s.output=o.flat();if(Ihe(f),!(s.emoji=c>1||o[0].is_emoji)&&f.every(m=>m<128))She(f),u="ASCII";else{let m=o.flatMap(y=>y.is_emoji?[]:y);if(!m.length)u="Emoji";else{if(Ud.has(f[0]))throw bv("leading combining mark");for(let v=1;v<c;v++){let g=o[v];if(!g.is_emoji&&Ud.has(g[0]))throw bv(`emoji + combining mark: "${bg(o[v-1])} + ${Mx([g[0]])}"`)}Ohe(f);let y=Wp(new Set(m)),[w]=Nhe(y);Mhe(w,m),Rhe(w,y),u=w.N}}s.type=u}catch(o){s.error=o}return s})}function Rhe(t,e){let r,n=[];for(let i of e){let a=Cp.get(i);if(a===NW)return;if(a){let s=a.M.get(i);if(r=r?r.filter(o=>s.has(o)):Wp(s),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(a=>rb(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function Nhe(t){let e=h0;for(let r of t){let n=e.filter(i=>rb(i,r));if(!n.length)throw h0.some(i=>rb(i,r))?jW(e[0],r):LW(r);if(e=n,n.length==1)break}return e}function Dhe(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${j8(Mx(e))}: ${i}`)}return bg(n)}).join(CW)}function LW(t){return new Error(`disallowed character: ${L8(t)}`)}function jW(t,e){let r=L8(e),n=h0.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function bv(t){return new Error(`illegal placement: ${t}`)}function Mhe(t,e){for(let r of e)if(!rb(t,r))throw jW(t,r);if(t.M){let r=TW(e);for(let n=1,i=r.length;n<i;n++)if(yR.has(r[n])){let a=n+1;for(let s;a<i&&yR.has(s=r[a]);a++)for(let o=n;o<a;o++)if(r[o]==s)throw new Error(`duplicate non-spacing marks: ${L8(s)}`);if(a-n>O9)throw new Error(`excessive non-spacing marks: ${j8(Mx(r.slice(n-1,a)))} (${a-n}/${O9})`);n=a}}}function $he(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let a=Lhe(t);if(a)i.length&&(n.push(e(i)),i=[]),n.push(r(a));else{let s=t.pop();if($W.has(s))i.push(s);else{let o=mR.get(s);if(o)i.push(...o);else if(!DW.has(s))throw LW(s)}}}return i.length&&n.push(e(i)),n}function khe(t){return t.filter(e=>e!=RW)}function Lhe(t,e){let r=vR,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:a}=r;a&&(n=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return n}const UW=new Uint8Array(32);UW.fill(0);function R9(t){return Ne(t.length!==0,"invalid ENS name; empty component","comp",t),t}function FW(t){const e=Wa(jhe(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(R9(e.slice(n,i))),n=i+1);return Ne(n<e.length,"invalid ENS name; empty component","name",t),r.push(R9(e.slice(n))),r}function jhe(t){try{if(t.length===0)throw new Error("empty label");return The(t)}catch(e){Ne(!1,`invalid ENS name (${e.message})`,"name",t)}}function bR(t){Ne(typeof t=="string","invalid ENS name; not a string","name",t),Ne(t.length,"invalid ENS name (empty label)","name",t);let e=UW;const r=FW(t);for(;r.length;)e=Fn(Bn([e,Fn(r.pop())]));return _t(e)}function Uhe(t){return _t(Bn(FW(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}function US(t,e){return{address:sn(t),storageKeys:e.map((r,n)=>(Ne(ai(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Mh(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(Ne(r.length===2,"invalid slot set",`value[${n}]`,r),US(r[0],r[1])):(Ne(r!=null&&typeof r=="object","invalid address-slot set","value",t),US(r.address,r.storageKeys)));Ne(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,a)=>(i[a]=!0,i),{});return US(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function t1(t){let e;return typeof t=="string"?e=Vc.computePublicKey(t,!1):e=t.publicKey,sn(Fn("0x"+e.substring(4)).substring(26))}function Fhe(t,e){return t1(Vc.recoverPublicKey(t,e))}const ds=BigInt(0),Bhe=BigInt(2),qhe=BigInt(27),Hhe=BigInt(28),zhe=BigInt(35),Vhe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function U8(t){return t==="0x"?null:sn(t)}function BW(t,e){try{return Mh(t)}catch(r){Ne(!1,r.message,e,t)}}function $x(t,e){return t==="0x"?0:jr(t,e)}function Ba(t,e){if(t==="0x")return ds;const r=rr(t,e);return Ne(r<=Vhe,"value exceeds uint size",e,r),r}function ra(t,e){const r=rr(t,"value"),n=gs(r);return Ne(n.length<=32,"value too large",`tx.${e}`,r),n}function qW(t){return Mh(t).map(e=>[e.address,e.storageKeys])}function Ghe(t){const e=E8(t);Ne(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:$x(e[0],"nonce"),gasPrice:Ba(e[1],"gasPrice"),gasLimit:Ba(e[2],"gasLimit"),to:U8(e[3]),value:Ba(e[4],"value"),data:_t(e[5]),chainId:ds};if(e.length===6)return r;const n=Ba(e[6],"v"),i=Ba(e[7],"r"),a=Ba(e[8],"s");if(i===ds&&a===ds)r.chainId=n;else{let s=(n-zhe)/Bhe;s<ds&&(s=ds),r.chainId=s,Ne(s!==ds||n===qhe||n===Hhe,"non-canonical legacy v","v",e[6]),r.signature=lc.from({r:bh(e[7],32),s:bh(e[8],32),v:n}),r.hash=Fn(t)}return r}function N9(t,e){const r=[ra(t.nonce||0,"nonce"),ra(t.gasPrice||0,"gasPrice"),ra(t.gasLimit||0,"gasLimit"),t.to!=null?sn(t.to):"0x",ra(t.value||0,"value"),t.data||"0x"];let n=ds;if(t.chainId!=ds)n=rr(t.chainId,"tx.chainId"),Ne(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const a=t.signature.legacyChainId;a!=null&&(n=a)}if(!e)return n!==ds&&(r.push(gs(n)),r.push("0x"),r.push("0x")),Jv(r);let i=BigInt(27+e.yParity);return n!==ds?i=lc.getChainIdV(n,e.v):BigInt(e.v)!==i&&Ne(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(gs(i)),r.push(gs(e.r)),r.push(gs(e.s)),Jv(r)}function HW(t,e){let r;try{if(r=$x(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{Ne(!1,"invalid yParity","yParity",e[0])}const n=bh(e[1],32),i=bh(e[2],32),a=lc.from({r:n,s:i,yParity:r});t.signature=a}function Khe(t){const e=E8(qt(t).slice(1));Ne(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",_t(t));const r=Ba(e[2],"maxPriorityFeePerGas"),n=Ba(e[3],"maxFeePerGas"),i={type:2,chainId:Ba(e[0],"chainId"),nonce:$x(e[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ba(e[4],"gasLimit"),to:U8(e[5]),value:Ba(e[6],"value"),data:_t(e[7]),accessList:BW(e[8],"accessList")};return e.length===9||(i.hash=Fn(t),HW(i,e.slice(9))),i}function D9(t,e){const r=[ra(t.chainId||0,"chainId"),ra(t.nonce||0,"nonce"),ra(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ra(t.maxFeePerGas||0,"maxFeePerGas"),ra(t.gasLimit||0,"gasLimit"),t.to!=null?sn(t.to):"0x",ra(t.value||0,"value"),t.data||"0x",qW(t.accessList||[])];return e&&(r.push(ra(e.yParity,"yParity")),r.push(gs(e.r)),r.push(gs(e.s))),Bn(["0x02",Jv(r)])}function Whe(t){const e=E8(qt(t).slice(1));Ne(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",_t(t));const r={type:1,chainId:Ba(e[0],"chainId"),nonce:$x(e[1],"nonce"),gasPrice:Ba(e[2],"gasPrice"),gasLimit:Ba(e[3],"gasLimit"),to:U8(e[4]),value:Ba(e[5],"value"),data:_t(e[6]),accessList:BW(e[7],"accessList")};return e.length===8||(r.hash=Fn(t),HW(r,e.slice(8))),r}function M9(t,e){const r=[ra(t.chainId||0,"chainId"),ra(t.nonce||0,"nonce"),ra(t.gasPrice||0,"gasPrice"),ra(t.gasLimit||0,"gasLimit"),t.to!=null?sn(t.to):"0x",ra(t.value||0,"value"),t.data||"0x",qW(t.accessList||[])];return e&&(r.push(ra(e.yParity,"recoveryParam")),r.push(gs(e.r)),r.push(gs(e.s))),Bn(["0x01",Jv(r)])}var Ru,N0,D0,M0,$0,k0,L0,j0,U0,F0,B0,q0;const Fl=class Fl{constructor(){Qe(this,Ru,void 0);Qe(this,N0,void 0);Qe(this,D0,void 0);Qe(this,M0,void 0);Qe(this,$0,void 0);Qe(this,k0,void 0);Qe(this,L0,void 0);Qe(this,j0,void 0);Qe(this,U0,void 0);Qe(this,F0,void 0);Qe(this,B0,void 0);Qe(this,q0,void 0);Te(this,Ru,null),Te(this,N0,null),Te(this,M0,0),Te(this,$0,BigInt(0)),Te(this,k0,null),Te(this,L0,null),Te(this,j0,null),Te(this,D0,"0x"),Te(this,U0,BigInt(0)),Te(this,F0,BigInt(0)),Te(this,B0,null),Te(this,q0,null)}get type(){return W(this,Ru)}set type(e){switch(e){case null:Te(this,Ru,null);break;case 0:case"legacy":Te(this,Ru,0);break;case 1:case"berlin":case"eip-2930":Te(this,Ru,1);break;case 2:case"london":case"eip-1559":Te(this,Ru,2);break;default:Ne(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}get to(){return W(this,N0)}set to(e){Te(this,N0,e==null?null:sn(e))}get nonce(){return W(this,M0)}set nonce(e){Te(this,M0,jr(e,"value"))}get gasLimit(){return W(this,$0)}set gasLimit(e){Te(this,$0,rr(e))}get gasPrice(){const e=W(this,k0);return e==null&&(this.type===0||this.type===1)?ds:e}set gasPrice(e){Te(this,k0,e==null?null:rr(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=W(this,L0);return e??(this.type===2?ds:null)}set maxPriorityFeePerGas(e){Te(this,L0,e==null?null:rr(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=W(this,j0);return e??(this.type===2?ds:null)}set maxFeePerGas(e){Te(this,j0,e==null?null:rr(e,"maxFeePerGas"))}get data(){return W(this,D0)}set data(e){Te(this,D0,_t(e))}get value(){return W(this,U0)}set value(e){Te(this,U0,rr(e,"value"))}get chainId(){return W(this,F0)}set chainId(e){Te(this,F0,rr(e))}get signature(){return W(this,B0)||null}set signature(e){Te(this,B0,e==null?null:lc.from(e))}get accessList(){const e=W(this,q0)||null;return e??(this.type===1||this.type===2?[]:null)}set accessList(e){Te(this,q0,e==null?null:Mh(e))}get hash(){return this.signature==null?null:Fn(this.serialized)}get unsignedHash(){return Fn(this.unsignedSerialized)}get from(){return this.signature==null?null:Fhe(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Vc.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){switch(it(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return N9(this,this.signature);case 1:return M9(this,this.signature);case 2:return D9(this,this.signature)}it(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return N9(this);case 1:return M9(this);case 2:return D9(this)}it(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){return this.inferTypes().pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&it(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),it(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),it(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):r?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Fl.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Fl;if(typeof e=="string"){const n=qt(e);if(n[0]>=127)return Fl.from(Ghe(n));switch(n[0]){case 1:return Fl.from(Whe(n));case 2:return Fl.from(Khe(n))}it(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Fl;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=lc.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.hash!=null&&(Ne(r.isSigned(),"unsigned transaction cannot define hash","tx",e),Ne(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Ne(r.isSigned(),"unsigned transaction cannot define from","tx",e),Ne(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};Ru=new WeakMap,N0=new WeakMap,D0=new WeakMap,M0=new WeakMap,$0=new WeakMap,k0=new WeakMap,L0=new WeakMap,j0=new WeakMap,U0=new WeakMap,F0=new WeakMap,B0=new WeakMap,q0=new WeakMap;let nb=Fl;function Qhe(t){return typeof t=="string"&&(t=Wa(t)),Fn(Bn([Wa(kde),Wa(String(t.length)),t]))}const zW=new Uint8Array(32);zW.fill(0);const Yhe=BigInt(-1),VW=BigInt(0),GW=BigInt(1),Jhe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Xhe(t){const e=qt(t),r=e.length%32;return r?Bn([e,zW.slice(r)]):_t(e)}const Zhe=Zu(GW,32),epe=Zu(VW,32),$9={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},FS=["name","version","chainId","verifyingContract","salt"];function k9(t){return function(e){return Ne(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const tpe={name:k9("name"),version:k9("version"),chainId:function(t){const e=rr(t,"domain.chainId");return Ne(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Gp(e)},verifyingContract:function(t){try{return sn(t).toLowerCase()}catch{}Ne(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=qt(t,"domain.salt");return Ne(e.length===32,'invalid domain value "salt"',"domain.salt",t),_t(e)}};function BS(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");Ne(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",t);const i=Ld(Jhe,r?n-1:n),a=r?(i+GW)*Yhe:VW;return function(s){const o=rr(s,"value");return Ne(o>=a&&o<=i,`value out-of-bounds for ${t}`,"value",o),Zu(r?cK(o,256):o,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return Ne(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=qt(n);return Ne(i.length===r,`invalid length for ${t}`,"value",n),Xhe(n)}}}switch(t){case"address":return function(e){return bh(sn(e),32)};case"bool":return function(e){return e?Zhe:epe};case"bytes":return function(e){return Fn(e)};case"string":return function(e){return el(e)}}return null}function L9(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}var Pb,Nu,H0,ax,KW;const co=class co{constructor(e){Qe(this,ax);Be(this,"primaryType");Qe(this,Pb,void 0);Qe(this,Nu,void 0);Qe(this,H0,void 0);Te(this,Pb,JSON.stringify(e)),Te(this,Nu,new Map),Te(this,H0,new Map);const r=new Map,n=new Map,i=new Map;Object.keys(e).forEach(o=>{r.set(o,new Set),n.set(o,[]),i.set(o,new Set)});for(const o in e){const c=new Set;for(const u of e[o]){Ne(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(o)}`,"types",e),c.add(u.name);const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Ne(f!==o,`circular type reference to ${JSON.stringify(f)}`,"types",e),!BS(f)&&(Ne(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(o),r.get(o).add(f))}}const a=Array.from(n.keys()).filter(o=>n.get(o).length===0);Ne(a.length!==0,"missing primary type","types",e),Ne(a.length===1,`ambiguous primary types or unused types: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),Qt(this,{primaryType:a[0]});function s(o,c){Ne(!c.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),c.add(o);for(const u of r.get(o))if(n.has(u)){s(u,c);for(const f of c)i.get(f).add(u)}c.delete(o)}s(this.primaryType,new Set);for(const[o,c]of i){const u=Array.from(c);u.sort(),W(this,Nu).set(o,L9(o,e[o])+u.map(f=>L9(f,e[f])).join(""))}}get types(){return JSON.parse(W(this,Pb))}getEncoder(e){let r=W(this,H0).get(e);return r||(r=ct(this,ax,KW).call(this,e),W(this,H0).set(e,r)),r}encodeType(e){const r=W(this,Nu).get(e);return Ne(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Fn(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(BS(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Ne(!i[3]||parseInt(i[3])===r.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",r),r.map(s=>this._visit(i[1],s,n));const a=this.types[e];if(a)return a.reduce((s,{name:o,type:c})=>(s[o]=this._visit(c,r[o],n),s),{});Ne(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new co(e)}static getPrimaryType(e){return co.from(e).primaryType}static hashStruct(e,r,n){return co.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=$9[n];Ne(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>FS.indexOf(n.name)-FS.indexOf(i.name)),co.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Bn(["0x1901",co.hashDomain(e),co.from(r).hash(n)])}static hash(e,r,n){return Fn(co.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const a={};e.verifyingContract&&!ai(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const s=co.from(r);s.visit(n,(o,c)=>(o==="address"&&!ai(c,20)&&(a[c]="0x"),c));for(const o in a)a[o]=await i(o);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=s.visit(n,(o,c)=>o==="address"&&a[c]?a[c]:c),{domain:e,value:n}}static getPayload(e,r,n){co.hashDomain(e);const i={},a=[];FS.forEach(c=>{const u=e[c];u!=null&&(i[c]=tpe[c](u),a.push({name:c,type:$9[c]}))});const s=co.from(r),o=Object.assign({},r);return Ne(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),o.EIP712Domain=a,s.encode(n),{types:o,domain:i,primaryType:s.primaryType,message:s.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return _t(qt(u));if(c.match(/^u?int/))return rr(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return Ne(typeof u=="string","invalid string","value",u),u}Ne(!1,"unsupported type","type",c)})}}};Pb=new WeakMap,Nu=new WeakMap,H0=new WeakMap,ax=new WeakSet,KW=function(e){{const i=BS(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],a=this.getEncoder(i);return s=>{Ne(!r[3]||parseInt(r[3])===s.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",s);let o=s.map(a);return W(this,Nu).has(i)&&(o=o.map(Fn)),Fn(Bn(o))}}const n=this.types[e];if(n){const i=el(W(this,Nu).get(e));return a=>{const s=n.map(({name:o,type:c})=>{const u=this.getEncoder(c)(a[o]);return W(this,Nu).has(c)?Fn(u):u});return s.unshift(i),Bn(s)}}Ne(!1,`unknown type: ${e}`,"type",e)};let _g=co;function Ga(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const rpe="external public payable",npe=Ga(rpe.split(" ")),WW="constant external internal payable private public pure view",ipe=Ga(WW.split(" ")),QW="constructor error event fallback function receive struct",YW=Ga(QW.split(" ")),JW="calldata memory storage payable indexed",ape=Ga(JW.split(" ")),spe="tuple returns",ope=[QW,JW,spe,WW].join(" "),cpe=Ga(ope.split(" ")),upe={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},lpe=new RegExp("^(\\s*)"),fpe=new RegExp("^([0-9]+)"),dpe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),XW=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),ZW=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Xi,ec,Tb,wR;const sx=class sx{constructor(e){Qe(this,Tb);Qe(this,Xi,void 0);Qe(this,ec,void 0);Te(this,Xi,0),Te(this,ec,e.slice())}get offset(){return W(this,Xi)}get length(){return W(this,ec).length-W(this,Xi)}clone(){return new sx(W(this,ec))}reset(){Te(this,Xi,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=ct(this,Tb,wR).call(this,W(this,Xi)+1,e.match+1);return Te(this,Xi,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;W(this,Xi)<e.match-1;){const n=this.peek().linkNext;r.push(ct(this,Tb,wR).call(this,W(this,Xi)+1,n)),Te(this,Xi,n)}return Te(this,Xi,e.match+1),r}peek(){if(W(this,Xi)>=W(this,ec).length)throw new Error("out-of-bounds");return W(this,ec)[W(this,Xi)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return Em(this,Xi)._++,e}toString(){const e=[];for(let r=W(this,Xi);r<W(this,ec).length;r++){const n=W(this,ec)[r];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};Xi=new WeakMap,ec=new WeakMap,Tb=new WeakSet,wR=function(e=0,r=0){return new sx(W(this,ec).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let fc=sx;function jf(t){const e=[],r=s=>{const o=a<t.length?JSON.stringify(t[a]):"$EOI";throw new Error(`invalid token ${o} at ${a}: ${s}`)};let n=[],i=[],a=0;for(;a<t.length;){let s=t.substring(a),o=s.match(lpe);o&&(a+=o[1].length,s=t.substring(a));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};e.push(c);let u=upe[s[0]]||"";if(u){if(c.type=u,c.text=s[0],a++,u==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&r("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let f=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const h=e.pop().text;f=h+f,e[e.length-1].value=jr(h)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(o=s.match(dpe),o){if(c.text=o[1],a+=c.text.length,cpe.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(ZW)){c.type="TYPE";continue}c.type="ID";continue}if(o=s.match(fpe),o){c.text=o[1],c.type="NUMBER",a+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(s[0])} at position ${a}`)}return new fc(e.map(s=>Object.freeze(s)))}function j9(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 kx(t,e){if(e.peekKeyword(YW)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function tl(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||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 eQ(t){let e=tl(t,ipe);return j9(e,Ga("constant payable nonpayable".split(" "))),j9(e,Ga("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"}function Wu(t,e){return t.popParams().map(r=>oa.from(r,e))}function tQ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return rr(t.pop().text);throw new Error("invalid gas")}return null}function wh(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const hpe=new RegExp(/^(.*)\[([0-9]*)\]$/);function U9(t){const e=t.match(ZW);if(Ne(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);Ne(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);Ne(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const ii={},_s=Symbol.for("_ethers_internal"),F9="_ParamTypeInternal",B9="_ErrorInternal",q9="_EventInternal",H9="_ConstructorInternal",z9="_FallbackInternal",V9="_FunctionInternal",G9="_StructInternal";var z0,S_;const uo=class uo{constructor(e,r,n,i,a,s,o,c){Qe(this,z0);Be(this,"name");Be(this,"type");Be(this,"baseType");Be(this,"indexed");Be(this,"components");Be(this,"arrayLength");Be(this,"arrayChildren");if(kf(e,ii,"ParamType"),Object.defineProperty(this,_s,{value:F9}),s&&(s=Object.freeze(s.slice())),i==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(i==="tuple"){if(s==null)throw new Error("")}else if(s!=null)throw new Error("");Qt(this,{name:r,type:n,baseType:i,indexed:a,components:s,arrayLength:o,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=n,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,a)=>n.components[a].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return ct(this,z0,S_).call(this,n,e,r,a=>{i[0]=a}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(uo.isParamType(e))return e;if(typeof e=="string")try{return uo.from(jf(e),r)}catch{Ne(!1,"invalid param type","obj",e)}else if(e instanceof fc){let o="",c="",u=null;tl(e,Ga(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(v=>uo.from(v)),o=`tuple(${u.map(v=>v.format()).join(",")})`):(o=U9(e.popType("TYPE")),c=o);let f=null,h=null;for(;e.length&&e.peekType("BRACKET");){const v=e.pop();f=new uo(ii,"",o,c,null,u,h,f),h=v.value,o+=v.text,c="array",u=null}let m=null;if(tl(e,ape).has("indexed")){if(!r)throw new Error("");m=!0}const w=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new uo(ii,w,o,c,m,u,h,f)}const n=e.name;Ne(!n||typeof n=="string"&&n.match(XW),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(Ne(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,s=a.match(hpe);if(s){const o=parseInt(s[2]||"-1"),c=uo.from({type:s[1],components:e.components});return new uo(ii,n||"",a,"array",i,null,o,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const o=e.components!=null?e.components.map(u=>uo.from(u)):null;return new uo(ii,n||"",a,"tuple",i,o,null,null)}return a=U9(e.type),new uo(ii,n||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[_s]===F9}};z0=new WeakSet,S_=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const s=this.arrayChildren,o=r.slice();o.forEach((c,u)=>{var f;ct(f=s,z0,S_).call(f,e,c,n,h=>{o[u]=h})}),i(o);return}if(this.isTuple()){const s=this.components;let o;if(Array.isArray(r))o=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");o=s.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,u)=>{var f;ct(f=s[u],z0,S_).call(f,e,c,n,h=>{o[u]=h})}),i(o);return}const a=n(this.type,r);a.then?e.push(async function(){i(await a)}()):i(a)};let oa=uo;class _h{constructor(e,r,n){Be(this,"type");Be(this,"inputs");kf(e,ii,"Fragment"),n=Object.freeze(n.slice()),Qt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{_h.from(JSON.parse(e))}catch{}return _h.from(jf(e))}if(e instanceof fc)switch(e.peekKeyword(YW)){case"constructor":return zu.from(e);case"error":return hs.from(e);case"event":return $c.from(e);case"fallback":case"receive":return Au.from(e);case"function":return kc.from(e);case"struct":return hh.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return zu.from(e);case"error":return hs.from(e);case"event":return $c.from(e);case"fallback":case"receive":return Au.from(e);case"function":return kc.from(e);case"struct":return hh.from(e)}it(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Ne(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return zu.isFragment(e)}static isError(e){return hs.isFragment(e)}static isEvent(e){return $c.isFragment(e)}static isFunction(e){return kc.isFragment(e)}static isStruct(e){return hh.isFragment(e)}}class Lx extends _h{constructor(r,n,i,a){super(r,n,a);Be(this,"name");Ne(typeof i=="string"&&i.match(XW),"invalid identifier","name",i),a=Object.freeze(a.slice()),Qt(this,{name:i})}}function ib(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class hs extends Lx{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,_s,{value:B9})}get selector(){return el(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+ib(e,this.inputs)),r.join(" ")}static from(e){if(hs.isFragment(e))return e;if(typeof e=="string")return hs.from(jf(e));if(e instanceof fc){const r=kx("error",e),n=Wu(e);return wh(e),new hs(ii,r,n)}return new hs(ii,e.name,e.inputs?e.inputs.map(oa.from):[])}static isFragment(e){return e&&e[_s]===B9}}class $c extends Lx{constructor(r,n,i,a){super(r,"event",n,i);Be(this,"anonymous");Object.defineProperty(this,_s,{value:q9}),Qt(this,{anonymous:a})}get topicHash(){return el(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+ib(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(a=>oa.from(a)),new $c(ii,r,n,!1).topicHash}static from(r){if($c.isFragment(r))return r;if(typeof r=="string")try{return $c.from(jf(r))}catch{Ne(!1,"invalid event fragment","obj",r)}else if(r instanceof fc){const n=kx("event",r),i=Wu(r,!0),a=!!tl(r,Ga(["anonymous"])).has("anonymous");return wh(r),new $c(ii,n,i,a)}return new $c(ii,r.name,r.inputs?r.inputs.map(n=>oa.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[_s]===q9}}class zu extends _h{constructor(r,n,i,a,s){super(r,n,i);Be(this,"payable");Be(this,"gas");Object.defineProperty(this,_s,{value:H9}),Qt(this,{payable:a,gas:s})}format(r){if(it(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${ib(r,this.inputs)}`];return n.push(this.payable?"payable":"nonpayable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(zu.isFragment(r))return r;if(typeof r=="string")try{return zu.from(jf(r))}catch{Ne(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof fc){tl(r,Ga(["constructor"]));const n=Wu(r),i=!!tl(r,npe).has("payable"),a=tQ(r);return wh(r),new zu(ii,"constructor",n,i,a)}return new zu(ii,"constructor",r.inputs?r.inputs.map(oa.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[_s]===H9}}class Au extends _h{constructor(r,n,i){super(r,"fallback",n);Be(this,"payable");Object.defineProperty(this,_s,{value:z9}),Qt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Au.isFragment(r))return r;if(typeof r=="string")try{return Au.from(jf(r))}catch{Ne(!1,"invalid fallback fragment","obj",r)}else if(r instanceof fc){const n=r.toString(),i=r.peekKeyword(Ga(["fallback","receive"]));if(Ne(i,"type must be fallback or receive","obj",n),r.popKeyword(Ga(["fallback","receive"]))==="receive"){const c=Wu(r);return Ne(c.length===0,"receive cannot have arguments","obj.inputs",c),tl(r,Ga(["payable"])),wh(r),new Au(ii,[],!0)}let s=Wu(r);s.length?Ne(s.length===1&&s[0].type==="bytes","invalid fallback inputs","obj.inputs",s.map(c=>c.format("minimal")).join(", ")):s=[oa.from("bytes")];const o=eQ(r);if(Ne(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),tl(r,Ga(["returns"])).has("returns")){const c=Wu(r);Ne(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return wh(r),new Au(ii,s,o==="payable")}if(r.type==="receive")return new Au(ii,[],!0);if(r.type==="fallback"){const n=[oa.from("bytes")],i=r.stateMutability==="payable";return new Au(ii,n,i)}Ne(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[_s]===z9}}class kc extends Lx{constructor(r,n,i,a,s,o){super(r,"function",n,a);Be(this,"constant");Be(this,"outputs");Be(this,"stateMutability");Be(this,"payable");Be(this,"gas");Object.defineProperty(this,_s,{value:V9}),s=Object.freeze(s.slice()),Qt(this,{constant:i==="view"||i==="pure",gas:o,outputs:s,payable:i==="payable",stateMutability:i})}get selector(){return el(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+ib(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(ib(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(a=>oa.from(a)),new kc(ii,r,"view",n,[],null).selector}static from(r){if(kc.isFragment(r))return r;if(typeof r=="string")try{return kc.from(jf(r))}catch{Ne(!1,"invalid function fragment","obj",r)}else if(r instanceof fc){const i=kx("function",r),a=Wu(r),s=eQ(r);let o=[];tl(r,Ga(["returns"])).has("returns")&&(o=Wu(r));const c=tQ(r);return wh(r),new kc(ii,i,s,a,o,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new kc(ii,r.name,n,r.inputs?r.inputs.map(oa.from):[],r.outputs?r.outputs.map(oa.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[_s]===V9}}class hh extends Lx{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,_s,{value:G9})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return hh.from(jf(e))}catch{Ne(!1,"invalid struct fragment","obj",e)}else if(e instanceof fc){const r=kx("struct",e),n=Wu(e);return wh(e),new hh(ii,r,n)}return new hh(ii,e.name,e.inputs?e.inputs.map(oa.from):[])}static isFragment(e){return e&&e[_s]===G9}}const dc=new Map;dc.set(0,"GENERIC_PANIC");dc.set(1,"ASSERT_FALSE");dc.set(17,"OVERFLOW");dc.set(18,"DIVIDE_BY_ZERO");dc.set(33,"ENUM_RANGE_ERROR");dc.set(34,"BAD_STORAGE_DATA");dc.set(49,"STACK_UNDERFLOW");dc.set(50,"ARRAY_RANGE_ERROR");dc.set(65,"OUT_OF_MEMORY");dc.set(81,"UNINITIALIZED_FUNCTION_CALL");const ppe=new RegExp(/^bytes([0-9]*)$/),gpe=new RegExp(/^(u?int)([0-9]*)$/);let qS=null;function mpe(t,e,r,n){let i="missing revert data",a=null;const s=null;let o=null;if(r){i="execution reverted";const u=qt(r);if(r=_t(r),u.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(_t(u.slice(0,4))==="0x08c379a0")try{a=n.decode(["string"],u.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(_t(u.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],u.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[f]},a=`Panic due to ${dc.get(f)||"UNKNOWN"}(${f})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?sn(e.to):null,data:e.data||"0x"};return e.from&&(c.from=sn(e.from)),Ni(i,"CALL_EXCEPTION",{action:t,data:r,reason:a,transaction:c,invocation:s,revert:o})}var Vl,Rp;const ox=class ox{constructor(){Qe(this,Vl)}getDefaultValue(e){const r=e.map(i=>ct(this,Vl,Rp).call(this,oa.from(i)));return new Dw(r,"_").defaultValue()}encode(e,r){nK(r.length,e.length,"types/values length mismatch");const n=e.map(s=>ct(this,Vl,Rp).call(this,oa.from(s))),i=new Dw(n,"_"),a=new sR;return i.encode(a,r),a.data}decode(e,r,n){const i=e.map(s=>ct(this,Vl,Rp).call(this,oa.from(s)));return new Dw(i,"_").decode(new oR(r,n))}static defaultAbiCoder(){return qS==null&&(qS=new ox),qS}static getBuiltinCallException(e,r,n){return mpe(e,r,n,ox.defaultAbiCoder())}};Vl=new WeakSet,Rp=function(e){if(e.isArray())return new Vde(ct(this,Vl,Rp).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Dw(e.components.map(n=>ct(this,Vl,Rp).call(this,n)),e.name);switch(e.baseType){case"address":return new Hde(e.name);case"bool":return new Gde(e.name);case"string":return new the(e.name);case"bytes":return new Kde(e.name);case"":return new Yde(e.name)}let r=e.type.match(gpe);if(r){let n=parseInt(r[2]||"256");return Ne(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new ehe(n/8,r[1]==="int",e.name)}if(r=e.type.match(ppe),r){let n=parseInt(r[1]);return Ne(n!==0&&n<=32,"invalid bytes length","param",e),new Wde(n,e.name)}Ne(!1,"invalid type","type",e.type)};let ab=ox;class ype{constructor(e,r,n){Be(this,"fragment");Be(this,"name");Be(this,"signature");Be(this,"topic");Be(this,"args");const i=e.name,a=e.format();Qt(this,{fragment:e,name:i,signature:a,topic:r,args:n})}}class vpe{constructor(e,r,n,i){Be(this,"fragment");Be(this,"name");Be(this,"args");Be(this,"signature");Be(this,"selector");Be(this,"value");const a=e.name,s=e.format();Qt(this,{fragment:e,name:a,args:n,signature:s,selector:r,value:i})}}class bpe{constructor(e,r,n){Be(this,"fragment");Be(this,"name");Be(this,"args");Be(this,"signature");Be(this,"selector");const i=e.name,a=e.format();Qt(this,{fragment:e,name:i,args:n,signature:a,selector:r})}}class K9{constructor(e){Be(this,"hash");Be(this,"_isIndexed");Qt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const W9={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"},Q9={"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&&W9[t.toString()]&&(e=W9[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Tc,Cc,Rc,va,V0,I_,G0,O_;const Jp=class Jp{constructor(e){Qe(this,V0);Qe(this,G0);Be(this,"fragments");Be(this,"deploy");Be(this,"fallback");Be(this,"receive");Qe(this,Tc,void 0);Qe(this,Cc,void 0);Qe(this,Rc,void 0);Qe(this,va,void 0);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,Te(this,Rc,new Map),Te(this,Tc,new Map),Te(this,Cc,new Map);const n=[];for(const s of r)try{n.push(_h.from(s))}catch(o){console.log("EE",o)}Qt(this,{fragments:Object.freeze(n)});let i=null,a=!1;Te(this,va,this.getAbiCoder()),this.fragments.forEach((s,o)=>{let c;switch(s.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Qt(this,{deploy:s});return;case"fallback":s.inputs.length===0?a=!0:(Ne(!i||s.payable!==i.payable,"conflicting fallback fragments",`fragments[${o}]`,s),i=s,a=i.payable);return;case"function":c=W(this,Rc);break;case"event":c=W(this,Cc);break;case"error":c=W(this,Tc);break;default:return}const u=s.format();c.has(u)||c.set(u,s)}),this.deploy||Qt(this,{deploy:zu.from("constructor()")}),Qt(this,{fallback:i,receive:a})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return ab.defaultAbiCoder()}getFunctionName(e){const r=ct(this,V0,I_).call(this,e,null,!1);return Ne(r,"no matching function","key",e),r.name}hasFunction(e){return!!ct(this,V0,I_).call(this,e,null,!1)}getFunction(e,r){return ct(this,V0,I_).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(W(this,Rc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Rc).get(i),n)}}getEventName(e){const r=ct(this,G0,O_).call(this,e,null,!1);return Ne(r,"no matching event","key",e),r.name}hasEvent(e){return!!ct(this,G0,O_).call(this,e,null,!1)}getEvent(e,r){return ct(this,G0,O_).call(this,e,r||null,!0)}forEachEvent(e){const r=Array.from(W(this,Cc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Cc).get(i),n)}}getError(e,r){if(ai(e)){const i=e.toLowerCase();if(Q9[i])return hs.from(Q9[i].signature);for(const a of W(this,Tc).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,s]of W(this,Tc))a.split("(")[0]===e&&i.push(s);if(i.length===0)return e==="Error"?hs.from("error Error(string)"):e==="Panic"?hs.from("error Panic(uint256)"):null;if(i.length>1){const a=i.map(s=>JSON.stringify(s.format())).join(", ");Ne(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=hs.from(e).format(),e==="Error(string)")return hs.from("error Error(string)");if(e==="Panic(uint256)")return hs.from("error Panic(uint256)");const n=W(this,Tc).get(e);return n||null}forEachError(e){const r=Array.from(W(this,Tc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Tc).get(i),n)}}_decodeParams(e,r){return W(this,va).decode(e,r)}_encodeParams(e,r){return W(this,va).encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);Ne(n,"unknown error","fragment",e),e=n}return Ne(zn(r,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",r),this._decodeParams(e.inputs,zn(r,4))}encodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);Ne(n,"unknown error","fragment",e),e=n}return Bn([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return Ne(zn(r,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",r),this._decodeParams(e.inputs,zn(r,4))}encodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return Bn([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionResult(e,r){if(typeof e=="string"){const a=this.getFunction(e);Ne(a,"unknown function","fragment",e),e=a}let n="invalid length for result data";const i=Pa(r);if(i.length%32===0)try{return W(this,va).decode(e.outputs,i)}catch{n="could not decode result data"}it(!1,n,"BAD_DATA",{value:_t(i),info:{method:e.name,signature:e.format()}})}makeError(e,r){const n=qt(e,"data"),i=ab.getBuiltinCallException("call",r,n),a="execution reverted (unknown custom error)";if(i.message.startsWith(a)){const o=_t(n.slice(0,4)),c=this.getError(o);if(c)try{const u=W(this,va).decode(c.inputs,n.slice(4));i.revert={name:c.name,signature:c.format(),args:u},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const s=this.parseTransaction(r);return s&&(i.invocation={method:s.name,signature:s.signature,args:s.args}),i}encodeFunctionResult(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return _t(W(this,va).encode(e.outputs,r||[]))}encodeFilterTopics(e,r){if(typeof e=="string"){const a=this.getEvent(e);Ne(a,"unknown event","eventFragment",e),e=a}it(r.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:r.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(a,s)=>a.type==="string"?el(s):a.type==="bytes"?Fn(_t(s)):(a.type==="bool"&&typeof s=="boolean"?s=s?"0x01":"0x00":a.type.match(/^u?int/)?s=Zu(s):a.type.match(/^bytes/)?s=Ile(s,32):a.type==="address"&&W(this,va).encode(["address"],[s]),bh(_t(s),32));for(r.forEach((a,s)=>{const o=e.inputs[s];if(!o.indexed){Ne(a==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,a);return}a==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Ne(!1,"filtering with tuples or arrays not supported","contract."+o.name,a):Array.isArray(a)?n.push(a.map(c=>i(o,c))):n.push(i(o,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const s=this.getEvent(e);Ne(s,"unknown event","eventFragment",e),e=s}const n=[],i=[],a=[];return e.anonymous||n.push(e.topicHash),Ne(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((s,o)=>{const c=r[o];if(s.indexed)if(s.type==="string")n.push(el(c));else if(s.type==="bytes")n.push(Fn(c));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");n.push(W(this,va).encode([s.type],[c]))}else i.push(s),a.push(c)}),{data:W(this,va).encode(i,a),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const y=this.getEvent(e);Ne(y,"unknown event","eventFragment",e),e=y}if(n!=null&&!e.anonymous){const y=e.topicHash;Ne(ai(n[0],32)&&n[0].toLowerCase()===y,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],a=[],s=[];e.inputs.forEach((y,w)=>{y.indexed?y.type==="string"||y.type==="bytes"||y.baseType==="tuple"||y.baseType==="array"?(i.push(oa.from({type:"bytes32",name:y.name})),s.push(!0)):(i.push(y),s.push(!1)):(a.push(y),s.push(!1))});const o=n!=null?W(this,va).decode(i,Bn(n)):null,c=W(this,va).decode(a,r,!0),u=[],f=[];let h=0,m=0;return e.inputs.forEach((y,w)=>{let v=null;if(y.indexed)if(o==null)v=new K9(null);else if(s[w])v=new K9(o[m++]);else try{v=o[m++]}catch(g){v=g}else try{v=c[h++]}catch(g){v=g}u.push(v),f.push(y.name||null)}),_E.fromItems(u,f)}parseTransaction(e){const r=qt(e.data,"tx.data"),n=rr(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(_t(r.slice(0,4)));if(!i)return null;const a=W(this,va).decode(i.inputs,r.slice(4));return new vpe(i,i.selector,a,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new ype(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=_t(e),n=this.getError(zn(r,0,4));if(!n)return null;const i=W(this,va).decode(n.inputs,zn(r,4));return new bpe(n,n.selector,i)}static from(e){return e instanceof Jp?e:typeof e=="string"?new Jp(JSON.parse(e)):typeof e.format=="function"?new Jp(e.format("json")):new Jp(e)}};Tc=new WeakMap,Cc=new WeakMap,Rc=new WeakMap,va=new WeakMap,V0=new WeakSet,I_=function(e,r,n){if(ai(e)){const a=e.toLowerCase();for(const s of W(this,Rc).values())if(a===s.selector)return s;return null}if(e.indexOf("(")===-1){const a=[];for(const[s,o]of W(this,Rc))s.split("(")[0]===e&&a.push(o);if(r){const s=r.length>0?r[r.length-1]:null;let o=r.length,c=!0;Ra.isTyped(s)&&s.type==="overrides"&&(c=!1,o--);for(let u=a.length-1;u>=0;u--){const f=a[u].inputs.length;f!==o&&(!c||f!==o-1)&&a.splice(u,1)}for(let u=a.length-1;u>=0;u--){const f=a[u].inputs;for(let h=0;h<r.length;h++)if(Ra.isTyped(r[h])){if(h>=f.length){if(r[h].type==="overrides")continue;a.splice(u,1);break}if(r[h].type!==f[h].baseType){a.splice(u,1);break}}}}if(a.length===1&&r&&r.length!==a[0].inputs.length){const s=r[r.length-1];(s==null||Array.isArray(s)||typeof s!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&n){const s=a.map(o=>JSON.stringify(o.format())).join(", ");Ne(!1,`ambiguous function description (i.e. matches ${s})`,"key",e)}return a[0]}const i=W(this,Rc).get(kc.from(e).format());return i||null},G0=new WeakSet,O_=function(e,r,n){if(ai(e)){const a=e.toLowerCase();for(const s of W(this,Cc).values())if(a===s.topicHash)return s;return null}if(e.indexOf("(")===-1){const a=[];for(const[s,o]of W(this,Cc))s.split("(")[0]===e&&a.push(o);if(r){for(let s=a.length-1;s>=0;s--)a[s].inputs.length<r.length&&a.splice(s,1);for(let s=a.length-1;s>=0;s--){const o=a[s].inputs;for(let c=0;c<r.length;c++)if(Ra.isTyped(r[c])&&r[c].type!==o[c].baseType){a.splice(s,1);break}}}if(a.length===0)return null;if(a.length>1&&n){const s=a.map(o=>JSON.stringify(o.format())).join(", ");Ne(!1,`ambiguous event description (i.e. matches ${s})`,"key",e)}return a[0]}const i=W(this,Cc).get($c.from(e).format());return i||null};let _R=Jp;const rQ=BigInt(0);function wv(t){return t??null}function Ia(t){return t==null?null:t.toString()}class Y9{constructor(e,r,n){Be(this,"gasPrice");Be(this,"maxFeePerGas");Be(this,"maxPriorityFeePerGas");Qt(this,{gasPrice:wv(e),maxFeePerGas:wv(r),maxPriorityFeePerGas:wv(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Ia(e),maxFeePerGas:Ia(r),maxPriorityFeePerGas:Ia(n)}}}function IE(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=_t(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=rr(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=jr(t[i],`request.${i}`));return t.accessList&&(e.accessList=Mh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Du;class wpe{constructor(e,r){Be(this,"provider");Be(this,"number");Be(this,"hash");Be(this,"timestamp");Be(this,"parentHash");Be(this,"nonce");Be(this,"difficulty");Be(this,"gasLimit");Be(this,"gasUsed");Be(this,"miner");Be(this,"extraData");Be(this,"baseFeePerGas");Qe(this,Du,void 0);Te(this,Du,e.transactions.map(n=>typeof n!="string"?new sb(n,r):n)),Qt(this,{provider:r,hash:wv(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:wv(e.baseFeePerGas)})}get transactions(){return W(this,Du).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=W(this,Du).slice();return e.length===0?[]:(it(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:a,hash:s,miner:o,nonce:c,number:u,parentHash:f,timestamp:h,transactions:m}=this;return{_type:"Block",baseFeePerGas:Ia(e),difficulty:Ia(r),extraData:n,gasLimit:Ia(i),gasUsed:Ia(a),hash:s,miner:o,nonce:c,number:u,parentHash:f,timestamp:h,transactions:m}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>e<this.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}get length(){return W(this,Du).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let r;if(typeof e=="number")r=W(this,Du)[e];else{const n=e.toLowerCase();for(const i of W(this,Du))if(typeof i=="string"){if(i!==n)continue;r=i;break}else{if(i.hash===n)continue;r=i;break}}if(r==null)throw new Error("no such tx");return typeof r=="string"?await this.provider.getTransaction(r):r}getPrefetchedTransaction(e){const r=this.prefetchedTransactions;if(typeof e=="number")return r[e];e=e.toLowerCase();for(const n of r)if(n.hash===e)return n;Ne(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return _pe(this)}}Du=new WeakMap;class r1{constructor(e,r){Be(this,"provider");Be(this,"transactionHash");Be(this,"blockHash");Be(this,"blockNumber");Be(this,"removed");Be(this,"address");Be(this,"data");Be(this,"topics");Be(this,"index");Be(this,"transactionIndex");this.provider=r;const n=Object.freeze(e.topics.slice());Qt(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:r,blockNumber:n,data:i,index:a,removed:s,topics:o,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:r,blockNumber:n,data:i,index:a,removed:s,topics:o,transactionHash:c,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return it(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return it(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return it(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Epe(this)}}var Cb;class nQ{constructor(e,r){Be(this,"provider");Be(this,"to");Be(this,"from");Be(this,"contractAddress");Be(this,"hash");Be(this,"index");Be(this,"blockHash");Be(this,"blockNumber");Be(this,"logsBloom");Be(this,"gasUsed");Be(this,"cumulativeGasUsed");Be(this,"gasPrice");Be(this,"type");Be(this,"status");Be(this,"root");Qe(this,Cb,void 0);Te(this,Cb,Object.freeze(e.logs.map(i=>new r1(i,r))));let n=rQ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Qt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:n,type:e.type,status:e.status,root:e.root})}get logs(){return W(this,Cb)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:a,blockHash:s,blockNumber:o,logsBloom:c,logs:u,status:f,root:h}=this;return{_type:"TransactionReceipt",blockHash:s,blockNumber:o,contractAddress:n,cumulativeGasUsed:Ia(this.cumulativeGasUsed),from:r,gasPrice:Ia(this.gasPrice),gasUsed:Ia(this.gasUsed),hash:i,index:a,logs:u,logsBloom:c,root:h,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return aQ(this)}reorderedEvent(e){return it(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),iQ(this,e)}}Cb=new WeakMap;var Gl;const RD=class RD{constructor(e,r){Be(this,"provider");Be(this,"blockNumber");Be(this,"blockHash");Be(this,"index");Be(this,"hash");Be(this,"type");Be(this,"to");Be(this,"from");Be(this,"nonce");Be(this,"gasLimit");Be(this,"gasPrice");Be(this,"maxPriorityFeePerGas");Be(this,"maxFeePerGas");Be(this,"data");Be(this,"value");Be(this,"chainId");Be(this,"signature");Be(this,"accessList");Qe(this,Gl,void 0);this.provider=r,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,Te(this,Gl,-1)}toJSON(){const{blockNumber:e,blockHash:r,index:n,hash:i,type:a,to:s,from:o,nonce:c,data:u,signature:f,accessList:h}=this;return{_type:"TransactionReceipt",accessList:h,blockNumber:e,blockHash:r,chainId:Ia(this.chainId),data:u,from:o,gasLimit:Ia(this.gasLimit),gasPrice:Ia(this.gasPrice),hash:i,maxFeePerGas:Ia(this.maxFeePerGas),maxPriorityFeePerGas:Ia(this.maxPriorityFeePerGas),nonce:c,signature:f,to:s,index:n,type:a,value:Ia(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const r=this.provider.getBlock(e);if(r==null)throw new Error("TODO");return r}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:r,blockNumber:n}=await _a({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return r==null||r.blockNumber==null?0:n-r.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,r){const n=e??1,i=r??0;let a=W(this,Gl),s=-1,o=a===-1;const c=async()=>{if(o)return null;const{blockNumber:m,nonce:y}=await _a({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(y<this.nonce){a=m;return}if(o)return null;const w=await this.getTransaction();if(!(w&&w.blockNumber!=null))for(s===-1&&(s=a-3,s<W(this,Gl)&&(s=W(this,Gl)));s<=m;){if(o)return null;const v=await this.provider.getBlock(s,!0);if(v==null)return;for(const g of v)if(g===this.hash)return;for(let g=0;g<v.length;g++){const _=await v.getTransaction(g);if(_.from===this.from&&_.nonce===this.nonce){if(o)return null;const b=await this.provider.getTransactionReceipt(_.hash);if(b==null||m-b.blockNumber+1<n)return;let S="replaced";_.data===this.data&&_.to===this.to&&_.value===this.value?S="repriced":_.data==="0x"&&_.from===_.to&&_.value===rQ&&(S="cancelled"),it(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:S==="replaced"||S==="cancelled",reason:S,replacement:_.replaceableTransaction(a),hash:_.hash,receipt:b})}}s++}},u=m=>{if(m==null||m.status!==0)return m;it(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:m.to,from:m.from,data:""},receipt:m})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(f);if(f){if(await f.confirmations()>=n)return u(f)}else if(await c(),n===0)return null;return await new Promise((m,y)=>{const w=[],v=()=>{w.forEach(_=>_())};if(w.push(()=>{o=!0}),i>0){const _=setTimeout(()=>{v(),y(Ni("wait for transaction timeout","TIMEOUT"))},i);w.push(()=>{clearTimeout(_)})}const g=async _=>{if(await _.confirmations()>=n){v();try{m(u(_))}catch(b){y(b)}}};if(w.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),a>=0){const _=async()=>{try{await c()}catch(b){if(wo(b,"TRANSACTION_REPLACED")){v(),y(b);return}}o||this.provider.once("block",_)};w.push(()=>{this.provider.off("block",_)}),this.provider.once("block",_)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return it(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),aQ(this)}reorderedEvent(e){return it(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),it(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),iQ(this,e)}replaceableTransaction(e){Ne(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new RD(this,this.provider);return Te(r,Gl,e),r}};Gl=new WeakMap;let sb=RD;function _pe(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function iQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function aQ(t){return{orphan:"drop-transaction",tx:t}}function Epe(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class F8 extends r1{constructor(r,n,i){super(r,r.provider);Be(this,"interface");Be(this,"fragment");Be(this,"args");const a=n.decodeEventLog(i,r.data,r.topics);Qt(this,{args:a,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class sQ extends r1{constructor(r,n){super(r,r.provider);Be(this,"error");Qt(this,{error:n})}}var K0;class xpe extends nQ{constructor(r,n,i){super(i,n);Qe(this,K0,void 0);Te(this,K0,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?W(this,K0).getEvent(r.topics[0]):null;if(n)try{return new F8(r,W(this,K0),n)}catch(i){return new sQ(r,i)}return r})}}K0=new WeakMap;var Rb;class B8 extends sb{constructor(r,n,i){super(i,n);Qe(this,Rb,void 0);Te(this,Rb,r)}async wait(r){const n=await super.wait(r);return n==null?null:new xpe(W(this,Rb),this.provider,n)}}Rb=new WeakMap;class oQ extends lK{constructor(r,n,i,a){super(r,n,i);Be(this,"log");Qt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Ape extends oQ{constructor(e,r,n,i,a){super(e,r,n,new F8(a,e.interface,i));const s=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Qt(this,{args:s,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const J9=BigInt(0);function cQ(t){return t&&typeof t.call=="function"}function uQ(t){return t&&typeof t.estimateGas=="function"}function jx(t){return t&&typeof t.resolveName=="function"}function lQ(t){return t&&typeof t.sendTransaction=="function"}function fQ(t){if(t!=null){if(jx(t))return t;if(t.provider)return t.provider}}var Nb;class Spe{constructor(e,r,n){Qe(this,Nb,void 0);Be(this,"fragment");if(Qt(this,{fragment:r}),r.inputs.length<n.length)throw new Error("too many arguments");const i=Eh(e.runner,"resolveName"),a=jx(i)?i:null;Te(this,Nb,async function(){const s=await Promise.all(r.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(f,h)=>f==="address"?Array.isArray(h)?Promise.all(h.map(m=>sa(m,a))):sa(h,a):h)));return e.interface.encodeFilterTopics(r,s)}())}getTopicFilter(){return W(this,Nb)}}Nb=new WeakMap;function Eh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Fd(t){return t==null?null:t.provider||null}async function dQ(t,e){const r=Ra.dereference(t,"overrides");Ne(typeof r=="object","invalid overrides parameter","overrides",t);const n=IE(r);return Ne(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),Ne(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function Ipe(t,e,r){const n=Eh(t,"resolveName"),i=jx(n)?n:null;return await Promise.all(e.map((a,s)=>a.walkAsync(r[s],(o,c)=>(c=Ra.dereference(c,o),o==="address"?sa(c,i):c))))}function Ope(t){const e=async function(s){const o=await dQ(s,["data"]);o.to=await t.getAddress(),o.from&&(o.from=await sa(o.from,fQ(t.runner)));const c=t.interface,u=rr(o.value||J9,"overrides.value")===J9,f=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!u&&Ne(!1,"cannot send data to receive or send value to non-payable fallback","overrides",s),Ne(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data);const h=c.receive||c.fallback&&c.fallback.payable;return Ne(h||u,"cannot send value to non-payable fallback","overrides.value",o.value),Ne(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data),o},r=async function(s){const o=Eh(t.runner,"call");it(cQ(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(s);try{return await o.call(c)}catch(u){throw w8(u)&&u.data?t.interface.makeError(u.data,c):u}},n=async function(s){const o=t.runner;it(lQ(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await o.sendTransaction(await e(s)),u=Fd(t.runner);return new B8(t.interface,u,c)},i=async function(s){const o=Eh(t.runner,"estimateGas");return it(uQ(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(s))},a=async s=>await n(s);return Qt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),a}function Ppe(t,e){const r=function(...u){const f=t.interface.getFunction(e,u);return it(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){const f=r(...u);let h={};if(f.inputs.length+1===u.length&&(h=await dQ(u.pop()),h.from&&(h.from=await sa(h.from,fQ(t.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const m=await Ipe(t.runner,f.inputs,u);return Object.assign({},h,await _a({to:t.getAddress(),data:t.interface.encodeFunctionData(f,m)}))},i=async function(...u){const f=await o(...u);return f.length===1?f[0]:f},a=async function(...u){const f=t.runner;it(lQ(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const h=await f.sendTransaction(await n(...u)),m=Fd(t.runner);return new B8(t.interface,m,h)},s=async function(...u){const f=Eh(t.runner,"estimateGas");return it(uQ(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},o=async function(...u){const f=Eh(t.runner,"call");it(cQ(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const h=await n(...u);let m="0x";try{m=await f.call(h)}catch(w){throw w8(w)&&w.data?t.interface.makeError(w.data,h):w}const y=r(...u);return t.interface.decodeFunctionResult(y,m)},c=async(...u)=>r(...u).constant?await i(...u):await a(...u);return Qt(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:s,populateTransaction:n,send:a,staticCall:i,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return it(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function Tpe(t,e){const r=function(...i){const a=t.interface.getEvent(e,i);return it(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},n=function(...i){return new Spe(t,r(...i),i)};return Qt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return it(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const OE=Symbol.for("_ethersInternal_contract"),hQ=new WeakMap;function Cpe(t,e){hQ.set(t[OE],e)}function Ts(t){return hQ.get(t[OE])}function Rpe(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function q8(t,e){let r,n=null;if(Array.isArray(e)){const a=function(s){if(ai(s,32))return s;const o=t.interface.getEvent(s);return Ne(o,"unknown fragment","name",s),o.topicHash};r=e.map(s=>s==null?null:Array.isArray(s)?s.map(a):a(s))}else e==="*"?r=[null]:typeof e=="string"?ai(e,32)?r=[e]:(n=t.interface.getEvent(e),Ne(n,"unknown fragment","event",e),r=[n.topicHash]):Rpe(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):Ne(!1,"unknown event name","event",e);r=r.map(a=>{if(a==null)return null;if(Array.isArray(a)){const s=Array.from(new Set(a.map(o=>o.toLowerCase())).values());return s.length===1?s[0]:(s.sort(),s)}return a.toLowerCase()});const i=r.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:n,tag:i,topics:r}}async function Wy(t,e){const{subs:r}=Ts(t);return r.get((await q8(t,e)).tag)||null}async function X9(t,e,r){const n=Fd(t.runner);it(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:s}=await q8(t,r),{addr:o,subs:c}=Ts(t);let u=c.get(a);if(!u){const h={address:o||t,topics:s},m=g=>{let _=i;if(_==null)try{_=t.interface.getEvent(g.topics[0])}catch{}if(_){const b=_,S=i?t.interface.decodeEventLog(i,g.data,g.topics):[];xR(t,r,S,A=>new Ape(t,A,r,b,g))}else xR(t,r,[],b=>new oQ(t,b,r,g))};let y=[];u={tag:a,listeners:[],start:()=>{y.length||y.push(n.on(h,m))},stop:async()=>{if(y.length==0)return;let g=y;y=[],await Promise.all(g),n.off(h,m)}},c.set(a,u)}return u}let ER=Promise.resolve();async function Npe(t,e,r,n){await ER;const i=await Wy(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:s,once:o})=>{const c=Array.from(r);n&&c.push(n(o?null:s));try{s.call(t,...c)}catch{}return!o}),i.listeners.length===0&&(i.stop(),Ts(t).subs.delete(i.tag)),a>0}async function xR(t,e,r,n){try{await ER}catch{}const i=Npe(t,e,r,n);return ER=i,await i}const Mw=["then"];var iDe;const Mv=class Mv{constructor(e,r,n,i){Be(this,"target");Be(this,"interface");Be(this,"runner");Be(this,"filters");Be(this,iDe);Be(this,"fallback");Ne(typeof e=="string"||gW(e),"invalid value for Contract target","target",e),n==null&&(n=null);const a=_R.from(r);Qt(this,{target:e,runner:n,interface:a}),Object.defineProperty(this,OE,{value:{}});let s,o=null,c=null;if(i){const h=Fd(n);c=new B8(this.interface,h,i)}let u=new Map;if(typeof e=="string")if(ai(e))o=e,s=Promise.resolve(e);else{const h=Eh(n,"resolveName");if(!jx(h))throw Ni("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});s=h.resolveName(e).then(m=>{if(m==null)throw Ni("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Ts(this).addr=m,m})}else s=e.getAddress().then(h=>{if(h==null)throw new Error("TODO");return Ts(this).addr=h,h});Cpe(this,{addrPromise:s,addr:o,deployTx:c,subs:u});const f=new Proxy({},{get:(h,m,y)=>{if(typeof m=="symbol"||Mw.indexOf(m)>=0)return Reflect.get(h,m,y);try{return this.getEvent(m)}catch(w){if(!wo(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(h,m)=>Mw.indexOf(m)>=0?Reflect.has(h,m):Reflect.has(h,m)||this.interface.hasEvent(String(m))});return Qt(this,{filters:f}),Qt(this,{fallback:a.receive||a.fallback?Ope(this):null}),new Proxy(this,{get:(h,m,y)=>{if(typeof m=="symbol"||m in h||Mw.indexOf(m)>=0)return Reflect.get(h,m,y);try{return h.getFunction(m)}catch(w){if(!wo(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(h,m)=>typeof m=="symbol"||m in h||Mw.indexOf(m)>=0?Reflect.has(h,m):h.interface.hasFunction(m)})}connect(e){return new Mv(this.target,this.interface,e)}attach(e){return new Mv(e,this.interface,this.runner)}async getAddress(){return await Ts(this).addrPromise}async getDeployedCode(){const e=Fd(this.runner);it(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Fd(this.runner);return it(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const s=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",s)}catch(o){a(o)}};s()})}deploymentTransaction(){return Ts(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Ppe(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Tpe(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:a}=Ts(this),s=i||await a,{fragment:o,topics:c}=await q8(this,e),u={address:s,topics:c,fromBlock:r,toBlock:n},f=Fd(this.runner);return it(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(h=>{let m=o;if(m==null)try{m=this.interface.getEvent(h.topics[0])}catch{}if(m)try{return new F8(h,this.interface,m)}catch(y){return new sQ(h,y)}return new r1(h,f)})}async on(e,r){const n=await X9(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await X9(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await xR(this,e,r,null)}async listenerCount(e){if(e){const i=await Wy(this,e);return i?i.listeners.length:0}const{subs:r}=Ts(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Wy(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:r}=Ts(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:a})=>a));return n}async off(e,r){const n=await Wy(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:a})=>a).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),Ts(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Wy(this,e);if(!r)return this;r.stop(),Ts(this).subs.delete(r.tag)}else{const{subs:r}=Ts(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends Mv{constructor(i,a=null){super(i,e,a)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};iDe=OE;let AR=Mv;function Dpe(){return AR}class _v extends Dpe(){}function HS(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Ne(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class Mpe{constructor(e){Be(this,"name");Qt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const pQ=new RegExp("^(ipfs)://(.*)$","i"),Z9=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),pQ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Kl,Xd,Wl,Np,cx,gQ;const Xp=class Xp{constructor(e,r,n){Qe(this,Wl);Be(this,"provider");Be(this,"address");Be(this,"name");Qe(this,Kl,void 0);Qe(this,Xd,void 0);Qt(this,{provider:e,address:r,name:n}),Te(this,Kl,null),Te(this,Xd,new _v(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return W(this,Kl)==null&&Te(this,Kl,(async()=>{try{return await W(this,Xd).supportsInterface("0x9061b923")}catch(e){if(wo(e,"CALL_EXCEPTION"))return!1;throw Te(this,Kl,null),e}})()),await W(this,Kl)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ct(this,Wl,Np).call(this,"addr(bytes32)");return a==null||a===hR?null:a}catch(a){if(wo(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const s=await ct(this,Wl,Np).call(this,"addr(bytes32,uint)",[a]);if(ai(s,20))return sn(s)}let r=null;for(const a of this.provider.plugins)if(a instanceof Mpe&&a.supportsCoinType(e)){r=a;break}if(r==null)return null;const n=await ct(this,Wl,Np).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;it(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await ct(this,Wl,Np).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await ct(this,Wl,Np).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",a=parseInt(r[4],16);if(r[5].length===a*2)return`${i}://${uK("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;it(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n<Z9.length;n++){const i=r.match(Z9[n]);if(i==null)continue;const a=i[1].toLowerCase();switch(a){case"https":case"data":return e.push({type:"url",value:r}),{linkage:e,url:r};case"ipfs":{const s=HS(r);return e.push({type:"ipfs",value:r}),e.push({type:"url",value:s}),{linkage:e,url:s}}case"erc721":case"erc1155":{const s=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:a,value:r});const o=await this.getAddress();if(o==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(i[2]||"").split("/");if(c.length!==2)return e.push({type:`!${a}caip`,value:i[2]||""}),{url:null,linkage:e};const u=c[1],f=new _v(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const v=await f.ownerOf(u);if(o!==v)return e.push({type:"!owner",value:v}),{url:null,linkage:e};e.push({type:"owner",value:v})}else if(a==="erc1155"){const v=await f.balanceOf(o,u);if(!v)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:v.toString()})}let h=await f[s](u);if(h==null||h==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:h}),a==="erc1155"&&(h=h.replace("{id}",Zu(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:h})),h.match(/^ipfs:/i)&&(h=HS(h)),e.push({type:"metadata-url",value:h});let m={};const y=await new Of(h).send();y.assertOk();try{m=y.bodyJson}catch{try{e.push({type:"!metadata",value:y.bodyText})}catch{const _=y.body;return _&&e.push({type:"!metadata",value:_t(_)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!m)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(m)});let w=m.image;if(typeof w!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!w.match(/^(https:\/\/|data:)/i)){if(w.match(pQ)==null)return e.push({type:"!imageUrl-ipfs",value:w}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:w}),w=HS(w)}return e.push({type:"url",value:w}),{linkage:e,url:w}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),n=r.getPlugin("org.ethers.plugins.network.Ens");return it(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),n.address}static async fromName(e,r){var i;let n=r;for(;;){if(n===""||n==="."||r!=="eth"&&n==="eth")return null;const a=await ct(i=Xp,cx,gQ).call(i,e,n);if(a!=null){const s=new Xp(e,a,r);return n!==r&&!await s.supportsWildcard()?null:s}n=n.split(".").slice(1).join(".")}}};Kl=new WeakMap,Xd=new WeakMap,Wl=new WeakSet,Np=async function(e,r){r=(r||[]).slice();const n=W(this,Xd).interface;r.unshift(bR(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),it(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),r=[Uhe(this.name),n.encodeFunctionData(i,r)],e="resolve(bytes,bytes)"),r.push({enableCcipRead:!0});try{const a=await W(this,Xd)[e](...r);return i?n.decodeFunctionResult(i,a)[0]:a}catch(a){if(!wo(a,"CALL_EXCEPTION"))throw a}return null},cx=new WeakSet,gQ=async function(e,r){const n=await Xp.getEnsAddress(e);try{const a=await new _v(n,["function resolver(bytes32) view returns (address)"],e).resolver(bR(r),{enableCcipRead:!0});return a===hR?null:a}catch(i){throw i}return null},Qe(Xp,cx);let PE=Xp;const eL=BigInt(0);function ni(t,e){return function(r){return r==null?e:t(r)}}function H8(t){return e=>{if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>t(r))}}function n1(t,e){return r=>{const n={};for(const i in t){let a=i;if(e&&i in e&&!(a in r)){for(const s of e[i])if(s in r){a=s;break}}try{const s=t[i](r[a]);s!==void 0&&(n[i]=s)}catch(s){const o=s instanceof Error?s.message:"not-an-error";it(!1,`invalid value for value.${i} (${o})`,"BAD_DATA",{value:r})}}return n}}function $pe(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Ne(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Eg(t){return Ne(ai(t,!0),"invalid data","value",t),t}function _o(t){return Ne(ai(t,32),"invalid hash","value",t),t}const kpe=n1({address:sn,blockHash:_o,blockNumber:jr,data:Eg,index:jr,removed:ni($pe,!1),topics:H8(_o),transactionHash:_o,transactionIndex:jr},{index:["logIndex"]});function Lpe(t){return kpe(t)}const jpe=n1({hash:ni(_o),parentHash:_o,number:jr,timestamp:jr,nonce:ni(Eg),difficulty:rr,gasLimit:rr,gasUsed:rr,miner:ni(sn),extraData:Eg,baseFeePerGas:ni(rr)});function Upe(t){const e=jpe(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:mQ(r)),e}const Fpe=n1({transactionIndex:jr,blockNumber:jr,transactionHash:_o,address:sn,topics:H8(_o),data:Eg,index:jr,blockHash:_o},{index:["logIndex"]});function Bpe(t){return Fpe(t)}const qpe=n1({to:ni(sn,null),from:ni(sn,null),contractAddress:ni(sn,null),index:jr,root:ni(_t),gasUsed:rr,logsBloom:ni(Eg),blockHash:_o,hash:_o,logs:H8(Bpe),blockNumber:jr,cumulativeGasUsed:rr,effectiveGasPrice:ni(rr),status:ni(jr),type:ni(jr,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Hpe(t){return qpe(t)}function mQ(t){t.to&&rr(t.to)===eL&&(t.to="0x0000000000000000000000000000000000000000");const e=n1({hash:_o,type:r=>r==="0x"||r==null?0:jr(r),accessList:ni(Mh,null),blockHash:ni(_o,null),blockNumber:ni(jr,null),transactionIndex:ni(jr,null),from:sn,gasPrice:ni(rr),maxPriorityFeePerGas:ni(rr),maxFeePerGas:ni(rr),gasLimit:rr,to:ni(sn,null),value:rr,nonce:jr,data:Eg,creates:ni(sn,null),chainId:ni(rr,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=qde(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=lc.from(t.signature):e.signature=lc.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&rr(e.blockHash)===eL&&(e.blockHash=null),e}const zpe="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class i1{constructor(e){Be(this,"name");Qt(this,{name:e})}clone(){return new i1(this.name)}}class Ux extends i1{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);Be(this,"effectiveBlock");Be(this,"txBase");Be(this,"txCreate");Be(this,"txDataZero");Be(this,"txDataNonzero");Be(this,"txAccessListStorageKey");Be(this,"txAccessListAddress");const i={effectiveBlock:r};function a(s,o){let c=(n||{})[s];c==null&&(c=o),Ne(typeof c=="number",`invalud value for ${s}`,"costs",n),i[s]=c}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),Qt(this,i)}clone(){return new Ux(this.effectiveBlock,this)}}class Fx extends i1{constructor(r,n){super("org.ethers.plugins.network.Ens");Be(this,"address");Be(this,"targetNetwork");Qt(this,{address:r||zpe,targetNetwork:n??1})}clone(){return new Fx(this.address,this.targetNetwork)}}var Db,Mb;class yQ extends i1{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Qe(this,Db,void 0);Qe(this,Mb,void 0);Te(this,Db,r),Te(this,Mb,n)}get url(){return W(this,Db)}get processFunc(){return W(this,Mb)}clone(){return this}}Db=new WeakMap,Mb=new WeakMap;const zS=new Map;var W0,Q0,Ql;const Zp=class Zp{constructor(e,r){Qe(this,W0,void 0);Qe(this,Q0,void 0);Qe(this,Ql,void 0);Te(this,W0,e),Te(this,Q0,rr(r)),Te(this,Ql,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return W(this,W0)}set name(e){Te(this,W0,e)}get chainId(){return W(this,Q0)}set chainId(e){Te(this,Q0,rr(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===rr(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===rr(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===rr(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(W(this,Ql).values())}attachPlugin(e){if(W(this,Ql).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return W(this,Ql).set(e.name,e.clone()),this}getPlugin(e){return W(this,Ql).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new Zp(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new Ux;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=r.txDataZero:n+=r.txDataNonzero;if(e.accessList){const i=Mh(e.accessList);for(const a in i)n+=r.txAccessListAddress+r.txAccessListStorageKey*i[a].storageKeys.length}return n}static from(e){if(Gpe(),e==null)return Zp.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const r=zS.get(e);if(r)return r();if(typeof e=="bigint")return new Zp("unknown",e);Ne(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){Ne(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const r=new Zp(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&r.attachPlugin(new Fx(e.ensAddress,e.ensNetwork)),r}Ne(!1,"invalid network","network",e)}static register(e,r){typeof e=="number"&&(e=BigInt(e));const n=zS.get(e);n&&Ne(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),zS.set(e,r)}};W0=new WeakMap,Q0=new WeakMap,Ql=new WeakMap;let Vu=Zp;function tL(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const n=r.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function rL(t){return new yQ(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[a,s]=await Promise.all([n.send(),e()]);i=a;const o=i.bodyJson.standard;return{gasPrice:s.gasPrice,maxFeePerGas:tL(o.maxFee,9),maxPriorityFeePerGas:tL(o.maxPriorityFee,9)}}catch(a){it(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:a})}})}function Vpe(t){return new yQ("data:",async(e,r,n)=>{const i=await e();if(i.maxFeePerGas==null||i.maxPriorityFeePerGas==null)return i;const a=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:a+t,maxPriorityFeePerGas:t}})}let nL=!1;function Gpe(){if(nL)return;nL=!0;function t(e,r,n){const i=function(){const a=new Vu(e,r);return n.ensNetwork!=null&&a.attachPlugin(new Fx(null,n.ensNetwork)),a.attachPlugin(new Ux),(n.plugins||[]).forEach(s=>{a.attachPlugin(s)}),a};Vu.register(e,i),Vu.register(r,i),n.altNames&&n.altNames.forEach(a=>{Vu.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[rL("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[rL("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[Vpe(BigInt("1000000"))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function SR(t){return JSON.parse(JSON.stringify(t))}var Mu,fo,Yl,Nc,Y0,P_;class Kpe{constructor(e){Qe(this,Y0);Qe(this,Mu,void 0);Qe(this,fo,void 0);Qe(this,Yl,void 0);Qe(this,Nc,void 0);Te(this,Mu,e),Te(this,fo,null),Te(this,Yl,4e3),Te(this,Nc,-2)}get pollingInterval(){return W(this,Yl)}set pollingInterval(e){Te(this,Yl,e)}start(){W(this,fo)||(Te(this,fo,W(this,Mu)._setTimeout(ct(this,Y0,P_).bind(this),W(this,Yl))),ct(this,Y0,P_).call(this))}stop(){W(this,fo)&&(W(this,Mu)._clearTimeout(W(this,fo)),Te(this,fo,null))}pause(e){this.stop(),e&&Te(this,Nc,-2)}resume(){this.start()}}Mu=new WeakMap,fo=new WeakMap,Yl=new WeakMap,Nc=new WeakMap,Y0=new WeakSet,P_=async function(){try{const e=await W(this,Mu).getBlockNumber();if(W(this,Nc)===-2){Te(this,Nc,e);return}if(e!==W(this,Nc)){for(let r=W(this,Nc)+1;r<=e;r++){if(W(this,fo)==null)return;await W(this,Mu).emit("block",r)}Te(this,Nc,e)}}catch{}W(this,fo)!=null&&Te(this,fo,W(this,Mu)._setTimeout(ct(this,Y0,P_).bind(this),W(this,Yl)))};var Zd,eh,Jl;class vQ{constructor(e){Qe(this,Zd,void 0);Qe(this,eh,void 0);Qe(this,Jl,void 0);Te(this,Zd,e),Te(this,Jl,!1),Te(this,eh,r=>{this._poll(r,W(this,Zd))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){W(this,Jl)||(Te(this,Jl,!0),W(this,eh).call(this,-2),W(this,Zd).on("block",W(this,eh)))}stop(){W(this,Jl)&&(Te(this,Jl,!1),W(this,Zd).off("block",W(this,eh)))}pause(e){this.stop()}resume(){this.start()}}Zd=new WeakMap,eh=new WeakMap,Jl=new WeakMap;var ux;class Wpe extends vQ{constructor(r,n){super(r);Qe(this,ux,void 0);Te(this,ux,SR(n))}async _poll(r,n){throw new Error("@TODO")}}ux=new WeakMap;var J0;class Qpe extends vQ{constructor(r,n){super(r);Qe(this,J0,void 0);Te(this,J0,n)}async _poll(r,n){const i=await n.getTransactionReceipt(W(this,J0));i&&n.emit(W(this,J0),i)}}J0=new WeakMap;var $u,X0,Z0,Xl,ho,lx,bQ;class z8{constructor(e,r){Qe(this,lx);Qe(this,$u,void 0);Qe(this,X0,void 0);Qe(this,Z0,void 0);Qe(this,Xl,void 0);Qe(this,ho,void 0);Te(this,$u,e),Te(this,X0,SR(r)),Te(this,Z0,ct(this,lx,bQ).bind(this)),Te(this,Xl,!1),Te(this,ho,-2)}start(){W(this,Xl)||(Te(this,Xl,!0),W(this,ho)===-2&&W(this,$u).getBlockNumber().then(e=>{Te(this,ho,e)}),W(this,$u).on("block",W(this,Z0)))}stop(){W(this,Xl)&&(Te(this,Xl,!1),W(this,$u).off("block",W(this,Z0)))}pause(e){this.stop(),e&&Te(this,ho,-2)}resume(){this.start()}}$u=new WeakMap,X0=new WeakMap,Z0=new WeakMap,Xl=new WeakMap,ho=new WeakMap,lx=new WeakSet,bQ=async function(e){if(W(this,ho)===-2)return;const r=SR(W(this,X0));r.fromBlock=W(this,ho)+1,r.toBlock=e;const n=await W(this,$u).getLogs(r);if(n.length===0){W(this,ho)<e-60&&Te(this,ho,e-60);return}for(const i of n)W(this,$u).emit(W(this,X0),i),Te(this,ho,i.blockNumber)};const Ype=BigInt(2),Jpe=10;function $w(t){return t&&typeof t.then=="function"}function T_(t,e){return t+":"+JSON.stringify(e,(r,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((a,s)=>(a[s]=n[s],a),{})}return n})}class wQ{constructor(e){Be(this,"name");Qt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Xpe(t){return JSON.parse(JSON.stringify(t))}function IR(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function VS(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"pending":case"debug":case"error":case"network":return{type:t,tag:t}}if(ai(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:T_("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:T_("orphan",r),filter:Xpe(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?IR(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],a=[],s=o=>{ai(o)?i.push(o):a.push((async()=>{i.push(await sa(o,e))})())};Array.isArray(r.address)?r.address.forEach(s):s(r.address),a.length&&await Promise.all(a),n.address=IR(i.map(o=>o.toLowerCase()))}return{filter:n,tag:T_("event",n),type:"event"}}Ne(!1,"unknown ProviderEvent","event",t)}function GS(){return new Date().getTime()}const Zpe={cacheTimeout:250,pollingInterval:4e3};var ba,Zl,wa,eg,Ns,th,ef,ku,$b,po,tg,rg,os,ro,kb,OR,Lb,PR,rh,Qy,jb,TR,nh,Yy,ng,C_;class e0e{constructor(e,r){Qe(this,os);Qe(this,kb);Qe(this,Lb);Qe(this,rh);Qe(this,jb);Qe(this,nh);Qe(this,ng);Qe(this,ba,void 0);Qe(this,Zl,void 0);Qe(this,wa,void 0);Qe(this,eg,void 0);Qe(this,Ns,void 0);Qe(this,th,void 0);Qe(this,ef,void 0);Qe(this,ku,void 0);Qe(this,$b,void 0);Qe(this,po,void 0);Qe(this,tg,void 0);Qe(this,rg,void 0);if(Te(this,rg,Object.assign({},Zpe,r||{})),e==="any")Te(this,th,!0),Te(this,Ns,null);else if(e){const n=Vu.from(e);Te(this,th,!1),Te(this,Ns,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else Te(this,th,!1),Te(this,Ns,null);Te(this,ku,-1),Te(this,ef,new Map),Te(this,ba,new Map),Te(this,Zl,new Map),Te(this,wa,null),Te(this,eg,!1),Te(this,$b,1),Te(this,po,new Map),Te(this,tg,!1)}get pollingInterval(){return W(this,rg).pollingInterval}get provider(){return this}get plugins(){return Array.from(W(this,Zl).values())}attachPlugin(e){if(W(this,Zl).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return W(this,Zl).set(e.name,e.connect(this)),this}getPlugin(e){return W(this,Zl).get(e)||null}get disableCcipRead(){return W(this,tg)}set disableCcipRead(e){Te(this,tg,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=r.toLowerCase(),s=[];for(let o=0;o<n.length;o++){const c=n[o],u=c.replace("{sender}",i).replace("{data}",a),f=new Of(u);c.indexOf("{data}")===-1&&(f.body={data:a,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:f,index:o,urls:n});let h="unknown error";const m=await f.send();try{const y=m.bodyJson;if(y.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:f,result:y}),y.data;y.message&&(h=y.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:f,result:y})}catch{}it(m.statusCode<400||m.statusCode>=500,`response not found during CCIP fetch: ${h}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:h}}),s.push(h)}it(!1,`error encountered during CCIP fetch: ${s.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:s}})}_wrapBlock(e,r){return new wpe(Upe(e),this)}_wrapLog(e,r){return new r1(Lpe(e),this)}_wrapTransactionReceipt(e,r){return new nQ(Hpe(e),this)}_wrapTransactionResponse(e,r){return new sb(mQ(e),this)}_detectNetwork(){it(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){it(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=jr(await ct(this,os,ro).call(this,{method:"getBlockNumber"}),"%response");return W(this,ku)>=0&&Te(this,ku,e),e}_getAddress(e){return sa(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(ai(e))return ai(e,32)?e:Gp(e);if(typeof e=="bigint"&&(e=jr(e,"blockTag")),typeof e=="number")return e>=0?Gp(e):W(this,ku)>=0?Gp(W(this,ku)+e):this.getBlockNumber().then(r=>Gp(r+e));Ne(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?IR(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,u,f)=>{let h;switch(c.length){case 0:break;case 1:h=c[0];break;default:c.sort(),h=c}if(n&&(u!=null||f!=null))throw new Error("invalid filter");const m={};return h&&(m.address=h),r.length&&(m.topics=r),u&&(m.fromBlock=u),f&&(m.toBlock=f),n&&(m.blockHash=n),m};let a=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)a.push(this._getAddress(c));else a.push(this._getAddress(e.address));let s;"fromBlock"in e&&(s=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),a.filter(c=>typeof c!="string").length||s!=null&&typeof s!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(a),s,o]).then(c=>i(c[0],c[1],c[2])):i(a,s,o)}_getTransactionRequest(e){const r=IE(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const a=sa(r[i],this);$w(a)?n.push(async function(){r[i]=await a}()):r[i]=a}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);$w(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(W(this,Ns)==null){const i=this._detectNetwork().then(a=>(this.emit("network",a,null),a),a=>{throw W(this,Ns)===i&&Te(this,Ns,null),a});return Te(this,Ns,i),(await i).clone()}const e=W(this,Ns),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(W(this,th)?(this.emit("network",n,r),W(this,Ns)===e&&Te(this,Ns,Promise.resolve(n))):it(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:a}=await _a({_block:ct(this,jb,TR).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ct(this,os,ro).call(this,{method:"getGasPrice"});return rr(u,"%response")}catch{}return null})()});let s=null,o=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(o=BigInt("1000000000"),s=c.baseFeePerGas*Ype+o),new Y9(a,s,o)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Of(n.url),a=await n.processFunc(r,this,i);return new Y9(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return $w(r)&&(r=await r),rr(await ct(this,os,ro).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await _a({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ct(this,Lb,PR).call(this,ct(this,kb,OR).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return rr(await ct(this,rh,Qy).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return jr(await ct(this,rh,Qy).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return _t(await ct(this,rh,Qy).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=rr(r,"position");return _t(await ct(this,rh,Qy).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await _a({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=nb.from(e);if(a.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await _a({network:this.getNetwork(),params:ct(this,jb,TR).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await _a({network:this.getNetwork(),params:ct(this,os,ro).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await _a({network:this.getNetwork(),params:ct(this,os,ro).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await ct(this,os,ro).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await _a({network:this.getNetwork(),result:ct(this,os,ro).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:_t(r)}async getLogs(e){let r=this._getFilter(e);$w(r)&&(r=await r);const{network:n,params:i}=await _a({network:this.getNetwork(),params:ct(this,os,ro).call(this,{method:"getLogs",filter:r})});return i.map(a=>this._wrapLog(a,n))}_getProvider(e){it(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await PE.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=sn(e);const r=bR(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await PE.getEnsAddress(this),a=await new _v(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(a==null||a===hR)return null;const o=await new _v(a,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(o)!==e?null:o}catch(n){if(wo(n,"BAD_DATA")&&n.value==="0x"||wo(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,s)=>{let o=null;const c=async u=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=i){a(f),o&&(clearTimeout(o),o=null);return}}catch(f){console.log("EEE",f)}this.once("block",c)};n!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",c),s(Ni("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){it(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=W(this,po).get(e);r&&(r.timer&&clearTimeout(r.timer),W(this,po).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=Em(this,$b)._++,i=()=>{W(this,po).delete(n),e()};if(this.paused)W(this,po).set(n,{timer:null,func:i,time:r});else{const a=setTimeout(i,r);W(this,po).set(n,{timer:a,func:i,time:GS()})}return n}_forEachSubscriber(e){for(const r of W(this,ba).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new wQ(e.type);case"block":{const r=new Kpe(this);return r.pollingInterval=this.pollingInterval,r}case"event":return new z8(this,e.filter);case"transaction":return new Qpe(this,e.hash);case"orphan":return new Wpe(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of W(this,ba).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),W(this,wa)!=null&&r.pause(W(this,wa));break}}async on(e,r){const n=await ct(this,ng,C_).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,W(this,wa)!=null&&n.subscriber.pause(W(this,wa))),this}async once(e,r){const n=await ct(this,ng,C_).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,W(this,wa)!=null&&n.subscriber.pause(W(this,wa))),this}async emit(e,...r){const n=await ct(this,nh,Yy).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:a,once:s})=>{const o=new lK(this,s?null:a,e);try{a.call(this,...r,o)}catch{}return!s}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),W(this,ba).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await ct(this,nh,Yy).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of W(this,ba).values())r+=n.length;return r}async listeners(e){if(e){const n=await ct(this,nh,Yy).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of W(this,ba).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await ct(this,nh,Yy).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:a})=>a).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),W(this,ba).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await ct(this,ng,C_).call(this,e);n&&i.stop(),W(this,ba).delete(r)}else for(const[r,{started:n,subscriber:i}]of W(this,ba))n&&i.stop(),W(this,ba).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return W(this,eg)}destroy(){this.removeAllListeners();for(const e of W(this,po).keys())this._clearTimeout(e);Te(this,eg,!0)}get paused(){return W(this,wa)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(Te(this,ku,-1),W(this,wa)!=null){if(W(this,wa)==!!e)return;it(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),Te(this,wa,!!e);for(const r of W(this,po).values())r.timer&&clearTimeout(r.timer),r.time=GS()-r.time}resume(){if(W(this,wa)!=null){this._forEachSubscriber(e=>e.resume()),Te(this,wa,null);for(const e of W(this,po).values()){let r=e.time;r<0&&(r=0),e.time=GS(),setTimeout(e.func,r)}}}}ba=new WeakMap,Zl=new WeakMap,wa=new WeakMap,eg=new WeakMap,Ns=new WeakMap,th=new WeakMap,ef=new WeakMap,ku=new WeakMap,$b=new WeakMap,po=new WeakMap,tg=new WeakMap,rg=new WeakMap,os=new WeakSet,ro=async function(e){const r=W(this,rg).cacheTimeout;if(r<0)return await this._perform(e);const n=T_(e.method,e);let i=W(this,ef).get(n);return i||(i=this._perform(e),W(this,ef).set(n,i),setTimeout(()=>{W(this,ef).get(n)===i&&W(this,ef).delete(n)},r)),await i},kb=new WeakSet,OR=async function(e,r,n){it(n<Jpe,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:r,enableCcipRead:!0})});const i=IE(e);try{return _t(await this._perform({method:"call",transaction:i,blockTag:r}))}catch(a){if(!this.disableCcipRead&&w8(a)&&a.data&&n>=0&&r==="latest"&&i.to!=null&&zn(a.data,0,4)==="0x556f1830"){const s=a.data,o=await sa(i.to,this);let c;try{c=a0e(zn(a.data,4))}catch(h){it(!1,h.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:s}})}it(c.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:s,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(i,c.calldata,c.urls);it(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:c.errorArgs}});const f={to:o,data:Bn([c.selector,i0e([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const h=await ct(this,kb,OR).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:h}),h}catch(h){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:h}),h}}throw a}},Lb=new WeakSet,PR=async function(e){const{value:r}=await _a({network:this.getNetwork(),value:e});return r},rh=new WeakSet,Qy=async function(e,r,n){let i=this._getAddress(r),a=this._getBlockTag(n);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ct(this,Lb,PR).call(this,ct(this,os,ro).call(this,Object.assign(e,{address:i,blockTag:a})))},jb=new WeakSet,TR=async function(e,r){if(ai(e,32))return await ct(this,os,ro).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await ct(this,os,ro).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},nh=new WeakSet,Yy=async function(e,r){let n=await VS(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await VS({orphan:"drop-log",log:r[0]},this)),W(this,ba).get(n.tag)||null},ng=new WeakSet,C_=async function(e){const r=await VS(e,this),n=r.tag;let i=W(this,ba).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},W(this,ba).set(n,i)),i};function t0e(t,e){try{const r=CR(t,e);if(r)return _8(r)}catch{}return null}function CR(t,e){if(t==="0x")return null;try{const r=jr(zn(t,e,e+32)),n=jr(zn(t,r,r+32));return zn(t,r+32,r+32+n)}catch{}return null}function iL(t){const e=gs(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 r0e(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const n0e=new Uint8Array([]);function i0e(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(n0e),r+=32;for(let n=0;n<t.length;n++){const i=qt(t[n]);e[n]=iL(r),e.push(iL(i.length)),e.push(r0e(i)),r+=32+Math.ceil(i.length/32)*32}return Bn(e)}const aL="0x0000000000000000000000000000000000000000000000000000000000000000";function a0e(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};it(l0(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=zn(t,0,32);it(zn(r,0,12)===zn(aL,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=zn(r,12);try{const n=[],i=jr(zn(t,32,64)),a=jr(zn(t,i,i+32)),s=zn(t,i+32);for(let o=0;o<a;o++){const c=t0e(s,o*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{it(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=CR(t,64);if(n==null)throw new Error("abort");e.calldata=n}catch{it(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}it(zn(t,100,128)===zn(aL,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=zn(t,96,100);try{const n=CR(t,128);if(n==null)throw new Error("abort");e.extraData=n}catch{it(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function yp(t,e){if(t.provider)return t.provider;it(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function sL(t,e){let r=IE(e);if(r.to!=null&&(r.to=sa(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),sa(n,t)]).then(([i,a])=>(Ne(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else r.from=t.getAddress();return await _a(r)}class V8{constructor(e){Be(this,"provider");Qt(this,{provider:e||null})}async getNonce(e){return yp(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await sL(this,e)}async populateTransaction(e){const r=yp(this,"populateTransaction"),n=await sL(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const s=rr(n.chainId);Ne(s===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const a=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||a)?Ne(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&a&&Ne(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const s=await r.getFeeData();it(s.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=s.gasPrice)}else{const s=await r.getFeeData();if(n.type==null)if(s.maxFeePerGas!=null&&s.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=s.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=s.maxPriorityFeePerGas);else s.gasPrice!=null?(it(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=s.gasPrice),n.type=0):it(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=s.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=s.maxPriorityFeePerGas))}return await _a(n)}async estimateGas(e){return yp(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return yp(this,"call").call(await this.populateCall(e))}async resolveName(e){return await yp(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=yp(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=nb.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var ig,R_;const ND=class ND extends V8{constructor(r,n){super(n);Qe(this,ig);Be(this,"address");Qt(this,{address:r})}async getAddress(){return this.address}connect(r){return new ND(this.address,r)}async signTransaction(r){ct(this,ig,R_).call(this,"transactions","signTransaction")}async signMessage(r){ct(this,ig,R_).call(this,"messages","signMessage")}async signTypedData(r,n,i){ct(this,ig,R_).call(this,"typed-data","signTypedData")}};ig=new WeakSet,R_=function(r,n){it(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let RR=ND;function s0e(t){return JSON.parse(JSON.stringify(t))}var cs,Dc,ih,tf,ah,ag,Ub,NR,Fb,DR;class _Q{constructor(e){Qe(this,Ub);Qe(this,Fb);Qe(this,cs,void 0);Qe(this,Dc,void 0);Qe(this,ih,void 0);Qe(this,tf,void 0);Qe(this,ah,void 0);Qe(this,ag,void 0);Te(this,cs,e),Te(this,Dc,null),Te(this,ih,ct(this,Ub,NR).bind(this)),Te(this,tf,!1),Te(this,ah,null),Te(this,ag,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){W(this,tf)||(Te(this,tf,!0),ct(this,Ub,NR).call(this,-2))}stop(){W(this,tf)&&(Te(this,tf,!1),Te(this,ag,!0),ct(this,Fb,DR).call(this),W(this,cs).off("block",W(this,ih)))}pause(e){e&&ct(this,Fb,DR).call(this),W(this,cs).off("block",W(this,ih))}resume(){this.start()}}cs=new WeakMap,Dc=new WeakMap,ih=new WeakMap,tf=new WeakMap,ah=new WeakMap,ag=new WeakMap,Ub=new WeakSet,NR=async function(e){try{W(this,Dc)==null&&Te(this,Dc,this._subscribe(W(this,cs)));let r=null;try{r=await W(this,Dc)}catch(a){if(!wo(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(r==null){Te(this,Dc,null),W(this,cs)._recoverSubscriber(this,this._recover(W(this,cs)));return}const n=await W(this,cs).getNetwork();if(W(this,ah)||Te(this,ah,n),W(this,ah).chainId!==n.chainId)throw new Error("chaid changed");if(W(this,ag))return;const i=await W(this,cs).send("eth_getFilterChanges",[r]);await this._emitResults(W(this,cs),i)}catch(r){console.log("@TODO",r)}W(this,cs).once("block",W(this,ih))},Fb=new WeakSet,DR=function(){const e=W(this,Dc);e&&(Te(this,Dc,null),e.then(r=>{W(this,cs).send("eth_uninstallFilter",[r])}))};var sh;class o0e extends _Q{constructor(r,n){super(r);Qe(this,sh,void 0);Te(this,sh,s0e(n))}_recover(r){return new z8(r,W(this,sh))}async _subscribe(r){return await r.send("eth_newFilter",[W(this,sh)])}async _emitResults(r,n){for(const i of n)r.emit(W(this,sh),r._wrapLog(i,r._network))}}sh=new WeakMap;class c0e extends _Q{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const u0e="bigint,boolean,function,number,string,symbol".split(/,/g);function N_(t){if(t==null||u0e.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(N_);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function l0e(t){return new Promise(e=>{setTimeout(e,t)})}function vp(t){return t&&t.toLowerCase()}function oL(t){return t&&typeof t.pollingInterval=="number"}const f0e={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class KS extends V8{constructor(r,n){super(r);Be(this,"address");n=sn(n),Qt(this,{address:n})}connect(r){it(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=N_(r),i=[];if(n.from){const s=n.from;i.push((async()=>{const o=await sa(s,this.provider);Ne(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const s=n.to;i.push((async()=>{n.to=await sa(s,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((a,s)=>{const o=[1e3,100],c=async()=>{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(n));return}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(r){const n=N_(r);if(n.from){const a=await sa(n.from,this.provider);Ne(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=a}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Wa(r):r;return await this.provider.send("personal_sign",[_t(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const a=N_(i),s=await _g.resolveNames(r,n,a,async o=>{const c=await sa(o);return Ne(c!=null,"TypedData does not support null address","value",o),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(_g.getPayload(s.domain,n,s.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Wa(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),_t(n)])}}var oh,sg,Lu,Mc,tc,ju,Bb,MR;class d0e extends e0e{constructor(r,n){super(r,n);Qe(this,Bb);Qe(this,oh,void 0);Qe(this,sg,void 0);Qe(this,Lu,void 0);Qe(this,Mc,void 0);Qe(this,tc,void 0);Qe(this,ju,void 0);Te(this,sg,1),Te(this,oh,Object.assign({},f0e,n||{})),Te(this,Lu,[]),Te(this,Mc,null),Te(this,ju,null);{let a=null;const s=new Promise(o=>{a=o});Te(this,tc,{promise:s,resolve:a})}const i=this._getOption("staticNetwork");i&&(Ne(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),Te(this,ju,i))}_getOption(r){return W(this,oh)[r]}get _network(){return it(W(this,ju),"network is not available yet","NETWORK_ERROR"),W(this,ju)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&rr(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)return r;if(this.ready)return Vu.from(rr(await this.send("eth_chainId",[])));const n={id:Em(this,sg)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0]}catch(a){throw this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Vu.from(rr(i.result));throw this.getRpcError(n,i)}_start(){W(this,tc)==null||W(this,tc).resolve==null||(W(this,tc).resolve(),Te(this,tc,null),(async()=>{for(;W(this,ju)==null&&!this.destroyed;)try{Te(this,ju,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Ni("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await l0e(1e3)}ct(this,Bb,MR).call(this)})())}async _waitUntilReady(){if(W(this,tc)!=null)return await W(this,tc).promise}_getSubscriber(r){return r.type==="pending"?new c0e(this):r.type==="event"?this._getOption("polling")?new z8(this,r.filter):new o0e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new wQ("orphan"):super._getSubscriber(r)}get ready(){return W(this,tc)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),n[a]=Gp(rr(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=_t(r[i]))}),r.accessList&&(n.accessList=Mh(r.accessList)),n}getRpcRequest(r){switch(r.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:[vp(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[vp(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[vp(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[vp(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(vp):r.filter.address=vp(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:a}=n;if(i==="eth_estimateGas"&&a.message){const c=a.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return Ni("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=$R(a),u=ab.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return u.info={error:a,payload:r},u}const s=JSON.stringify(p0e(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return Ni("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(s.match(/insufficient funds|base fee exceeds gas limit/i))return Ni("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:a}});if(s.match(/nonce/i)&&s.match(/too low/i))return Ni("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:a}});if(s.match(/replacement transaction/i)&&s.match(/underpriced/i))return Ni("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:a}});if(s.match(/only replay-protected/i))return Ni("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:a}}})}let o=!!s.match(/the method .* does not exist/i);return o||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(o=!0),o?Ni("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:a,payload:r}}):Ni("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(Ni("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=Em(this,sg)._++,a=new Promise((s,o)=>{W(this,Lu).push({resolve:s,reject:o,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return ct(this,Bb,MR).call(this),a}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const a=await n;if(r>=a.length)throw new Error("no such account");return new KS(this,a[r])}const{accounts:i}=await _a({network:this.getNetwork(),accounts:n});r=sn(r);for(const a of i)if(sn(a)===r)return new KS(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new KS(this,n))}destroy(){W(this,Mc)&&(clearTimeout(W(this,Mc)),Te(this,Mc,null));for(const{payload:r,reject:n}of W(this,Lu))n(Ni("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));Te(this,Lu,[]),super.destroy()}}oh=new WeakMap,sg=new WeakMap,Lu=new WeakMap,Mc=new WeakMap,tc=new WeakMap,ju=new WeakMap,Bb=new WeakSet,MR=function(){if(W(this,Mc))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Te(this,Mc,setTimeout(()=>{Te(this,Mc,null);const n=W(this,Lu);for(Te(this,Lu,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==W(this,oh).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(s=>s.payload)).length>W(this,oh).batchMaxSize){n.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(s=>s.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const s=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:s});for(const{resolve:o,reject:c,payload:u}of i){if(this.destroyed){c(Ni("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const f=s.filter(h=>h.id===u.id)[0];if(f==null){const h=Ni("missing response for request","BAD_DATA",{value:s,info:{payload:u}});this.emit("error",h),c(h);continue}if("error"in f){c(this.getRpcError(u,f));continue}o(f.result)}}catch(s){this.emit("debug",{action:"receiveRpcError",error:s});for(const{reject:o}of i)o(s)}})()}},r))};var rf;class h0e extends d0e{constructor(r,n){super(r,n);Qe(this,rf,void 0);Te(this,rf,4e3)}_getSubscriber(r){const n=super._getSubscriber(r);return oL(n)&&(n.pollingInterval=W(this,rf)),n}get pollingInterval(){return W(this,rf)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");Te(this,rf,r),this._forEachSubscriber(n=>{oL(n)&&(n.pollingInterval=W(this,rf))})}}rf=new WeakMap;function $R(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&ai(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=$R(t[e]);if(r)return r}return null}if(typeof t=="string")try{return $R(JSON.parse(t))}catch{}return null}function kR(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)kR(t[r],e);if(typeof t=="string")try{return kR(JSON.parse(t),e)}catch{}}}function p0e(t){const e=[];return kR(t,e),e}var og;class LR extends h0e{constructor(r,n){super(n,{batchMaxCount:1});Qe(this,og,void 0);Te(this,og,async(i,a)=>{const s={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:s});try{const o=await r.request(s);return this.emit("debug",{action:"receiveEip1193Result",result:o}),o}catch(o){const c=new Error(o.message);throw c.code=o.code,c.data=o.data,c.payload=s,this.emit("debug",{action:"receiveEip1193Error",error:c}),c}})}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){Ne(!Array.isArray(r),"EIP-1193 does not support batch request","payload",r);try{const n=await W(this,og).call(this,r.method,r.params||[]);return[{id:r.id,result:n}]}catch(n){return[{id:r.id,error:{code:n.code,data:n.data,message:n.message}}]}}getRpcError(r,n){switch(n=JSON.parse(JSON.stringify(n)),n.error.code||-1){case 4001:n.error.message=`ethers-user-denied: ${n.error.message}`;break;case 4200:n.error.message=`ethers-unsupported: ${n.error.message}`;break}return super.getRpcError(r,n)}async hasSigner(r){r==null&&(r=0);const n=await this.send("eth_accounts",[]);return typeof r=="number"?n.length>r:(r=r.toLowerCase(),n.filter(i=>i.toLowerCase()===r).length!==0)}async getSigner(r){if(r==null&&(r=0),!await this.hasSigner(r))try{await W(this,og).call(this,"eth_requestAccounts",[])}catch(n){const i=n.payload;throw this.getRpcError(i,{id:i.id,error:n})}return await super.getSigner(r)}}og=new WeakMap;var cg;const DD=class DD extends V8{constructor(r,n){super(n);Be(this,"address");Qe(this,cg,void 0);Ne(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),Te(this,cg,r);const i=t1(this.signingKey.publicKey);Qt(this,{address:i})}get signingKey(){return W(this,cg)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new DD(W(this,cg),r)}async signTransaction(r){const{to:n,from:i}=await _a({to:r.to?sa(r.to,this.provider):void 0,from:r.from?sa(r.from,this.provider):void 0});n!=null&&(r.to=n),i!=null&&(r.from=i),r.from!=null&&(Ne(sn(r.from)===this.address,"transaction from address mismatch","tx.from",r.from),delete r.from);const a=nb.from(r);return a.signature=this.signingKey.sign(a.unsignedHash),a.serialized}async signMessage(r){return this.signMessageSync(r)}signMessageSync(r){return this.signingKey.sign(Qhe(r)).serialized}async signTypedData(r,n,i){const a=await _g.resolveNames(r,n,i,async s=>{it(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:s}});const o=await this.provider.resolveName(s);return it(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:s}),o});return this.signingKey.sign(_g.hash(a.domain,n,a.value)).serialized}};cg=new WeakMap;let TE=DD;const CE=" !#$%&'()*+,-./<=>?@[]^_`{|}~",g0e=/^[a-z]*$/i;function cL(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(g0e)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function m0e(t,e){for(let i=CE.length-1;i>=0;i--)t=t.split(CE[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,a,s,o)=>{if(s)for(let c=parseInt(s);c>=0;c--)r.push(";");else r.push(a.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return cL(cL(r,";"),":")}function y0e(t){return Ne(t[0]==="0","unsupported auwl data","data",t),m0e(t.substring(1+2*CE.length),t.substring(1,1+2*CE.length))}class v0e{constructor(e){Be(this,"locale");Qt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var ug,qb,ch,Hb,jR;class b0e extends v0e{constructor(r,n,i){super(r);Qe(this,Hb);Qe(this,ug,void 0);Qe(this,qb,void 0);Qe(this,ch,void 0);Te(this,ug,n),Te(this,qb,i),Te(this,ch,null)}get _data(){return W(this,ug)}_decodeWords(){return y0e(W(this,ug))}getWord(r){const n=ct(this,Hb,jR).call(this);return Ne(r>=0&&r<n.length,`invalid word index: ${r}`,"index",r),n[r]}getWordIndex(r){return ct(this,Hb,jR).call(this).indexOf(r)}}ug=new WeakMap,qb=new WeakMap,ch=new WeakMap,Hb=new WeakSet,jR=function(){if(W(this,ch)==null){const r=this._decodeWords();if(el(r.join(`
|
|
69
|
+
`,y9=BigInt(0),v9=BigInt(1),b9=BigInt(2),w9=BigInt(27),_9=BigInt(28),Nw=BigInt(35),mp={};function E9(t){return bh(gs(t),32)}var T0,C0,R0,Yd;const Vo=class Vo{constructor(e,r,n,i){Qe(this,T0,void 0);Qe(this,C0,void 0);Qe(this,R0,void 0);Qe(this,Yd,void 0);kf(e,mp,"Signature"),Te(this,T0,r),Te(this,C0,n),Te(this,R0,i),Te(this,Yd,null)}get r(){return W(this,T0)}set r(e){Ne(l0(e)===32,"invalid r","value",e),Te(this,T0,_t(e))}get s(){return W(this,C0)}set s(e){Ne(l0(e)===32,"invalid s","value",e);const r=_t(e);Ne(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),Te(this,C0,r)}get v(){return W(this,R0)}set v(e){const r=jr(e,"value");Ne(r===27||r===28,"invalid v","v",e),Te(this,R0,r)}get networkV(){return W(this,Yd)}get legacyChainId(){const e=this.networkV;return e==null?null:Vo.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=qt(this.s);return this.yParity&&(e[0]|=128),_t(e)}get compactSerialized(){return Bn([this.r,this.yParityAndS])}get serialized(){return Bn([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Vo(mp,this.r,this.s,this.v);return this.networkV&&Te(e,Yd,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=rr(e,"v");return r==w9||r==_9?y9:(Ne(r>=Nw,"invalid EIP-155 v","v",e),(r-Nw)/b9)}static getChainIdV(e,r){return rr(e)*b9+BigInt(35+r-27)}static getNormalizedV(e){const r=rr(e);return r===y9||r===w9?27:r===v9||r===_9?28:(Ne(r>=Nw,"invalid v","v",e),r&v9?27:28)}static from(e){function r(u,f){Ne(u,f,"signature",e)}if(e==null)return new Vo(mp,m9,m9,27);if(typeof e=="string"){const u=qt(e,"signature");if(u.length===64){const f=_t(u.slice(0,32)),h=u.slice(32,64),m=h[0]&128?28:27;return h[0]&=127,new Vo(mp,f,_t(h),m)}if(u.length===65){const f=_t(u.slice(0,32)),h=u.slice(32,64);r((h[0]&128)===0,"non-canonical s");const m=Vo.getNormalizedV(u[64]);return new Vo(mp,f,_t(h),m)}r(!1,"invalid raw signature length")}if(e instanceof Vo)return e.clone();const n=e.r;r(n!=null,"missing r");const i=E9(n),a=function(u,f){if(u!=null)return E9(u);if(f!=null){r(ai(f,32),"invalid yParityAndS");const h=qt(f);return h[0]&=127,_t(h)}r(!1,"missing s")}(e.s,e.yParityAndS);r((qt(a)[0]&128)==0,"non-canonical s");const{networkV:s,v:o}=function(u,f,h){if(u!=null){const m=rr(u);return{networkV:m>=Nw?m:void 0,v:Vo.getNormalizedV(m)}}if(f!=null)return r(ai(f,32),"invalid yParityAndS"),{v:qt(f)[0]&128?28:27};if(h!=null){switch(jr(h,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Vo(mp,i,a,o);return s&&Te(c,Yd,s),r(e.yParity==null||jr(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};T0=new WeakMap,C0=new WeakMap,R0=new WeakMap,Yd=new WeakMap;let lc=Vo;var Cu;const Cd=class Cd{constructor(e){Qe(this,Cu,void 0);Ne(l0(e)===32,"invalid private key","privateKey","[REDACTED]"),Te(this,Cu,_t(e))}get privateKey(){return W(this,Cu)}get publicKey(){return Cd.computePublicKey(W(this,Cu))}get compressedPublicKey(){return Cd.computePublicKey(W(this,Cu),!0)}sign(e){Ne(l0(e)===32,"invalid digest length","digest",e);const r=kl.sign(Pa(e),Pa(W(this,Cu)),{lowS:!0});return lc.from({r:Zu(r.r,32),s:Zu(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Cd.computePublicKey(e);return _t(kl.getSharedSecret(Pa(W(this,Cu)),qt(r),!1))}static computePublicKey(e,r){let n=qt(e,"key");if(n.length===32){const a=kl.getPublicKey(n,!!r);return _t(a)}if(n.length===64){const a=new Uint8Array(65);a[0]=4,a.set(n,1),n=a}const i=kl.ProjectivePoint.fromHex(n);return _t(i.toRawBytes(r))}static recoverPublicKey(e,r){Ne(l0(e)===32,"invalid digest length","digest",e);const n=lc.from(r);let i=kl.Signature.fromCompact(Pa(Bn([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const a=i.recoverPublicKey(Pa(e));return Ne(a!=null,"invalid signautre for digest","signature",r),"0x"+a.toHex(!1)}static addPoints(e,r,n){const i=kl.ProjectivePoint.fromHex(Cd.computePublicKey(e).substring(2)),a=kl.ProjectivePoint.fromHex(Cd.computePublicKey(r).substring(2));return"0x"+i.add(a).toHex(!!n)}};Cu=new WeakMap;let Vc=Cd;const Lde=BigInt(0),jde=BigInt(36);function x9(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=qt(Fn(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const $8={};for(let t=0;t<10;t++)$8[String(t)]=String(t);for(let t=0;t<26;t++)$8[String.fromCharCode(65+t)]=String(10+t);const A9=15;function Ude(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>$8[n]).join("");for(;e.length>=A9;){let n=e.substring(0,A9);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const Fde=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function Bde(t){t=t.toLowerCase();let e=Lde;for(let r=0;r<t.length;r++)e=e*jde+Fde[t[r]];return e}function sn(t){if(Ne(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=x9(t);return Ne(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Ne(t.substring(2,4)===Ude(t),"bad icap checksum","address",t);let e=Bde(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return x9("0x"+e)}Ne(!1,"invalid address","address",t)}function qde(t){const e=sn(t.from);let n=rr(t.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,sn(zn(Fn(Jv([e,n])),12))}function gW(t){return t&&typeof t.getAddress=="function"}async function LS(t,e){const r=await e;return(r==null||r==="0x0000000000000000000000000000000000000000")&&(it(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),Ne(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),sn(r)}function sa(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?sn(t):(it(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),LS(t,e.resolveName(t)));if(gW(t))return LS(t,t.getAddress());if(t&&typeof t.then=="function")return LS(t,t);Ne(!1,"unsupported addressable value","target",t)}const wu={};function jt(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new Ra(wu,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function pn(t,e){return new Ra(wu,`bytes${e||""}`,t,{size:e})}const S9=Symbol.for("_ethers_typed");var Jd;const Eu=class Eu{constructor(e,r,n,i){Be(this,"type");Be(this,"value");Qe(this,Jd,void 0);Be(this,"_typedSymbol");i==null&&(i=null),kf(wu,e,"Typed"),Qt(this,{_typedSymbol:S9,type:r,value:n}),Te(this,Jd,i),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return W(this,Jd)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return W(this,Jd)===!0?-1:W(this,Jd)===!1?this.value.length:null}static from(e,r){return new Eu(wu,e,r)}static uint8(e){return jt(e,8)}static uint16(e){return jt(e,16)}static uint24(e){return jt(e,24)}static uint32(e){return jt(e,32)}static uint40(e){return jt(e,40)}static uint48(e){return jt(e,48)}static uint56(e){return jt(e,56)}static uint64(e){return jt(e,64)}static uint72(e){return jt(e,72)}static uint80(e){return jt(e,80)}static uint88(e){return jt(e,88)}static uint96(e){return jt(e,96)}static uint104(e){return jt(e,104)}static uint112(e){return jt(e,112)}static uint120(e){return jt(e,120)}static uint128(e){return jt(e,128)}static uint136(e){return jt(e,136)}static uint144(e){return jt(e,144)}static uint152(e){return jt(e,152)}static uint160(e){return jt(e,160)}static uint168(e){return jt(e,168)}static uint176(e){return jt(e,176)}static uint184(e){return jt(e,184)}static uint192(e){return jt(e,192)}static uint200(e){return jt(e,200)}static uint208(e){return jt(e,208)}static uint216(e){return jt(e,216)}static uint224(e){return jt(e,224)}static uint232(e){return jt(e,232)}static uint240(e){return jt(e,240)}static uint248(e){return jt(e,248)}static uint256(e){return jt(e,256)}static uint(e){return jt(e,256)}static int8(e){return jt(e,-8)}static int16(e){return jt(e,-16)}static int24(e){return jt(e,-24)}static int32(e){return jt(e,-32)}static int40(e){return jt(e,-40)}static int48(e){return jt(e,-48)}static int56(e){return jt(e,-56)}static int64(e){return jt(e,-64)}static int72(e){return jt(e,-72)}static int80(e){return jt(e,-80)}static int88(e){return jt(e,-88)}static int96(e){return jt(e,-96)}static int104(e){return jt(e,-104)}static int112(e){return jt(e,-112)}static int120(e){return jt(e,-120)}static int128(e){return jt(e,-128)}static int136(e){return jt(e,-136)}static int144(e){return jt(e,-144)}static int152(e){return jt(e,-152)}static int160(e){return jt(e,-160)}static int168(e){return jt(e,-168)}static int176(e){return jt(e,-176)}static int184(e){return jt(e,-184)}static int192(e){return jt(e,-192)}static int200(e){return jt(e,-200)}static int208(e){return jt(e,-208)}static int216(e){return jt(e,-216)}static int224(e){return jt(e,-224)}static int232(e){return jt(e,-232)}static int240(e){return jt(e,-240)}static int248(e){return jt(e,-248)}static int256(e){return jt(e,-256)}static int(e){return jt(e,-256)}static bytes1(e){return pn(e,1)}static bytes2(e){return pn(e,2)}static bytes3(e){return pn(e,3)}static bytes4(e){return pn(e,4)}static bytes5(e){return pn(e,5)}static bytes6(e){return pn(e,6)}static bytes7(e){return pn(e,7)}static bytes8(e){return pn(e,8)}static bytes9(e){return pn(e,9)}static bytes10(e){return pn(e,10)}static bytes11(e){return pn(e,11)}static bytes12(e){return pn(e,12)}static bytes13(e){return pn(e,13)}static bytes14(e){return pn(e,14)}static bytes15(e){return pn(e,15)}static bytes16(e){return pn(e,16)}static bytes17(e){return pn(e,17)}static bytes18(e){return pn(e,18)}static bytes19(e){return pn(e,19)}static bytes20(e){return pn(e,20)}static bytes21(e){return pn(e,21)}static bytes22(e){return pn(e,22)}static bytes23(e){return pn(e,23)}static bytes24(e){return pn(e,24)}static bytes25(e){return pn(e,25)}static bytes26(e){return pn(e,26)}static bytes27(e){return pn(e,27)}static bytes28(e){return pn(e,28)}static bytes29(e){return pn(e,29)}static bytes30(e){return pn(e,30)}static bytes31(e){return pn(e,31)}static bytes32(e){return pn(e,32)}static address(e){return new Eu(wu,"address",e)}static bool(e){return new Eu(wu,"bool",!!e)}static bytes(e){return new Eu(wu,"bytes",e)}static string(e){return new Eu(wu,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Eu(wu,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===S9}static dereference(e,r){if(Eu.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};Jd=new WeakMap;let Ra=Eu;class Hde extends al{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Ra.dereference(r,"string");try{n=sn(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return sn(Zu(e.readValue(),20))}}class zde extends al{constructor(r){super(r.name,r.type,"_",r.dynamic);Be(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function mW(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(u=>{const f=u.localName;return it(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),it(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),c[f]=!0,r[f]})}else Ne(!1,"invalid tuple value","tuple",r);Ne(e.length===n.length,"types/value length mismatch","tuple",r);let i=new sR,a=new sR,s=[];e.forEach((c,u)=>{let f=n[u];if(c.dynamic){let h=a.length;c.encode(a,f);let m=i.writeUpdatableValue();s.push(y=>{m(y+h)})}else c.encode(i,f)}),s.forEach(c=>{c(i.length)});let o=t.appendWriter(i);return o+=t.appendWriter(a),o}function yW(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(a=>{let s=null;if(a.dynamic){let o=t.readIndex(),c=i.subReader(o);try{s=a.decode(c)}catch(u){if(wo(u,"BUFFER_OVERRUN"))throw u;s=u,s.baseType=a.name,s.name=a.localName,s.type=a.type}}else try{s=a.decode(t)}catch(o){if(wo(o,"BUFFER_OVERRUN"))throw o;s=o,s.baseType=a.name,s.name=a.localName,s.type=a.type}if(s==null)throw new Error("investigate");r.push(s),n.push(a.localName||null)}),_E.fromItems(r,n)}class Vde extends al{constructor(r,n,i){const a=r.type+"["+(n>=0?n:"")+"]",s=n===-1||r.dynamic;super("array",a,i,s);Be(this,"coder");Be(this,"length");Qt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;i<this.length;i++)n.push(r);return n}encode(r,n){const i=Ra.dereference(n,"array");Array.isArray(i)||this._throwError("expected array value",i);let a=this.length;a===-1&&(a=i.length,r.writeValue(i.length)),nK(i.length,a,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let o=0;o<i.length;o++)s.push(this.coder);return mW(r,s,i)}decode(r){let n=this.length;n===-1&&(n=r.readIndex(),it(n*Va<=r.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:r.bytes,offset:n*Va,length:r.dataLength}));let i=[];for(let a=0;a<n;a++)i.push(new zde(this.coder));return yW(r,i)}}class Gde extends al{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){const n=Ra.dereference(r,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class vW extends al{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=Pa(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class Kde extends vW{constructor(e){super("bytes",e)}decode(e){return _t(super.decode(e))}}class Wde extends al{constructor(r,n){let i="bytes"+String(r);super(i,i,n,!1);Be(this,"size");Qt(this,{size:r},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(r,n){let i=Pa(Ra.dereference(n,this.type));return i.length!==this.size&&this._throwError("incorrect data length",n),r.writeBytes(i)}decode(r){return _t(r.readBytes(this.size))}}const Qde=new Uint8Array([]);class Yde extends al{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes(Qde)}decode(e){return e.readBytes(0),null}}const Jde=BigInt(0),Xde=BigInt(1),Zde=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ehe extends al{constructor(r,n,i){const a=(n?"int":"uint")+r*8;super(a,a,i,!1);Be(this,"size");Be(this,"signed");Qt(this,{size:r,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(r,n){let i=rr(Ra.dereference(n,this.type)),a=Ld(Zde,Va*8);if(this.signed){let s=Ld(a,this.size*8-1);(i>s||i<-(s+Xde))&&this._throwError("value out-of-bounds",n),i=cK(i,8*Va)}else(i<Jde||i>Ld(a,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=Ld(r.readValue(),this.size*8);return this.signed&&(n=wE(n,this.size*8)),n}}class the extends vW{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Wa(Ra.dereference(r,"string")))}decode(e){return _8(super.decode(e))}}class Dw extends al{constructor(r,n){let i=!1;const a=[];r.forEach(o=>{o.dynamic&&(i=!0),a.push(o.type)});const s="tuple("+a.join(",")+")";super("tuple",s,n,i);Be(this,"coders");Qt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,a)=>{const s=a.localName;return s&&(i[s]||(i[s]=0),i[s]++),i},{});return this.coders.forEach((i,a)=>{let s=i.localName;!s||n[s]!==1||(s==="length"&&(s="_length"),r[s]==null&&(r[s]=r[a]))}),Object.freeze(r)}encode(r,n){const i=Ra.dereference(n,"tuple");return mW(r,this.coders,i)}decode(r){return yW(r,this.coders)}}function el(t){return Fn(Wa(t))}var rhe="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkCh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Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),O9=4;function nhe(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,a=[0,1];for(let I=1;I<n;I++)a.push(i+=r());let s=r(),o=e;e+=s;let c=0,u=0;function f(){return c==0&&(u=u<<8|t[e++],c=8),u>>--c&1}const h=31,m=2**h,y=m>>>1,w=y>>1,v=m-1;let g=0;for(let I=0;I<h;I++)g=g<<1|f();let _=[],b=0,S=m;for(;;){let I=Math.floor(((g-b+1)*i-1)/S),E=0,p=n;for(;p-E>1;){let F=E+p>>>1;I<a[F]?p=F:E=F}if(E==0)break;_.push(E);let O=b+Math.floor(S*a[E]/i),N=b+Math.floor(S*a[E+1]/i)-1;for(;!((O^N)&y);)g=g<<1&v|f(),O=O<<1&v,N=N<<1&v|1;for(;O&~N&w;)g=g&y|g<<1&v>>>1|f(),O=O<<1^y,N=(N^y)<<1|y|1;b=O,S=1+N-O}let A=n-4;return _.map(I=>{switch(I-A){case 3:return A+65792+(t[o++]<<16|t[o++]<<8|t[o++]);case 2:return A+256+(t[o++]<<8|t[o++]);case 1:return A+t[o++];default:return I-1}})}function ihe(t){let e=0;return()=>t[e++]}function bW(t){return ihe(nhe(ahe(t)))}function ahe(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,a=0,s=0,o=0;i<r;i++)o=o<<6|e[t.charCodeAt(i)],s+=6,s>=8&&(n[a++]=o>>(s-=8));return n}function she(t){return t&1?~t>>1:t>>1}function ohe(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=she(e());return r}function Zv(t,e=0){let r=[];for(;;){let n=t(),i=t();if(!i)break;e+=n;for(let a=0;a<i;a++)r.push(e+a);e+=i+1}return r}function wW(t){return eb(()=>{let e=Zv(t);if(e.length)return e})}function _W(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(che(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(uhe(r,t))}return e.flat()}function eb(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function EW(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)ohe(t,r).forEach((a,s)=>n[s].push(a));return n}function che(t,e){let r=1+e(),n=e(),i=eb(e);return EW(i.length,1+t,e).flatMap((s,o)=>{let[c,...u]=s;return Array(i[o]).fill().map((f,h)=>{let m=h*n;return[c+h*r,u.map(y=>y+m)]})})}function uhe(t,e){let r=1+e();return EW(r,1+t,e).map(i=>[i[0],i.slice(1)])}function lhe(t){let e=[],r=Zv(t);return i(n([]),[]),e;function n(a){let s=t(),o=eb(()=>{let c=Zv(t).map(u=>r[u]);if(c.length)return n(c)});return{S:s,B:o,Q:a}}function i({S:a,B:s},o,c){if(!(a&4&&c===o[o.length-1])){a&2&&(c=o[o.length-1]),a&1&&e.push(o);for(let u of s)for(let f of u.Q)i(u,[...o,f],c)}}}function fhe(t){return t.toString(16).toUpperCase().padStart(2,"0")}function xW(t){return`{${fhe(t)}}`}function dhe(t){let e=[];for(let r=0,n=t.length;r<n;){let i=t.codePointAt(r);r+=i<65536?1:2,e.push(i)}return e}function bg(t){let r=t.length;if(r<4096)return String.fromCodePoint(...t);let n=[];for(let i=0;i<r;)n.push(String.fromCodePoint(...t.slice(i,i+=4096)));return n.join("")}function hhe(t,e){let r=t.length,n=r-e.length;for(let i=0;n==0&&i<r;i++)n=t[i]-e[i];return n}var phe="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tAB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4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const tb=44032,EE=4352,xE=4449,AE=4519,AW=19,SW=21,wg=28,SE=SW*wg,ghe=AW*SE,mhe=tb+ghe,yhe=EE+AW,vhe=xE+SW,bhe=AE+wg;function Ky(t){return t>>24&255}function IW(t){return t&16777215}let pR,P9,gR,A_;function whe(){let t=bW(phe);pR=new Map(wW(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),P9=new Set(Zv(t)),gR=new Map,A_=new Map;for(let[e,r]of _W(t)){if(!P9.has(e)&&r.length==2){let[n,i]=r,a=A_.get(n);a||(a=new Map,A_.set(n,a)),a.set(i,e)}gR.set(e,r.reverse())}}function OW(t){return t>=tb&&t<mhe}function _he(t,e){if(t>=EE&&t<yhe&&e>=xE&&e<vhe)return tb+(t-EE)*SE+(e-xE)*wg;if(OW(t)&&e>AE&&e<bhe&&(t-tb)%wg==0)return t+(e-AE);{let r=A_.get(t);return r&&(r=r.get(e),r)?r:-1}}function PW(t){pR||whe();let e=[],r=[],n=!1;function i(a){let s=pR.get(a);s&&(n=!0,a|=s),e.push(a)}for(let a of t)for(;;){if(a<128)e.push(a);else if(OW(a)){let s=a-tb,o=s/SE|0,c=s%SE/wg|0,u=s%wg;i(EE+o),i(xE+c),u>0&&i(AE+u)}else{let s=gR.get(a);s?r.push(...s):i(a)}if(!r.length)break;a=r.pop()}if(n&&e.length>1){let a=Ky(e[0]);for(let s=1;s<e.length;s++){let o=Ky(e[s]);if(o==0||a<=o){a=o;continue}let c=s-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(a=Ky(e[--c]),a<=o))break}a=Ky(e[s])}}return e}function Ehe(t){let e=[],r=[],n=-1,i=0;for(let a of t){let s=Ky(a),o=IW(a);if(n==-1)s==0?n=o:e.push(o);else if(i>0&&i>=s)s==0?(e.push(n,...r),r.length=0,n=o):r.push(o),i=s;else{let c=_he(n,o);c>=0?n=c:i==0&&s==0?(e.push(n),n=o):(r.push(o),i=s)}}return n>=0&&e.push(n,...r),e}function TW(t){return PW(t).map(IW)}function xhe(t){return Ehe(PW(t))}const T9=45,CW=".",RW=65039,NW=1,Wp=t=>Array.from(t);function rb(t,e){return t.P.has(e)||t.Q.has(e)}class Ahe extends Array{get is_emoji(){return!0}}let mR,DW,Ud,yR,MW,h0,jS,Cp,$W,C9,vR;function k8(){if(mR)return;let t=bW(rhe);const e=()=>Zv(t),r=()=>new Set(e());mR=new Map(_W(t)),DW=r(),Ud=e(),yR=new Set(e().map(f=>Ud[f])),Ud=new Set(Ud),MW=r(),r();let n=wW(t),i=t();const a=()=>new Set(e().flatMap(f=>n[f]).concat(e()));h0=eb(f=>{let h=eb(t).map(m=>m+96);if(h.length){let m=f>=i;h[0]-=32,h=bg(h),m&&(h=`Restricted[${h}]`);let y=a(),w=a(),v=!t();return{N:h,P:y,Q:w,M:v,R:m}}}),jS=r(),Cp=new Map;let s=e().concat(Wp(jS)).sort((f,h)=>f-h);s.forEach((f,h)=>{let m=t(),y=s[h]=m?s[h-m]:{V:[],M:new Map};y.V.push(f),jS.has(f)||Cp.set(f,y)});for(let{V:f,M:h}of new Set(Cp.values())){let m=[];for(let w of f){let v=h0.filter(_=>rb(_,w)),g=m.find(({G:_})=>v.some(b=>_.has(b)));g||(g={G:new Set,V:[]},m.push(g)),g.V.push(w),v.forEach(_=>g.G.add(_))}let y=m.flatMap(w=>Wp(w.G));for(let{G:w,V:v}of m){let g=new Set(y.filter(_=>!w.has(_)));for(let _ of v)h.set(_,g)}}let o=new Set,c=new Set;const u=f=>o.has(f)?c.add(f):o.add(f);for(let f of h0){for(let h of f.P)u(h);for(let h of f.Q)u(h)}for(let f of o)!Cp.has(f)&&!c.has(f)&&Cp.set(f,NW);$W=new Set(Wp(o).concat(Wp(TW(o)))),C9=lhe(t).map(f=>Ahe.from(f)).sort(hhe),vR=new Map;for(let f of C9){let h=[vR];for(let m of f){let y=h.map(w=>{let v=w.get(m);return v||(v=new Map,w.set(m,v)),v});m===RW?h.push(...y):h=y}for(let m of h)m.V=f}}function L8(t){return(kW(t)?"":`${j8(Mx([t]))} `)+xW(t)}function j8(t){return`"${t}"`}function She(t){if(t.length>=4&&t[2]==T9&&t[3]==T9)throw new Error(`invalid label extension: "${bg(t.slice(0,4))}"`)}function Ihe(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function Ohe(t){let e=t[0],r=I9.get(e);if(r)throw bv(`leading ${r}`);let n=t.length,i=-1;for(let a=1;a<n;a++){e=t[a];let s=I9.get(e);if(s){if(i==a)throw bv(`${r} + ${s}`);i=a+1,r=s}}if(i==n)throw bv(`trailing ${r}`)}function Mx(t,e=xW){let r=[];Phe(t[0])&&r.push("◌");let n=0,i=t.length;for(let a=0;a<i;a++){let s=t[a];kW(s)&&(r.push(bg(t.slice(n,a))),r.push(e(s)),n=a+1)}return r.push(bg(t.slice(n,i))),r.join("")}function Phe(t){return k8(),Ud.has(t)}function kW(t){return k8(),MW.has(t)}function The(t){return Dhe(Che(t,xhe,khe))}function Che(t,e,r){if(!t)return[];k8();let n=0;return t.split(CW).map(i=>{let a=dhe(i),s={input:a,offset:n};n+=a.length+1;try{let o=s.tokens=$he(a,e,r),c=o.length,u;if(!c)throw new Error("empty label");let f=s.output=o.flat();if(Ihe(f),!(s.emoji=c>1||o[0].is_emoji)&&f.every(m=>m<128))She(f),u="ASCII";else{let m=o.flatMap(y=>y.is_emoji?[]:y);if(!m.length)u="Emoji";else{if(Ud.has(f[0]))throw bv("leading combining mark");for(let v=1;v<c;v++){let g=o[v];if(!g.is_emoji&&Ud.has(g[0]))throw bv(`emoji + combining mark: "${bg(o[v-1])} + ${Mx([g[0]])}"`)}Ohe(f);let y=Wp(new Set(m)),[w]=Nhe(y);Mhe(w,m),Rhe(w,y),u=w.N}}s.type=u}catch(o){s.error=o}return s})}function Rhe(t,e){let r,n=[];for(let i of e){let a=Cp.get(i);if(a===NW)return;if(a){let s=a.M.get(i);if(r=r?r.filter(o=>s.has(o)):Wp(s),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(a=>rb(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function Nhe(t){let e=h0;for(let r of t){let n=e.filter(i=>rb(i,r));if(!n.length)throw h0.some(i=>rb(i,r))?jW(e[0],r):LW(r);if(e=n,n.length==1)break}return e}function Dhe(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${j8(Mx(e))}: ${i}`)}return bg(n)}).join(CW)}function LW(t){return new Error(`disallowed character: ${L8(t)}`)}function jW(t,e){let r=L8(e),n=h0.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function bv(t){return new Error(`illegal placement: ${t}`)}function Mhe(t,e){for(let r of e)if(!rb(t,r))throw jW(t,r);if(t.M){let r=TW(e);for(let n=1,i=r.length;n<i;n++)if(yR.has(r[n])){let a=n+1;for(let s;a<i&&yR.has(s=r[a]);a++)for(let o=n;o<a;o++)if(r[o]==s)throw new Error(`duplicate non-spacing marks: ${L8(s)}`);if(a-n>O9)throw new Error(`excessive non-spacing marks: ${j8(Mx(r.slice(n-1,a)))} (${a-n}/${O9})`);n=a}}}function $he(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let a=Lhe(t);if(a)i.length&&(n.push(e(i)),i=[]),n.push(r(a));else{let s=t.pop();if($W.has(s))i.push(s);else{let o=mR.get(s);if(o)i.push(...o);else if(!DW.has(s))throw LW(s)}}}return i.length&&n.push(e(i)),n}function khe(t){return t.filter(e=>e!=RW)}function Lhe(t,e){let r=vR,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:a}=r;a&&(n=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return n}const UW=new Uint8Array(32);UW.fill(0);function R9(t){return Ne(t.length!==0,"invalid ENS name; empty component","comp",t),t}function FW(t){const e=Wa(jhe(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(R9(e.slice(n,i))),n=i+1);return Ne(n<e.length,"invalid ENS name; empty component","name",t),r.push(R9(e.slice(n))),r}function jhe(t){try{if(t.length===0)throw new Error("empty label");return The(t)}catch(e){Ne(!1,`invalid ENS name (${e.message})`,"name",t)}}function bR(t){Ne(typeof t=="string","invalid ENS name; not a string","name",t),Ne(t.length,"invalid ENS name (empty label)","name",t);let e=UW;const r=FW(t);for(;r.length;)e=Fn(Bn([e,Fn(r.pop())]));return _t(e)}function Uhe(t){return _t(Bn(FW(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}function US(t,e){return{address:sn(t),storageKeys:e.map((r,n)=>(Ne(ai(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Mh(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(Ne(r.length===2,"invalid slot set",`value[${n}]`,r),US(r[0],r[1])):(Ne(r!=null&&typeof r=="object","invalid address-slot set","value",t),US(r.address,r.storageKeys)));Ne(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,a)=>(i[a]=!0,i),{});return US(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function t1(t){let e;return typeof t=="string"?e=Vc.computePublicKey(t,!1):e=t.publicKey,sn(Fn("0x"+e.substring(4)).substring(26))}function Fhe(t,e){return t1(Vc.recoverPublicKey(t,e))}const ds=BigInt(0),Bhe=BigInt(2),qhe=BigInt(27),Hhe=BigInt(28),zhe=BigInt(35),Vhe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function U8(t){return t==="0x"?null:sn(t)}function BW(t,e){try{return Mh(t)}catch(r){Ne(!1,r.message,e,t)}}function $x(t,e){return t==="0x"?0:jr(t,e)}function Ba(t,e){if(t==="0x")return ds;const r=rr(t,e);return Ne(r<=Vhe,"value exceeds uint size",e,r),r}function ra(t,e){const r=rr(t,"value"),n=gs(r);return Ne(n.length<=32,"value too large",`tx.${e}`,r),n}function qW(t){return Mh(t).map(e=>[e.address,e.storageKeys])}function Ghe(t){const e=E8(t);Ne(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:$x(e[0],"nonce"),gasPrice:Ba(e[1],"gasPrice"),gasLimit:Ba(e[2],"gasLimit"),to:U8(e[3]),value:Ba(e[4],"value"),data:_t(e[5]),chainId:ds};if(e.length===6)return r;const n=Ba(e[6],"v"),i=Ba(e[7],"r"),a=Ba(e[8],"s");if(i===ds&&a===ds)r.chainId=n;else{let s=(n-zhe)/Bhe;s<ds&&(s=ds),r.chainId=s,Ne(s!==ds||n===qhe||n===Hhe,"non-canonical legacy v","v",e[6]),r.signature=lc.from({r:bh(e[7],32),s:bh(e[8],32),v:n}),r.hash=Fn(t)}return r}function N9(t,e){const r=[ra(t.nonce||0,"nonce"),ra(t.gasPrice||0,"gasPrice"),ra(t.gasLimit||0,"gasLimit"),t.to!=null?sn(t.to):"0x",ra(t.value||0,"value"),t.data||"0x"];let n=ds;if(t.chainId!=ds)n=rr(t.chainId,"tx.chainId"),Ne(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const a=t.signature.legacyChainId;a!=null&&(n=a)}if(!e)return n!==ds&&(r.push(gs(n)),r.push("0x"),r.push("0x")),Jv(r);let i=BigInt(27+e.yParity);return n!==ds?i=lc.getChainIdV(n,e.v):BigInt(e.v)!==i&&Ne(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(gs(i)),r.push(gs(e.r)),r.push(gs(e.s)),Jv(r)}function HW(t,e){let r;try{if(r=$x(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{Ne(!1,"invalid yParity","yParity",e[0])}const n=bh(e[1],32),i=bh(e[2],32),a=lc.from({r:n,s:i,yParity:r});t.signature=a}function Khe(t){const e=E8(qt(t).slice(1));Ne(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",_t(t));const r=Ba(e[2],"maxPriorityFeePerGas"),n=Ba(e[3],"maxFeePerGas"),i={type:2,chainId:Ba(e[0],"chainId"),nonce:$x(e[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ba(e[4],"gasLimit"),to:U8(e[5]),value:Ba(e[6],"value"),data:_t(e[7]),accessList:BW(e[8],"accessList")};return e.length===9||(i.hash=Fn(t),HW(i,e.slice(9))),i}function D9(t,e){const r=[ra(t.chainId||0,"chainId"),ra(t.nonce||0,"nonce"),ra(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ra(t.maxFeePerGas||0,"maxFeePerGas"),ra(t.gasLimit||0,"gasLimit"),t.to!=null?sn(t.to):"0x",ra(t.value||0,"value"),t.data||"0x",qW(t.accessList||[])];return e&&(r.push(ra(e.yParity,"yParity")),r.push(gs(e.r)),r.push(gs(e.s))),Bn(["0x02",Jv(r)])}function Whe(t){const e=E8(qt(t).slice(1));Ne(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",_t(t));const r={type:1,chainId:Ba(e[0],"chainId"),nonce:$x(e[1],"nonce"),gasPrice:Ba(e[2],"gasPrice"),gasLimit:Ba(e[3],"gasLimit"),to:U8(e[4]),value:Ba(e[5],"value"),data:_t(e[6]),accessList:BW(e[7],"accessList")};return e.length===8||(r.hash=Fn(t),HW(r,e.slice(8))),r}function M9(t,e){const r=[ra(t.chainId||0,"chainId"),ra(t.nonce||0,"nonce"),ra(t.gasPrice||0,"gasPrice"),ra(t.gasLimit||0,"gasLimit"),t.to!=null?sn(t.to):"0x",ra(t.value||0,"value"),t.data||"0x",qW(t.accessList||[])];return e&&(r.push(ra(e.yParity,"recoveryParam")),r.push(gs(e.r)),r.push(gs(e.s))),Bn(["0x01",Jv(r)])}var Ru,N0,D0,M0,$0,k0,L0,j0,U0,F0,B0,q0;const Fl=class Fl{constructor(){Qe(this,Ru,void 0);Qe(this,N0,void 0);Qe(this,D0,void 0);Qe(this,M0,void 0);Qe(this,$0,void 0);Qe(this,k0,void 0);Qe(this,L0,void 0);Qe(this,j0,void 0);Qe(this,U0,void 0);Qe(this,F0,void 0);Qe(this,B0,void 0);Qe(this,q0,void 0);Te(this,Ru,null),Te(this,N0,null),Te(this,M0,0),Te(this,$0,BigInt(0)),Te(this,k0,null),Te(this,L0,null),Te(this,j0,null),Te(this,D0,"0x"),Te(this,U0,BigInt(0)),Te(this,F0,BigInt(0)),Te(this,B0,null),Te(this,q0,null)}get type(){return W(this,Ru)}set type(e){switch(e){case null:Te(this,Ru,null);break;case 0:case"legacy":Te(this,Ru,0);break;case 1:case"berlin":case"eip-2930":Te(this,Ru,1);break;case 2:case"london":case"eip-1559":Te(this,Ru,2);break;default:Ne(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}get to(){return W(this,N0)}set to(e){Te(this,N0,e==null?null:sn(e))}get nonce(){return W(this,M0)}set nonce(e){Te(this,M0,jr(e,"value"))}get gasLimit(){return W(this,$0)}set gasLimit(e){Te(this,$0,rr(e))}get gasPrice(){const e=W(this,k0);return e==null&&(this.type===0||this.type===1)?ds:e}set gasPrice(e){Te(this,k0,e==null?null:rr(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=W(this,L0);return e??(this.type===2?ds:null)}set maxPriorityFeePerGas(e){Te(this,L0,e==null?null:rr(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=W(this,j0);return e??(this.type===2?ds:null)}set maxFeePerGas(e){Te(this,j0,e==null?null:rr(e,"maxFeePerGas"))}get data(){return W(this,D0)}set data(e){Te(this,D0,_t(e))}get value(){return W(this,U0)}set value(e){Te(this,U0,rr(e,"value"))}get chainId(){return W(this,F0)}set chainId(e){Te(this,F0,rr(e))}get signature(){return W(this,B0)||null}set signature(e){Te(this,B0,e==null?null:lc.from(e))}get accessList(){const e=W(this,q0)||null;return e??(this.type===1||this.type===2?[]:null)}set accessList(e){Te(this,q0,e==null?null:Mh(e))}get hash(){return this.signature==null?null:Fn(this.serialized)}get unsignedHash(){return Fn(this.unsignedSerialized)}get from(){return this.signature==null?null:Fhe(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Vc.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){switch(it(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return N9(this,this.signature);case 1:return M9(this,this.signature);case 2:return D9(this,this.signature)}it(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return N9(this);case 1:return M9(this);case 2:return D9(this)}it(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){return this.inferTypes().pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&it(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),it(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),it(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):r?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Fl.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Fl;if(typeof e=="string"){const n=qt(e);if(n[0]>=127)return Fl.from(Ghe(n));switch(n[0]){case 1:return Fl.from(Whe(n));case 2:return Fl.from(Khe(n))}it(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Fl;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=lc.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.hash!=null&&(Ne(r.isSigned(),"unsigned transaction cannot define hash","tx",e),Ne(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Ne(r.isSigned(),"unsigned transaction cannot define from","tx",e),Ne(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};Ru=new WeakMap,N0=new WeakMap,D0=new WeakMap,M0=new WeakMap,$0=new WeakMap,k0=new WeakMap,L0=new WeakMap,j0=new WeakMap,U0=new WeakMap,F0=new WeakMap,B0=new WeakMap,q0=new WeakMap;let nb=Fl;function Qhe(t){return typeof t=="string"&&(t=Wa(t)),Fn(Bn([Wa(kde),Wa(String(t.length)),t]))}const zW=new Uint8Array(32);zW.fill(0);const Yhe=BigInt(-1),VW=BigInt(0),GW=BigInt(1),Jhe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Xhe(t){const e=qt(t),r=e.length%32;return r?Bn([e,zW.slice(r)]):_t(e)}const Zhe=Zu(GW,32),epe=Zu(VW,32),$9={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},FS=["name","version","chainId","verifyingContract","salt"];function k9(t){return function(e){return Ne(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const tpe={name:k9("name"),version:k9("version"),chainId:function(t){const e=rr(t,"domain.chainId");return Ne(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Gp(e)},verifyingContract:function(t){try{return sn(t).toLowerCase()}catch{}Ne(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=qt(t,"domain.salt");return Ne(e.length===32,'invalid domain value "salt"',"domain.salt",t),_t(e)}};function BS(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");Ne(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",t);const i=Ld(Jhe,r?n-1:n),a=r?(i+GW)*Yhe:VW;return function(s){const o=rr(s,"value");return Ne(o>=a&&o<=i,`value out-of-bounds for ${t}`,"value",o),Zu(r?cK(o,256):o,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return Ne(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=qt(n);return Ne(i.length===r,`invalid length for ${t}`,"value",n),Xhe(n)}}}switch(t){case"address":return function(e){return bh(sn(e),32)};case"bool":return function(e){return e?Zhe:epe};case"bytes":return function(e){return Fn(e)};case"string":return function(e){return el(e)}}return null}function L9(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}var Pb,Nu,H0,ax,KW;const co=class co{constructor(e){Qe(this,ax);Be(this,"primaryType");Qe(this,Pb,void 0);Qe(this,Nu,void 0);Qe(this,H0,void 0);Te(this,Pb,JSON.stringify(e)),Te(this,Nu,new Map),Te(this,H0,new Map);const r=new Map,n=new Map,i=new Map;Object.keys(e).forEach(o=>{r.set(o,new Set),n.set(o,[]),i.set(o,new Set)});for(const o in e){const c=new Set;for(const u of e[o]){Ne(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(o)}`,"types",e),c.add(u.name);const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Ne(f!==o,`circular type reference to ${JSON.stringify(f)}`,"types",e),!BS(f)&&(Ne(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(o),r.get(o).add(f))}}const a=Array.from(n.keys()).filter(o=>n.get(o).length===0);Ne(a.length!==0,"missing primary type","types",e),Ne(a.length===1,`ambiguous primary types or unused types: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),Qt(this,{primaryType:a[0]});function s(o,c){Ne(!c.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),c.add(o);for(const u of r.get(o))if(n.has(u)){s(u,c);for(const f of c)i.get(f).add(u)}c.delete(o)}s(this.primaryType,new Set);for(const[o,c]of i){const u=Array.from(c);u.sort(),W(this,Nu).set(o,L9(o,e[o])+u.map(f=>L9(f,e[f])).join(""))}}get types(){return JSON.parse(W(this,Pb))}getEncoder(e){let r=W(this,H0).get(e);return r||(r=ct(this,ax,KW).call(this,e),W(this,H0).set(e,r)),r}encodeType(e){const r=W(this,Nu).get(e);return Ne(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Fn(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(BS(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Ne(!i[3]||parseInt(i[3])===r.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",r),r.map(s=>this._visit(i[1],s,n));const a=this.types[e];if(a)return a.reduce((s,{name:o,type:c})=>(s[o]=this._visit(c,r[o],n),s),{});Ne(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new co(e)}static getPrimaryType(e){return co.from(e).primaryType}static hashStruct(e,r,n){return co.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=$9[n];Ne(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>FS.indexOf(n.name)-FS.indexOf(i.name)),co.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Bn(["0x1901",co.hashDomain(e),co.from(r).hash(n)])}static hash(e,r,n){return Fn(co.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const a={};e.verifyingContract&&!ai(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const s=co.from(r);s.visit(n,(o,c)=>(o==="address"&&!ai(c,20)&&(a[c]="0x"),c));for(const o in a)a[o]=await i(o);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=s.visit(n,(o,c)=>o==="address"&&a[c]?a[c]:c),{domain:e,value:n}}static getPayload(e,r,n){co.hashDomain(e);const i={},a=[];FS.forEach(c=>{const u=e[c];u!=null&&(i[c]=tpe[c](u),a.push({name:c,type:$9[c]}))});const s=co.from(r),o=Object.assign({},r);return Ne(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),o.EIP712Domain=a,s.encode(n),{types:o,domain:i,primaryType:s.primaryType,message:s.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return _t(qt(u));if(c.match(/^u?int/))return rr(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return Ne(typeof u=="string","invalid string","value",u),u}Ne(!1,"unsupported type","type",c)})}}};Pb=new WeakMap,Nu=new WeakMap,H0=new WeakMap,ax=new WeakSet,KW=function(e){{const i=BS(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],a=this.getEncoder(i);return s=>{Ne(!r[3]||parseInt(r[3])===s.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",s);let o=s.map(a);return W(this,Nu).has(i)&&(o=o.map(Fn)),Fn(Bn(o))}}const n=this.types[e];if(n){const i=el(W(this,Nu).get(e));return a=>{const s=n.map(({name:o,type:c})=>{const u=this.getEncoder(c)(a[o]);return W(this,Nu).has(c)?Fn(u):u});return s.unshift(i),Bn(s)}}Ne(!1,`unknown type: ${e}`,"type",e)};let _g=co;function Ga(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const rpe="external public payable",npe=Ga(rpe.split(" ")),WW="constant external internal payable private public pure view",ipe=Ga(WW.split(" ")),QW="constructor error event fallback function receive struct",YW=Ga(QW.split(" ")),JW="calldata memory storage payable indexed",ape=Ga(JW.split(" ")),spe="tuple returns",ope=[QW,JW,spe,WW].join(" "),cpe=Ga(ope.split(" ")),upe={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},lpe=new RegExp("^(\\s*)"),fpe=new RegExp("^([0-9]+)"),dpe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),XW=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),ZW=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Xi,ec,Tb,wR;const sx=class sx{constructor(e){Qe(this,Tb);Qe(this,Xi,void 0);Qe(this,ec,void 0);Te(this,Xi,0),Te(this,ec,e.slice())}get offset(){return W(this,Xi)}get length(){return W(this,ec).length-W(this,Xi)}clone(){return new sx(W(this,ec))}reset(){Te(this,Xi,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=ct(this,Tb,wR).call(this,W(this,Xi)+1,e.match+1);return Te(this,Xi,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;W(this,Xi)<e.match-1;){const n=this.peek().linkNext;r.push(ct(this,Tb,wR).call(this,W(this,Xi)+1,n)),Te(this,Xi,n)}return Te(this,Xi,e.match+1),r}peek(){if(W(this,Xi)>=W(this,ec).length)throw new Error("out-of-bounds");return W(this,ec)[W(this,Xi)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return Em(this,Xi)._++,e}toString(){const e=[];for(let r=W(this,Xi);r<W(this,ec).length;r++){const n=W(this,ec)[r];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};Xi=new WeakMap,ec=new WeakMap,Tb=new WeakSet,wR=function(e=0,r=0){return new sx(W(this,ec).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let fc=sx;function jf(t){const e=[],r=s=>{const o=a<t.length?JSON.stringify(t[a]):"$EOI";throw new Error(`invalid token ${o} at ${a}: ${s}`)};let n=[],i=[],a=0;for(;a<t.length;){let s=t.substring(a),o=s.match(lpe);o&&(a+=o[1].length,s=t.substring(a));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};e.push(c);let u=upe[s[0]]||"";if(u){if(c.type=u,c.text=s[0],a++,u==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&r("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let f=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const h=e.pop().text;f=h+f,e[e.length-1].value=jr(h)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(o=s.match(dpe),o){if(c.text=o[1],a+=c.text.length,cpe.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(ZW)){c.type="TYPE";continue}c.type="ID";continue}if(o=s.match(fpe),o){c.text=o[1],c.type="NUMBER",a+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(s[0])} at position ${a}`)}return new fc(e.map(s=>Object.freeze(s)))}function j9(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 kx(t,e){if(e.peekKeyword(YW)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function tl(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||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 eQ(t){let e=tl(t,ipe);return j9(e,Ga("constant payable nonpayable".split(" "))),j9(e,Ga("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"}function Wu(t,e){return t.popParams().map(r=>oa.from(r,e))}function tQ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return rr(t.pop().text);throw new Error("invalid gas")}return null}function wh(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const hpe=new RegExp(/^(.*)\[([0-9]*)\]$/);function U9(t){const e=t.match(ZW);if(Ne(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);Ne(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);Ne(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const ii={},_s=Symbol.for("_ethers_internal"),F9="_ParamTypeInternal",B9="_ErrorInternal",q9="_EventInternal",H9="_ConstructorInternal",z9="_FallbackInternal",V9="_FunctionInternal",G9="_StructInternal";var z0,S_;const uo=class uo{constructor(e,r,n,i,a,s,o,c){Qe(this,z0);Be(this,"name");Be(this,"type");Be(this,"baseType");Be(this,"indexed");Be(this,"components");Be(this,"arrayLength");Be(this,"arrayChildren");if(kf(e,ii,"ParamType"),Object.defineProperty(this,_s,{value:F9}),s&&(s=Object.freeze(s.slice())),i==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(i==="tuple"){if(s==null)throw new Error("")}else if(s!=null)throw new Error("");Qt(this,{name:r,type:n,baseType:i,indexed:a,components:s,arrayLength:o,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=n,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,a)=>n.components[a].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return ct(this,z0,S_).call(this,n,e,r,a=>{i[0]=a}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(uo.isParamType(e))return e;if(typeof e=="string")try{return uo.from(jf(e),r)}catch{Ne(!1,"invalid param type","obj",e)}else if(e instanceof fc){let o="",c="",u=null;tl(e,Ga(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(v=>uo.from(v)),o=`tuple(${u.map(v=>v.format()).join(",")})`):(o=U9(e.popType("TYPE")),c=o);let f=null,h=null;for(;e.length&&e.peekType("BRACKET");){const v=e.pop();f=new uo(ii,"",o,c,null,u,h,f),h=v.value,o+=v.text,c="array",u=null}let m=null;if(tl(e,ape).has("indexed")){if(!r)throw new Error("");m=!0}const w=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new uo(ii,w,o,c,m,u,h,f)}const n=e.name;Ne(!n||typeof n=="string"&&n.match(XW),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(Ne(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,s=a.match(hpe);if(s){const o=parseInt(s[2]||"-1"),c=uo.from({type:s[1],components:e.components});return new uo(ii,n||"",a,"array",i,null,o,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const o=e.components!=null?e.components.map(u=>uo.from(u)):null;return new uo(ii,n||"",a,"tuple",i,o,null,null)}return a=U9(e.type),new uo(ii,n||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[_s]===F9}};z0=new WeakSet,S_=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const s=this.arrayChildren,o=r.slice();o.forEach((c,u)=>{var f;ct(f=s,z0,S_).call(f,e,c,n,h=>{o[u]=h})}),i(o);return}if(this.isTuple()){const s=this.components;let o;if(Array.isArray(r))o=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");o=s.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,u)=>{var f;ct(f=s[u],z0,S_).call(f,e,c,n,h=>{o[u]=h})}),i(o);return}const a=n(this.type,r);a.then?e.push(async function(){i(await a)}()):i(a)};let oa=uo;class _h{constructor(e,r,n){Be(this,"type");Be(this,"inputs");kf(e,ii,"Fragment"),n=Object.freeze(n.slice()),Qt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{_h.from(JSON.parse(e))}catch{}return _h.from(jf(e))}if(e instanceof fc)switch(e.peekKeyword(YW)){case"constructor":return zu.from(e);case"error":return hs.from(e);case"event":return $c.from(e);case"fallback":case"receive":return Au.from(e);case"function":return kc.from(e);case"struct":return hh.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return zu.from(e);case"error":return hs.from(e);case"event":return $c.from(e);case"fallback":case"receive":return Au.from(e);case"function":return kc.from(e);case"struct":return hh.from(e)}it(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Ne(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return zu.isFragment(e)}static isError(e){return hs.isFragment(e)}static isEvent(e){return $c.isFragment(e)}static isFunction(e){return kc.isFragment(e)}static isStruct(e){return hh.isFragment(e)}}class Lx extends _h{constructor(r,n,i,a){super(r,n,a);Be(this,"name");Ne(typeof i=="string"&&i.match(XW),"invalid identifier","name",i),a=Object.freeze(a.slice()),Qt(this,{name:i})}}function ib(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class hs extends Lx{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,_s,{value:B9})}get selector(){return el(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+ib(e,this.inputs)),r.join(" ")}static from(e){if(hs.isFragment(e))return e;if(typeof e=="string")return hs.from(jf(e));if(e instanceof fc){const r=kx("error",e),n=Wu(e);return wh(e),new hs(ii,r,n)}return new hs(ii,e.name,e.inputs?e.inputs.map(oa.from):[])}static isFragment(e){return e&&e[_s]===B9}}class $c extends Lx{constructor(r,n,i,a){super(r,"event",n,i);Be(this,"anonymous");Object.defineProperty(this,_s,{value:q9}),Qt(this,{anonymous:a})}get topicHash(){return el(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+ib(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(a=>oa.from(a)),new $c(ii,r,n,!1).topicHash}static from(r){if($c.isFragment(r))return r;if(typeof r=="string")try{return $c.from(jf(r))}catch{Ne(!1,"invalid event fragment","obj",r)}else if(r instanceof fc){const n=kx("event",r),i=Wu(r,!0),a=!!tl(r,Ga(["anonymous"])).has("anonymous");return wh(r),new $c(ii,n,i,a)}return new $c(ii,r.name,r.inputs?r.inputs.map(n=>oa.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[_s]===q9}}class zu extends _h{constructor(r,n,i,a,s){super(r,n,i);Be(this,"payable");Be(this,"gas");Object.defineProperty(this,_s,{value:H9}),Qt(this,{payable:a,gas:s})}format(r){if(it(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${ib(r,this.inputs)}`];return n.push(this.payable?"payable":"nonpayable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(zu.isFragment(r))return r;if(typeof r=="string")try{return zu.from(jf(r))}catch{Ne(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof fc){tl(r,Ga(["constructor"]));const n=Wu(r),i=!!tl(r,npe).has("payable"),a=tQ(r);return wh(r),new zu(ii,"constructor",n,i,a)}return new zu(ii,"constructor",r.inputs?r.inputs.map(oa.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[_s]===H9}}class Au extends _h{constructor(r,n,i){super(r,"fallback",n);Be(this,"payable");Object.defineProperty(this,_s,{value:z9}),Qt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Au.isFragment(r))return r;if(typeof r=="string")try{return Au.from(jf(r))}catch{Ne(!1,"invalid fallback fragment","obj",r)}else if(r instanceof fc){const n=r.toString(),i=r.peekKeyword(Ga(["fallback","receive"]));if(Ne(i,"type must be fallback or receive","obj",n),r.popKeyword(Ga(["fallback","receive"]))==="receive"){const c=Wu(r);return Ne(c.length===0,"receive cannot have arguments","obj.inputs",c),tl(r,Ga(["payable"])),wh(r),new Au(ii,[],!0)}let s=Wu(r);s.length?Ne(s.length===1&&s[0].type==="bytes","invalid fallback inputs","obj.inputs",s.map(c=>c.format("minimal")).join(", ")):s=[oa.from("bytes")];const o=eQ(r);if(Ne(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),tl(r,Ga(["returns"])).has("returns")){const c=Wu(r);Ne(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return wh(r),new Au(ii,s,o==="payable")}if(r.type==="receive")return new Au(ii,[],!0);if(r.type==="fallback"){const n=[oa.from("bytes")],i=r.stateMutability==="payable";return new Au(ii,n,i)}Ne(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[_s]===z9}}class kc extends Lx{constructor(r,n,i,a,s,o){super(r,"function",n,a);Be(this,"constant");Be(this,"outputs");Be(this,"stateMutability");Be(this,"payable");Be(this,"gas");Object.defineProperty(this,_s,{value:V9}),s=Object.freeze(s.slice()),Qt(this,{constant:i==="view"||i==="pure",gas:o,outputs:s,payable:i==="payable",stateMutability:i})}get selector(){return el(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+ib(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(ib(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(a=>oa.from(a)),new kc(ii,r,"view",n,[],null).selector}static from(r){if(kc.isFragment(r))return r;if(typeof r=="string")try{return kc.from(jf(r))}catch{Ne(!1,"invalid function fragment","obj",r)}else if(r instanceof fc){const i=kx("function",r),a=Wu(r),s=eQ(r);let o=[];tl(r,Ga(["returns"])).has("returns")&&(o=Wu(r));const c=tQ(r);return wh(r),new kc(ii,i,s,a,o,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new kc(ii,r.name,n,r.inputs?r.inputs.map(oa.from):[],r.outputs?r.outputs.map(oa.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[_s]===V9}}class hh extends Lx{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,_s,{value:G9})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return hh.from(jf(e))}catch{Ne(!1,"invalid struct fragment","obj",e)}else if(e instanceof fc){const r=kx("struct",e),n=Wu(e);return wh(e),new hh(ii,r,n)}return new hh(ii,e.name,e.inputs?e.inputs.map(oa.from):[])}static isFragment(e){return e&&e[_s]===G9}}const dc=new Map;dc.set(0,"GENERIC_PANIC");dc.set(1,"ASSERT_FALSE");dc.set(17,"OVERFLOW");dc.set(18,"DIVIDE_BY_ZERO");dc.set(33,"ENUM_RANGE_ERROR");dc.set(34,"BAD_STORAGE_DATA");dc.set(49,"STACK_UNDERFLOW");dc.set(50,"ARRAY_RANGE_ERROR");dc.set(65,"OUT_OF_MEMORY");dc.set(81,"UNINITIALIZED_FUNCTION_CALL");const ppe=new RegExp(/^bytes([0-9]*)$/),gpe=new RegExp(/^(u?int)([0-9]*)$/);let qS=null;function mpe(t,e,r,n){let i="missing revert data",a=null;const s=null;let o=null;if(r){i="execution reverted";const u=qt(r);if(r=_t(r),u.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(_t(u.slice(0,4))==="0x08c379a0")try{a=n.decode(["string"],u.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(_t(u.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],u.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[f]},a=`Panic due to ${dc.get(f)||"UNKNOWN"}(${f})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?sn(e.to):null,data:e.data||"0x"};return e.from&&(c.from=sn(e.from)),Ni(i,"CALL_EXCEPTION",{action:t,data:r,reason:a,transaction:c,invocation:s,revert:o})}var Vl,Rp;const ox=class ox{constructor(){Qe(this,Vl)}getDefaultValue(e){const r=e.map(i=>ct(this,Vl,Rp).call(this,oa.from(i)));return new Dw(r,"_").defaultValue()}encode(e,r){nK(r.length,e.length,"types/values length mismatch");const n=e.map(s=>ct(this,Vl,Rp).call(this,oa.from(s))),i=new Dw(n,"_"),a=new sR;return i.encode(a,r),a.data}decode(e,r,n){const i=e.map(s=>ct(this,Vl,Rp).call(this,oa.from(s)));return new Dw(i,"_").decode(new oR(r,n))}static defaultAbiCoder(){return qS==null&&(qS=new ox),qS}static getBuiltinCallException(e,r,n){return mpe(e,r,n,ox.defaultAbiCoder())}};Vl=new WeakSet,Rp=function(e){if(e.isArray())return new Vde(ct(this,Vl,Rp).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Dw(e.components.map(n=>ct(this,Vl,Rp).call(this,n)),e.name);switch(e.baseType){case"address":return new Hde(e.name);case"bool":return new Gde(e.name);case"string":return new the(e.name);case"bytes":return new Kde(e.name);case"":return new Yde(e.name)}let r=e.type.match(gpe);if(r){let n=parseInt(r[2]||"256");return Ne(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new ehe(n/8,r[1]==="int",e.name)}if(r=e.type.match(ppe),r){let n=parseInt(r[1]);return Ne(n!==0&&n<=32,"invalid bytes length","param",e),new Wde(n,e.name)}Ne(!1,"invalid type","type",e.type)};let ab=ox;class ype{constructor(e,r,n){Be(this,"fragment");Be(this,"name");Be(this,"signature");Be(this,"topic");Be(this,"args");const i=e.name,a=e.format();Qt(this,{fragment:e,name:i,signature:a,topic:r,args:n})}}class vpe{constructor(e,r,n,i){Be(this,"fragment");Be(this,"name");Be(this,"args");Be(this,"signature");Be(this,"selector");Be(this,"value");const a=e.name,s=e.format();Qt(this,{fragment:e,name:a,args:n,signature:s,selector:r,value:i})}}class bpe{constructor(e,r,n){Be(this,"fragment");Be(this,"name");Be(this,"args");Be(this,"signature");Be(this,"selector");const i=e.name,a=e.format();Qt(this,{fragment:e,name:i,args:n,signature:a,selector:r})}}class K9{constructor(e){Be(this,"hash");Be(this,"_isIndexed");Qt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const W9={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"},Q9={"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&&W9[t.toString()]&&(e=W9[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Tc,Cc,Rc,va,V0,I_,G0,O_;const Jp=class Jp{constructor(e){Qe(this,V0);Qe(this,G0);Be(this,"fragments");Be(this,"deploy");Be(this,"fallback");Be(this,"receive");Qe(this,Tc,void 0);Qe(this,Cc,void 0);Qe(this,Rc,void 0);Qe(this,va,void 0);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,Te(this,Rc,new Map),Te(this,Tc,new Map),Te(this,Cc,new Map);const n=[];for(const s of r)try{n.push(_h.from(s))}catch(o){console.log("EE",o)}Qt(this,{fragments:Object.freeze(n)});let i=null,a=!1;Te(this,va,this.getAbiCoder()),this.fragments.forEach((s,o)=>{let c;switch(s.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Qt(this,{deploy:s});return;case"fallback":s.inputs.length===0?a=!0:(Ne(!i||s.payable!==i.payable,"conflicting fallback fragments",`fragments[${o}]`,s),i=s,a=i.payable);return;case"function":c=W(this,Rc);break;case"event":c=W(this,Cc);break;case"error":c=W(this,Tc);break;default:return}const u=s.format();c.has(u)||c.set(u,s)}),this.deploy||Qt(this,{deploy:zu.from("constructor()")}),Qt(this,{fallback:i,receive:a})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return ab.defaultAbiCoder()}getFunctionName(e){const r=ct(this,V0,I_).call(this,e,null,!1);return Ne(r,"no matching function","key",e),r.name}hasFunction(e){return!!ct(this,V0,I_).call(this,e,null,!1)}getFunction(e,r){return ct(this,V0,I_).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(W(this,Rc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Rc).get(i),n)}}getEventName(e){const r=ct(this,G0,O_).call(this,e,null,!1);return Ne(r,"no matching event","key",e),r.name}hasEvent(e){return!!ct(this,G0,O_).call(this,e,null,!1)}getEvent(e,r){return ct(this,G0,O_).call(this,e,r||null,!0)}forEachEvent(e){const r=Array.from(W(this,Cc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Cc).get(i),n)}}getError(e,r){if(ai(e)){const i=e.toLowerCase();if(Q9[i])return hs.from(Q9[i].signature);for(const a of W(this,Tc).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,s]of W(this,Tc))a.split("(")[0]===e&&i.push(s);if(i.length===0)return e==="Error"?hs.from("error Error(string)"):e==="Panic"?hs.from("error Panic(uint256)"):null;if(i.length>1){const a=i.map(s=>JSON.stringify(s.format())).join(", ");Ne(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=hs.from(e).format(),e==="Error(string)")return hs.from("error Error(string)");if(e==="Panic(uint256)")return hs.from("error Panic(uint256)");const n=W(this,Tc).get(e);return n||null}forEachError(e){const r=Array.from(W(this,Tc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Tc).get(i),n)}}_decodeParams(e,r){return W(this,va).decode(e,r)}_encodeParams(e,r){return W(this,va).encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);Ne(n,"unknown error","fragment",e),e=n}return Ne(zn(r,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",r),this._decodeParams(e.inputs,zn(r,4))}encodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);Ne(n,"unknown error","fragment",e),e=n}return Bn([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return Ne(zn(r,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",r),this._decodeParams(e.inputs,zn(r,4))}encodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return Bn([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionResult(e,r){if(typeof e=="string"){const a=this.getFunction(e);Ne(a,"unknown function","fragment",e),e=a}let n="invalid length for result data";const i=Pa(r);if(i.length%32===0)try{return W(this,va).decode(e.outputs,i)}catch{n="could not decode result data"}it(!1,n,"BAD_DATA",{value:_t(i),info:{method:e.name,signature:e.format()}})}makeError(e,r){const n=qt(e,"data"),i=ab.getBuiltinCallException("call",r,n),a="execution reverted (unknown custom error)";if(i.message.startsWith(a)){const o=_t(n.slice(0,4)),c=this.getError(o);if(c)try{const u=W(this,va).decode(c.inputs,n.slice(4));i.revert={name:c.name,signature:c.format(),args:u},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const s=this.parseTransaction(r);return s&&(i.invocation={method:s.name,signature:s.signature,args:s.args}),i}encodeFunctionResult(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return _t(W(this,va).encode(e.outputs,r||[]))}encodeFilterTopics(e,r){if(typeof e=="string"){const a=this.getEvent(e);Ne(a,"unknown event","eventFragment",e),e=a}it(r.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:r.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(a,s)=>a.type==="string"?el(s):a.type==="bytes"?Fn(_t(s)):(a.type==="bool"&&typeof s=="boolean"?s=s?"0x01":"0x00":a.type.match(/^u?int/)?s=Zu(s):a.type.match(/^bytes/)?s=Ile(s,32):a.type==="address"&&W(this,va).encode(["address"],[s]),bh(_t(s),32));for(r.forEach((a,s)=>{const o=e.inputs[s];if(!o.indexed){Ne(a==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,a);return}a==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Ne(!1,"filtering with tuples or arrays not supported","contract."+o.name,a):Array.isArray(a)?n.push(a.map(c=>i(o,c))):n.push(i(o,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const s=this.getEvent(e);Ne(s,"unknown event","eventFragment",e),e=s}const n=[],i=[],a=[];return e.anonymous||n.push(e.topicHash),Ne(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((s,o)=>{const c=r[o];if(s.indexed)if(s.type==="string")n.push(el(c));else if(s.type==="bytes")n.push(Fn(c));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");n.push(W(this,va).encode([s.type],[c]))}else i.push(s),a.push(c)}),{data:W(this,va).encode(i,a),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const y=this.getEvent(e);Ne(y,"unknown event","eventFragment",e),e=y}if(n!=null&&!e.anonymous){const y=e.topicHash;Ne(ai(n[0],32)&&n[0].toLowerCase()===y,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],a=[],s=[];e.inputs.forEach((y,w)=>{y.indexed?y.type==="string"||y.type==="bytes"||y.baseType==="tuple"||y.baseType==="array"?(i.push(oa.from({type:"bytes32",name:y.name})),s.push(!0)):(i.push(y),s.push(!1)):(a.push(y),s.push(!1))});const o=n!=null?W(this,va).decode(i,Bn(n)):null,c=W(this,va).decode(a,r,!0),u=[],f=[];let h=0,m=0;return e.inputs.forEach((y,w)=>{let v=null;if(y.indexed)if(o==null)v=new K9(null);else if(s[w])v=new K9(o[m++]);else try{v=o[m++]}catch(g){v=g}else try{v=c[h++]}catch(g){v=g}u.push(v),f.push(y.name||null)}),_E.fromItems(u,f)}parseTransaction(e){const r=qt(e.data,"tx.data"),n=rr(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(_t(r.slice(0,4)));if(!i)return null;const a=W(this,va).decode(i.inputs,r.slice(4));return new vpe(i,i.selector,a,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new ype(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=_t(e),n=this.getError(zn(r,0,4));if(!n)return null;const i=W(this,va).decode(n.inputs,zn(r,4));return new bpe(n,n.selector,i)}static from(e){return e instanceof Jp?e:typeof e=="string"?new Jp(JSON.parse(e)):typeof e.format=="function"?new Jp(e.format("json")):new Jp(e)}};Tc=new WeakMap,Cc=new WeakMap,Rc=new WeakMap,va=new WeakMap,V0=new WeakSet,I_=function(e,r,n){if(ai(e)){const a=e.toLowerCase();for(const s of W(this,Rc).values())if(a===s.selector)return s;return null}if(e.indexOf("(")===-1){const a=[];for(const[s,o]of W(this,Rc))s.split("(")[0]===e&&a.push(o);if(r){const s=r.length>0?r[r.length-1]:null;let o=r.length,c=!0;Ra.isTyped(s)&&s.type==="overrides"&&(c=!1,o--);for(let u=a.length-1;u>=0;u--){const f=a[u].inputs.length;f!==o&&(!c||f!==o-1)&&a.splice(u,1)}for(let u=a.length-1;u>=0;u--){const f=a[u].inputs;for(let h=0;h<r.length;h++)if(Ra.isTyped(r[h])){if(h>=f.length){if(r[h].type==="overrides")continue;a.splice(u,1);break}if(r[h].type!==f[h].baseType){a.splice(u,1);break}}}}if(a.length===1&&r&&r.length!==a[0].inputs.length){const s=r[r.length-1];(s==null||Array.isArray(s)||typeof s!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&n){const s=a.map(o=>JSON.stringify(o.format())).join(", ");Ne(!1,`ambiguous function description (i.e. matches ${s})`,"key",e)}return a[0]}const i=W(this,Rc).get(kc.from(e).format());return i||null},G0=new WeakSet,O_=function(e,r,n){if(ai(e)){const a=e.toLowerCase();for(const s of W(this,Cc).values())if(a===s.topicHash)return s;return null}if(e.indexOf("(")===-1){const a=[];for(const[s,o]of W(this,Cc))s.split("(")[0]===e&&a.push(o);if(r){for(let s=a.length-1;s>=0;s--)a[s].inputs.length<r.length&&a.splice(s,1);for(let s=a.length-1;s>=0;s--){const o=a[s].inputs;for(let c=0;c<r.length;c++)if(Ra.isTyped(r[c])&&r[c].type!==o[c].baseType){a.splice(s,1);break}}}if(a.length===0)return null;if(a.length>1&&n){const s=a.map(o=>JSON.stringify(o.format())).join(", ");Ne(!1,`ambiguous event description (i.e. matches ${s})`,"key",e)}return a[0]}const i=W(this,Cc).get($c.from(e).format());return i||null};let _R=Jp;const rQ=BigInt(0);function wv(t){return t??null}function Ia(t){return t==null?null:t.toString()}class Y9{constructor(e,r,n){Be(this,"gasPrice");Be(this,"maxFeePerGas");Be(this,"maxPriorityFeePerGas");Qt(this,{gasPrice:wv(e),maxFeePerGas:wv(r),maxPriorityFeePerGas:wv(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Ia(e),maxFeePerGas:Ia(r),maxPriorityFeePerGas:Ia(n)}}}function IE(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=_t(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=rr(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=jr(t[i],`request.${i}`));return t.accessList&&(e.accessList=Mh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Du;class wpe{constructor(e,r){Be(this,"provider");Be(this,"number");Be(this,"hash");Be(this,"timestamp");Be(this,"parentHash");Be(this,"nonce");Be(this,"difficulty");Be(this,"gasLimit");Be(this,"gasUsed");Be(this,"miner");Be(this,"extraData");Be(this,"baseFeePerGas");Qe(this,Du,void 0);Te(this,Du,e.transactions.map(n=>typeof n!="string"?new sb(n,r):n)),Qt(this,{provider:r,hash:wv(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:wv(e.baseFeePerGas)})}get transactions(){return W(this,Du).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=W(this,Du).slice();return e.length===0?[]:(it(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:a,hash:s,miner:o,nonce:c,number:u,parentHash:f,timestamp:h,transactions:m}=this;return{_type:"Block",baseFeePerGas:Ia(e),difficulty:Ia(r),extraData:n,gasLimit:Ia(i),gasUsed:Ia(a),hash:s,miner:o,nonce:c,number:u,parentHash:f,timestamp:h,transactions:m}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>e<this.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}get length(){return W(this,Du).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let r;if(typeof e=="number")r=W(this,Du)[e];else{const n=e.toLowerCase();for(const i of W(this,Du))if(typeof i=="string"){if(i!==n)continue;r=i;break}else{if(i.hash===n)continue;r=i;break}}if(r==null)throw new Error("no such tx");return typeof r=="string"?await this.provider.getTransaction(r):r}getPrefetchedTransaction(e){const r=this.prefetchedTransactions;if(typeof e=="number")return r[e];e=e.toLowerCase();for(const n of r)if(n.hash===e)return n;Ne(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return _pe(this)}}Du=new WeakMap;class r1{constructor(e,r){Be(this,"provider");Be(this,"transactionHash");Be(this,"blockHash");Be(this,"blockNumber");Be(this,"removed");Be(this,"address");Be(this,"data");Be(this,"topics");Be(this,"index");Be(this,"transactionIndex");this.provider=r;const n=Object.freeze(e.topics.slice());Qt(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:r,blockNumber:n,data:i,index:a,removed:s,topics:o,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:r,blockNumber:n,data:i,index:a,removed:s,topics:o,transactionHash:c,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return it(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return it(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return it(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Epe(this)}}var Cb;class nQ{constructor(e,r){Be(this,"provider");Be(this,"to");Be(this,"from");Be(this,"contractAddress");Be(this,"hash");Be(this,"index");Be(this,"blockHash");Be(this,"blockNumber");Be(this,"logsBloom");Be(this,"gasUsed");Be(this,"cumulativeGasUsed");Be(this,"gasPrice");Be(this,"type");Be(this,"status");Be(this,"root");Qe(this,Cb,void 0);Te(this,Cb,Object.freeze(e.logs.map(i=>new r1(i,r))));let n=rQ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Qt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:n,type:e.type,status:e.status,root:e.root})}get logs(){return W(this,Cb)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:a,blockHash:s,blockNumber:o,logsBloom:c,logs:u,status:f,root:h}=this;return{_type:"TransactionReceipt",blockHash:s,blockNumber:o,contractAddress:n,cumulativeGasUsed:Ia(this.cumulativeGasUsed),from:r,gasPrice:Ia(this.gasPrice),gasUsed:Ia(this.gasUsed),hash:i,index:a,logs:u,logsBloom:c,root:h,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return aQ(this)}reorderedEvent(e){return it(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),iQ(this,e)}}Cb=new WeakMap;var Gl;const RD=class RD{constructor(e,r){Be(this,"provider");Be(this,"blockNumber");Be(this,"blockHash");Be(this,"index");Be(this,"hash");Be(this,"type");Be(this,"to");Be(this,"from");Be(this,"nonce");Be(this,"gasLimit");Be(this,"gasPrice");Be(this,"maxPriorityFeePerGas");Be(this,"maxFeePerGas");Be(this,"data");Be(this,"value");Be(this,"chainId");Be(this,"signature");Be(this,"accessList");Qe(this,Gl,void 0);this.provider=r,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,Te(this,Gl,-1)}toJSON(){const{blockNumber:e,blockHash:r,index:n,hash:i,type:a,to:s,from:o,nonce:c,data:u,signature:f,accessList:h}=this;return{_type:"TransactionReceipt",accessList:h,blockNumber:e,blockHash:r,chainId:Ia(this.chainId),data:u,from:o,gasLimit:Ia(this.gasLimit),gasPrice:Ia(this.gasPrice),hash:i,maxFeePerGas:Ia(this.maxFeePerGas),maxPriorityFeePerGas:Ia(this.maxPriorityFeePerGas),nonce:c,signature:f,to:s,index:n,type:a,value:Ia(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const r=this.provider.getBlock(e);if(r==null)throw new Error("TODO");return r}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:r,blockNumber:n}=await _a({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return r==null||r.blockNumber==null?0:n-r.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,r){const n=e??1,i=r??0;let a=W(this,Gl),s=-1,o=a===-1;const c=async()=>{if(o)return null;const{blockNumber:m,nonce:y}=await _a({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(y<this.nonce){a=m;return}if(o)return null;const w=await this.getTransaction();if(!(w&&w.blockNumber!=null))for(s===-1&&(s=a-3,s<W(this,Gl)&&(s=W(this,Gl)));s<=m;){if(o)return null;const v=await this.provider.getBlock(s,!0);if(v==null)return;for(const g of v)if(g===this.hash)return;for(let g=0;g<v.length;g++){const _=await v.getTransaction(g);if(_.from===this.from&&_.nonce===this.nonce){if(o)return null;const b=await this.provider.getTransactionReceipt(_.hash);if(b==null||m-b.blockNumber+1<n)return;let S="replaced";_.data===this.data&&_.to===this.to&&_.value===this.value?S="repriced":_.data==="0x"&&_.from===_.to&&_.value===rQ&&(S="cancelled"),it(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:S==="replaced"||S==="cancelled",reason:S,replacement:_.replaceableTransaction(a),hash:_.hash,receipt:b})}}s++}},u=m=>{if(m==null||m.status!==0)return m;it(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:m.to,from:m.from,data:""},receipt:m})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(f);if(f){if(await f.confirmations()>=n)return u(f)}else if(await c(),n===0)return null;return await new Promise((m,y)=>{const w=[],v=()=>{w.forEach(_=>_())};if(w.push(()=>{o=!0}),i>0){const _=setTimeout(()=>{v(),y(Ni("wait for transaction timeout","TIMEOUT"))},i);w.push(()=>{clearTimeout(_)})}const g=async _=>{if(await _.confirmations()>=n){v();try{m(u(_))}catch(b){y(b)}}};if(w.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),a>=0){const _=async()=>{try{await c()}catch(b){if(wo(b,"TRANSACTION_REPLACED")){v(),y(b);return}}o||this.provider.once("block",_)};w.push(()=>{this.provider.off("block",_)}),this.provider.once("block",_)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return it(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),aQ(this)}reorderedEvent(e){return it(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),it(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),iQ(this,e)}replaceableTransaction(e){Ne(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new RD(this,this.provider);return Te(r,Gl,e),r}};Gl=new WeakMap;let sb=RD;function _pe(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function iQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function aQ(t){return{orphan:"drop-transaction",tx:t}}function Epe(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class F8 extends r1{constructor(r,n,i){super(r,r.provider);Be(this,"interface");Be(this,"fragment");Be(this,"args");const a=n.decodeEventLog(i,r.data,r.topics);Qt(this,{args:a,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class sQ extends r1{constructor(r,n){super(r,r.provider);Be(this,"error");Qt(this,{error:n})}}var K0;class xpe extends nQ{constructor(r,n,i){super(i,n);Qe(this,K0,void 0);Te(this,K0,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?W(this,K0).getEvent(r.topics[0]):null;if(n)try{return new F8(r,W(this,K0),n)}catch(i){return new sQ(r,i)}return r})}}K0=new WeakMap;var Rb;class B8 extends sb{constructor(r,n,i){super(i,n);Qe(this,Rb,void 0);Te(this,Rb,r)}async wait(r){const n=await super.wait(r);return n==null?null:new xpe(W(this,Rb),this.provider,n)}}Rb=new WeakMap;class oQ extends lK{constructor(r,n,i,a){super(r,n,i);Be(this,"log");Qt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Ape extends oQ{constructor(e,r,n,i,a){super(e,r,n,new F8(a,e.interface,i));const s=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Qt(this,{args:s,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const J9=BigInt(0);function cQ(t){return t&&typeof t.call=="function"}function uQ(t){return t&&typeof t.estimateGas=="function"}function jx(t){return t&&typeof t.resolveName=="function"}function lQ(t){return t&&typeof t.sendTransaction=="function"}function fQ(t){if(t!=null){if(jx(t))return t;if(t.provider)return t.provider}}var Nb;class Spe{constructor(e,r,n){Qe(this,Nb,void 0);Be(this,"fragment");if(Qt(this,{fragment:r}),r.inputs.length<n.length)throw new Error("too many arguments");const i=Eh(e.runner,"resolveName"),a=jx(i)?i:null;Te(this,Nb,async function(){const s=await Promise.all(r.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(f,h)=>f==="address"?Array.isArray(h)?Promise.all(h.map(m=>sa(m,a))):sa(h,a):h)));return e.interface.encodeFilterTopics(r,s)}())}getTopicFilter(){return W(this,Nb)}}Nb=new WeakMap;function Eh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Fd(t){return t==null?null:t.provider||null}async function dQ(t,e){const r=Ra.dereference(t,"overrides");Ne(typeof r=="object","invalid overrides parameter","overrides",t);const n=IE(r);return Ne(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),Ne(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function Ipe(t,e,r){const n=Eh(t,"resolveName"),i=jx(n)?n:null;return await Promise.all(e.map((a,s)=>a.walkAsync(r[s],(o,c)=>(c=Ra.dereference(c,o),o==="address"?sa(c,i):c))))}function Ope(t){const e=async function(s){const o=await dQ(s,["data"]);o.to=await t.getAddress(),o.from&&(o.from=await sa(o.from,fQ(t.runner)));const c=t.interface,u=rr(o.value||J9,"overrides.value")===J9,f=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!u&&Ne(!1,"cannot send data to receive or send value to non-payable fallback","overrides",s),Ne(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data);const h=c.receive||c.fallback&&c.fallback.payable;return Ne(h||u,"cannot send value to non-payable fallback","overrides.value",o.value),Ne(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data),o},r=async function(s){const o=Eh(t.runner,"call");it(cQ(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(s);try{return await o.call(c)}catch(u){throw w8(u)&&u.data?t.interface.makeError(u.data,c):u}},n=async function(s){const o=t.runner;it(lQ(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await o.sendTransaction(await e(s)),u=Fd(t.runner);return new B8(t.interface,u,c)},i=async function(s){const o=Eh(t.runner,"estimateGas");return it(uQ(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(s))},a=async s=>await n(s);return Qt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),a}function Ppe(t,e){const r=function(...u){const f=t.interface.getFunction(e,u);return it(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){const f=r(...u);let h={};if(f.inputs.length+1===u.length&&(h=await dQ(u.pop()),h.from&&(h.from=await sa(h.from,fQ(t.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const m=await Ipe(t.runner,f.inputs,u);return Object.assign({},h,await _a({to:t.getAddress(),data:t.interface.encodeFunctionData(f,m)}))},i=async function(...u){const f=await o(...u);return f.length===1?f[0]:f},a=async function(...u){const f=t.runner;it(lQ(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const h=await f.sendTransaction(await n(...u)),m=Fd(t.runner);return new B8(t.interface,m,h)},s=async function(...u){const f=Eh(t.runner,"estimateGas");return it(uQ(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},o=async function(...u){const f=Eh(t.runner,"call");it(cQ(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const h=await n(...u);let m="0x";try{m=await f.call(h)}catch(w){throw w8(w)&&w.data?t.interface.makeError(w.data,h):w}const y=r(...u);return t.interface.decodeFunctionResult(y,m)},c=async(...u)=>r(...u).constant?await i(...u):await a(...u);return Qt(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:s,populateTransaction:n,send:a,staticCall:i,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return it(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function Tpe(t,e){const r=function(...i){const a=t.interface.getEvent(e,i);return it(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},n=function(...i){return new Spe(t,r(...i),i)};return Qt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return it(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const OE=Symbol.for("_ethersInternal_contract"),hQ=new WeakMap;function Cpe(t,e){hQ.set(t[OE],e)}function Ts(t){return hQ.get(t[OE])}function Rpe(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function q8(t,e){let r,n=null;if(Array.isArray(e)){const a=function(s){if(ai(s,32))return s;const o=t.interface.getEvent(s);return Ne(o,"unknown fragment","name",s),o.topicHash};r=e.map(s=>s==null?null:Array.isArray(s)?s.map(a):a(s))}else e==="*"?r=[null]:typeof e=="string"?ai(e,32)?r=[e]:(n=t.interface.getEvent(e),Ne(n,"unknown fragment","event",e),r=[n.topicHash]):Rpe(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):Ne(!1,"unknown event name","event",e);r=r.map(a=>{if(a==null)return null;if(Array.isArray(a)){const s=Array.from(new Set(a.map(o=>o.toLowerCase())).values());return s.length===1?s[0]:(s.sort(),s)}return a.toLowerCase()});const i=r.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:n,tag:i,topics:r}}async function Wy(t,e){const{subs:r}=Ts(t);return r.get((await q8(t,e)).tag)||null}async function X9(t,e,r){const n=Fd(t.runner);it(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:s}=await q8(t,r),{addr:o,subs:c}=Ts(t);let u=c.get(a);if(!u){const h={address:o||t,topics:s},m=g=>{let _=i;if(_==null)try{_=t.interface.getEvent(g.topics[0])}catch{}if(_){const b=_,S=i?t.interface.decodeEventLog(i,g.data,g.topics):[];xR(t,r,S,A=>new Ape(t,A,r,b,g))}else xR(t,r,[],b=>new oQ(t,b,r,g))};let y=[];u={tag:a,listeners:[],start:()=>{y.length||y.push(n.on(h,m))},stop:async()=>{if(y.length==0)return;let g=y;y=[],await Promise.all(g),n.off(h,m)}},c.set(a,u)}return u}let ER=Promise.resolve();async function Npe(t,e,r,n){await ER;const i=await Wy(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:s,once:o})=>{const c=Array.from(r);n&&c.push(n(o?null:s));try{s.call(t,...c)}catch{}return!o}),i.listeners.length===0&&(i.stop(),Ts(t).subs.delete(i.tag)),a>0}async function xR(t,e,r,n){try{await ER}catch{}const i=Npe(t,e,r,n);return ER=i,await i}const Mw=["then"];var aDe;const Mv=class Mv{constructor(e,r,n,i){Be(this,"target");Be(this,"interface");Be(this,"runner");Be(this,"filters");Be(this,aDe);Be(this,"fallback");Ne(typeof e=="string"||gW(e),"invalid value for Contract target","target",e),n==null&&(n=null);const a=_R.from(r);Qt(this,{target:e,runner:n,interface:a}),Object.defineProperty(this,OE,{value:{}});let s,o=null,c=null;if(i){const h=Fd(n);c=new B8(this.interface,h,i)}let u=new Map;if(typeof e=="string")if(ai(e))o=e,s=Promise.resolve(e);else{const h=Eh(n,"resolveName");if(!jx(h))throw Ni("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});s=h.resolveName(e).then(m=>{if(m==null)throw Ni("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Ts(this).addr=m,m})}else s=e.getAddress().then(h=>{if(h==null)throw new Error("TODO");return Ts(this).addr=h,h});Cpe(this,{addrPromise:s,addr:o,deployTx:c,subs:u});const f=new Proxy({},{get:(h,m,y)=>{if(typeof m=="symbol"||Mw.indexOf(m)>=0)return Reflect.get(h,m,y);try{return this.getEvent(m)}catch(w){if(!wo(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(h,m)=>Mw.indexOf(m)>=0?Reflect.has(h,m):Reflect.has(h,m)||this.interface.hasEvent(String(m))});return Qt(this,{filters:f}),Qt(this,{fallback:a.receive||a.fallback?Ope(this):null}),new Proxy(this,{get:(h,m,y)=>{if(typeof m=="symbol"||m in h||Mw.indexOf(m)>=0)return Reflect.get(h,m,y);try{return h.getFunction(m)}catch(w){if(!wo(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(h,m)=>typeof m=="symbol"||m in h||Mw.indexOf(m)>=0?Reflect.has(h,m):h.interface.hasFunction(m)})}connect(e){return new Mv(this.target,this.interface,e)}attach(e){return new Mv(e,this.interface,this.runner)}async getAddress(){return await Ts(this).addrPromise}async getDeployedCode(){const e=Fd(this.runner);it(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Fd(this.runner);return it(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const s=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",s)}catch(o){a(o)}};s()})}deploymentTransaction(){return Ts(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Ppe(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Tpe(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:a}=Ts(this),s=i||await a,{fragment:o,topics:c}=await q8(this,e),u={address:s,topics:c,fromBlock:r,toBlock:n},f=Fd(this.runner);return it(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(h=>{let m=o;if(m==null)try{m=this.interface.getEvent(h.topics[0])}catch{}if(m)try{return new F8(h,this.interface,m)}catch(y){return new sQ(h,y)}return new r1(h,f)})}async on(e,r){const n=await X9(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await X9(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await xR(this,e,r,null)}async listenerCount(e){if(e){const i=await Wy(this,e);return i?i.listeners.length:0}const{subs:r}=Ts(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await Wy(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:r}=Ts(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:a})=>a));return n}async off(e,r){const n=await Wy(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:a})=>a).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),Ts(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await Wy(this,e);if(!r)return this;r.stop(),Ts(this).subs.delete(r.tag)}else{const{subs:r}=Ts(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends Mv{constructor(i,a=null){super(i,e,a)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};aDe=OE;let AR=Mv;function Dpe(){return AR}class _v extends Dpe(){}function HS(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Ne(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class Mpe{constructor(e){Be(this,"name");Qt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const pQ=new RegExp("^(ipfs)://(.*)$","i"),Z9=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),pQ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Kl,Xd,Wl,Np,cx,gQ;const Xp=class Xp{constructor(e,r,n){Qe(this,Wl);Be(this,"provider");Be(this,"address");Be(this,"name");Qe(this,Kl,void 0);Qe(this,Xd,void 0);Qt(this,{provider:e,address:r,name:n}),Te(this,Kl,null),Te(this,Xd,new _v(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return W(this,Kl)==null&&Te(this,Kl,(async()=>{try{return await W(this,Xd).supportsInterface("0x9061b923")}catch(e){if(wo(e,"CALL_EXCEPTION"))return!1;throw Te(this,Kl,null),e}})()),await W(this,Kl)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ct(this,Wl,Np).call(this,"addr(bytes32)");return a==null||a===hR?null:a}catch(a){if(wo(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const s=await ct(this,Wl,Np).call(this,"addr(bytes32,uint)",[a]);if(ai(s,20))return sn(s)}let r=null;for(const a of this.provider.plugins)if(a instanceof Mpe&&a.supportsCoinType(e)){r=a;break}if(r==null)return null;const n=await ct(this,Wl,Np).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;it(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await ct(this,Wl,Np).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await ct(this,Wl,Np).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",a=parseInt(r[4],16);if(r[5].length===a*2)return`${i}://${uK("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;it(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n<Z9.length;n++){const i=r.match(Z9[n]);if(i==null)continue;const a=i[1].toLowerCase();switch(a){case"https":case"data":return e.push({type:"url",value:r}),{linkage:e,url:r};case"ipfs":{const s=HS(r);return e.push({type:"ipfs",value:r}),e.push({type:"url",value:s}),{linkage:e,url:s}}case"erc721":case"erc1155":{const s=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:a,value:r});const o=await this.getAddress();if(o==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(i[2]||"").split("/");if(c.length!==2)return e.push({type:`!${a}caip`,value:i[2]||""}),{url:null,linkage:e};const u=c[1],f=new _v(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const v=await f.ownerOf(u);if(o!==v)return e.push({type:"!owner",value:v}),{url:null,linkage:e};e.push({type:"owner",value:v})}else if(a==="erc1155"){const v=await f.balanceOf(o,u);if(!v)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:v.toString()})}let h=await f[s](u);if(h==null||h==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:h}),a==="erc1155"&&(h=h.replace("{id}",Zu(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:h})),h.match(/^ipfs:/i)&&(h=HS(h)),e.push({type:"metadata-url",value:h});let m={};const y=await new Of(h).send();y.assertOk();try{m=y.bodyJson}catch{try{e.push({type:"!metadata",value:y.bodyText})}catch{const _=y.body;return _&&e.push({type:"!metadata",value:_t(_)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!m)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(m)});let w=m.image;if(typeof w!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!w.match(/^(https:\/\/|data:)/i)){if(w.match(pQ)==null)return e.push({type:"!imageUrl-ipfs",value:w}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:w}),w=HS(w)}return e.push({type:"url",value:w}),{linkage:e,url:w}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),n=r.getPlugin("org.ethers.plugins.network.Ens");return it(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),n.address}static async fromName(e,r){var i;let n=r;for(;;){if(n===""||n==="."||r!=="eth"&&n==="eth")return null;const a=await ct(i=Xp,cx,gQ).call(i,e,n);if(a!=null){const s=new Xp(e,a,r);return n!==r&&!await s.supportsWildcard()?null:s}n=n.split(".").slice(1).join(".")}}};Kl=new WeakMap,Xd=new WeakMap,Wl=new WeakSet,Np=async function(e,r){r=(r||[]).slice();const n=W(this,Xd).interface;r.unshift(bR(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),it(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),r=[Uhe(this.name),n.encodeFunctionData(i,r)],e="resolve(bytes,bytes)"),r.push({enableCcipRead:!0});try{const a=await W(this,Xd)[e](...r);return i?n.decodeFunctionResult(i,a)[0]:a}catch(a){if(!wo(a,"CALL_EXCEPTION"))throw a}return null},cx=new WeakSet,gQ=async function(e,r){const n=await Xp.getEnsAddress(e);try{const a=await new _v(n,["function resolver(bytes32) view returns (address)"],e).resolver(bR(r),{enableCcipRead:!0});return a===hR?null:a}catch(i){throw i}return null},Qe(Xp,cx);let PE=Xp;const eL=BigInt(0);function ni(t,e){return function(r){return r==null?e:t(r)}}function H8(t){return e=>{if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>t(r))}}function n1(t,e){return r=>{const n={};for(const i in t){let a=i;if(e&&i in e&&!(a in r)){for(const s of e[i])if(s in r){a=s;break}}try{const s=t[i](r[a]);s!==void 0&&(n[i]=s)}catch(s){const o=s instanceof Error?s.message:"not-an-error";it(!1,`invalid value for value.${i} (${o})`,"BAD_DATA",{value:r})}}return n}}function $pe(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Ne(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Eg(t){return Ne(ai(t,!0),"invalid data","value",t),t}function _o(t){return Ne(ai(t,32),"invalid hash","value",t),t}const kpe=n1({address:sn,blockHash:_o,blockNumber:jr,data:Eg,index:jr,removed:ni($pe,!1),topics:H8(_o),transactionHash:_o,transactionIndex:jr},{index:["logIndex"]});function Lpe(t){return kpe(t)}const jpe=n1({hash:ni(_o),parentHash:_o,number:jr,timestamp:jr,nonce:ni(Eg),difficulty:rr,gasLimit:rr,gasUsed:rr,miner:ni(sn),extraData:Eg,baseFeePerGas:ni(rr)});function Upe(t){const e=jpe(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:mQ(r)),e}const Fpe=n1({transactionIndex:jr,blockNumber:jr,transactionHash:_o,address:sn,topics:H8(_o),data:Eg,index:jr,blockHash:_o},{index:["logIndex"]});function Bpe(t){return Fpe(t)}const qpe=n1({to:ni(sn,null),from:ni(sn,null),contractAddress:ni(sn,null),index:jr,root:ni(_t),gasUsed:rr,logsBloom:ni(Eg),blockHash:_o,hash:_o,logs:H8(Bpe),blockNumber:jr,cumulativeGasUsed:rr,effectiveGasPrice:ni(rr),status:ni(jr),type:ni(jr,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Hpe(t){return qpe(t)}function mQ(t){t.to&&rr(t.to)===eL&&(t.to="0x0000000000000000000000000000000000000000");const e=n1({hash:_o,type:r=>r==="0x"||r==null?0:jr(r),accessList:ni(Mh,null),blockHash:ni(_o,null),blockNumber:ni(jr,null),transactionIndex:ni(jr,null),from:sn,gasPrice:ni(rr),maxPriorityFeePerGas:ni(rr),maxFeePerGas:ni(rr),gasLimit:rr,to:ni(sn,null),value:rr,nonce:jr,data:Eg,creates:ni(sn,null),chainId:ni(rr,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=qde(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=lc.from(t.signature):e.signature=lc.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&rr(e.blockHash)===eL&&(e.blockHash=null),e}const zpe="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class i1{constructor(e){Be(this,"name");Qt(this,{name:e})}clone(){return new i1(this.name)}}class Ux extends i1{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);Be(this,"effectiveBlock");Be(this,"txBase");Be(this,"txCreate");Be(this,"txDataZero");Be(this,"txDataNonzero");Be(this,"txAccessListStorageKey");Be(this,"txAccessListAddress");const i={effectiveBlock:r};function a(s,o){let c=(n||{})[s];c==null&&(c=o),Ne(typeof c=="number",`invalud value for ${s}`,"costs",n),i[s]=c}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),Qt(this,i)}clone(){return new Ux(this.effectiveBlock,this)}}class Fx extends i1{constructor(r,n){super("org.ethers.plugins.network.Ens");Be(this,"address");Be(this,"targetNetwork");Qt(this,{address:r||zpe,targetNetwork:n??1})}clone(){return new Fx(this.address,this.targetNetwork)}}var Db,Mb;class yQ extends i1{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Qe(this,Db,void 0);Qe(this,Mb,void 0);Te(this,Db,r),Te(this,Mb,n)}get url(){return W(this,Db)}get processFunc(){return W(this,Mb)}clone(){return this}}Db=new WeakMap,Mb=new WeakMap;const zS=new Map;var W0,Q0,Ql;const Zp=class Zp{constructor(e,r){Qe(this,W0,void 0);Qe(this,Q0,void 0);Qe(this,Ql,void 0);Te(this,W0,e),Te(this,Q0,rr(r)),Te(this,Ql,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return W(this,W0)}set name(e){Te(this,W0,e)}get chainId(){return W(this,Q0)}set chainId(e){Te(this,Q0,rr(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===rr(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===rr(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===rr(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(W(this,Ql).values())}attachPlugin(e){if(W(this,Ql).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return W(this,Ql).set(e.name,e.clone()),this}getPlugin(e){return W(this,Ql).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new Zp(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new Ux;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=r.txDataZero:n+=r.txDataNonzero;if(e.accessList){const i=Mh(e.accessList);for(const a in i)n+=r.txAccessListAddress+r.txAccessListStorageKey*i[a].storageKeys.length}return n}static from(e){if(Gpe(),e==null)return Zp.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const r=zS.get(e);if(r)return r();if(typeof e=="bigint")return new Zp("unknown",e);Ne(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){Ne(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const r=new Zp(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&r.attachPlugin(new Fx(e.ensAddress,e.ensNetwork)),r}Ne(!1,"invalid network","network",e)}static register(e,r){typeof e=="number"&&(e=BigInt(e));const n=zS.get(e);n&&Ne(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),zS.set(e,r)}};W0=new WeakMap,Q0=new WeakMap,Ql=new WeakMap;let Vu=Zp;function tL(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const n=r.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function rL(t){return new yQ(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[a,s]=await Promise.all([n.send(),e()]);i=a;const o=i.bodyJson.standard;return{gasPrice:s.gasPrice,maxFeePerGas:tL(o.maxFee,9),maxPriorityFeePerGas:tL(o.maxPriorityFee,9)}}catch(a){it(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:a})}})}function Vpe(t){return new yQ("data:",async(e,r,n)=>{const i=await e();if(i.maxFeePerGas==null||i.maxPriorityFeePerGas==null)return i;const a=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:a+t,maxPriorityFeePerGas:t}})}let nL=!1;function Gpe(){if(nL)return;nL=!0;function t(e,r,n){const i=function(){const a=new Vu(e,r);return n.ensNetwork!=null&&a.attachPlugin(new Fx(null,n.ensNetwork)),a.attachPlugin(new Ux),(n.plugins||[]).forEach(s=>{a.attachPlugin(s)}),a};Vu.register(e,i),Vu.register(r,i),n.altNames&&n.altNames.forEach(a=>{Vu.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[rL("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[rL("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[Vpe(BigInt("1000000"))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function SR(t){return JSON.parse(JSON.stringify(t))}var Mu,fo,Yl,Nc,Y0,P_;class Kpe{constructor(e){Qe(this,Y0);Qe(this,Mu,void 0);Qe(this,fo,void 0);Qe(this,Yl,void 0);Qe(this,Nc,void 0);Te(this,Mu,e),Te(this,fo,null),Te(this,Yl,4e3),Te(this,Nc,-2)}get pollingInterval(){return W(this,Yl)}set pollingInterval(e){Te(this,Yl,e)}start(){W(this,fo)||(Te(this,fo,W(this,Mu)._setTimeout(ct(this,Y0,P_).bind(this),W(this,Yl))),ct(this,Y0,P_).call(this))}stop(){W(this,fo)&&(W(this,Mu)._clearTimeout(W(this,fo)),Te(this,fo,null))}pause(e){this.stop(),e&&Te(this,Nc,-2)}resume(){this.start()}}Mu=new WeakMap,fo=new WeakMap,Yl=new WeakMap,Nc=new WeakMap,Y0=new WeakSet,P_=async function(){try{const e=await W(this,Mu).getBlockNumber();if(W(this,Nc)===-2){Te(this,Nc,e);return}if(e!==W(this,Nc)){for(let r=W(this,Nc)+1;r<=e;r++){if(W(this,fo)==null)return;await W(this,Mu).emit("block",r)}Te(this,Nc,e)}}catch{}W(this,fo)!=null&&Te(this,fo,W(this,Mu)._setTimeout(ct(this,Y0,P_).bind(this),W(this,Yl)))};var Zd,eh,Jl;class vQ{constructor(e){Qe(this,Zd,void 0);Qe(this,eh,void 0);Qe(this,Jl,void 0);Te(this,Zd,e),Te(this,Jl,!1),Te(this,eh,r=>{this._poll(r,W(this,Zd))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){W(this,Jl)||(Te(this,Jl,!0),W(this,eh).call(this,-2),W(this,Zd).on("block",W(this,eh)))}stop(){W(this,Jl)&&(Te(this,Jl,!1),W(this,Zd).off("block",W(this,eh)))}pause(e){this.stop()}resume(){this.start()}}Zd=new WeakMap,eh=new WeakMap,Jl=new WeakMap;var ux;class Wpe extends vQ{constructor(r,n){super(r);Qe(this,ux,void 0);Te(this,ux,SR(n))}async _poll(r,n){throw new Error("@TODO")}}ux=new WeakMap;var J0;class Qpe extends vQ{constructor(r,n){super(r);Qe(this,J0,void 0);Te(this,J0,n)}async _poll(r,n){const i=await n.getTransactionReceipt(W(this,J0));i&&n.emit(W(this,J0),i)}}J0=new WeakMap;var $u,X0,Z0,Xl,ho,lx,bQ;class z8{constructor(e,r){Qe(this,lx);Qe(this,$u,void 0);Qe(this,X0,void 0);Qe(this,Z0,void 0);Qe(this,Xl,void 0);Qe(this,ho,void 0);Te(this,$u,e),Te(this,X0,SR(r)),Te(this,Z0,ct(this,lx,bQ).bind(this)),Te(this,Xl,!1),Te(this,ho,-2)}start(){W(this,Xl)||(Te(this,Xl,!0),W(this,ho)===-2&&W(this,$u).getBlockNumber().then(e=>{Te(this,ho,e)}),W(this,$u).on("block",W(this,Z0)))}stop(){W(this,Xl)&&(Te(this,Xl,!1),W(this,$u).off("block",W(this,Z0)))}pause(e){this.stop(),e&&Te(this,ho,-2)}resume(){this.start()}}$u=new WeakMap,X0=new WeakMap,Z0=new WeakMap,Xl=new WeakMap,ho=new WeakMap,lx=new WeakSet,bQ=async function(e){if(W(this,ho)===-2)return;const r=SR(W(this,X0));r.fromBlock=W(this,ho)+1,r.toBlock=e;const n=await W(this,$u).getLogs(r);if(n.length===0){W(this,ho)<e-60&&Te(this,ho,e-60);return}for(const i of n)W(this,$u).emit(W(this,X0),i),Te(this,ho,i.blockNumber)};const Ype=BigInt(2),Jpe=10;function $w(t){return t&&typeof t.then=="function"}function T_(t,e){return t+":"+JSON.stringify(e,(r,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((a,s)=>(a[s]=n[s],a),{})}return n})}class wQ{constructor(e){Be(this,"name");Qt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Xpe(t){return JSON.parse(JSON.stringify(t))}function IR(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function VS(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"pending":case"debug":case"error":case"network":return{type:t,tag:t}}if(ai(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:T_("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:T_("orphan",r),filter:Xpe(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?IR(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],a=[],s=o=>{ai(o)?i.push(o):a.push((async()=>{i.push(await sa(o,e))})())};Array.isArray(r.address)?r.address.forEach(s):s(r.address),a.length&&await Promise.all(a),n.address=IR(i.map(o=>o.toLowerCase()))}return{filter:n,tag:T_("event",n),type:"event"}}Ne(!1,"unknown ProviderEvent","event",t)}function GS(){return new Date().getTime()}const Zpe={cacheTimeout:250,pollingInterval:4e3};var ba,Zl,wa,eg,Ns,th,ef,ku,$b,po,tg,rg,os,ro,kb,OR,Lb,PR,rh,Qy,jb,TR,nh,Yy,ng,C_;class e0e{constructor(e,r){Qe(this,os);Qe(this,kb);Qe(this,Lb);Qe(this,rh);Qe(this,jb);Qe(this,nh);Qe(this,ng);Qe(this,ba,void 0);Qe(this,Zl,void 0);Qe(this,wa,void 0);Qe(this,eg,void 0);Qe(this,Ns,void 0);Qe(this,th,void 0);Qe(this,ef,void 0);Qe(this,ku,void 0);Qe(this,$b,void 0);Qe(this,po,void 0);Qe(this,tg,void 0);Qe(this,rg,void 0);if(Te(this,rg,Object.assign({},Zpe,r||{})),e==="any")Te(this,th,!0),Te(this,Ns,null);else if(e){const n=Vu.from(e);Te(this,th,!1),Te(this,Ns,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else Te(this,th,!1),Te(this,Ns,null);Te(this,ku,-1),Te(this,ef,new Map),Te(this,ba,new Map),Te(this,Zl,new Map),Te(this,wa,null),Te(this,eg,!1),Te(this,$b,1),Te(this,po,new Map),Te(this,tg,!1)}get pollingInterval(){return W(this,rg).pollingInterval}get provider(){return this}get plugins(){return Array.from(W(this,Zl).values())}attachPlugin(e){if(W(this,Zl).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return W(this,Zl).set(e.name,e.connect(this)),this}getPlugin(e){return W(this,Zl).get(e)||null}get disableCcipRead(){return W(this,tg)}set disableCcipRead(e){Te(this,tg,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=r.toLowerCase(),s=[];for(let o=0;o<n.length;o++){const c=n[o],u=c.replace("{sender}",i).replace("{data}",a),f=new Of(u);c.indexOf("{data}")===-1&&(f.body={data:a,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:f,index:o,urls:n});let h="unknown error";const m=await f.send();try{const y=m.bodyJson;if(y.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:f,result:y}),y.data;y.message&&(h=y.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:f,result:y})}catch{}it(m.statusCode<400||m.statusCode>=500,`response not found during CCIP fetch: ${h}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:h}}),s.push(h)}it(!1,`error encountered during CCIP fetch: ${s.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:s}})}_wrapBlock(e,r){return new wpe(Upe(e),this)}_wrapLog(e,r){return new r1(Lpe(e),this)}_wrapTransactionReceipt(e,r){return new nQ(Hpe(e),this)}_wrapTransactionResponse(e,r){return new sb(mQ(e),this)}_detectNetwork(){it(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){it(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=jr(await ct(this,os,ro).call(this,{method:"getBlockNumber"}),"%response");return W(this,ku)>=0&&Te(this,ku,e),e}_getAddress(e){return sa(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(ai(e))return ai(e,32)?e:Gp(e);if(typeof e=="bigint"&&(e=jr(e,"blockTag")),typeof e=="number")return e>=0?Gp(e):W(this,ku)>=0?Gp(W(this,ku)+e):this.getBlockNumber().then(r=>Gp(r+e));Ne(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?IR(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,u,f)=>{let h;switch(c.length){case 0:break;case 1:h=c[0];break;default:c.sort(),h=c}if(n&&(u!=null||f!=null))throw new Error("invalid filter");const m={};return h&&(m.address=h),r.length&&(m.topics=r),u&&(m.fromBlock=u),f&&(m.toBlock=f),n&&(m.blockHash=n),m};let a=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)a.push(this._getAddress(c));else a.push(this._getAddress(e.address));let s;"fromBlock"in e&&(s=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),a.filter(c=>typeof c!="string").length||s!=null&&typeof s!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(a),s,o]).then(c=>i(c[0],c[1],c[2])):i(a,s,o)}_getTransactionRequest(e){const r=IE(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const a=sa(r[i],this);$w(a)?n.push(async function(){r[i]=await a}()):r[i]=a}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);$w(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(W(this,Ns)==null){const i=this._detectNetwork().then(a=>(this.emit("network",a,null),a),a=>{throw W(this,Ns)===i&&Te(this,Ns,null),a});return Te(this,Ns,i),(await i).clone()}const e=W(this,Ns),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(W(this,th)?(this.emit("network",n,r),W(this,Ns)===e&&Te(this,Ns,Promise.resolve(n))):it(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:a}=await _a({_block:ct(this,jb,TR).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ct(this,os,ro).call(this,{method:"getGasPrice"});return rr(u,"%response")}catch{}return null})()});let s=null,o=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(o=BigInt("1000000000"),s=c.baseFeePerGas*Ype+o),new Y9(a,s,o)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Of(n.url),a=await n.processFunc(r,this,i);return new Y9(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return $w(r)&&(r=await r),rr(await ct(this,os,ro).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await _a({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ct(this,Lb,PR).call(this,ct(this,kb,OR).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return rr(await ct(this,rh,Qy).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return jr(await ct(this,rh,Qy).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return _t(await ct(this,rh,Qy).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=rr(r,"position");return _t(await ct(this,rh,Qy).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await _a({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=nb.from(e);if(a.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await _a({network:this.getNetwork(),params:ct(this,jb,TR).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await _a({network:this.getNetwork(),params:ct(this,os,ro).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await _a({network:this.getNetwork(),params:ct(this,os,ro).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await ct(this,os,ro).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await _a({network:this.getNetwork(),result:ct(this,os,ro).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:_t(r)}async getLogs(e){let r=this._getFilter(e);$w(r)&&(r=await r);const{network:n,params:i}=await _a({network:this.getNetwork(),params:ct(this,os,ro).call(this,{method:"getLogs",filter:r})});return i.map(a=>this._wrapLog(a,n))}_getProvider(e){it(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await PE.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=sn(e);const r=bR(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await PE.getEnsAddress(this),a=await new _v(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(a==null||a===hR)return null;const o=await new _v(a,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(o)!==e?null:o}catch(n){if(wo(n,"BAD_DATA")&&n.value==="0x"||wo(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,s)=>{let o=null;const c=async u=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=i){a(f),o&&(clearTimeout(o),o=null);return}}catch(f){console.log("EEE",f)}this.once("block",c)};n!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",c),s(Ni("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){it(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=W(this,po).get(e);r&&(r.timer&&clearTimeout(r.timer),W(this,po).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=Em(this,$b)._++,i=()=>{W(this,po).delete(n),e()};if(this.paused)W(this,po).set(n,{timer:null,func:i,time:r});else{const a=setTimeout(i,r);W(this,po).set(n,{timer:a,func:i,time:GS()})}return n}_forEachSubscriber(e){for(const r of W(this,ba).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new wQ(e.type);case"block":{const r=new Kpe(this);return r.pollingInterval=this.pollingInterval,r}case"event":return new z8(this,e.filter);case"transaction":return new Qpe(this,e.hash);case"orphan":return new Wpe(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of W(this,ba).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),W(this,wa)!=null&&r.pause(W(this,wa));break}}async on(e,r){const n=await ct(this,ng,C_).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,W(this,wa)!=null&&n.subscriber.pause(W(this,wa))),this}async once(e,r){const n=await ct(this,ng,C_).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,W(this,wa)!=null&&n.subscriber.pause(W(this,wa))),this}async emit(e,...r){const n=await ct(this,nh,Yy).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:a,once:s})=>{const o=new lK(this,s?null:a,e);try{a.call(this,...r,o)}catch{}return!s}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),W(this,ba).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await ct(this,nh,Yy).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of W(this,ba).values())r+=n.length;return r}async listeners(e){if(e){const n=await ct(this,nh,Yy).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of W(this,ba).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await ct(this,nh,Yy).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:a})=>a).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),W(this,ba).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await ct(this,ng,C_).call(this,e);n&&i.stop(),W(this,ba).delete(r)}else for(const[r,{started:n,subscriber:i}]of W(this,ba))n&&i.stop(),W(this,ba).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return W(this,eg)}destroy(){this.removeAllListeners();for(const e of W(this,po).keys())this._clearTimeout(e);Te(this,eg,!0)}get paused(){return W(this,wa)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(Te(this,ku,-1),W(this,wa)!=null){if(W(this,wa)==!!e)return;it(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),Te(this,wa,!!e);for(const r of W(this,po).values())r.timer&&clearTimeout(r.timer),r.time=GS()-r.time}resume(){if(W(this,wa)!=null){this._forEachSubscriber(e=>e.resume()),Te(this,wa,null);for(const e of W(this,po).values()){let r=e.time;r<0&&(r=0),e.time=GS(),setTimeout(e.func,r)}}}}ba=new WeakMap,Zl=new WeakMap,wa=new WeakMap,eg=new WeakMap,Ns=new WeakMap,th=new WeakMap,ef=new WeakMap,ku=new WeakMap,$b=new WeakMap,po=new WeakMap,tg=new WeakMap,rg=new WeakMap,os=new WeakSet,ro=async function(e){const r=W(this,rg).cacheTimeout;if(r<0)return await this._perform(e);const n=T_(e.method,e);let i=W(this,ef).get(n);return i||(i=this._perform(e),W(this,ef).set(n,i),setTimeout(()=>{W(this,ef).get(n)===i&&W(this,ef).delete(n)},r)),await i},kb=new WeakSet,OR=async function(e,r,n){it(n<Jpe,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:r,enableCcipRead:!0})});const i=IE(e);try{return _t(await this._perform({method:"call",transaction:i,blockTag:r}))}catch(a){if(!this.disableCcipRead&&w8(a)&&a.data&&n>=0&&r==="latest"&&i.to!=null&&zn(a.data,0,4)==="0x556f1830"){const s=a.data,o=await sa(i.to,this);let c;try{c=a0e(zn(a.data,4))}catch(h){it(!1,h.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:s}})}it(c.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:s,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(i,c.calldata,c.urls);it(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:c.errorArgs}});const f={to:o,data:Bn([c.selector,i0e([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const h=await ct(this,kb,OR).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:h}),h}catch(h){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:h}),h}}throw a}},Lb=new WeakSet,PR=async function(e){const{value:r}=await _a({network:this.getNetwork(),value:e});return r},rh=new WeakSet,Qy=async function(e,r,n){let i=this._getAddress(r),a=this._getBlockTag(n);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ct(this,Lb,PR).call(this,ct(this,os,ro).call(this,Object.assign(e,{address:i,blockTag:a})))},jb=new WeakSet,TR=async function(e,r){if(ai(e,32))return await ct(this,os,ro).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await ct(this,os,ro).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},nh=new WeakSet,Yy=async function(e,r){let n=await VS(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await VS({orphan:"drop-log",log:r[0]},this)),W(this,ba).get(n.tag)||null},ng=new WeakSet,C_=async function(e){const r=await VS(e,this),n=r.tag;let i=W(this,ba).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},W(this,ba).set(n,i)),i};function t0e(t,e){try{const r=CR(t,e);if(r)return _8(r)}catch{}return null}function CR(t,e){if(t==="0x")return null;try{const r=jr(zn(t,e,e+32)),n=jr(zn(t,r,r+32));return zn(t,r+32,r+32+n)}catch{}return null}function iL(t){const e=gs(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 r0e(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const n0e=new Uint8Array([]);function i0e(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(n0e),r+=32;for(let n=0;n<t.length;n++){const i=qt(t[n]);e[n]=iL(r),e.push(iL(i.length)),e.push(r0e(i)),r+=32+Math.ceil(i.length/32)*32}return Bn(e)}const aL="0x0000000000000000000000000000000000000000000000000000000000000000";function a0e(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};it(l0(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=zn(t,0,32);it(zn(r,0,12)===zn(aL,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=zn(r,12);try{const n=[],i=jr(zn(t,32,64)),a=jr(zn(t,i,i+32)),s=zn(t,i+32);for(let o=0;o<a;o++){const c=t0e(s,o*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{it(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=CR(t,64);if(n==null)throw new Error("abort");e.calldata=n}catch{it(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}it(zn(t,100,128)===zn(aL,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=zn(t,96,100);try{const n=CR(t,128);if(n==null)throw new Error("abort");e.extraData=n}catch{it(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function yp(t,e){if(t.provider)return t.provider;it(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function sL(t,e){let r=IE(e);if(r.to!=null&&(r.to=sa(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),sa(n,t)]).then(([i,a])=>(Ne(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else r.from=t.getAddress();return await _a(r)}class V8{constructor(e){Be(this,"provider");Qt(this,{provider:e||null})}async getNonce(e){return yp(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await sL(this,e)}async populateTransaction(e){const r=yp(this,"populateTransaction"),n=await sL(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const s=rr(n.chainId);Ne(s===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const a=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||a)?Ne(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&a&&Ne(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const s=await r.getFeeData();it(s.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=s.gasPrice)}else{const s=await r.getFeeData();if(n.type==null)if(s.maxFeePerGas!=null&&s.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=s.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=s.maxPriorityFeePerGas);else s.gasPrice!=null?(it(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=s.gasPrice),n.type=0):it(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=s.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=s.maxPriorityFeePerGas))}return await _a(n)}async estimateGas(e){return yp(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return yp(this,"call").call(await this.populateCall(e))}async resolveName(e){return await yp(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=yp(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=nb.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var ig,R_;const ND=class ND extends V8{constructor(r,n){super(n);Qe(this,ig);Be(this,"address");Qt(this,{address:r})}async getAddress(){return this.address}connect(r){return new ND(this.address,r)}async signTransaction(r){ct(this,ig,R_).call(this,"transactions","signTransaction")}async signMessage(r){ct(this,ig,R_).call(this,"messages","signMessage")}async signTypedData(r,n,i){ct(this,ig,R_).call(this,"typed-data","signTypedData")}};ig=new WeakSet,R_=function(r,n){it(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let RR=ND;function s0e(t){return JSON.parse(JSON.stringify(t))}var cs,Dc,ih,tf,ah,ag,Ub,NR,Fb,DR;class _Q{constructor(e){Qe(this,Ub);Qe(this,Fb);Qe(this,cs,void 0);Qe(this,Dc,void 0);Qe(this,ih,void 0);Qe(this,tf,void 0);Qe(this,ah,void 0);Qe(this,ag,void 0);Te(this,cs,e),Te(this,Dc,null),Te(this,ih,ct(this,Ub,NR).bind(this)),Te(this,tf,!1),Te(this,ah,null),Te(this,ag,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){W(this,tf)||(Te(this,tf,!0),ct(this,Ub,NR).call(this,-2))}stop(){W(this,tf)&&(Te(this,tf,!1),Te(this,ag,!0),ct(this,Fb,DR).call(this),W(this,cs).off("block",W(this,ih)))}pause(e){e&&ct(this,Fb,DR).call(this),W(this,cs).off("block",W(this,ih))}resume(){this.start()}}cs=new WeakMap,Dc=new WeakMap,ih=new WeakMap,tf=new WeakMap,ah=new WeakMap,ag=new WeakMap,Ub=new WeakSet,NR=async function(e){try{W(this,Dc)==null&&Te(this,Dc,this._subscribe(W(this,cs)));let r=null;try{r=await W(this,Dc)}catch(a){if(!wo(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(r==null){Te(this,Dc,null),W(this,cs)._recoverSubscriber(this,this._recover(W(this,cs)));return}const n=await W(this,cs).getNetwork();if(W(this,ah)||Te(this,ah,n),W(this,ah).chainId!==n.chainId)throw new Error("chaid changed");if(W(this,ag))return;const i=await W(this,cs).send("eth_getFilterChanges",[r]);await this._emitResults(W(this,cs),i)}catch(r){console.log("@TODO",r)}W(this,cs).once("block",W(this,ih))},Fb=new WeakSet,DR=function(){const e=W(this,Dc);e&&(Te(this,Dc,null),e.then(r=>{W(this,cs).send("eth_uninstallFilter",[r])}))};var sh;class o0e extends _Q{constructor(r,n){super(r);Qe(this,sh,void 0);Te(this,sh,s0e(n))}_recover(r){return new z8(r,W(this,sh))}async _subscribe(r){return await r.send("eth_newFilter",[W(this,sh)])}async _emitResults(r,n){for(const i of n)r.emit(W(this,sh),r._wrapLog(i,r._network))}}sh=new WeakMap;class c0e extends _Q{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const u0e="bigint,boolean,function,number,string,symbol".split(/,/g);function N_(t){if(t==null||u0e.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(N_);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function l0e(t){return new Promise(e=>{setTimeout(e,t)})}function vp(t){return t&&t.toLowerCase()}function oL(t){return t&&typeof t.pollingInterval=="number"}const f0e={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class KS extends V8{constructor(r,n){super(r);Be(this,"address");n=sn(n),Qt(this,{address:n})}connect(r){it(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=N_(r),i=[];if(n.from){const s=n.from;i.push((async()=>{const o=await sa(s,this.provider);Ne(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const s=n.to;i.push((async()=>{n.to=await sa(s,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((a,s)=>{const o=[1e3,100],c=async()=>{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(n));return}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(r){const n=N_(r);if(n.from){const a=await sa(n.from,this.provider);Ne(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=a}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Wa(r):r;return await this.provider.send("personal_sign",[_t(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const a=N_(i),s=await _g.resolveNames(r,n,a,async o=>{const c=await sa(o);return Ne(c!=null,"TypedData does not support null address","value",o),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(_g.getPayload(s.domain,n,s.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Wa(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),_t(n)])}}var oh,sg,Lu,Mc,tc,ju,Bb,MR;class d0e extends e0e{constructor(r,n){super(r,n);Qe(this,Bb);Qe(this,oh,void 0);Qe(this,sg,void 0);Qe(this,Lu,void 0);Qe(this,Mc,void 0);Qe(this,tc,void 0);Qe(this,ju,void 0);Te(this,sg,1),Te(this,oh,Object.assign({},f0e,n||{})),Te(this,Lu,[]),Te(this,Mc,null),Te(this,ju,null);{let a=null;const s=new Promise(o=>{a=o});Te(this,tc,{promise:s,resolve:a})}const i=this._getOption("staticNetwork");i&&(Ne(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),Te(this,ju,i))}_getOption(r){return W(this,oh)[r]}get _network(){return it(W(this,ju),"network is not available yet","NETWORK_ERROR"),W(this,ju)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&rr(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)return r;if(this.ready)return Vu.from(rr(await this.send("eth_chainId",[])));const n={id:Em(this,sg)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0]}catch(a){throw this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Vu.from(rr(i.result));throw this.getRpcError(n,i)}_start(){W(this,tc)==null||W(this,tc).resolve==null||(W(this,tc).resolve(),Te(this,tc,null),(async()=>{for(;W(this,ju)==null&&!this.destroyed;)try{Te(this,ju,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Ni("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await l0e(1e3)}ct(this,Bb,MR).call(this)})())}async _waitUntilReady(){if(W(this,tc)!=null)return await W(this,tc).promise}_getSubscriber(r){return r.type==="pending"?new c0e(this):r.type==="event"?this._getOption("polling")?new z8(this,r.filter):new o0e(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new wQ("orphan"):super._getSubscriber(r)}get ready(){return W(this,tc)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),n[a]=Gp(rr(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=_t(r[i]))}),r.accessList&&(n.accessList=Mh(r.accessList)),n}getRpcRequest(r){switch(r.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:[vp(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[vp(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[vp(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[vp(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(vp):r.filter.address=vp(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:a}=n;if(i==="eth_estimateGas"&&a.message){const c=a.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return Ni("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=$R(a),u=ab.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return u.info={error:a,payload:r},u}const s=JSON.stringify(p0e(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return Ni("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(s.match(/insufficient funds|base fee exceeds gas limit/i))return Ni("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:a}});if(s.match(/nonce/i)&&s.match(/too low/i))return Ni("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:a}});if(s.match(/replacement transaction/i)&&s.match(/underpriced/i))return Ni("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:a}});if(s.match(/only replay-protected/i))return Ni("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:a}}})}let o=!!s.match(/the method .* does not exist/i);return o||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(o=!0),o?Ni("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:a,payload:r}}):Ni("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(Ni("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=Em(this,sg)._++,a=new Promise((s,o)=>{W(this,Lu).push({resolve:s,reject:o,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return ct(this,Bb,MR).call(this),a}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const a=await n;if(r>=a.length)throw new Error("no such account");return new KS(this,a[r])}const{accounts:i}=await _a({network:this.getNetwork(),accounts:n});r=sn(r);for(const a of i)if(sn(a)===r)return new KS(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new KS(this,n))}destroy(){W(this,Mc)&&(clearTimeout(W(this,Mc)),Te(this,Mc,null));for(const{payload:r,reject:n}of W(this,Lu))n(Ni("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));Te(this,Lu,[]),super.destroy()}}oh=new WeakMap,sg=new WeakMap,Lu=new WeakMap,Mc=new WeakMap,tc=new WeakMap,ju=new WeakMap,Bb=new WeakSet,MR=function(){if(W(this,Mc))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Te(this,Mc,setTimeout(()=>{Te(this,Mc,null);const n=W(this,Lu);for(Te(this,Lu,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==W(this,oh).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(s=>s.payload)).length>W(this,oh).batchMaxSize){n.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(s=>s.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const s=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:s});for(const{resolve:o,reject:c,payload:u}of i){if(this.destroyed){c(Ni("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const f=s.filter(h=>h.id===u.id)[0];if(f==null){const h=Ni("missing response for request","BAD_DATA",{value:s,info:{payload:u}});this.emit("error",h),c(h);continue}if("error"in f){c(this.getRpcError(u,f));continue}o(f.result)}}catch(s){this.emit("debug",{action:"receiveRpcError",error:s});for(const{reject:o}of i)o(s)}})()}},r))};var rf;class h0e extends d0e{constructor(r,n){super(r,n);Qe(this,rf,void 0);Te(this,rf,4e3)}_getSubscriber(r){const n=super._getSubscriber(r);return oL(n)&&(n.pollingInterval=W(this,rf)),n}get pollingInterval(){return W(this,rf)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");Te(this,rf,r),this._forEachSubscriber(n=>{oL(n)&&(n.pollingInterval=W(this,rf))})}}rf=new WeakMap;function $R(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&ai(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=$R(t[e]);if(r)return r}return null}if(typeof t=="string")try{return $R(JSON.parse(t))}catch{}return null}function kR(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)kR(t[r],e);if(typeof t=="string")try{return kR(JSON.parse(t),e)}catch{}}}function p0e(t){const e=[];return kR(t,e),e}var og;class LR extends h0e{constructor(r,n){super(n,{batchMaxCount:1});Qe(this,og,void 0);Te(this,og,async(i,a)=>{const s={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:s});try{const o=await r.request(s);return this.emit("debug",{action:"receiveEip1193Result",result:o}),o}catch(o){const c=new Error(o.message);throw c.code=o.code,c.data=o.data,c.payload=s,this.emit("debug",{action:"receiveEip1193Error",error:c}),c}})}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){Ne(!Array.isArray(r),"EIP-1193 does not support batch request","payload",r);try{const n=await W(this,og).call(this,r.method,r.params||[]);return[{id:r.id,result:n}]}catch(n){return[{id:r.id,error:{code:n.code,data:n.data,message:n.message}}]}}getRpcError(r,n){switch(n=JSON.parse(JSON.stringify(n)),n.error.code||-1){case 4001:n.error.message=`ethers-user-denied: ${n.error.message}`;break;case 4200:n.error.message=`ethers-unsupported: ${n.error.message}`;break}return super.getRpcError(r,n)}async hasSigner(r){r==null&&(r=0);const n=await this.send("eth_accounts",[]);return typeof r=="number"?n.length>r:(r=r.toLowerCase(),n.filter(i=>i.toLowerCase()===r).length!==0)}async getSigner(r){if(r==null&&(r=0),!await this.hasSigner(r))try{await W(this,og).call(this,"eth_requestAccounts",[])}catch(n){const i=n.payload;throw this.getRpcError(i,{id:i.id,error:n})}return await super.getSigner(r)}}og=new WeakMap;var cg;const DD=class DD extends V8{constructor(r,n){super(n);Be(this,"address");Qe(this,cg,void 0);Ne(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),Te(this,cg,r);const i=t1(this.signingKey.publicKey);Qt(this,{address:i})}get signingKey(){return W(this,cg)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new DD(W(this,cg),r)}async signTransaction(r){const{to:n,from:i}=await _a({to:r.to?sa(r.to,this.provider):void 0,from:r.from?sa(r.from,this.provider):void 0});n!=null&&(r.to=n),i!=null&&(r.from=i),r.from!=null&&(Ne(sn(r.from)===this.address,"transaction from address mismatch","tx.from",r.from),delete r.from);const a=nb.from(r);return a.signature=this.signingKey.sign(a.unsignedHash),a.serialized}async signMessage(r){return this.signMessageSync(r)}signMessageSync(r){return this.signingKey.sign(Qhe(r)).serialized}async signTypedData(r,n,i){const a=await _g.resolveNames(r,n,i,async s=>{it(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:s}});const o=await this.provider.resolveName(s);return it(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:s}),o});return this.signingKey.sign(_g.hash(a.domain,n,a.value)).serialized}};cg=new WeakMap;let TE=DD;const CE=" !#$%&'()*+,-./<=>?@[]^_`{|}~",g0e=/^[a-z]*$/i;function cL(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(g0e)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function m0e(t,e){for(let i=CE.length-1;i>=0;i--)t=t.split(CE[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,a,s,o)=>{if(s)for(let c=parseInt(s);c>=0;c--)r.push(";");else r.push(a.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return cL(cL(r,";"),":")}function y0e(t){return Ne(t[0]==="0","unsupported auwl data","data",t),m0e(t.substring(1+2*CE.length),t.substring(1,1+2*CE.length))}class v0e{constructor(e){Be(this,"locale");Qt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var ug,qb,ch,Hb,jR;class b0e extends v0e{constructor(r,n,i){super(r);Qe(this,Hb);Qe(this,ug,void 0);Qe(this,qb,void 0);Qe(this,ch,void 0);Te(this,ug,n),Te(this,qb,i),Te(this,ch,null)}get _data(){return W(this,ug)}_decodeWords(){return y0e(W(this,ug))}getWord(r){const n=ct(this,Hb,jR).call(this);return Ne(r>=0&&r<n.length,`invalid word index: ${r}`,"index",r),n[r]}getWordIndex(r){return ct(this,Hb,jR).call(this).indexOf(r)}}ug=new WeakMap,qb=new WeakMap,ch=new WeakMap,Hb=new WeakSet,jR=function(){if(W(this,ch)==null){const r=this._decodeWords();if(el(r.join(`
|
|
70
70
|
`)+`
|
|
71
71
|
`)!==W(this,qb))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);Te(this,ch,r)}return W(this,ch)};const w0e="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%EeIght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0BBb#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",_0e="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let WS=null;class xh extends b0e{constructor(){super("en",w0e,_0e)}static wordlist(){return WS==null&&(WS=new xh),WS}}function EQ(t){return(1<<t)-1<<8-t&255}function E0e(t){return(1<<t)-1&255}function QS(t,e){iK("NFKD"),e==null&&(e=xh.wordlist());const r=e.split(t);Ne(r.length%3===0&&r.length>=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let u=0;u<r.length;u++){let f=e.getWordIndex(r[u].normalize("NFKD"));Ne(f>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let h=0;h<11;h++)f&1<<10-h&&(n[i>>3]|=1<<7-i%8),i++}const a=32*r.length/3,s=r.length/3,o=EQ(s),c=qt(uc(n.slice(0,a/8)))[0]&o;return Ne(c===(n[n.length-1]&o),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),_t(n.slice(0,a/8))}function YS(t,e){Ne(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=xh.wordlist());const r=[0];let n=11;for(let s=0;s<t.length;s++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[s],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[s]>>8-n,r.push(t[s]&E0e(8-n)),n+=3);const i=t.length/4,a=parseInt(uc(t).substring(2,4),16)&EQ(i);return r[r.length-1]<<=i,r[r.length-1]|=a>>8-i,e.join(r.map(s=>e.getWord(s)))}const JS={};class xg{constructor(e,r,n,i,a){Be(this,"phrase");Be(this,"password");Be(this,"wordlist");Be(this,"entropy");i==null&&(i=""),a==null&&(a=xh.wordlist()),kf(e,JS,"Mnemonic"),Qt(this,{phrase:n,password:i,wordlist:a,entropy:r})}computeSeed(){const e=Wa("mnemonic"+this.password,"NFKD");return Lf(Wa(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,n){const i=QS(e,n);return e=YS(qt(i),n),new xg(JS,i,e,r,n)}static fromEntropy(e,r,n){const i=qt(e,"entropy"),a=YS(i,n);return new xg(JS,_t(i),a,r,n)}static entropyToPhrase(e,r){const n=qt(e,"entropy");return YS(n,r)}static phraseToEntropy(e,r){return QS(e,r)}static isValidMnemonic(e,r){try{return QS(e,r),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var Wi=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},XS=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},D_,no,Ic;const x0e={16:10,24:12,32:14},A0e=[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],Zs=[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],kw=[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],S0e=[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],I0e=[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],O0e=[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],P0e=[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],T0e=[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],C0e=[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],R0e=[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],N0e=[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],D0e=[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],M0e=[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],$0e=[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],k0e=[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 ZS(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 G8{get key(){return Wi(this,D_,"f").slice()}constructor(e){if(D_.set(this,void 0),no.set(this,void 0),Ic.set(this,void 0),!(this instanceof G8))throw Error("AES must be instanitated with `new`");XS(this,D_,new Uint8Array(e),"f");const r=x0e[this.key.length];if(r==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");XS(this,Ic,[],"f"),XS(this,no,[],"f");for(let f=0;f<=r;f++)Wi(this,Ic,"f").push([0,0,0,0]),Wi(this,no,"f").push([0,0,0,0]);const n=(r+1)*4,i=this.key.length/4,a=ZS(this.key);let s;for(let f=0;f<i;f++)s=f>>2,Wi(this,Ic,"f")[s][f%4]=a[f],Wi(this,no,"f")[r-s][f%4]=a[f];let o=0,c=i,u;for(;c<n;){if(u=a[i-1],a[0]^=Zs[u>>16&255]<<24^Zs[u>>8&255]<<16^Zs[u&255]<<8^Zs[u>>24&255]^A0e[o]<<24,o+=1,i!=8)for(let y=1;y<i;y++)a[y]^=a[y-1];else{for(let y=1;y<i/2;y++)a[y]^=a[y-1];u=a[i/2-1],a[i/2]^=Zs[u&255]^Zs[u>>8&255]<<8^Zs[u>>16&255]<<16^Zs[u>>24&255]<<24;for(let y=i/2+1;y<i;y++)a[y]^=a[y-1]}let f=0,h,m;for(;f<i&&c<n;)h=c>>2,m=c%4,Wi(this,Ic,"f")[h][m]=a[f],Wi(this,no,"f")[r-h][m]=a[f++],c++}for(let f=1;f<r;f++)for(let h=0;h<4;h++)u=Wi(this,no,"f")[f][h],Wi(this,no,"f")[f][h]=D0e[u>>24&255]^M0e[u>>16&255]^$0e[u>>8&255]^k0e[u&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const r=Wi(this,Ic,"f").length-1,n=[0,0,0,0];let i=ZS(e);for(let o=0;o<4;o++)i[o]^=Wi(this,Ic,"f")[0][o];for(let o=1;o<r;o++){for(let c=0;c<4;c++)n[c]=S0e[i[c]>>24&255]^I0e[i[(c+1)%4]>>16&255]^O0e[i[(c+2)%4]>>8&255]^P0e[i[(c+3)%4]&255]^Wi(this,Ic,"f")[o][c];i=n.slice()}const a=new Uint8Array(16);let s=0;for(let o=0;o<4;o++)s=Wi(this,Ic,"f")[r][o],a[4*o]=(Zs[i[o]>>24&255]^s>>24)&255,a[4*o+1]=(Zs[i[(o+1)%4]>>16&255]^s>>16)&255,a[4*o+2]=(Zs[i[(o+2)%4]>>8&255]^s>>8)&255,a[4*o+3]=(Zs[i[(o+3)%4]&255]^s)&255;return a}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const r=Wi(this,no,"f").length-1,n=[0,0,0,0];let i=ZS(e);for(let o=0;o<4;o++)i[o]^=Wi(this,no,"f")[0][o];for(let o=1;o<r;o++){for(let c=0;c<4;c++)n[c]=T0e[i[c]>>24&255]^C0e[i[(c+3)%4]>>16&255]^R0e[i[(c+2)%4]>>8&255]^N0e[i[(c+1)%4]&255]^Wi(this,no,"f")[o][c];i=n.slice()}const a=new Uint8Array(16);let s=0;for(let o=0;o<4;o++)s=Wi(this,no,"f")[r][o],a[4*o]=(kw[i[o]>>24&255]^s>>24)&255,a[4*o+1]=(kw[i[(o+3)%4]>>16&255]^s>>16)&255,a[4*o+2]=(kw[i[(o+2)%4]>>8&255]^s>>8)&255,a[4*o+3]=(kw[i[(o+1)%4]&255]^s)&255;return a}}D_=new WeakMap,no=new WeakMap,Ic=new WeakMap;class xQ{constructor(e,r,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new G8(r)},name:{enumerable:!0,value:e}})}}var Lw=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},bp=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Jy,bu;class K8 extends xQ{constructor(e,r){if(super("ECC",e,K8),Jy.set(this,void 0),bu.set(this,void 0),r){if(r.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Lw(this,Jy,new Uint8Array(r),"f")}else Lw(this,Jy,new Uint8Array(16),"f");Lw(this,bu,this.iv,"f")}get iv(){return new Uint8Array(bp(this,Jy,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let i=0;i<16;i++)bp(this,bu,"f")[i]^=e[n+i];Lw(this,bu,this.aes.encrypt(bp(this,bu,"f")),"f"),r.set(bp(this,bu,"f"),n)}return r}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){const i=this.aes.decrypt(e.subarray(n,n+16));for(let a=0;a<16;a++)r[n+a]=i[a]^bp(this,bu,"f")[a],bp(this,bu,"f")[a]=e[n+a]}return r}}Jy=new WeakMap,bu=new WeakMap;var wp=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},eo=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xy,Sd,io;class Ag extends xQ{constructor(e,r){super("CTR",e,Ag),Xy.set(this,void 0),Sd.set(this,void 0),io.set(this,void 0),wp(this,io,new Uint8Array(16),"f"),eo(this,io,"f").fill(0),wp(this,Xy,eo(this,io,"f"),"f"),wp(this,Sd,16,"f"),r==null&&(r=1),typeof r=="number"?this.setCounterValue(r):this.setCounterBytes(r)}get counter(){return new Uint8Array(eo(this,io,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let r=15;r>=0;--r)eo(this,io,"f")[r]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");eo(this,io,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(eo(this,io,"f")[e]===255)eo(this,io,"f")[e]=0;else{eo(this,io,"f")[e]++;break}}encrypt(e){var r,n;const i=new Uint8Array(e);for(let a=0;a<i.length;a++)eo(this,Sd,"f")===16&&(wp(this,Xy,this.aes.encrypt(eo(this,io,"f")),"f"),wp(this,Sd,0,"f"),this.increment()),i[a]^=eo(this,Xy,"f")[wp(this,Sd,(n=eo(this,Sd,"f"),r=n++,n),"f"),r];return i}decrypt(e){return this.encrypt(e)}}Xy=new WeakMap,Sd=new WeakMap,io=new WeakMap;function L0e(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))}function AQ(t){return typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t),Pa(t)}function jm(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function a1(t){return typeof t=="string"?Wa(t,"NFKC"):Pa(t)}function yi(t,e){const r=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);Ne(r!=null,"invalid path","path",e);const n=r[1],i=r[3],a=r[4]==="!";let s=t;for(const o of n.toLowerCase().split(".")){if(Array.isArray(s)){if(!o.match(/^[0-9]+$/))break;s=s[parseInt(o)]}else if(typeof s=="object"){let c=null;for(const u in s)if(u.toLowerCase()===o){c=s[u];break}s=c}else s=null;if(s==null)break}if(Ne(!a||s!=null,"missing required value","path",n),i&&s!=null){if(i==="int"){if(typeof s=="string"&&s.match(/^-?[0-9]+$/))return parseInt(s);if(Number.isSafeInteger(s))return s}if(i==="number"&&typeof s=="string"&&s.match(/^-?[0-9.]*$/))return parseFloat(s);if(i==="data"&&typeof s=="string")return AQ(s);if(i==="array"&&Array.isArray(s)||i===typeof s)return s;Ne(!1,`wrong type found for ${i} `,"path",n)}return s}const SQ="m/44'/60'/0'/0/0";function uL(t){try{const e=JSON.parse(t);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}function j0e(t,e,r){if(yi(t,"crypto.cipher:string")==="aes-128-ctr"){const i=yi(t,"crypto.cipherparams.iv:data!"),a=new Ag(e,i);return _t(a.decrypt(r))}it(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function RE(t,e){const r=qt(e),n=yi(t,"crypto.ciphertext:data!"),i=_t(Fn(Bn([r.slice(16,32),n]))).substring(2);Ne(i===yi(t,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const a=j0e(t,r.slice(0,16),n),s=t1(a);if(t.address){let u=t.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),Ne(sn(u)===s,"keystore address/privateKey mismatch","address",t.address)}const o={address:s,privateKey:a};if(yi(t,"x-ethers.version:string")==="0.1"){const u=r.slice(32,64),f=yi(t,"x-ethers.mnemonicCiphertext:data!"),h=yi(t,"x-ethers.mnemonicCounter:data!"),m=new Ag(u,h);o.mnemonic={path:yi(t,"x-ethers.path:string")||SQ,locale:yi(t,"x-ethers.locale:string")||"en",entropy:_t(qt(m.decrypt(f)))}}return o}function IQ(t){const e=yi(t,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){const r=yi(t,"crypto.kdfparams.salt:data!"),n=yi(t,"crypto.kdfparams.n:int!"),i=yi(t,"crypto.kdfparams.r:int!"),a=yi(t,"crypto.kdfparams.p:int!");Ne(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),Ne(i>0&&a>0,"invalid kdf","kdf",e);const s=yi(t,"crypto.kdfparams.dklen:int!");return Ne(s===32,"invalid kdf.dklen","kdf.dflen",s),{name:"scrypt",salt:r,N:n,r:i,p:a,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const r=yi(t,"crypto.kdfparams.salt:data!"),n=yi(t,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();Ne(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const a=yi(t,"crypto.kdfparams.c:int!"),s=yi(t,"crypto.kdfparams.dklen:int!");return Ne(s===32,"invalid kdf.dklen","kdf.dklen",s),{name:"pbkdf2",salt:r,count:a,dkLen:s,algorithm:i}}}Ne(!1,"unsupported key-derivation function","kdf",e)}function U0e(t,e){const r=JSON.parse(t),n=a1(e),i=IQ(r);if(i.name==="pbkdf2"){const{salt:h,count:m,dkLen:y,algorithm:w}=i,v=Lf(n,h,m,y,w);return RE(r,v)}it(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:a,N:s,r:o,p:c,dkLen:u}=i,f=Qg(n,a,s,o,c,u);return RE(r,f)}function lL(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function F0e(t,e,r){const n=JSON.parse(t),i=a1(e),a=IQ(n);if(a.name==="pbkdf2"){r&&(r(0),await lL(0));const{salt:m,count:y,dkLen:w,algorithm:v}=a,g=Lf(i,m,y,w,v);return r&&(r(1),await lL(0)),RE(n,g)}it(a.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:s,N:o,r:c,p:u,dkLen:f}=a,h=await Wg(i,s,o,c,u,f,r);return RE(n,h)}function OQ(t){const e=t.salt!=null?qt(t.salt,"options.salt"):Ku(32);let r=1<<17,n=8,i=1;return t.scrypt&&(t.scrypt.N&&(r=t.scrypt.N),t.scrypt.r&&(n=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),Ne(typeof r=="number"&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),Ne(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),Ne(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:r,r:n,p:i}}function PQ(t,e,r,n){const i=qt(r.privateKey,"privateKey"),a=n.iv!=null?qt(n.iv,"options.iv"):Ku(16);Ne(a.length===16,"invalid options.iv length","options.iv",n.iv);const s=n.uuid!=null?qt(n.uuid,"options.uuid"):Ku(16);Ne(s.length===16,"invalid options.uuid length","options.uuid",n.iv);const o=t.slice(0,16),c=t.slice(16,32),u=new Ag(o,a),f=qt(u.encrypt(i)),h=Fn(Bn([c,f])),m={address:r.address.substring(2).toLowerCase(),id:Xle(s),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:_t(a).substring(2)},ciphertext:_t(f).substring(2),kdf:"scrypt",kdfparams:{salt:_t(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:h.substring(2)}};if(r.mnemonic){const y=n.client!=null?n.client:`ethers/${rK}`,w=r.mnemonic.path||SQ,v=r.mnemonic.locale||"en",g=t.slice(32,64),_=qt(r.mnemonic.entropy,"account.mnemonic.entropy"),b=Ku(16),S=new Ag(g,b),A=qt(S.encrypt(_)),I=new Date,p="UTC--"+(I.getUTCFullYear()+"-"+jm(I.getUTCMonth()+1,2)+"-"+jm(I.getUTCDate(),2)+"T"+jm(I.getUTCHours(),2)+"-"+jm(I.getUTCMinutes(),2)+"-"+jm(I.getUTCSeconds(),2)+".0Z")+"--"+m.address;m["x-ethers"]={client:y,gethFilename:p,path:w,locale:v,mnemonicCounter:_t(b).substring(2),mnemonicCiphertext:_t(A).substring(2),version:"0.1"}}return JSON.stringify(m)}function TQ(t,e,r){r==null&&(r={});const n=a1(e),i=OQ(r),a=Qg(n,i.salt,i.N,i.r,i.p,64);return PQ(qt(a),i,t,r)}async function CQ(t,e,r){r==null&&(r={});const n=a1(e),i=OQ(r),a=await Wg(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return PQ(qt(a),i,t,r)}const eI="m/44'/60'/0'/0/0",B0e=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),wf=2147483648,q0e=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),H0e="0123456789abcdef";function NE(t,e){let r="";for(;t;)r=H0e[t%16]+r,t=Math.trunc(t/16);for(;r.length<e*2;)r="0"+r;return"0x"+r}function UR(t){const e=qt(t),r=zn(uc(uc(e)),0,4),n=Bn([e,r]);return uK(n)}const Oc={};function RQ(t,e,r,n){const i=new Uint8Array(37);t&wf?(it(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(qt(n),1)):i.set(qt(r));for(let s=24;s>=0;s-=8)i[33+(s>>3)]=t>>24-s&255;const a=qt(Gg("sha512",e,i));return{IL:a.slice(0,32),IR:a.slice(32)}}function NQ(t,e){const r=e.split("/");Ne(r.length>0&&(r[0]==="m"||t.depth>0),"invalid path","path",e),r[0]==="m"&&r.shift();let n=t;for(let i=0;i<r.length;i++){const a=r[i];if(a.match(/^[0-9]+'$/)){const s=parseInt(a.substring(0,a.length-1));Ne(s<wf,"invalid path index",`path[${i}]`,a),n=n.deriveChild(wf+s)}else if(a.match(/^[0-9]+$/)){const s=parseInt(a);Ne(s<wf,"invalid path index",`path[${i}]`,a),n=n.deriveChild(s)}else Ne(!1,"invalid path component",`path[${i}]`,a)}return n}var zb,FR,uh,Zy;const Go=class Go extends TE{constructor(r,n,i,a,s,o,c,u,f){super(n,f);Qe(this,zb);Be(this,"publicKey");Be(this,"fingerprint");Be(this,"parentFingerprint");Be(this,"mnemonic");Be(this,"chainCode");Be(this,"path");Be(this,"index");Be(this,"depth");kf(r,Oc,"HDNodeWallet"),Qt(this,{publicKey:n.compressedPublicKey});const h=zn(Kg(uc(this.publicKey)),0,4);Qt(this,{parentFingerprint:i,fingerprint:h,chainCode:a,path:s,index:o,depth:c}),Qt(this,{mnemonic:u})}connect(r){return new Go(Oc,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,r)}async encrypt(r,n){return await CQ(ct(this,zb,FR).call(this),r,{progressCallback:n})}encryptSync(r){return TQ(ct(this,zb,FR).call(this),r)}get extendedKey(){return it(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),UR(Bn(["0x0488ADE4",NE(this.depth,1),this.parentFingerprint,NE(this.index,4),this.chainCode,Bn(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new ob(Oc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(r){const n=jr(r,"index");Ne(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~wf),n&wf&&(i+="'"));const{IR:a,IL:s}=RQ(n,this.chainCode,this.publicKey,this.privateKey),o=new Vc(Zu((Zb(s)+BigInt(this.privateKey))%q0e,32));return new Go(Oc,o,this.fingerprint,_t(a),i,n,this.depth+1,this.mnemonic,this.provider)}derivePath(r){return NQ(this,r)}static fromExtendedKey(r){const n=gs(Cle(r));Ne(n.length===82||UR(n.slice(0,78))===r,"invalid extended key","extendedKey","[ REDACTED ]");const i=n[4],a=_t(n.slice(5,9)),s=parseInt(_t(n.slice(9,13)).substring(2),16),o=_t(n.slice(13,45)),c=n.slice(45,78);switch(_t(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const u=_t(c);return new ob(Oc,t1(u),u,a,o,null,s,i,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new Go(Oc,new Vc(c.slice(1)),a,o,null,s,i,null,null)}Ne(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(r,n,i){var s;r==null&&(r=""),n==null&&(n=eI),i==null&&(i=xh.wordlist());const a=xg.fromEntropy(Ku(16),r,i);return ct(s=Go,uh,Zy).call(s,a.computeSeed(),a).derivePath(n)}static fromMnemonic(r,n){var i;return n||(n=eI),ct(i=Go,uh,Zy).call(i,r.computeSeed(),r).derivePath(n)}static fromPhrase(r,n,i,a){var o;n==null&&(n=""),i==null&&(i=eI),a==null&&(a=xh.wordlist());const s=xg.fromPhrase(r,n,a);return ct(o=Go,uh,Zy).call(o,s.computeSeed(),s).derivePath(i)}static fromSeed(r){var n;return ct(n=Go,uh,Zy).call(n,r,null)}};zb=new WeakSet,FR=function(){const r={address:this.address,privateKey:this.privateKey},n=this.mnemonic;return this.path&&n&&n.wordlist.locale==="en"&&n.password===""&&(r.mnemonic={path:this.path,locale:"en",entropy:n.entropy}),r},uh=new WeakSet,Zy=function(r,n){Ne(sK(r),"invalid seed","seed","[REDACTED]");const i=qt(r,"seed");Ne(i.length>=16&&i.length<=64,"invalid seed","seed","[REDACTED]");const a=qt(Gg("sha512",B0e,i)),s=new Vc(_t(a.slice(0,32)));return new Go(Oc,s,"0x00000000",_t(a.slice(32)),"m",0,0,n,null)},Qe(Go,uh);let Ev=Go;class ob extends RR{constructor(r,n,i,a,s,o,c,u,f){super(n,f);Be(this,"publicKey");Be(this,"fingerprint");Be(this,"parentFingerprint");Be(this,"chainCode");Be(this,"path");Be(this,"index");Be(this,"depth");kf(r,Oc,"HDNodeVoidWallet"),Qt(this,{publicKey:i});const h=zn(Kg(uc(i)),0,4);Qt(this,{publicKey:i,fingerprint:h,parentFingerprint:a,chainCode:s,path:o,index:c,depth:u})}connect(r){return new ob(Oc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,r)}get extendedKey(){return it(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),UR(Bn(["0x0488B21E",NE(this.depth,1),this.parentFingerprint,NE(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(r){const n=jr(r,"index");Ne(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~wf),n&wf&&(i+="'"));const{IR:a,IL:s}=RQ(n,this.chainCode,this.publicKey,null),o=Vc.addPoints(s,this.publicKey,!0),c=t1(o);return new ob(Oc,c,o,this.fingerprint,_t(a),i,n,this.depth+1,this.provider)}derivePath(r){return NQ(this,r)}}function fL(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function dL(t,e){const r=JSON.parse(t),n=a1(e),i=sn(yi(r,"ethaddr:string!")),a=AQ(yi(r,"encseed:string!"));Ne(a&&a.length%16===0,"invalid encseed","json",t);const s=qt(Lf(n,n,2e3,32,"sha256")).slice(0,16),o=a.slice(0,16),c=a.slice(16),u=new K8(s,o),f=L0e(qt(u.decrypt(c)));let h="";for(let m=0;m<f.length;m++)h+=String.fromCharCode(f[m]);return{address:i,privateKey:el(h)}}function hL(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}var Vb,qR;const Rd=class Rd extends TE{constructor(e,r){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new Vc(e):e;super(n,r)}connect(e){return new Rd(this.signingKey,e)}async encrypt(e,r){const n={address:this.address,privateKey:this.privateKey};return await CQ(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return TQ(r,e)}static async fromEncryptedJson(e,r,n){var a;let i=null;return uL(e)?i=await F0e(e,r,n):fL(e)&&(n&&(n(0),await hL(0)),i=dL(e,r),n&&(n(1),await hL(0))),ct(a=Rd,Vb,qR).call(a,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return uL(e)?n=U0e(e,r):fL(e)?n=dL(e,r):Ne(!1,"invalid JSON wallet","json","[ REDACTED ]"),ct(i=Rd,Vb,qR).call(i,n)}static createRandom(e){const r=Ev.createRandom();return e?r.connect(e):r}static fromPhrase(e,r){const n=Ev.fromPhrase(e);return r?n.connect(r):n}};Vb=new WeakSet,qR=function(e){if(Ne(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=xg.fromEntropy(e.mnemonic.entropy),i=Ev.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const r=new Rd(e.privateKey);return Ne(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r},Qe(Rd,Vb);let BR=Rd;var Ah={},Um={},DQ={exports:{}},MQ={exports:{}};(function(t){function e(r){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(MQ);var W8=MQ.exports;(function(t){var e=W8.default;function r(i){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(r=function(c){return c?s:a})(i)}function n(i,a){if(!a&&i&&i.__esModule)return i;if(i===null||e(i)!="object"&&typeof i!="function")return{default:i};var s=r(a);if(s&&s.has(i))return s.get(i);var o={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in i)if(u!=="default"&&Object.prototype.hasOwnProperty.call(i,u)){var f=c?Object.getOwnPropertyDescriptor(i,u):null;f&&(f.get||f.set)?Object.defineProperty(o,u,f):o[u]=i[u]}return o.default=i,s&&s.set(i,o),o}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(DQ);var Ro=DQ.exports,$Q={exports:{}};(function(t){function e(r){return r&&r.__esModule?r:{default:r}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})($Q);var yr=$Q.exports,tI={exports:{}},pL;function Dn(){return pL||(pL=1,function(t){function e(){return t.exports=e=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},t.exports.__esModule=!0,t.exports.default=t.exports,e.apply(this,arguments)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(tI)),tI.exports}var rI={exports:{}},nI={exports:{}},gL;function z0e(){return gL||(gL=1,function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},t.exports.__esModule=!0,t.exports.default=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(nI)),nI.exports}var mL;function hc(){return mL||(mL=1,function(t){var e=z0e();function r(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e(n,i)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(rI)),rI.exports}var iI,yL;function kQ(){if(yL)return iI;yL=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return iI=t,iI}var aI,vL;function Ii(){if(vL)return aI;vL=1;var t=Array.isArray;return aI=t,aI}var sI,bL;function LQ(){if(bL)return sI;bL=1;var t=typeof ke=="object"&&ke&&ke.Object===Object&&ke;return sI=t,sI}var oI,wL;function sl(){if(wL)return oI;wL=1;var t=LQ(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return oI=r,oI}var cI,_L;function s1(){if(_L)return cI;_L=1;var t=sl(),e=t.Symbol;return cI=e,cI}var uI,EL;function V0e(){if(EL)return uI;EL=1;var t=s1(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(s){var o=r.call(s,i),c=s[i];try{s[i]=void 0;var u=!0}catch{}var f=n.call(s);return u&&(o?s[i]=c:delete s[i]),f}return uI=a,uI}var lI,xL;function G0e(){if(xL)return lI;xL=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return lI=r,lI}var fI,AL;function ol(){if(AL)return fI;AL=1;var t=s1(),e=V0e(),r=G0e(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?i:n:a&&a in Object(o)?e(o):r(o)}return fI=s,fI}var dI,SL;function pc(){if(SL)return dI;SL=1;function t(e){return e!=null&&typeof e=="object"}return dI=t,dI}var hI,IL;function Yg(){if(IL)return hI;IL=1;var t=ol(),e=pc(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return hI=n,hI}var pI,OL;function Q8(){if(OL)return pI;OL=1;var t=Ii(),e=Yg(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){if(t(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||s!=null&&a in Object(s)}return pI=i,pI}var gI,PL;function cl(){if(PL)return gI;PL=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return gI=t,gI}var mI,TL;function Bx(){if(TL)return mI;TL=1;var t=ol(),e=cl(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!e(o))return!1;var c=t(o);return c==n||c==i||c==r||c==a}return mI=s,mI}var yI,CL;function K0e(){if(CL)return yI;CL=1;var t=sl(),e=t["__core-js_shared__"];return yI=e,yI}var vI,RL;function W0e(){if(RL)return vI;RL=1;var t=K0e(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return vI=r,vI}var bI,NL;function jQ(){if(NL)return bI;NL=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return bI=r,bI}var wI,DL;function Q0e(){if(DL)return wI;DL=1;var t=Bx(),e=W0e(),r=cl(),n=jQ(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,c=s.toString,u=o.hasOwnProperty,f=RegExp("^"+c.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(m){if(!r(m)||e(m))return!1;var y=t(m)?f:a;return y.test(n(m))}return wI=h,wI}var _I,ML;function Y0e(){if(ML)return _I;ML=1;function t(e,r){return e==null?void 0:e[r]}return _I=t,_I}var EI,$L;function $h(){if($L)return EI;$L=1;var t=Q0e(),e=Y0e();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return EI=r,EI}var xI,kL;function qx(){if(kL)return xI;kL=1;var t=$h(),e=t(Object,"create");return xI=e,xI}var AI,LL;function J0e(){if(LL)return AI;LL=1;var t=qx();function e(){this.__data__=t?t(null):{},this.size=0}return AI=e,AI}var SI,jL;function X0e(){if(jL)return SI;jL=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return SI=t,SI}var II,UL;function Z0e(){if(UL)return II;UL=1;var t=qx(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var s=this.__data__;if(t){var o=s[a];return o===e?void 0:o}return n.call(s,a)?s[a]:void 0}return II=i,II}var OI,FL;function ege(){if(FL)return OI;FL=1;var t=qx(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return OI=n,OI}var PI,BL;function tge(){if(BL)return PI;BL=1;var t=qx(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return PI=r,PI}var TI,qL;function rge(){if(qL)return TI;qL=1;var t=J0e(),e=X0e(),r=Z0e(),n=ege(),i=tge();function a(s){var o=-1,c=s==null?0:s.length;for(this.clear();++o<c;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,TI=a,TI}var CI,HL;function nge(){if(HL)return CI;HL=1;function t(){this.__data__=[],this.size=0}return CI=t,CI}var RI,zL;function Hx(){if(zL)return RI;zL=1;function t(e,r){return e===r||e!==e&&r!==r}return RI=t,RI}var NI,VL;function zx(){if(VL)return NI;VL=1;var t=Hx();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return NI=e,NI}var DI,GL;function ige(){if(GL)return DI;GL=1;var t=zx(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,s=t(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():r.call(a,s,1),--this.size,!0}return DI=n,DI}var MI,KL;function age(){if(KL)return MI;KL=1;var t=zx();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return MI=e,MI}var $I,WL;function sge(){if(WL)return $I;WL=1;var t=zx();function e(r){return t(this.__data__,r)>-1}return $I=e,$I}var kI,QL;function oge(){if(QL)return kI;QL=1;var t=zx();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return kI=e,kI}var LI,YL;function Vx(){if(YL)return LI;YL=1;var t=nge(),e=ige(),r=age(),n=sge(),i=oge();function a(s){var o=-1,c=s==null?0:s.length;for(this.clear();++o<c;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,LI=a,LI}var jI,JL;function Y8(){if(JL)return jI;JL=1;var t=$h(),e=sl(),r=t(e,"Map");return jI=r,jI}var UI,XL;function cge(){if(XL)return UI;XL=1;var t=rge(),e=Vx(),r=Y8();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return UI=n,UI}var FI,ZL;function uge(){if(ZL)return FI;ZL=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return FI=t,FI}var BI,e7;function Gx(){if(e7)return BI;e7=1;var t=uge();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return BI=e,BI}var qI,t7;function lge(){if(t7)return qI;t7=1;var t=Gx();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return qI=e,qI}var HI,r7;function fge(){if(r7)return HI;r7=1;var t=Gx();function e(r){return t(this,r).get(r)}return HI=e,HI}var zI,n7;function dge(){if(n7)return zI;n7=1;var t=Gx();function e(r){return t(this,r).has(r)}return zI=e,zI}var VI,i7;function hge(){if(i7)return VI;i7=1;var t=Gx();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return VI=e,VI}var GI,a7;function J8(){if(a7)return GI;a7=1;var t=cge(),e=lge(),r=fge(),n=dge(),i=hge();function a(s){var o=-1,c=s==null?0:s.length;for(this.clear();++o<c;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,GI=a,GI}var KI,s7;function X8(){if(s7)return KI;s7=1;var t=J8(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],c=a.cache;if(c.has(o))return c.get(o);var u=n.apply(this,s);return a.cache=c.set(o,u)||c,u};return a.cache=new(r.Cache||t),a}return r.Cache=t,KI=r,KI}var WI,o7;function pge(){if(o7)return WI;o7=1;var t=X8(),e=500;function r(n){var i=t(n,function(s){return a.size===e&&a.clear(),s}),a=i.cache;return i}return WI=r,WI}var QI,c7;function gge(){if(c7)return QI;c7=1;var t=pge(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(s,o,c,u){a.push(c?u.replace(r,"$1"):o||s)}),a});return QI=n,QI}var YI,u7;function kh(){if(u7)return YI;u7=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return YI=t,YI}var JI,l7;function Z8(){if(l7)return JI;l7=1;var t=s1(),e=kh(),r=Ii(),n=Yg(),i=1/0,a=t?t.prototype:void 0,s=a?a.toString:void 0;function o(c){if(typeof c=="string")return c;if(r(c))return e(c,o)+"";if(n(c))return s?s.call(c):"";var u=c+"";return u=="0"&&1/c==-i?"-0":u}return JI=o,JI}var XI,f7;function e5(){if(f7)return XI;f7=1;var t=Z8();function e(r){return r==null?"":t(r)}return XI=e,XI}var ZI,d7;function o1(){if(d7)return ZI;d7=1;var t=Ii(),e=Q8(),r=gge(),n=e5();function i(a,s){return t(a)?a:e(a,s)?[a]:r(n(a))}return ZI=i,ZI}var eO,h7;function mge(){if(h7)return eO;h7=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return eO=t,eO}var tO,p7;function Jg(){if(p7)return tO;p7=1;var t=Yg(),e=1/0;function r(n){if(typeof n=="string"||t(n))return n;var i=n+"";return i=="0"&&1/n==-e?"-0":i}return tO=r,tO}var rO,g7;function c1(){if(g7)return rO;g7=1;var t=o1(),e=Jg();function r(n,i){i=t(i,n);for(var a=0,s=i.length;n!=null&&a<s;)n=n[e(i[a++])];return a&&a==s?n:void 0}return rO=r,rO}var nO,m7;function t5(){if(m7)return nO;m7=1;function t(e,r,n){var i=-1,a=e.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var s=Array(a);++i<a;)s[i]=e[i+r];return s}return nO=t,nO}var iO,y7;function yge(){if(y7)return iO;y7=1;var t=c1(),e=t5();function r(n,i){return i.length<2?n:t(n,e(i,0,-1))}return iO=r,iO}var aO,v7;function vge(){if(v7)return aO;v7=1;var t=kQ(),e=o1(),r=mge(),n=yge(),i=Jg();function a(s,o,c){o=e(o,s),s=n(s,o);var u=s==null?s:s[i(r(o))];return u==null?void 0:t(u,s,c)}return aO=a,aO}var sO,b7;function Uf(){if(b7)return sO;b7=1;function t(e){return e}return sO=t,sO}var oO,w7;function UQ(){if(w7)return oO;w7=1;var t=kQ(),e=Math.max;function r(n,i,a){return i=e(i===void 0?n.length-1:i,0),function(){for(var s=arguments,o=-1,c=e(s.length-i,0),u=Array(c);++o<c;)u[o]=s[i+o];o=-1;for(var f=Array(i+1);++o<i;)f[o]=s[o];return f[i]=a(u),t(n,this,f)}}return oO=r,oO}var cO,_7;function FQ(){if(_7)return cO;_7=1;function t(e){return function(){return e}}return cO=t,cO}var uO,E7;function BQ(){if(E7)return uO;E7=1;var t=$h(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return uO=e,uO}var lO,x7;function bge(){if(x7)return lO;x7=1;var t=FQ(),e=BQ(),r=Uf(),n=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(a),writable:!0})}:r;return lO=n,lO}var fO,A7;function wge(){if(A7)return fO;A7=1;var t=800,e=16,r=Date.now;function n(i){var a=0,s=0;return function(){var o=r(),c=e-(o-s);if(s=o,c>0){if(++a>=t)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return fO=n,fO}var dO,S7;function qQ(){if(S7)return dO;S7=1;var t=bge(),e=wge(),r=e(t);return dO=r,dO}var hO,I7;function u1(){if(I7)return hO;I7=1;var t=Uf(),e=UQ(),r=qQ();function n(i,a){return r(e(i,a,t),i+"")}return hO=n,hO}var pO,O7;function No(){if(O7)return pO;O7=1;var t=vge(),e=u1(),r=e(t);return pO=r,pO}var gO,P7;function ul(){if(P7)return gO;P7=1;function t(e){return e==null}return gO=t,gO}function _ge(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var HQ={exports:{}},On={};/** @license React v16.13.1
|
|
72
72
|
* react-is.production.min.js
|
|
@@ -110,7 +110,7 @@ Instead of \``+M+"`, did you mean:",k.map(function($){return`
|
|
|
110
110
|
border-radius: 0;
|
|
111
111
|
z-index: 2147483647;
|
|
112
112
|
}
|
|
113
|
-
`}])),IT}var dEe=ke&&ke.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hEe=ke&&ke.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pEe=ke&&ke.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&dEe(e,t,r);return hEe(e,t),e};Object.defineProperty(x2,"__esModule",{value:!0});x2.FortmaticConnector=void 0;const gEe=vJ,mEe=Lh,yEe=Io;class vEe extends gEe.AbstractConnector{constructor(e){const r=yEe.getConfiguration()[mEe.ProviderType.FORTMATIC],n=Object.keys(r.apiKeys).map(i=>Number(i));if(!n.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:n}),this.apiKey=r.apiKeys[e],this.chainId=e,this.rpcUrl=r.urls[e]}async activate(){if(!this.fortmatic){const{default:r}=await Promise.resolve().then(()=>pEe(fEe()));this.fortmatic=new r(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(r=>r[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}x2.FortmaticConnector=vEe;var N2={};function N6(){return N6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},N6.apply(this,arguments)}function C4(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function D6(t){return D6=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D6(t)}function jE(t,e){return jE=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},jE(t,e)}function bEe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function U_(t,e,r){return bEe()?U_=Reflect.construct:U_=function(i,a,s){var o=[null];o.push.apply(o,a);var c=Function.bind.apply(i,o),u=new c;return s&&jE(u,s.prototype),u},U_.apply(null,arguments)}function wEe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function UE(t){var e=typeof Map=="function"?new Map:void 0;return UE=function(n){if(n===null||!wEe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return U_(n,arguments,D6(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),jE(i,n)},UE(t)}function Ww(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function Ap(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function xc(t){return t.hasOwnProperty("result")?t.result:t}var F_=function(t){C4(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="No Ethereum provider was found on window.ethereum.",r}return e}(UE(Error)),bX=function(t){C4(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="The user rejected the request.",r}return e}(UE(Error)),_Ee=function(t){C4(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(Ww(i)),i.handleChainChanged=i.handleChainChanged.bind(Ww(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(Ww(i)),i.handleClose=i.handleClose.bind(Ww(i)),i}var r=e.prototype;return r.handleChainChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.handleAccountsChanged=function(i){i.length===0?this.emitDeactivate():this.emitUpdate({account:i[0]})},r.handleClose=function(i,a){this.emitDeactivate()},r.handleNetworkChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.activate=function(){try{var i=function(f){if(a)return f;function h(){return N6({provider:window.ethereum},o?{account:o}:{})}var m=function(){if(!o)return Promise.resolve(window.ethereum.enable().then(function(y){return y&&xc(y)[0]})).then(function(y){o=y})}();return m&&m.then?m.then(h):h(m)},a=!1,s=this;if(!window.ethereum)throw new F_;window.ethereum.on&&(window.ethereum.on("chainChanged",s.handleChainChanged),window.ethereum.on("accountsChanged",s.handleAccountsChanged),window.ethereum.on("close",s.handleClose),window.ethereum.on("networkChanged",s.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var o,c=Ap(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return xc(u)[0]})).then(function(u){o=u})},function(u){if(u.code===4001)throw new bX});return Promise.resolve(c&&c.then?c.then(i):i(c))}catch(u){return Promise.reject(u)}},r.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(i){return Promise.reject(i)}},r.getChainId=function(){try{var i=function(){function c(){if(!a)try{a=xc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=xc(window.ethereum.cachedResults.net_version):a=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),a}var u=function(){if(!a){var f=Ap(function(){return Promise.resolve(window.ethereum.send("net_version").then(xc)).then(function(h){a=h})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new F_;var a,s=Ap(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(xc)).then(function(o){a=o})},function(){});return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(o){return Promise.reject(o)}},r.getAccount=function(){try{var i=function(){function c(){return a||(a=xc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=Ap(function(){return Promise.resolve(window.ethereum.enable().then(function(h){return xc(h)[0]})).then(function(h){a=h})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new F_;var a,s=Ap(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(o){return xc(o)[0]})).then(function(o){a=o})},function(){});return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(o){return Promise.reject(o)}},r.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},r.isAuthorized=function(){try{return window.ethereum?Promise.resolve(Ap(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return xc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(E2);const EEe=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:_Ee,NoEthereumProviderError:F_,UserRejectedRequestError:bX},Symbol.toStringTag,{value:"Module"})),xEe=js(EEe);Object.defineProperty(N2,"__esModule",{value:!0});N2.InjectedConnector=void 0;const AEe=xEe;class SEe extends AEe.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}N2.InjectedConnector=SEe;var D2={},IEe="Invariant failed";function XB(t,e){if(!t)throw new Error(IEe)}function wX(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,cb(t,e)}function M6(t){return M6=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},M6(t)}function cb(t,e){return cb=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},cb(t,e)}function OEe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function B_(t,e,r){return OEe()?B_=Reflect.construct:B_=function(i,a,s){var o=[null];o.push.apply(o,a);var c=Function.bind.apply(i,o),u=new c;return s&&cb(u,s.prototype),u},B_.apply(null,arguments)}function PEe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function $6(t){var e=typeof Map=="function"?new Map:void 0;return $6=function(n){if(n===null||!PEe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return B_(n,arguments,M6(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),cb(i,n)},$6(t)}var q_=function(t){wX(e,t);function e(r,n,i){var a;return a=t.call(this)||this,a.code=n,a.data=i,a.name=a.constructor.name,a.message=r,a}return e}($6(Error)),TEe=function(e,r){var n=this,i=this;this.isMetaMask=!1,this.sendAsync=function(s,o){console.log("sendAsync",s.method,s.params),i.request(s.method,s.params).then(function(c){return o(null,{jsonrpc:"2.0",id:s.id,result:c})}).catch(function(c){return o(c,null)})},this.request=function(s,o){try{return typeof s!="string"&&(o=s.params,s=s.method),Promise.resolve(fetch(n.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:s,params:o}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new q_(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,h,m;throw new q_(u==null||(f=u.error)==null?void 0:f.message,u==null||(h=u.error)==null?void 0:h.code,u==null||(m=u.error)==null?void 0:m.data)}else{if("result"in u)return u.result;throw new q_("Received unexpected JSON-RPC response to "+s+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=e,this.url=r;var a=new URL(r);this.host=a.host,this.path=a.pathname},CEe=function(t){wX(e,t);function e(n){var i,a=n.urls,s=n.defaultChainId;return s||Object.keys(a).length===1||XB(!1),i=t.call(this,{supportedChainIds:Object.keys(a).map(function(o){return Number(o)})})||this,i.currentChainId=s||Number(Object.keys(a)[0]),i.providers=Object.keys(a).reduce(function(o,c){return o[Number(c)]=new TEe(Number(c),a[Number(c)]),o},{}),i}var r=e.prototype;return r.activate=function(){try{var i=this;return Promise.resolve({provider:i.providers[i.currentChainId],chainId:i.currentChainId,account:null})}catch(a){return Promise.reject(a)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.providers[i.currentChainId])}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.currentChainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){return Promise.resolve(null)},r.deactivate=function(){},r.changeChainId=function(i){Object.keys(this.providers).includes(i.toString())||XB(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(E2);const REe=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:CEe,RequestError:q_},Symbol.toStringTag,{value:"Module"})),NEe=js(REe);Object.defineProperty(D2,"__esModule",{value:!0});D2.NetworkConnector=void 0;const DEe=sc,MEe=NEe,$Ee=Io;class kEe extends MEe.NetworkConnector{constructor(e){super({urls:$Ee.getConfiguration()[DEe.ProviderType.NETWORK].urls,defaultChainId:e})}}D2.NetworkConnector=kEe;var M2={};const LEe="modulepreload",jEe=function(t){return"/"+t},ZB={},ub=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=jEe(a),a in ZB)return;ZB[a]=!0;const s=a.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const h=i[f];if(h.href===a&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":LEe,s||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),s)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a})};function k6(){return k6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},k6.apply(this,arguments)}function UEe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,L6(t,e)}function L6(t,e){return L6=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},L6(t,e)}function eq(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var FEe=1,BEe=function(t){UEe(e,t);function e(n){var i,a=n.url,s=n.appName,o=n.appLogoUrl,c=n.darkMode,u=n.supportedChainIds;return i=t.call(this,{supportedChainIds:u})||this,i.url=a,i.appName=s,i.appLogoUrl=o,i.darkMode=c||!1,i.handleChainChanged=i.handleChainChanged.bind(eq(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(eq(i)),i}var r=e.prototype;return r.activate=function(){try{var i=this,a=function(){return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return i.provider.on("chainChanged",i.handleChainChanged),i.provider.on("accountsChanged",i.handleAccountsChanged),{provider:i.provider,account:u}})},s=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)i.provider=window.ethereum;else{var o=function(){if(!i.walletLink)return Promise.resolve(ub(()=>import("./index-0bf5e711.js").then(c=>c.i),[]).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){i.walletLink=new c(k6({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,FEe)})}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(a):a(s))}catch(o){return Promise.reject(o)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.provider)}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.provider.chainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){try{var i=this;return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(a){return a[0]})}catch(a){return Promise.reject(a)}},r.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},r.close=function(){try{var i=this;return i.provider.close(),i.emitDeactivate(),Promise.resolve()}catch(a){return Promise.reject(a)}},r.handleChainChanged=function(i){this.emitUpdate({chainId:i})},r.handleAccountsChanged=function(i){this.emitUpdate({account:i[0]})},e}(E2);const qEe=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:BEe},Symbol.toStringTag,{value:"Module"})),HEe=js(qEe);Object.defineProperty(M2,"__esModule",{value:!0});M2.WalletLinkConnector=void 0;const zEe=Lh,VEe=HEe,GEe=Io;class KEe extends VEe.WalletLinkConnector{constructor(e){const r=GEe.getConfiguration()[zEe.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}M2.WalletLinkConnector=KEe;var $2={},R4={},k2={},Mr={},_X={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,c){var u=o>>>16&65535,f=o&65535,h=c>>>16&65535,m=c&65535;return f*m+(u*m+f*h<<16>>>0)|0}t.mul=Math.imul||e;function r(o,c){return o+c|0}t.add=r;function n(o,c){return o-c|0}t.sub=n;function i(o,c){return o<<c|o>>>32-c}t.rotl=i;function a(o,c){return o<<32-c|o>>>c}t.rotr=a;function s(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}t.isInteger=Number.isInteger||s,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(o){return t.isInteger(o)&&o>=-t.MAX_SAFE_INTEGER&&o<=t.MAX_SAFE_INTEGER}})(_X);Object.defineProperty(Mr,"__esModule",{value:!0});var EX=_X;function WEe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Mr.readInt16BE=WEe;function QEe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Mr.readUint16BE=QEe;function YEe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Mr.readInt16LE=YEe;function JEe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Mr.readUint16LE=JEe;function xX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}Mr.writeUint16BE=xX;Mr.writeInt16BE=xX;function AX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}Mr.writeUint16LE=AX;Mr.writeInt16LE=AX;function j6(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Mr.readInt32BE=j6;function U6(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Mr.readUint32BE=U6;function F6(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Mr.readInt32LE=F6;function B6(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Mr.readUint32LE=B6;function FE(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}Mr.writeUint32BE=FE;Mr.writeInt32BE=FE;function BE(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}Mr.writeUint32LE=BE;Mr.writeInt32LE=BE;function XEe(t,e){e===void 0&&(e=0);var r=j6(t,e),n=j6(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Mr.readInt64BE=XEe;function ZEe(t,e){e===void 0&&(e=0);var r=U6(t,e),n=U6(t,e+4);return r*4294967296+n}Mr.readUint64BE=ZEe;function exe(t,e){e===void 0&&(e=0);var r=F6(t,e),n=F6(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Mr.readInt64LE=exe;function txe(t,e){e===void 0&&(e=0);var r=B6(t,e),n=B6(t,e+4);return n*4294967296+r}Mr.readUint64LE=txe;function SX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),FE(t/4294967296>>>0,e,r),FE(t>>>0,e,r+4),e}Mr.writeUint64BE=SX;Mr.writeInt64BE=SX;function IX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),BE(t>>>0,e,r),BE(t/4294967296>>>0,e,r+4),e}Mr.writeUint64LE=IX;Mr.writeInt64LE=IX;function rxe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}Mr.readUintBE=rxe;function nxe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}Mr.readUintLE=nxe;function ixe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!EX.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}Mr.writeUintBE=ixe;function axe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!EX.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}Mr.writeUintLE=axe;function sxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Mr.readFloat32BE=sxe;function oxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Mr.readFloat32LE=oxe;function cxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Mr.readFloat64BE=cxe;function uxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Mr.readFloat64LE=uxe;function lxe(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}Mr.writeFloat32BE=lxe;function fxe(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}Mr.writeFloat32LE=fxe;function dxe(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}Mr.writeFloat64BE=dxe;function hxe(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}Mr.writeFloat64LE=hxe;var qs={};Object.defineProperty(qs,"__esModule",{value:!0});function pxe(t){for(var e=0;e<t.length;e++)t[e]=0;return t}qs.wipe=pxe;Object.defineProperty(k2,"__esModule",{value:!0});var ma=Mr,q6=qs,gxe=20;function mxe(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,s=1797285236,o=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],h=r[19]<<24|r[18]<<16|r[17]<<8|r[16],m=r[23]<<24|r[22]<<16|r[21]<<8|r[20],y=r[27]<<24|r[26]<<16|r[25]<<8|r[24],w=r[31]<<24|r[30]<<16|r[29]<<8|r[28],v=e[3]<<24|e[2]<<16|e[1]<<8|e[0],g=e[7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<<8,U=U+L|0,N^=U,N=N>>>32-7|N<<7,S=S+O|0,j^=S,j=j>>>32-8|j<<8,ve=ve+j|0,O^=ve,O=O>>>32-7|O<<7;ma.writeUint32LE(S+n|0,t,0),ma.writeUint32LE(A+i|0,t,4),ma.writeUint32LE(I+a|0,t,8),ma.writeUint32LE(E+s|0,t,12),ma.writeUint32LE(p+o|0,t,16),ma.writeUint32LE(O+c|0,t,20),ma.writeUint32LE(N+u|0,t,24),ma.writeUint32LE(F+f|0,t,28),ma.writeUint32LE(V+h|0,t,32),ma.writeUint32LE(de+m|0,t,36),ma.writeUint32LE(ve+y|0,t,40),ma.writeUint32LE(U+w|0,t,44),ma.writeUint32LE(L+v|0,t,48),ma.writeUint32LE(Q+g|0,t,52),ma.writeUint32LE(ne+_|0,t,56),ma.writeUint32LE(j+b|0,t,60)}function OX(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,s;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),s=a.length-e.length,a.set(e,s)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,s=i}for(var o=new Uint8Array(64),c=0;c<r.length;c+=64){mxe(o,a,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^o[u-c];vxe(a,0,s)}return q6.wipe(o),i===0&&q6.wipe(a),n}k2.streamXOR=OX;function yxe(t,e,r,n){return n===void 0&&(n=0),q6.wipe(r),OX(t,e,r,r,n)}k2.stream=yxe;function vxe(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var PX={},zf={};Object.defineProperty(zf,"__esModule",{value:!0});function bxe(t,e,r){return~(t-1)&e|t-1&r}zf.select=bxe;function wxe(t,e){return(t|0)-(e|0)-1>>>31&1}zf.lessOrEqual=wxe;function TX(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}zf.compare=TX;function _xe(t,e){return t.length===0||e.length===0?!1:TX(t,e)!==0}zf.equal=_xe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=zf,r=qs;t.DIGEST_LENGTH=16;var n=function(){function s(o){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=o[0]|o[1]<<8;this._r[0]=c&8191;var u=o[2]|o[3]<<8;this._r[1]=(c>>>13|u<<3)&8191;var f=o[4]|o[5]<<8;this._r[2]=(u>>>10|f<<6)&7939;var h=o[6]|o[7]<<8;this._r[3]=(f>>>7|h<<9)&8191;var m=o[8]|o[9]<<8;this._r[4]=(h>>>4|m<<12)&255,this._r[5]=m>>>1&8190;var y=o[10]|o[11]<<8;this._r[6]=(m>>>14|y<<2)&8191;var w=o[12]|o[13]<<8;this._r[7]=(y>>>11|w<<5)&8065;var v=o[14]|o[15]<<8;this._r[8]=(w>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=o[16]|o[17]<<8,this._pad[1]=o[18]|o[19]<<8,this._pad[2]=o[20]|o[21]<<8,this._pad[3]=o[22]|o[23]<<8,this._pad[4]=o[24]|o[25]<<8,this._pad[5]=o[26]|o[27]<<8,this._pad[6]=o[28]|o[29]<<8,this._pad[7]=o[30]|o[31]<<8}return s.prototype._blocks=function(o,c,u){for(var f=this._fin?0:2048,h=this._h[0],m=this._h[1],y=this._h[2],w=this._h[3],v=this._h[4],g=this._h[5],_=this._h[6],b=this._h[7],S=this._h[8],A=this._h[9],I=this._r[0],E=this._r[1],p=this._r[2],O=this._r[3],N=this._r[4],F=this._r[5],V=this._r[6],de=this._r[7],ve=this._r[8],U=this._r[9];u>=16;){var L=o[c+0]|o[c+1]<<8;h+=L&8191;var Q=o[c+2]|o[c+3]<<8;m+=(L>>>13|Q<<3)&8191;var ne=o[c+4]|o[c+5]<<8;y+=(Q>>>10|ne<<6)&8191;var j=o[c+6]|o[c+7]<<8;w+=(ne>>>7|j<<9)&8191;var B=o[c+8]|o[c+9]<<8;v+=(j>>>4|B<<12)&8191,g+=B>>>1&8191;var H=o[c+10]|o[c+11]<<8;_+=(B>>>14|H<<2)&8191;var M=o[c+12]|o[c+13]<<8;b+=(H>>>11|M<<5)&8191;var q=o[c+14]|o[c+15]<<8;S+=(M>>>8|q<<8)&8191,A+=q>>>5|f;var k=0,$=k;$+=h*I,$+=m*(5*U),$+=y*(5*ve),$+=w*(5*de),$+=v*(5*V),k=$>>>13,$&=8191,$+=g*(5*F),$+=_*(5*N),$+=b*(5*O),$+=S*(5*p),$+=A*(5*E),k+=$>>>13,$&=8191;var G=k;G+=h*E,G+=m*I,G+=y*(5*U),G+=w*(5*ve),G+=v*(5*de),k=G>>>13,G&=8191,G+=g*(5*V),G+=_*(5*F),G+=b*(5*N),G+=S*(5*O),G+=A*(5*p),k+=G>>>13,G&=8191;var pe=k;pe+=h*p,pe+=m*E,pe+=y*I,pe+=w*(5*U),pe+=v*(5*ve),k=pe>>>13,pe&=8191,pe+=g*(5*de),pe+=_*(5*V),pe+=b*(5*F),pe+=S*(5*N),pe+=A*(5*O),k+=pe>>>13,pe&=8191;var Y=k;Y+=h*O,Y+=m*p,Y+=y*E,Y+=w*I,Y+=v*(5*U),k=Y>>>13,Y&=8191,Y+=g*(5*ve),Y+=_*(5*de),Y+=b*(5*V),Y+=S*(5*F),Y+=A*(5*N),k+=Y>>>13,Y&=8191;var te=k;te+=h*N,te+=m*O,te+=y*p,te+=w*E,te+=v*I,k=te>>>13,te&=8191,te+=g*(5*U),te+=_*(5*ve),te+=b*(5*de),te+=S*(5*V),te+=A*(5*F),k+=te>>>13,te&=8191;var ce=k;ce+=h*F,ce+=m*N,ce+=y*O,ce+=w*p,ce+=v*E,k=ce>>>13,ce&=8191,ce+=g*I,ce+=_*(5*U),ce+=b*(5*ve),ce+=S*(5*de),ce+=A*(5*V),k+=ce>>>13,ce&=8191;var T=k;T+=h*V,T+=m*F,T+=y*N,T+=w*O,T+=v*p,k=T>>>13,T&=8191,T+=g*E,T+=_*I,T+=b*(5*U),T+=S*(5*ve),T+=A*(5*de),k+=T>>>13,T&=8191;var le=k;le+=h*de,le+=m*V,le+=y*F,le+=w*N,le+=v*O,k=le>>>13,le&=8191,le+=g*p,le+=_*E,le+=b*I,le+=S*(5*U),le+=A*(5*ve),k+=le>>>13,le&=8191;var ze=k;ze+=h*ve,ze+=m*de,ze+=y*V,ze+=w*F,ze+=v*N,k=ze>>>13,ze&=8191,ze+=g*O,ze+=_*p,ze+=b*E,ze+=S*I,ze+=A*(5*U),k+=ze>>>13,ze&=8191;var et=k;et+=h*U,et+=m*ve,et+=y*de,et+=w*V,et+=v*F,k=et>>>13,et&=8191,et+=g*N,et+=_*O,et+=b*p,et+=S*E,et+=A*I,k+=et>>>13,et&=8191,k=(k<<2)+k|0,k=k+$|0,$=k&8191,k=k>>>13,G+=k,h=$,m=G,y=pe,w=Y,v=te,g=ce,_=T,b=le,S=ze,A=et,c+=16,u-=16}this._h[0]=h,this._h[1]=m,this._h[2]=y,this._h[3]=w,this._h[4]=v,this._h[5]=g,this._h[6]=_,this._h[7]=b,this._h[8]=S,this._h[9]=A},s.prototype.finish=function(o,c){c===void 0&&(c=0);var u=new Uint16Array(10),f,h,m,y;if(this._leftover){for(y=this._leftover,this._buffer[y++]=1;y<16;y++)this._buffer[y]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,y=2;y<10;y++)this._h[y]+=f,f=this._h[y]>>>13,this._h[y]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,u[0]=this._h[0]+5,f=u[0]>>>13,u[0]&=8191,y=1;y<10;y++)u[y]=this._h[y]+f,f=u[y]>>>13,u[y]&=8191;for(u[9]-=8192,h=(f^1)-1,y=0;y<10;y++)u[y]&=h;for(h=~h,y=0;y<10;y++)this._h[y]=this._h[y]&h|u[y];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,m=this._h[0]+this._pad[0],this._h[0]=m&65535,y=1;y<8;y++)m=(this._h[y]+this._pad[y]|0)+(m>>>16)|0,this._h[y]=m&65535;return o[c+0]=this._h[0]>>>0,o[c+1]=this._h[0]>>>8,o[c+2]=this._h[1]>>>0,o[c+3]=this._h[1]>>>8,o[c+4]=this._h[2]>>>0,o[c+5]=this._h[2]>>>8,o[c+6]=this._h[3]>>>0,o[c+7]=this._h[3]>>>8,o[c+8]=this._h[4]>>>0,o[c+9]=this._h[4]>>>8,o[c+10]=this._h[5]>>>0,o[c+11]=this._h[5]>>>8,o[c+12]=this._h[6]>>>0,o[c+13]=this._h[6]>>>8,o[c+14]=this._h[7]>>>0,o[c+15]=this._h[7]>>>8,this._finished=!0,this},s.prototype.update=function(o){var c=0,u=o.length,f;if(this._leftover){f=16-this._leftover,f>u&&(f=u);for(var h=0;h<f;h++)this._buffer[this._leftover+h]=o[c+h];if(u-=f,c+=f,this._leftover+=f,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(f=u-u%16,this._blocks(o,c,f),c+=f,u-=f),u){for(var h=0;h<u;h++)this._buffer[this._leftover+h]=o[c+h];this._leftover+=u}return this},s.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var o=new Uint8Array(16);return this.finish(o),o},s.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},s}();t.Poly1305=n;function i(s,o){var c=new n(s);c.update(o);var u=c.digest();return c.clean(),u}t.oneTimeAuth=i;function a(s,o){return s.length!==t.DIGEST_LENGTH||o.length!==t.DIGEST_LENGTH?!1:e.equal(s,o)}t.equal=a})(PX);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=k2,r=PX,n=qs,i=Mr,a=zf;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var s=new Uint8Array(16),o=function(){function c(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return c.prototype.seal=function(u,f,h,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var y=new Uint8Array(16);y.set(u,y.length-u.length);var w=new Uint8Array(32);e.stream(this._key,y,w,4);var v=f.length+this.tagLength,g;if(m){if(m.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");g=m}else g=new Uint8Array(v);return e.streamXOR(this._key,y,f,g,4),this._authenticate(g.subarray(g.length-this.tagLength,g.length),w,g.subarray(0,g.length-this.tagLength),h),n.wipe(y),g},c.prototype.open=function(u,f,h,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length<this.tagLength)return null;var y=new Uint8Array(16);y.set(u,y.length-u.length);var w=new Uint8Array(32);e.stream(this._key,y,w,4);var v=new Uint8Array(this.tagLength);if(this._authenticate(v,w,f.subarray(0,f.length-this.tagLength),h),!a.equal(v,f.subarray(f.length-this.tagLength,f.length)))return null;var g=f.length-this.tagLength,_;if(m){if(m.length!==g)throw new Error("ChaCha20Poly1305: incorrect destination length");_=m}else _=new Uint8Array(g);return e.streamXOR(this._key,y,f.subarray(0,f.length-this.tagLength),_,4),n.wipe(y),_},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(u,f,h,m){var y=new r.Poly1305(f);m&&(y.update(m),m.length%16>0&&y.update(s.subarray(m.length%16))),y.update(h),h.length%16>0&&y.update(s.subarray(h.length%16));var w=new Uint8Array(8);m&&i.writeUint64LE(m.length,w),y.update(w),i.writeUint64LE(h.length,w),y.update(w);for(var v=y.digest(),g=0;g<v.length;g++)u[g]=v[g];y.clean(),n.wipe(v),n.wipe(w)},c}();t.ChaCha20Poly1305=o})(R4);var CX={},y1={},N4={};Object.defineProperty(N4,"__esModule",{value:!0});function Exe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}N4.isSerializableHash=Exe;Object.defineProperty(y1,"__esModule",{value:!0});var Ac=N4,xxe=zf,Axe=qs,RX=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Ac.isSerializableHash(this._inner)&&Ac.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Axe.wipe(n)}return t.prototype.reset=function(){if(!Ac.isSerializableHash(this._inner)||!Ac.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Ac.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ac.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Ac.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Ac.isSerializableHash(this._inner)||!Ac.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Ac.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();y1.HMAC=RX;function Sxe(t,e,r){var n=new RX(t,e);n.update(r);var i=n.digest();return n.clean(),i}y1.hmac=Sxe;y1.equal=xxe.equal;Object.defineProperty(CX,"__esModule",{value:!0});var tq=y1,rq=qs,Ixe=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=tq.hmac(this._hash,n,r);this._hmac=new tq.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),rq.wipe(this._buffer),rq.wipe(this._counter),this._bufpos=0},t}(),Oxe=CX.HKDF=Ixe,rm={},L2={},j2={};Object.defineProperty(j2,"__esModule",{value:!0});j2.BrowserRandomSource=void 0;const nq=65536;class Pxe{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=nq)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,nq)));return r}}j2.BrowserRandomSource=Pxe;function H6(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var U2={};const Txe={},Cxe=Object.freeze(Object.defineProperty({__proto__:null,default:Txe},Symbol.toStringTag,{value:"Module"})),NX=js(Cxe);Object.defineProperty(U2,"__esModule",{value:!0});U2.NodeRandomSource=void 0;const Rxe=qs;class Nxe{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof H6<"u"){const e=NX;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,Rxe.wipe)(r),n}}U2.NodeRandomSource=Nxe;Object.defineProperty(L2,"__esModule",{value:!0});L2.SystemRandomSource=void 0;const Dxe=j2,Mxe=U2;class $xe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Dxe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Mxe.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}L2.SystemRandomSource=$xe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=L2,r=Mr,n=qs;t.defaultRandomSource=new e.SystemRandomSource;function i(u,f=t.defaultRandomSource){return f.randomBytes(u)}t.randomBytes=i;function a(u=t.defaultRandomSource){const f=i(4,u),h=(0,r.readUint32LE)(f);return(0,n.wipe)(f),h}t.randomUint32=a;const s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function o(u,f=s,h=t.defaultRandomSource){if(f.length<2)throw new Error("randomString charset is too short");if(f.length>256)throw new Error("randomString charset is too long");let m="";const y=f.length,w=256-256%y;for(;u>0;){const v=i(Math.ceil(u*256/w),h);for(let g=0;g<v.length&&u>0;g++){const _=v[g];_<w&&(m+=f.charAt(_%y),u--)}(0,n.wipe)(v)}return m}t.randomString=o;function c(u,f=s,h=t.defaultRandomSource){const m=Math.ceil(u/(Math.log(f.length)/Math.LN2));return o(m,f,h)}t.randomStringForEntropy=c})(rm);var F2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Mr,r=qs;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function o(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},o.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},o.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},o.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=a(this._temp,this._state,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},o.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,h=u/536870912|0,m=u<<3,y=u%64<56?64:128;this._buffer[f]=128;for(var w=f+1;w<y-8;w++)this._buffer[w]=0;e.writeUint32BE(h,this._buffer,y-8),e.writeUint32BE(m,this._buffer,y-4),a(this._temp,this._state,this._buffer,0,y),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)e.writeUint32BE(this._state[w],c,w*4);return this},o.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},o.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},o}();t.SHA256=n;var i=new Int32Array([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]);function a(o,c,u,f,h){for(;h>=64;){for(var m=c[0],y=c[1],w=c[2],v=c[3],g=c[4],_=c[5],b=c[6],S=c[7],A=0;A<16;A++){var I=f+A*4;o[A]=e.readUint32BE(u,I)}for(var A=16;A<64;A++){var E=o[A-2],p=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=o[A-15];var O=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;o[A]=(p+o[A-7]|0)+(O+o[A-16]|0)}for(var A=0;A<64;A++){var p=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&_^~g&b)|0)+(S+(i[A]+o[A]|0)|0)|0,O=((m>>>2|m<<32-2)^(m>>>13|m<<32-13)^(m>>>22|m<<32-22))+(m&y^m&w^y&w)|0;S=b,b=_,_=g,g=v+p|0,v=w,w=y,y=m,m=p+O|0}c[0]+=m,c[1]+=y,c[2]+=w,c[3]+=v,c[4]+=g,c[5]+=_,c[6]+=b,c[7]+=S,f+=64,h-=64}return f}function s(o){var c=new n;c.update(o);var u=c.digest();return c.clean(),u}t.hash=s})(F2);var D4={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=rm,r=qs;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(A){const I=new Float64Array(16);if(A)for(let E=0;E<A.length;E++)I[E]=A[E];return I}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function s(A){let I=1;for(let E=0;E<16;E++){let p=A[E]+I+65535;I=Math.floor(p/65536),A[E]=p-I*65536}A[0]+=I-1+37*(I-1)}function o(A,I,E){const p=~(E-1);for(let O=0;O<16;O++){const N=p&(A[O]^I[O]);A[O]^=N,I[O]^=N}}function c(A,I){const E=n(),p=n();for(let O=0;O<16;O++)p[O]=I[O];s(p),s(p),s(p);for(let O=0;O<2;O++){E[0]=p[0]-65517;for(let F=1;F<15;F++)E[F]=p[F]-65535-(E[F-1]>>16&1),E[F-1]&=65535;E[15]=p[15]-32767-(E[14]>>16&1);const N=E[15]>>16&1;E[14]&=65535,o(p,E,1-N)}for(let O=0;O<16;O++)A[2*O]=p[O]&255,A[2*O+1]=p[O]>>8}function u(A,I){for(let E=0;E<16;E++)A[E]=I[2*E]+(I[2*E+1]<<8);A[15]&=32767}function f(A,I,E){for(let p=0;p<16;p++)A[p]=I[p]+E[p]}function h(A,I,E){for(let p=0;p<16;p++)A[p]=I[p]-E[p]}function m(A,I,E){let p,O,N=0,F=0,V=0,de=0,ve=0,U=0,L=0,Q=0,ne=0,j=0,B=0,H=0,M=0,q=0,k=0,$=0,G=0,pe=0,Y=0,te=0,ce=0,T=0,le=0,ze=0,et=0,yt=0,vt=0,gt=0,Ut=0,Xt=0,Sr=0,Ct=E[0],Pt=E[1],kt=E[2],Rt=E[3],Kt=E[4],Ft=E[5],Gt=E[6],Dt=E[7],Nt=E[8],zt=E[9],Mt=E[10],cr=E[11],tr=E[12],ar=E[13],nr=E[14],br=E[15];p=I[0],N+=p*Ct,F+=p*Pt,V+=p*kt,de+=p*Rt,ve+=p*Kt,U+=p*Ft,L+=p*Gt,Q+=p*Dt,ne+=p*Nt,j+=p*zt,B+=p*Mt,H+=p*cr,M+=p*tr,q+=p*ar,k+=p*nr,$+=p*br,p=I[1],F+=p*Ct,V+=p*Pt,de+=p*kt,ve+=p*Rt,U+=p*Kt,L+=p*Ft,Q+=p*Gt,ne+=p*Dt,j+=p*Nt,B+=p*zt,H+=p*Mt,M+=p*cr,q+=p*tr,k+=p*ar,$+=p*nr,G+=p*br,p=I[2],V+=p*Ct,de+=p*Pt,ve+=p*kt,U+=p*Rt,L+=p*Kt,Q+=p*Ft,ne+=p*Gt,j+=p*Dt,B+=p*Nt,H+=p*zt,M+=p*Mt,q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B+=38*vt,H+=38*gt,M+=38*Ut,q+=38*Xt,k+=38*Sr,O=1,p=N+O+65535,O=Math.floor(p/65536),N=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=V+O+65535,O=Math.floor(p/65536),V=p-O*65536,p=de+O+65535,O=Math.floor(p/65536),de=p-O*65536,p=ve+O+65535,O=Math.floor(p/65536),ve=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=Q+O+65535,O=Math.floor(p/65536),Q=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,N+=O-1+37*(O-1),O=1,p=N+O+65535,O=Math.floor(p/65536),N=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=V+O+65535,O=Math.floor(p/65536),V=p-O*65536,p=de+O+65535,O=Math.floor(p/65536),de=p-O*65536,p=ve+O+65535,O=Math.floor(p/65536),ve=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=Q+O+65535,O=Math.floor(p/65536),Q=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,N+=O-1+37*(O-1),A[0]=N,A[1]=F,A[2]=V,A[3]=de,A[4]=ve,A[5]=U,A[6]=L,A[7]=Q,A[8]=ne,A[9]=j,A[10]=B,A[11]=H,A[12]=M,A[13]=q,A[14]=k,A[15]=$}function y(A,I){m(A,I,I)}function w(A,I){const E=n();for(let p=0;p<16;p++)E[p]=I[p];for(let p=253;p>=0;p--)y(E,E),p!==2&&p!==4&&m(E,E,I);for(let p=0;p<16;p++)A[p]=E[p]}function v(A,I){const E=new Uint8Array(32),p=new Float64Array(80),O=n(),N=n(),F=n(),V=n(),de=n(),ve=n();for(let ne=0;ne<31;ne++)E[ne]=A[ne];E[31]=A[31]&127|64,E[0]&=248,u(p,I);for(let ne=0;ne<16;ne++)N[ne]=p[ne];O[0]=V[0]=1;for(let ne=254;ne>=0;--ne){const j=E[ne>>>3]>>>(ne&7)&1;o(O,N,j),o(F,V,j),f(de,O,F),h(O,O,F),f(F,N,V),h(N,N,V),y(V,de),y(ve,O),m(O,F,O),m(F,N,de),f(de,O,F),h(O,O,F),y(N,O),h(F,V,ve),m(O,F,a),f(O,O,V),m(F,F,O),m(O,V,ve),m(V,N,p),y(N,de),o(O,N,j),o(F,V,j)}for(let ne=0;ne<16;ne++)p[ne+16]=O[ne],p[ne+32]=F[ne],p[ne+48]=N[ne],p[ne+64]=V[ne];const U=p.subarray(32),L=p.subarray(16);w(U,U),m(L,L,U);const Q=new Uint8Array(32);return c(Q,L),Q}t.scalarMult=v;function g(A){return v(A,i)}t.scalarMultBase=g;function _(A){if(A.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const I=new Uint8Array(A);return{publicKey:g(I),secretKey:I}}t.generateKeyPairFromSeed=_;function b(A){const I=(0,e.randomBytes)(32,A),E=_(I);return(0,r.wipe)(I),E}t.generateKeyPair=b;function S(A,I,E=!1){if(A.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(A,I);if(E){let O=0;for(let N=0;N<p.length;N++)O|=p[N];if(O===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=S})(D4);function M4(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function DX(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?M4(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function z6(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=DX(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return M4(r)}function kxe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),s=a.charCodeAt(0);if(r[s]!==255)throw new TypeError(a+" is ambiguous");r[s]=i}var o=t.length,c=t.charAt(0),u=Math.log(o)/Math.log(256),f=Math.log(256)/Math.log(o);function h(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,g=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var S=(b-_)*f+1>>>0,A=new Uint8Array(S);_!==b;){for(var I=w[_],E=0,p=S-1;(I!==0||E<g)&&p!==-1;p--,E++)I+=256*A[p]>>>0,A[p]=I%o>>>0,I=I/o>>>0;if(I!==0)throw new Error("Non-zero carry");g=E,_++}for(var O=S-g;O!==S&&A[O]===0;)O++;for(var N=c.repeat(v);O<S;++O)N+=t.charAt(A[O]);return N}function m(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var g=0,_=0;w[v]===c;)g++,v++;for(var b=(w.length-v)*u+1>>>0,S=new Uint8Array(b);w[v];){var A=r[w.charCodeAt(v)];if(A===255)return;for(var I=0,E=b-1;(A!==0||I<_)&&E!==-1;E--,I++)A+=o*S[E]>>>0,S[E]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");_=I,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var O=new Uint8Array(g+(b-p)),N=g;p!==b;)O[N++]=S[p++];return O}}}function y(w){var v=m(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:m,decode:y}}var Lxe=kxe,jxe=Lxe;const Uxe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Fxe=t=>new TextEncoder().encode(t),Bxe=t=>new TextDecoder().decode(t);class qxe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Hxe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return MX(this,e)}}class zxe{constructor(e){this.decoders=e}or(e){return MX(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const MX=(t,e)=>new zxe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Vxe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new qxe(e,r,n),this.decoder=new Hxe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const B2=({name:t,prefix:e,encode:r,decode:n})=>new Vxe(t,e,r,n),v1=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=jxe(r,e);return B2({prefix:t,name:e,encode:n,decode:a=>Uxe(i(a))})},Gxe=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let a=t.length;for(;t[a-1]==="=";)--a;const s=new Uint8Array(a*r/8|0);let o=0,c=0,u=0;for(let f=0;f<a;++f){const h=i[t[f]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,o+=r,o>=8&&(o-=8,s[u++]=255&c>>o)}if(o>=r||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return s},Kxe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let a="",s=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],s+=8;s>r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<<r-s]),n)for(;a.length*r&7;)a+="=";return a},ua=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>B2({prefix:e,name:t,encode(i){return Kxe(i,n,r)},decode(i){return Gxe(i,n,r,t)}}),Wxe=B2({prefix:"\0",name:"identity",encode:t=>Bxe(t),decode:t=>Fxe(t)}),Qxe=Object.freeze(Object.defineProperty({__proto__:null,identity:Wxe},Symbol.toStringTag,{value:"Module"})),Yxe=ua({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Jxe=Object.freeze(Object.defineProperty({__proto__:null,base2:Yxe},Symbol.toStringTag,{value:"Module"})),Xxe=ua({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Zxe=Object.freeze(Object.defineProperty({__proto__:null,base8:Xxe},Symbol.toStringTag,{value:"Module"})),e2e=v1({prefix:"9",name:"base10",alphabet:"0123456789"}),t2e=Object.freeze(Object.defineProperty({__proto__:null,base10:e2e},Symbol.toStringTag,{value:"Module"})),r2e=ua({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),n2e=ua({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),i2e=Object.freeze(Object.defineProperty({__proto__:null,base16:r2e,base16upper:n2e},Symbol.toStringTag,{value:"Module"})),a2e=ua({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),s2e=ua({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),o2e=ua({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),c2e=ua({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),u2e=ua({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),l2e=ua({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),f2e=ua({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),d2e=ua({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),h2e=ua({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),p2e=Object.freeze(Object.defineProperty({__proto__:null,base32:a2e,base32hex:u2e,base32hexpad:f2e,base32hexpadupper:d2e,base32hexupper:l2e,base32pad:o2e,base32padupper:c2e,base32upper:s2e,base32z:h2e},Symbol.toStringTag,{value:"Module"})),g2e=v1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),m2e=v1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),y2e=Object.freeze(Object.defineProperty({__proto__:null,base36:g2e,base36upper:m2e},Symbol.toStringTag,{value:"Module"})),v2e=v1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),b2e=v1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),w2e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:v2e,base58flickr:b2e},Symbol.toStringTag,{value:"Module"})),_2e=ua({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),E2e=ua({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),x2e=ua({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),A2e=ua({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),S2e=Object.freeze(Object.defineProperty({__proto__:null,base64:_2e,base64pad:E2e,base64url:x2e,base64urlpad:A2e},Symbol.toStringTag,{value:"Module"})),$X=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),I2e=$X.reduce((t,e,r)=>(t[r]=e,t),[]),O2e=$X.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function P2e(t){return t.reduce((e,r)=>(e+=I2e[r],e),"")}function T2e(t){const e=[];for(const r of t){const n=O2e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const C2e=B2({prefix:"🚀",name:"base256emoji",encode:P2e,decode:T2e}),R2e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:C2e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const iq={...Qxe,...Jxe,...Zxe,...t2e,...i2e,...p2e,...y2e,...w2e,...S2e,...R2e};function kX(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const aq=kX("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),OT=kX("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=DX(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),LX={utf8:aq,"utf-8":aq,hex:iq.base16,latin1:OT,ascii:OT,binary:OT,...iq};function ms(t,e="utf8"){const r=LX[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?M4(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Ya(t,e="utf8"){const r=LX[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var sq=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},N2e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),D2e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),M2e=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),$2e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),k2e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),L2e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,j2e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,oq=3,U2e=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",L2e]],cq=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function F2e(t){return t?uq(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new k2e:typeof navigator<"u"?uq(navigator.userAgent):H2e()}function B2e(t){return t!==""&&U2e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function uq(t){var e=B2e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new $2e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<oq&&(i=sq(sq([],i,!0),z2e(oq-i.length),!0)):i=[];var a=i.join("."),s=q2e(t),o=j2e.exec(t);return o&&o[1]?new M2e(r,a,s,o[1]):new N2e(r,a,s)}function q2e(t){for(var e=0,r=cq.length;e<r;e++){var n=cq[e],i=n[0],a=n[1],s=a.exec(t);if(s)return i}return null}function H2e(){var t=typeof process<"u"&&process.version;return t?new D2e(process.version.slice(1)):null}function z2e(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Jt={};/*! *****************************************************************************
|
|
113
|
+
`}])),IT}var dEe=ke&&ke.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hEe=ke&&ke.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pEe=ke&&ke.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&dEe(e,t,r);return hEe(e,t),e};Object.defineProperty(x2,"__esModule",{value:!0});x2.FortmaticConnector=void 0;const gEe=vJ,mEe=Lh,yEe=Io;class vEe extends gEe.AbstractConnector{constructor(e){const r=yEe.getConfiguration()[mEe.ProviderType.FORTMATIC],n=Object.keys(r.apiKeys).map(i=>Number(i));if(!n.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:n}),this.apiKey=r.apiKeys[e],this.chainId=e,this.rpcUrl=r.urls[e]}async activate(){if(!this.fortmatic){const{default:r}=await Promise.resolve().then(()=>pEe(fEe()));this.fortmatic=new r(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(r=>r[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}x2.FortmaticConnector=vEe;var N2={};function N6(){return N6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},N6.apply(this,arguments)}function C4(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function D6(t){return D6=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},D6(t)}function jE(t,e){return jE=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},jE(t,e)}function bEe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function U_(t,e,r){return bEe()?U_=Reflect.construct:U_=function(i,a,s){var o=[null];o.push.apply(o,a);var c=Function.bind.apply(i,o),u=new c;return s&&jE(u,s.prototype),u},U_.apply(null,arguments)}function wEe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function UE(t){var e=typeof Map=="function"?new Map:void 0;return UE=function(n){if(n===null||!wEe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return U_(n,arguments,D6(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),jE(i,n)},UE(t)}function Ww(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function Ap(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function xc(t){return t.hasOwnProperty("result")?t.result:t}var F_=function(t){C4(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="No Ethereum provider was found on window.ethereum.",r}return e}(UE(Error)),bX=function(t){C4(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="The user rejected the request.",r}return e}(UE(Error)),_Ee=function(t){C4(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(Ww(i)),i.handleChainChanged=i.handleChainChanged.bind(Ww(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(Ww(i)),i.handleClose=i.handleClose.bind(Ww(i)),i}var r=e.prototype;return r.handleChainChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.handleAccountsChanged=function(i){i.length===0?this.emitDeactivate():this.emitUpdate({account:i[0]})},r.handleClose=function(i,a){this.emitDeactivate()},r.handleNetworkChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.activate=function(){try{var i=function(f){if(a)return f;function h(){return N6({provider:window.ethereum},o?{account:o}:{})}var m=function(){if(!o)return Promise.resolve(window.ethereum.enable().then(function(y){return y&&xc(y)[0]})).then(function(y){o=y})}();return m&&m.then?m.then(h):h(m)},a=!1,s=this;if(!window.ethereum)throw new F_;window.ethereum.on&&(window.ethereum.on("chainChanged",s.handleChainChanged),window.ethereum.on("accountsChanged",s.handleAccountsChanged),window.ethereum.on("close",s.handleClose),window.ethereum.on("networkChanged",s.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var o,c=Ap(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return xc(u)[0]})).then(function(u){o=u})},function(u){if(u.code===4001)throw new bX});return Promise.resolve(c&&c.then?c.then(i):i(c))}catch(u){return Promise.reject(u)}},r.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(i){return Promise.reject(i)}},r.getChainId=function(){try{var i=function(){function c(){if(!a)try{a=xc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=xc(window.ethereum.cachedResults.net_version):a=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),a}var u=function(){if(!a){var f=Ap(function(){return Promise.resolve(window.ethereum.send("net_version").then(xc)).then(function(h){a=h})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new F_;var a,s=Ap(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(xc)).then(function(o){a=o})},function(){});return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(o){return Promise.reject(o)}},r.getAccount=function(){try{var i=function(){function c(){return a||(a=xc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=Ap(function(){return Promise.resolve(window.ethereum.enable().then(function(h){return xc(h)[0]})).then(function(h){a=h})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new F_;var a,s=Ap(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(o){return xc(o)[0]})).then(function(o){a=o})},function(){});return Promise.resolve(s&&s.then?s.then(i):i(s))}catch(o){return Promise.reject(o)}},r.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},r.isAuthorized=function(){try{return window.ethereum?Promise.resolve(Ap(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return xc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(E2);const EEe=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:_Ee,NoEthereumProviderError:F_,UserRejectedRequestError:bX},Symbol.toStringTag,{value:"Module"})),xEe=js(EEe);Object.defineProperty(N2,"__esModule",{value:!0});N2.InjectedConnector=void 0;const AEe=xEe;class SEe extends AEe.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}N2.InjectedConnector=SEe;var D2={},IEe="Invariant failed";function XB(t,e){if(!t)throw new Error(IEe)}function wX(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,cb(t,e)}function M6(t){return M6=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},M6(t)}function cb(t,e){return cb=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},cb(t,e)}function OEe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function B_(t,e,r){return OEe()?B_=Reflect.construct:B_=function(i,a,s){var o=[null];o.push.apply(o,a);var c=Function.bind.apply(i,o),u=new c;return s&&cb(u,s.prototype),u},B_.apply(null,arguments)}function PEe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function $6(t){var e=typeof Map=="function"?new Map:void 0;return $6=function(n){if(n===null||!PEe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return B_(n,arguments,M6(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),cb(i,n)},$6(t)}var q_=function(t){wX(e,t);function e(r,n,i){var a;return a=t.call(this)||this,a.code=n,a.data=i,a.name=a.constructor.name,a.message=r,a}return e}($6(Error)),TEe=function(e,r){var n=this,i=this;this.isMetaMask=!1,this.sendAsync=function(s,o){console.log("sendAsync",s.method,s.params),i.request(s.method,s.params).then(function(c){return o(null,{jsonrpc:"2.0",id:s.id,result:c})}).catch(function(c){return o(c,null)})},this.request=function(s,o){try{return typeof s!="string"&&(o=s.params,s=s.method),Promise.resolve(fetch(n.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:s,params:o}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new q_(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,h,m;throw new q_(u==null||(f=u.error)==null?void 0:f.message,u==null||(h=u.error)==null?void 0:h.code,u==null||(m=u.error)==null?void 0:m.data)}else{if("result"in u)return u.result;throw new q_("Received unexpected JSON-RPC response to "+s+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=e,this.url=r;var a=new URL(r);this.host=a.host,this.path=a.pathname},CEe=function(t){wX(e,t);function e(n){var i,a=n.urls,s=n.defaultChainId;return s||Object.keys(a).length===1||XB(!1),i=t.call(this,{supportedChainIds:Object.keys(a).map(function(o){return Number(o)})})||this,i.currentChainId=s||Number(Object.keys(a)[0]),i.providers=Object.keys(a).reduce(function(o,c){return o[Number(c)]=new TEe(Number(c),a[Number(c)]),o},{}),i}var r=e.prototype;return r.activate=function(){try{var i=this;return Promise.resolve({provider:i.providers[i.currentChainId],chainId:i.currentChainId,account:null})}catch(a){return Promise.reject(a)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.providers[i.currentChainId])}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.currentChainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){return Promise.resolve(null)},r.deactivate=function(){},r.changeChainId=function(i){Object.keys(this.providers).includes(i.toString())||XB(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(E2);const REe=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:CEe,RequestError:q_},Symbol.toStringTag,{value:"Module"})),NEe=js(REe);Object.defineProperty(D2,"__esModule",{value:!0});D2.NetworkConnector=void 0;const DEe=sc,MEe=NEe,$Ee=Io;class kEe extends MEe.NetworkConnector{constructor(e){super({urls:$Ee.getConfiguration()[DEe.ProviderType.NETWORK].urls,defaultChainId:e})}}D2.NetworkConnector=kEe;var M2={};const LEe="modulepreload",jEe=function(t){return"/"+t},ZB={},ub=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=jEe(a),a in ZB)return;ZB[a]=!0;const s=a.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const h=i[f];if(h.href===a&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${o}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":LEe,s||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),s)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a})};function k6(){return k6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},k6.apply(this,arguments)}function UEe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,L6(t,e)}function L6(t,e){return L6=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},L6(t,e)}function eq(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var FEe=1,BEe=function(t){UEe(e,t);function e(n){var i,a=n.url,s=n.appName,o=n.appLogoUrl,c=n.darkMode,u=n.supportedChainIds;return i=t.call(this,{supportedChainIds:u})||this,i.url=a,i.appName=s,i.appLogoUrl=o,i.darkMode=c||!1,i.handleChainChanged=i.handleChainChanged.bind(eq(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(eq(i)),i}var r=e.prototype;return r.activate=function(){try{var i=this,a=function(){return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return i.provider.on("chainChanged",i.handleChainChanged),i.provider.on("accountsChanged",i.handleAccountsChanged),{provider:i.provider,account:u}})},s=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)i.provider=window.ethereum;else{var o=function(){if(!i.walletLink)return Promise.resolve(ub(()=>import("./index-5d117518.js").then(c=>c.i),[]).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){i.walletLink=new c(k6({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,FEe)})}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(s&&s.then?s.then(a):a(s))}catch(o){return Promise.reject(o)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.provider)}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.provider.chainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){try{var i=this;return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(a){return a[0]})}catch(a){return Promise.reject(a)}},r.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},r.close=function(){try{var i=this;return i.provider.close(),i.emitDeactivate(),Promise.resolve()}catch(a){return Promise.reject(a)}},r.handleChainChanged=function(i){this.emitUpdate({chainId:i})},r.handleAccountsChanged=function(i){this.emitUpdate({account:i[0]})},e}(E2);const qEe=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:BEe},Symbol.toStringTag,{value:"Module"})),HEe=js(qEe);Object.defineProperty(M2,"__esModule",{value:!0});M2.WalletLinkConnector=void 0;const zEe=Lh,VEe=HEe,GEe=Io;class KEe extends VEe.WalletLinkConnector{constructor(e){const r=GEe.getConfiguration()[zEe.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}M2.WalletLinkConnector=KEe;var $2={},R4={},k2={},Mr={},_X={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,c){var u=o>>>16&65535,f=o&65535,h=c>>>16&65535,m=c&65535;return f*m+(u*m+f*h<<16>>>0)|0}t.mul=Math.imul||e;function r(o,c){return o+c|0}t.add=r;function n(o,c){return o-c|0}t.sub=n;function i(o,c){return o<<c|o>>>32-c}t.rotl=i;function a(o,c){return o<<32-c|o>>>c}t.rotr=a;function s(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}t.isInteger=Number.isInteger||s,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(o){return t.isInteger(o)&&o>=-t.MAX_SAFE_INTEGER&&o<=t.MAX_SAFE_INTEGER}})(_X);Object.defineProperty(Mr,"__esModule",{value:!0});var EX=_X;function WEe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Mr.readInt16BE=WEe;function QEe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Mr.readUint16BE=QEe;function YEe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Mr.readInt16LE=YEe;function JEe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Mr.readUint16LE=JEe;function xX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}Mr.writeUint16BE=xX;Mr.writeInt16BE=xX;function AX(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}Mr.writeUint16LE=AX;Mr.writeInt16LE=AX;function j6(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Mr.readInt32BE=j6;function U6(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Mr.readUint32BE=U6;function F6(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Mr.readInt32LE=F6;function B6(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Mr.readUint32LE=B6;function FE(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}Mr.writeUint32BE=FE;Mr.writeInt32BE=FE;function BE(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}Mr.writeUint32LE=BE;Mr.writeInt32LE=BE;function XEe(t,e){e===void 0&&(e=0);var r=j6(t,e),n=j6(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Mr.readInt64BE=XEe;function ZEe(t,e){e===void 0&&(e=0);var r=U6(t,e),n=U6(t,e+4);return r*4294967296+n}Mr.readUint64BE=ZEe;function exe(t,e){e===void 0&&(e=0);var r=F6(t,e),n=F6(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Mr.readInt64LE=exe;function txe(t,e){e===void 0&&(e=0);var r=B6(t,e),n=B6(t,e+4);return n*4294967296+r}Mr.readUint64LE=txe;function SX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),FE(t/4294967296>>>0,e,r),FE(t>>>0,e,r+4),e}Mr.writeUint64BE=SX;Mr.writeInt64BE=SX;function IX(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),BE(t>>>0,e,r),BE(t/4294967296>>>0,e,r+4),e}Mr.writeUint64LE=IX;Mr.writeInt64LE=IX;function rxe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}Mr.readUintBE=rxe;function nxe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}Mr.readUintLE=nxe;function ixe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!EX.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}Mr.writeUintBE=ixe;function axe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!EX.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}Mr.writeUintLE=axe;function sxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Mr.readFloat32BE=sxe;function oxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Mr.readFloat32LE=oxe;function cxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Mr.readFloat64BE=cxe;function uxe(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Mr.readFloat64LE=uxe;function lxe(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}Mr.writeFloat32BE=lxe;function fxe(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}Mr.writeFloat32LE=fxe;function dxe(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}Mr.writeFloat64BE=dxe;function hxe(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}Mr.writeFloat64LE=hxe;var qs={};Object.defineProperty(qs,"__esModule",{value:!0});function pxe(t){for(var e=0;e<t.length;e++)t[e]=0;return t}qs.wipe=pxe;Object.defineProperty(k2,"__esModule",{value:!0});var ma=Mr,q6=qs,gxe=20;function mxe(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,s=1797285236,o=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r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^=V,F=F>>>32-12|F<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,de=de+ne|0,p^=de,p=p>>>32-12|p<<12,I=I+F|0,Q^=I,Q=Q>>>32-8|Q<<8,V=V+Q|0,F^=V,F=F>>>32-7|F<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,de=de+ne|0,p^=de,p=p>>>32-7|p<<7,A=A+N|0,L^=A,L=L>>>32-8|L<<8,U=U+L|0,N^=U,N=N>>>32-7|N<<7,S=S+O|0,j^=S,j=j>>>32-8|j<<8,ve=ve+j|0,O^=ve,O=O>>>32-7|O<<7;ma.writeUint32LE(S+n|0,t,0),ma.writeUint32LE(A+i|0,t,4),ma.writeUint32LE(I+a|0,t,8),ma.writeUint32LE(E+s|0,t,12),ma.writeUint32LE(p+o|0,t,16),ma.writeUint32LE(O+c|0,t,20),ma.writeUint32LE(N+u|0,t,24),ma.writeUint32LE(F+f|0,t,28),ma.writeUint32LE(V+h|0,t,32),ma.writeUint32LE(de+m|0,t,36),ma.writeUint32LE(ve+y|0,t,40),ma.writeUint32LE(U+w|0,t,44),ma.writeUint32LE(L+v|0,t,48),ma.writeUint32LE(Q+g|0,t,52),ma.writeUint32LE(ne+_|0,t,56),ma.writeUint32LE(j+b|0,t,60)}function OX(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,s;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),s=a.length-e.length,a.set(e,s)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,s=i}for(var o=new Uint8Array(64),c=0;c<r.length;c+=64){mxe(o,a,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^o[u-c];vxe(a,0,s)}return q6.wipe(o),i===0&&q6.wipe(a),n}k2.streamXOR=OX;function yxe(t,e,r,n){return n===void 0&&(n=0),q6.wipe(r),OX(t,e,r,r,n)}k2.stream=yxe;function vxe(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var PX={},zf={};Object.defineProperty(zf,"__esModule",{value:!0});function bxe(t,e,r){return~(t-1)&e|t-1&r}zf.select=bxe;function wxe(t,e){return(t|0)-(e|0)-1>>>31&1}zf.lessOrEqual=wxe;function TX(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}zf.compare=TX;function _xe(t,e){return t.length===0||e.length===0?!1:TX(t,e)!==0}zf.equal=_xe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=zf,r=qs;t.DIGEST_LENGTH=16;var n=function(){function s(o){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=o[0]|o[1]<<8;this._r[0]=c&8191;var u=o[2]|o[3]<<8;this._r[1]=(c>>>13|u<<3)&8191;var f=o[4]|o[5]<<8;this._r[2]=(u>>>10|f<<6)&7939;var h=o[6]|o[7]<<8;this._r[3]=(f>>>7|h<<9)&8191;var m=o[8]|o[9]<<8;this._r[4]=(h>>>4|m<<12)&255,this._r[5]=m>>>1&8190;var y=o[10]|o[11]<<8;this._r[6]=(m>>>14|y<<2)&8191;var w=o[12]|o[13]<<8;this._r[7]=(y>>>11|w<<5)&8065;var v=o[14]|o[15]<<8;this._r[8]=(w>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=o[16]|o[17]<<8,this._pad[1]=o[18]|o[19]<<8,this._pad[2]=o[20]|o[21]<<8,this._pad[3]=o[22]|o[23]<<8,this._pad[4]=o[24]|o[25]<<8,this._pad[5]=o[26]|o[27]<<8,this._pad[6]=o[28]|o[29]<<8,this._pad[7]=o[30]|o[31]<<8}return s.prototype._blocks=function(o,c,u){for(var f=this._fin?0:2048,h=this._h[0],m=this._h[1],y=this._h[2],w=this._h[3],v=this._h[4],g=this._h[5],_=this._h[6],b=this._h[7],S=this._h[8],A=this._h[9],I=this._r[0],E=this._r[1],p=this._r[2],O=this._r[3],N=this._r[4],F=this._r[5],V=this._r[6],de=this._r[7],ve=this._r[8],U=this._r[9];u>=16;){var L=o[c+0]|o[c+1]<<8;h+=L&8191;var Q=o[c+2]|o[c+3]<<8;m+=(L>>>13|Q<<3)&8191;var ne=o[c+4]|o[c+5]<<8;y+=(Q>>>10|ne<<6)&8191;var j=o[c+6]|o[c+7]<<8;w+=(ne>>>7|j<<9)&8191;var B=o[c+8]|o[c+9]<<8;v+=(j>>>4|B<<12)&8191,g+=B>>>1&8191;var H=o[c+10]|o[c+11]<<8;_+=(B>>>14|H<<2)&8191;var M=o[c+12]|o[c+13]<<8;b+=(H>>>11|M<<5)&8191;var q=o[c+14]|o[c+15]<<8;S+=(M>>>8|q<<8)&8191,A+=q>>>5|f;var k=0,$=k;$+=h*I,$+=m*(5*U),$+=y*(5*ve),$+=w*(5*de),$+=v*(5*V),k=$>>>13,$&=8191,$+=g*(5*F),$+=_*(5*N),$+=b*(5*O),$+=S*(5*p),$+=A*(5*E),k+=$>>>13,$&=8191;var G=k;G+=h*E,G+=m*I,G+=y*(5*U),G+=w*(5*ve),G+=v*(5*de),k=G>>>13,G&=8191,G+=g*(5*V),G+=_*(5*F),G+=b*(5*N),G+=S*(5*O),G+=A*(5*p),k+=G>>>13,G&=8191;var pe=k;pe+=h*p,pe+=m*E,pe+=y*I,pe+=w*(5*U),pe+=v*(5*ve),k=pe>>>13,pe&=8191,pe+=g*(5*de),pe+=_*(5*V),pe+=b*(5*F),pe+=S*(5*N),pe+=A*(5*O),k+=pe>>>13,pe&=8191;var Y=k;Y+=h*O,Y+=m*p,Y+=y*E,Y+=w*I,Y+=v*(5*U),k=Y>>>13,Y&=8191,Y+=g*(5*ve),Y+=_*(5*de),Y+=b*(5*V),Y+=S*(5*F),Y+=A*(5*N),k+=Y>>>13,Y&=8191;var te=k;te+=h*N,te+=m*O,te+=y*p,te+=w*E,te+=v*I,k=te>>>13,te&=8191,te+=g*(5*U),te+=_*(5*ve),te+=b*(5*de),te+=S*(5*V),te+=A*(5*F),k+=te>>>13,te&=8191;var ce=k;ce+=h*F,ce+=m*N,ce+=y*O,ce+=w*p,ce+=v*E,k=ce>>>13,ce&=8191,ce+=g*I,ce+=_*(5*U),ce+=b*(5*ve),ce+=S*(5*de),ce+=A*(5*V),k+=ce>>>13,ce&=8191;var T=k;T+=h*V,T+=m*F,T+=y*N,T+=w*O,T+=v*p,k=T>>>13,T&=8191,T+=g*E,T+=_*I,T+=b*(5*U),T+=S*(5*ve),T+=A*(5*de),k+=T>>>13,T&=8191;var le=k;le+=h*de,le+=m*V,le+=y*F,le+=w*N,le+=v*O,k=le>>>13,le&=8191,le+=g*p,le+=_*E,le+=b*I,le+=S*(5*U),le+=A*(5*ve),k+=le>>>13,le&=8191;var ze=k;ze+=h*ve,ze+=m*de,ze+=y*V,ze+=w*F,ze+=v*N,k=ze>>>13,ze&=8191,ze+=g*O,ze+=_*p,ze+=b*E,ze+=S*I,ze+=A*(5*U),k+=ze>>>13,ze&=8191;var et=k;et+=h*U,et+=m*ve,et+=y*de,et+=w*V,et+=v*F,k=et>>>13,et&=8191,et+=g*N,et+=_*O,et+=b*p,et+=S*E,et+=A*I,k+=et>>>13,et&=8191,k=(k<<2)+k|0,k=k+$|0,$=k&8191,k=k>>>13,G+=k,h=$,m=G,y=pe,w=Y,v=te,g=ce,_=T,b=le,S=ze,A=et,c+=16,u-=16}this._h[0]=h,this._h[1]=m,this._h[2]=y,this._h[3]=w,this._h[4]=v,this._h[5]=g,this._h[6]=_,this._h[7]=b,this._h[8]=S,this._h[9]=A},s.prototype.finish=function(o,c){c===void 0&&(c=0);var u=new Uint16Array(10),f,h,m,y;if(this._leftover){for(y=this._leftover,this._buffer[y++]=1;y<16;y++)this._buffer[y]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,y=2;y<10;y++)this._h[y]+=f,f=this._h[y]>>>13,this._h[y]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,u[0]=this._h[0]+5,f=u[0]>>>13,u[0]&=8191,y=1;y<10;y++)u[y]=this._h[y]+f,f=u[y]>>>13,u[y]&=8191;for(u[9]-=8192,h=(f^1)-1,y=0;y<10;y++)u[y]&=h;for(h=~h,y=0;y<10;y++)this._h[y]=this._h[y]&h|u[y];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,m=this._h[0]+this._pad[0],this._h[0]=m&65535,y=1;y<8;y++)m=(this._h[y]+this._pad[y]|0)+(m>>>16)|0,this._h[y]=m&65535;return o[c+0]=this._h[0]>>>0,o[c+1]=this._h[0]>>>8,o[c+2]=this._h[1]>>>0,o[c+3]=this._h[1]>>>8,o[c+4]=this._h[2]>>>0,o[c+5]=this._h[2]>>>8,o[c+6]=this._h[3]>>>0,o[c+7]=this._h[3]>>>8,o[c+8]=this._h[4]>>>0,o[c+9]=this._h[4]>>>8,o[c+10]=this._h[5]>>>0,o[c+11]=this._h[5]>>>8,o[c+12]=this._h[6]>>>0,o[c+13]=this._h[6]>>>8,o[c+14]=this._h[7]>>>0,o[c+15]=this._h[7]>>>8,this._finished=!0,this},s.prototype.update=function(o){var c=0,u=o.length,f;if(this._leftover){f=16-this._leftover,f>u&&(f=u);for(var h=0;h<f;h++)this._buffer[this._leftover+h]=o[c+h];if(u-=f,c+=f,this._leftover+=f,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(f=u-u%16,this._blocks(o,c,f),c+=f,u-=f),u){for(var h=0;h<u;h++)this._buffer[this._leftover+h]=o[c+h];this._leftover+=u}return this},s.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var o=new Uint8Array(16);return this.finish(o),o},s.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},s}();t.Poly1305=n;function i(s,o){var c=new n(s);c.update(o);var u=c.digest();return c.clean(),u}t.oneTimeAuth=i;function a(s,o){return s.length!==t.DIGEST_LENGTH||o.length!==t.DIGEST_LENGTH?!1:e.equal(s,o)}t.equal=a})(PX);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=k2,r=PX,n=qs,i=Mr,a=zf;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var s=new Uint8Array(16),o=function(){function c(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return c.prototype.seal=function(u,f,h,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var y=new Uint8Array(16);y.set(u,y.length-u.length);var w=new Uint8Array(32);e.stream(this._key,y,w,4);var v=f.length+this.tagLength,g;if(m){if(m.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");g=m}else g=new Uint8Array(v);return e.streamXOR(this._key,y,f,g,4),this._authenticate(g.subarray(g.length-this.tagLength,g.length),w,g.subarray(0,g.length-this.tagLength),h),n.wipe(y),g},c.prototype.open=function(u,f,h,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length<this.tagLength)return null;var y=new Uint8Array(16);y.set(u,y.length-u.length);var w=new Uint8Array(32);e.stream(this._key,y,w,4);var v=new Uint8Array(this.tagLength);if(this._authenticate(v,w,f.subarray(0,f.length-this.tagLength),h),!a.equal(v,f.subarray(f.length-this.tagLength,f.length)))return null;var g=f.length-this.tagLength,_;if(m){if(m.length!==g)throw new Error("ChaCha20Poly1305: incorrect destination length");_=m}else _=new Uint8Array(g);return e.streamXOR(this._key,y,f.subarray(0,f.length-this.tagLength),_,4),n.wipe(y),_},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(u,f,h,m){var y=new r.Poly1305(f);m&&(y.update(m),m.length%16>0&&y.update(s.subarray(m.length%16))),y.update(h),h.length%16>0&&y.update(s.subarray(h.length%16));var w=new Uint8Array(8);m&&i.writeUint64LE(m.length,w),y.update(w),i.writeUint64LE(h.length,w),y.update(w);for(var v=y.digest(),g=0;g<v.length;g++)u[g]=v[g];y.clean(),n.wipe(v),n.wipe(w)},c}();t.ChaCha20Poly1305=o})(R4);var CX={},y1={},N4={};Object.defineProperty(N4,"__esModule",{value:!0});function Exe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}N4.isSerializableHash=Exe;Object.defineProperty(y1,"__esModule",{value:!0});var Ac=N4,xxe=zf,Axe=qs,RX=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Ac.isSerializableHash(this._inner)&&Ac.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Axe.wipe(n)}return t.prototype.reset=function(){if(!Ac.isSerializableHash(this._inner)||!Ac.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Ac.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ac.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Ac.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Ac.isSerializableHash(this._inner)||!Ac.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Ac.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();y1.HMAC=RX;function Sxe(t,e,r){var n=new RX(t,e);n.update(r);var i=n.digest();return n.clean(),i}y1.hmac=Sxe;y1.equal=xxe.equal;Object.defineProperty(CX,"__esModule",{value:!0});var tq=y1,rq=qs,Ixe=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=tq.hmac(this._hash,n,r);this._hmac=new tq.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),rq.wipe(this._buffer),rq.wipe(this._counter),this._bufpos=0},t}(),Oxe=CX.HKDF=Ixe,rm={},L2={},j2={};Object.defineProperty(j2,"__esModule",{value:!0});j2.BrowserRandomSource=void 0;const nq=65536;class Pxe{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=nq)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,nq)));return r}}j2.BrowserRandomSource=Pxe;function H6(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var U2={};const Txe={},Cxe=Object.freeze(Object.defineProperty({__proto__:null,default:Txe},Symbol.toStringTag,{value:"Module"})),NX=js(Cxe);Object.defineProperty(U2,"__esModule",{value:!0});U2.NodeRandomSource=void 0;const Rxe=qs;class Nxe{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof H6<"u"){const e=NX;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,Rxe.wipe)(r),n}}U2.NodeRandomSource=Nxe;Object.defineProperty(L2,"__esModule",{value:!0});L2.SystemRandomSource=void 0;const Dxe=j2,Mxe=U2;class $xe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new Dxe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new Mxe.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}L2.SystemRandomSource=$xe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=L2,r=Mr,n=qs;t.defaultRandomSource=new e.SystemRandomSource;function i(u,f=t.defaultRandomSource){return f.randomBytes(u)}t.randomBytes=i;function a(u=t.defaultRandomSource){const f=i(4,u),h=(0,r.readUint32LE)(f);return(0,n.wipe)(f),h}t.randomUint32=a;const s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function o(u,f=s,h=t.defaultRandomSource){if(f.length<2)throw new Error("randomString charset is too short");if(f.length>256)throw new Error("randomString charset is too long");let m="";const y=f.length,w=256-256%y;for(;u>0;){const v=i(Math.ceil(u*256/w),h);for(let g=0;g<v.length&&u>0;g++){const _=v[g];_<w&&(m+=f.charAt(_%y),u--)}(0,n.wipe)(v)}return m}t.randomString=o;function c(u,f=s,h=t.defaultRandomSource){const m=Math.ceil(u/(Math.log(f.length)/Math.LN2));return o(m,f,h)}t.randomStringForEntropy=c})(rm);var F2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Mr,r=qs;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function o(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},o.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},o.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},o.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=a(this._temp,this._state,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},o.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,h=u/536870912|0,m=u<<3,y=u%64<56?64:128;this._buffer[f]=128;for(var w=f+1;w<y-8;w++)this._buffer[w]=0;e.writeUint32BE(h,this._buffer,y-8),e.writeUint32BE(m,this._buffer,y-4),a(this._temp,this._state,this._buffer,0,y),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)e.writeUint32BE(this._state[w],c,w*4);return this},o.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},o.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},o}();t.SHA256=n;var i=new Int32Array([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]);function a(o,c,u,f,h){for(;h>=64;){for(var m=c[0],y=c[1],w=c[2],v=c[3],g=c[4],_=c[5],b=c[6],S=c[7],A=0;A<16;A++){var I=f+A*4;o[A]=e.readUint32BE(u,I)}for(var A=16;A<64;A++){var E=o[A-2],p=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=o[A-15];var O=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;o[A]=(p+o[A-7]|0)+(O+o[A-16]|0)}for(var A=0;A<64;A++){var p=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&_^~g&b)|0)+(S+(i[A]+o[A]|0)|0)|0,O=((m>>>2|m<<32-2)^(m>>>13|m<<32-13)^(m>>>22|m<<32-22))+(m&y^m&w^y&w)|0;S=b,b=_,_=g,g=v+p|0,v=w,w=y,y=m,m=p+O|0}c[0]+=m,c[1]+=y,c[2]+=w,c[3]+=v,c[4]+=g,c[5]+=_,c[6]+=b,c[7]+=S,f+=64,h-=64}return f}function s(o){var c=new n;c.update(o);var u=c.digest();return c.clean(),u}t.hash=s})(F2);var D4={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=rm,r=qs;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(A){const I=new Float64Array(16);if(A)for(let E=0;E<A.length;E++)I[E]=A[E];return I}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function s(A){let I=1;for(let E=0;E<16;E++){let p=A[E]+I+65535;I=Math.floor(p/65536),A[E]=p-I*65536}A[0]+=I-1+37*(I-1)}function o(A,I,E){const p=~(E-1);for(let O=0;O<16;O++){const N=p&(A[O]^I[O]);A[O]^=N,I[O]^=N}}function c(A,I){const E=n(),p=n();for(let O=0;O<16;O++)p[O]=I[O];s(p),s(p),s(p);for(let O=0;O<2;O++){E[0]=p[0]-65517;for(let F=1;F<15;F++)E[F]=p[F]-65535-(E[F-1]>>16&1),E[F-1]&=65535;E[15]=p[15]-32767-(E[14]>>16&1);const N=E[15]>>16&1;E[14]&=65535,o(p,E,1-N)}for(let O=0;O<16;O++)A[2*O]=p[O]&255,A[2*O+1]=p[O]>>8}function u(A,I){for(let E=0;E<16;E++)A[E]=I[2*E]+(I[2*E+1]<<8);A[15]&=32767}function f(A,I,E){for(let p=0;p<16;p++)A[p]=I[p]+E[p]}function h(A,I,E){for(let p=0;p<16;p++)A[p]=I[p]-E[p]}function m(A,I,E){let p,O,N=0,F=0,V=0,de=0,ve=0,U=0,L=0,Q=0,ne=0,j=0,B=0,H=0,M=0,q=0,k=0,$=0,G=0,pe=0,Y=0,te=0,ce=0,T=0,le=0,ze=0,et=0,yt=0,vt=0,gt=0,Ut=0,Xt=0,Sr=0,Ct=E[0],Pt=E[1],kt=E[2],Rt=E[3],Kt=E[4],Ft=E[5],Gt=E[6],Dt=E[7],Nt=E[8],zt=E[9],Mt=E[10],cr=E[11],tr=E[12],ar=E[13],nr=E[14],br=E[15];p=I[0],N+=p*Ct,F+=p*Pt,V+=p*kt,de+=p*Rt,ve+=p*Kt,U+=p*Ft,L+=p*Gt,Q+=p*Dt,ne+=p*Nt,j+=p*zt,B+=p*Mt,H+=p*cr,M+=p*tr,q+=p*ar,k+=p*nr,$+=p*br,p=I[1],F+=p*Ct,V+=p*Pt,de+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+=p*Ct,G+=p*Pt,pe+=p*kt,Y+=p*Rt,te+=p*Kt,ce+=p*Ft,T+=p*Gt,le+=p*Dt,ze+=p*Nt,et+=p*zt,yt+=p*Mt,vt+=p*cr,gt+=p*tr,Ut+=p*ar,Xt+=p*nr,Sr+=p*br,N+=38*G,F+=38*pe,V+=38*Y,de+=38*te,ve+=38*ce,U+=38*T,L+=38*le,Q+=38*ze,ne+=38*et,j+=38*yt,B+=38*vt,H+=38*gt,M+=38*Ut,q+=38*Xt,k+=38*Sr,O=1,p=N+O+65535,O=Math.floor(p/65536),N=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=V+O+65535,O=Math.floor(p/65536),V=p-O*65536,p=de+O+65535,O=Math.floor(p/65536),de=p-O*65536,p=ve+O+65535,O=Math.floor(p/65536),ve=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=Q+O+65535,O=Math.floor(p/65536),Q=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,N+=O-1+37*(O-1),O=1,p=N+O+65535,O=Math.floor(p/65536),N=p-O*65536,p=F+O+65535,O=Math.floor(p/65536),F=p-O*65536,p=V+O+65535,O=Math.floor(p/65536),V=p-O*65536,p=de+O+65535,O=Math.floor(p/65536),de=p-O*65536,p=ve+O+65535,O=Math.floor(p/65536),ve=p-O*65536,p=U+O+65535,O=Math.floor(p/65536),U=p-O*65536,p=L+O+65535,O=Math.floor(p/65536),L=p-O*65536,p=Q+O+65535,O=Math.floor(p/65536),Q=p-O*65536,p=ne+O+65535,O=Math.floor(p/65536),ne=p-O*65536,p=j+O+65535,O=Math.floor(p/65536),j=p-O*65536,p=B+O+65535,O=Math.floor(p/65536),B=p-O*65536,p=H+O+65535,O=Math.floor(p/65536),H=p-O*65536,p=M+O+65535,O=Math.floor(p/65536),M=p-O*65536,p=q+O+65535,O=Math.floor(p/65536),q=p-O*65536,p=k+O+65535,O=Math.floor(p/65536),k=p-O*65536,p=$+O+65535,O=Math.floor(p/65536),$=p-O*65536,N+=O-1+37*(O-1),A[0]=N,A[1]=F,A[2]=V,A[3]=de,A[4]=ve,A[5]=U,A[6]=L,A[7]=Q,A[8]=ne,A[9]=j,A[10]=B,A[11]=H,A[12]=M,A[13]=q,A[14]=k,A[15]=$}function y(A,I){m(A,I,I)}function w(A,I){const E=n();for(let p=0;p<16;p++)E[p]=I[p];for(let p=253;p>=0;p--)y(E,E),p!==2&&p!==4&&m(E,E,I);for(let p=0;p<16;p++)A[p]=E[p]}function v(A,I){const E=new Uint8Array(32),p=new Float64Array(80),O=n(),N=n(),F=n(),V=n(),de=n(),ve=n();for(let ne=0;ne<31;ne++)E[ne]=A[ne];E[31]=A[31]&127|64,E[0]&=248,u(p,I);for(let ne=0;ne<16;ne++)N[ne]=p[ne];O[0]=V[0]=1;for(let ne=254;ne>=0;--ne){const j=E[ne>>>3]>>>(ne&7)&1;o(O,N,j),o(F,V,j),f(de,O,F),h(O,O,F),f(F,N,V),h(N,N,V),y(V,de),y(ve,O),m(O,F,O),m(F,N,de),f(de,O,F),h(O,O,F),y(N,O),h(F,V,ve),m(O,F,a),f(O,O,V),m(F,F,O),m(O,V,ve),m(V,N,p),y(N,de),o(O,N,j),o(F,V,j)}for(let ne=0;ne<16;ne++)p[ne+16]=O[ne],p[ne+32]=F[ne],p[ne+48]=N[ne],p[ne+64]=V[ne];const U=p.subarray(32),L=p.subarray(16);w(U,U),m(L,L,U);const Q=new Uint8Array(32);return c(Q,L),Q}t.scalarMult=v;function g(A){return v(A,i)}t.scalarMultBase=g;function _(A){if(A.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const I=new Uint8Array(A);return{publicKey:g(I),secretKey:I}}t.generateKeyPairFromSeed=_;function b(A){const I=(0,e.randomBytes)(32,A),E=_(I);return(0,r.wipe)(I),E}t.generateKeyPair=b;function S(A,I,E=!1){if(A.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(A,I);if(E){let O=0;for(let N=0;N<p.length;N++)O|=p[N];if(O===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=S})(D4);function M4(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function DX(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?M4(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function z6(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=DX(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return M4(r)}function kxe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),s=a.charCodeAt(0);if(r[s]!==255)throw new TypeError(a+" is ambiguous");r[s]=i}var o=t.length,c=t.charAt(0),u=Math.log(o)/Math.log(256),f=Math.log(256)/Math.log(o);function h(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,g=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var S=(b-_)*f+1>>>0,A=new Uint8Array(S);_!==b;){for(var I=w[_],E=0,p=S-1;(I!==0||E<g)&&p!==-1;p--,E++)I+=256*A[p]>>>0,A[p]=I%o>>>0,I=I/o>>>0;if(I!==0)throw new Error("Non-zero carry");g=E,_++}for(var O=S-g;O!==S&&A[O]===0;)O++;for(var N=c.repeat(v);O<S;++O)N+=t.charAt(A[O]);return N}function m(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var g=0,_=0;w[v]===c;)g++,v++;for(var b=(w.length-v)*u+1>>>0,S=new Uint8Array(b);w[v];){var A=r[w.charCodeAt(v)];if(A===255)return;for(var I=0,E=b-1;(A!==0||I<_)&&E!==-1;E--,I++)A+=o*S[E]>>>0,S[E]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");_=I,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var O=new Uint8Array(g+(b-p)),N=g;p!==b;)O[N++]=S[p++];return O}}}function y(w){var v=m(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:m,decode:y}}var Lxe=kxe,jxe=Lxe;const Uxe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Fxe=t=>new TextEncoder().encode(t),Bxe=t=>new TextDecoder().decode(t);class qxe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Hxe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return MX(this,e)}}class zxe{constructor(e){this.decoders=e}or(e){return MX(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const MX=(t,e)=>new zxe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Vxe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new qxe(e,r,n),this.decoder=new Hxe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const B2=({name:t,prefix:e,encode:r,decode:n})=>new Vxe(t,e,r,n),v1=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=jxe(r,e);return B2({prefix:t,name:e,encode:n,decode:a=>Uxe(i(a))})},Gxe=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let a=t.length;for(;t[a-1]==="=";)--a;const s=new Uint8Array(a*r/8|0);let o=0,c=0,u=0;for(let f=0;f<a;++f){const h=i[t[f]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,o+=r,o>=8&&(o-=8,s[u++]=255&c>>o)}if(o>=r||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return s},Kxe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let a="",s=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],s+=8;s>r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<<r-s]),n)for(;a.length*r&7;)a+="=";return a},ua=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>B2({prefix:e,name:t,encode(i){return Kxe(i,n,r)},decode(i){return Gxe(i,n,r,t)}}),Wxe=B2({prefix:"\0",name:"identity",encode:t=>Bxe(t),decode:t=>Fxe(t)}),Qxe=Object.freeze(Object.defineProperty({__proto__:null,identity:Wxe},Symbol.toStringTag,{value:"Module"})),Yxe=ua({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Jxe=Object.freeze(Object.defineProperty({__proto__:null,base2:Yxe},Symbol.toStringTag,{value:"Module"})),Xxe=ua({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Zxe=Object.freeze(Object.defineProperty({__proto__:null,base8:Xxe},Symbol.toStringTag,{value:"Module"})),e2e=v1({prefix:"9",name:"base10",alphabet:"0123456789"}),t2e=Object.freeze(Object.defineProperty({__proto__:null,base10:e2e},Symbol.toStringTag,{value:"Module"})),r2e=ua({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),n2e=ua({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),i2e=Object.freeze(Object.defineProperty({__proto__:null,base16:r2e,base16upper:n2e},Symbol.toStringTag,{value:"Module"})),a2e=ua({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),s2e=ua({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),o2e=ua({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),c2e=ua({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),u2e=ua({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),l2e=ua({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),f2e=ua({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),d2e=ua({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),h2e=ua({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),p2e=Object.freeze(Object.defineProperty({__proto__:null,base32:a2e,base32hex:u2e,base32hexpad:f2e,base32hexpadupper:d2e,base32hexupper:l2e,base32pad:o2e,base32padupper:c2e,base32upper:s2e,base32z:h2e},Symbol.toStringTag,{value:"Module"})),g2e=v1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),m2e=v1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),y2e=Object.freeze(Object.defineProperty({__proto__:null,base36:g2e,base36upper:m2e},Symbol.toStringTag,{value:"Module"})),v2e=v1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),b2e=v1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),w2e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:v2e,base58flickr:b2e},Symbol.toStringTag,{value:"Module"})),_2e=ua({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),E2e=ua({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),x2e=ua({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),A2e=ua({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),S2e=Object.freeze(Object.defineProperty({__proto__:null,base64:_2e,base64pad:E2e,base64url:x2e,base64urlpad:A2e},Symbol.toStringTag,{value:"Module"})),$X=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),I2e=$X.reduce((t,e,r)=>(t[r]=e,t),[]),O2e=$X.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function P2e(t){return t.reduce((e,r)=>(e+=I2e[r],e),"")}function T2e(t){const e=[];for(const r of t){const n=O2e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const C2e=B2({prefix:"🚀",name:"base256emoji",encode:P2e,decode:T2e}),R2e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:C2e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const iq={...Qxe,...Jxe,...Zxe,...t2e,...i2e,...p2e,...y2e,...w2e,...S2e,...R2e};function kX(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const aq=kX("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),OT=kX("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=DX(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),LX={utf8:aq,"utf-8":aq,hex:iq.base16,latin1:OT,ascii:OT,binary:OT,...iq};function ms(t,e="utf8"){const r=LX[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?M4(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Ya(t,e="utf8"){const r=LX[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var sq=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},N2e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),D2e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),M2e=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),$2e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),k2e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),L2e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,j2e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,oq=3,U2e=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",L2e]],cq=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function F2e(t){return t?uq(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new k2e:typeof navigator<"u"?uq(navigator.userAgent):H2e()}function B2e(t){return t!==""&&U2e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function uq(t){var e=B2e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new $2e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<oq&&(i=sq(sq([],i,!0),z2e(oq-i.length),!0)):i=[];var a=i.join("."),s=q2e(t),o=j2e.exec(t);return o&&o[1]?new M2e(r,a,s,o[1]):new N2e(r,a,s)}function q2e(t){for(var e=0,r=cq.length;e<r;e++){var n=cq[e],i=n[0],a=n[1],s=a.exec(t);if(s)return i}return null}function H2e(){var t=typeof process<"u"&&process.version;return t?new D2e(process.version.slice(1)):null}function z2e(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Jt={};/*! *****************************************************************************
|
|
114
114
|
Copyright (c) Microsoft Corporation.
|
|
115
115
|
|
|
116
116
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -179,4 +179,4 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
179
179
|
Ephemeral address: ${H}
|
|
180
180
|
Expiration: ${M.toISOString()}`}N.getEphemeralMessage=B})(m=t.Authenticator||(t.Authenticator={}));const y=async(N,F)=>({nextAuthority:F.payload});t.SIGNER_VALIDATOR=y;const w=async(N,F)=>{if(!F.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_SIGNED_ENTITY_VALIDATOR'");const V=(0,f.recoverAddressFromEthSignature)(F.signature,F.payload),de=N.toLocaleLowerCase(),ve=V.toLocaleLowerCase();if(de===ve)return{nextAuthority:F.payload};throw new Error(`Invalid signer address. Expected: ${de}. Actual: ${ve}`)};t.ECDSA_SIGNED_ENTITY_VALIDATOR=w;const v=async(N,F,V)=>{if(!F.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_PERSONAL_EPHEMERAL_VALIDATOR'");const{message:de,ephemeralAddress:ve,expiration:U}=I(F.payload),L=V.dateToValidateExpirationInMillis?V.dateToValidateExpirationInMillis:Date.now();if(U>L){const Q=(0,f.recoverAddressFromEthSignature)(F.signature,de),ne=N.toLocaleLowerCase(),j=Q.toLocaleLowerCase();if(ne===j)return{nextAuthority:ve};throw new Error(`Invalid signer address. Expected: ${ne}. Actual: ${j}`)}throw new Error(`Ephemeral key expired. Expiration: ${U}. Test: ${L}`)};t.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR=v;const g=async(N,F,V)=>{if(!F.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_EIP_1654_EPHEMERAL_VALIDATOR'");const{message:de,ephemeralAddress:ve,expiration:U}=I(F.payload),L=V!=null&&V.dateToValidateExpirationInMillis?V==null?void 0:V.dateToValidateExpirationInMillis:Date.now();if(U>L&&await p(V.provider,N,de,F.signature,L))return{nextAuthority:ve};throw new Error(`Ephemeral key expired. Expiration: ${U}. Test: ${L}`)};t.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR=g;const _=async(N,F,V)=>{if(!F.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'EIP_1654_SIGNED_ENTITY_VALIDATOR'");if(await p(V.provider,N,F.payload,F.signature,V.dateToValidateExpirationInMillis))return{nextAuthority:F.payload};throw new Error("Invalid validation")};t.EIP_1654_SIGNED_ENTITY_VALIDATOR=_;const b=async(N,F)=>({error:"Error Validator."});function S(N){return N.length===h?o.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:o.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL}t.getEphemeralSignatureType=S;function A(N){return N.length===h?o.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:o.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY}t.getSignedIdentitySignatureType=A;function I(N){const F=N.replace(/\r/g,""),V=F.split(`
|
|
181
181
|
`),de=V[1].substring(19),ve=V[2].substring(12),U=Date.parse(ve);return{message:F,ephemeralAddress:de,expiration:U}}t.parseEmphemeralPayload=I;async function E(N,F,V,de){const ve=m.createEIP1271MessageHash(F),U=(0,a.hexToBytes)(V);let L;try{L=(0,a.bytesToHex)(await N.isValidSignature(ve,U,de))}catch{}if(L===t.ERC1654_MAGIC_VALUE)return!0;const Q=(0,f.createEthereumMessageHash)(F);try{L=(0,a.bytesToHex)(await N.isValidSignature(Q,U,de))}catch{}return L===t.ERC1654_MAGIC_VALUE}t.isValidEIP1271Signature=E;async function p(N,F,V,de,ve){if(!N)throw new Error("Missing provider");const U=new a.default(N),L=await(0,s.SignatureValidator)(U,F);let Q=await E(L,V,de);if(Q)return!0;const ne=new u.default(U);try{const{block:j}=await ne.getDate(ve,!1);if(Q=await E(L,V,de,j),Q)return!0}catch(j){throw new Error(`Invalid validation. Error: ${j.message}`)}throw new Error(`Invalid validation. Expected: ${t.ERC1654_MAGIC_VALUE}. Actual: ${Q}`)}function O(N){switch(N){case o.AuthLinkType.SIGNER:return t.SIGNER_VALIDATOR;case o.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:return t.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR;case o.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:return t.ECDSA_SIGNED_ENTITY_VALIDATOR;case o.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL:return t.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR;case o.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY:return t.EIP_1654_SIGNED_ENTITY_VALIDATOR;default:return b}}})(Wee);(function(t){var e=ke&&ke.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=ke&&ke.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Wee,t),r(bD,t)})(Kee);var pN={},qc={},gN={exports:{}},mN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function r(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(s){return typeof s}:r=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r(i)}function n(i){var a=typeof i=="string"||i instanceof String;if(!a){var s=r(i);throw i===null?s="null":s==="object"&&(s=i.constructor.name),new TypeError("Expected a string but received a ".concat(s))}}t.exports=e.default,t.exports.default=e.default})(mN,mN.exports);var SD=mN.exports,yN={exports:{}},vN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;for(var a in i)typeof n[a]>"u"&&(n[a]=i[a]);return n}t.exports=e.default,t.exports.default=e.default})(vN,vN.exports);var ote=vN.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var r=i(SD),n=i(ote);function i(o){return o&&o.__esModule?o:{default:o}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function s(o,c){(0,r.default)(o),c=(0,n.default)(c,a),c.allow_trailing_dot&&o[o.length-1]==="."&&(o=o.substring(0,o.length-1)),c.allow_wildcard===!0&&o.indexOf("*.")===0&&(o=o.substring(2));var u=o.split("."),f=u[u.length-1];return c.require_tld&&(u.length<2||!c.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(f)||/\s/.test(f))||!c.allow_numeric_tld&&/^\d+$/.test(f)?!1:u.every(function(h){return!(h.length>63&&!c.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(h)||/[\uff01-\uff5e]/.test(h)||/^-|-$/.test(h)||!c.allow_underscores&&/_/.test(h))})}t.exports=e.default,t.exports.default=e.default})(yN,yN.exports);var $4e=yN.exports,bN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var r=n(SD);function n(f){return f&&f.__esModule?f:{default:f}}var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(i,"[.]){3}").concat(i),s=new RegExp("^".concat(a,"$")),o="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(o,":){7}(?:").concat(o,"|:)|")+"(?:".concat(o,":){6}(?:").concat(a,"|:").concat(o,"|:)|")+"(?:".concat(o,":){5}(?::").concat(a,"|(:").concat(o,"){1,2}|:)|")+"(?:".concat(o,":){4}(?:(:").concat(o,"){0,1}:").concat(a,"|(:").concat(o,"){1,3}|:)|")+"(?:".concat(o,":){3}(?:(:").concat(o,"){0,2}:").concat(a,"|(:").concat(o,"){1,4}|:)|")+"(?:".concat(o,":){2}(?:(:").concat(o,"){0,3}:").concat(a,"|(:").concat(o,"){1,5}|:)|")+"(?:".concat(o,":){1}(?:(:").concat(o,"){0,4}:").concat(a,"|(:").concat(o,"){1,6}|:)|")+"(?::((?::".concat(o,"){0,5}:").concat(a,"|(?::").concat(o,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function u(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,r.default)(f),h=String(h),h?h==="4"?s.test(f):h==="6"?c.test(f):!1:u(f,4)||u(f,6)}t.exports=e.default,t.exports.default=e.default})(bN,bN.exports);var k4e=bN.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=_;var r=s(SD),n=s($4e),i=s(k4e),a=s(ote);function s(b){return b&&b.__esModule?b:{default:b}}function o(b,S){return m(b)||h(b,S)||u(b,S)||c()}function c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
182
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(b,S){if(b){if(typeof b=="string")return f(b,S);var A=Object.prototype.toString.call(b).slice(8,-1);if(A==="Object"&&b.constructor&&(A=b.constructor.name),A==="Map"||A==="Set")return Array.from(b);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return f(b,S)}}function f(b,S){(S==null||S>b.length)&&(S=b.length);for(var A=0,I=new Array(S);A<S;A++)I[A]=b[A];return I}function h(b,S){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(b)))){var A=[],I=!0,E=!1,p=void 0;try{for(var O=b[Symbol.iterator](),N;!(I=(N=O.next()).done)&&(A.push(N.value),!(S&&A.length===S));I=!0);}catch(F){E=!0,p=F}finally{try{!I&&O.return!=null&&O.return()}finally{if(E)throw p}}return A}}function m(b){if(Array.isArray(b))return b}var y={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},w=/^\[([^\]]+)\](?::([0-9]+))?$/;function v(b){return Object.prototype.toString.call(b)==="[object RegExp]"}function g(b,S){for(var A=0;A<S.length;A++){var I=S[A];if(b===I||v(I)&&I.test(b))return!0}return!1}function _(b,S){if((0,r.default)(b),!b||/[\s<>]/.test(b)||b.indexOf("mailto:")===0||(S=(0,a.default)(S,y),S.validate_length&&b.length>=2083)||!S.allow_fragments&&b.includes("#")||!S.allow_query_components&&(b.includes("?")||b.includes("&")))return!1;var A,I,E,p,O,N,F,V;if(F=b.split("#"),b=F.shift(),F=b.split("?"),b=F.shift(),F=b.split("://"),F.length>1){if(A=F.shift().toLowerCase(),S.require_valid_protocol&&S.protocols.indexOf(A)===-1)return!1}else{if(S.require_protocol)return!1;if(b.slice(0,2)==="//"){if(!S.allow_protocol_relative_urls)return!1;F[0]=b.slice(2)}}if(b=F.join("://"),b==="")return!1;if(F=b.split("/"),b=F.shift(),b===""&&!S.require_host)return!0;if(F=b.split("@"),F.length>1){if(S.disallow_auth||F[0]===""||(I=F.shift(),I.indexOf(":")>=0&&I.split(":").length>2))return!1;var de=I.split(":"),ve=o(de,2),U=ve[0],L=ve[1];if(U===""&&L==="")return!1}p=F.join("@"),N=null,V=null;var Q=p.match(w);if(Q?(E="",V=Q[1],N=Q[2]||null):(F=p.split(":"),E=F.shift(),F.length&&(N=F.join(":"))),N!==null&&N.length>0){if(O=parseInt(N,10),!/^[0-9]+$/.test(N)||O<=0||O>65535)return!1}else if(S.require_port)return!1;return S.host_whitelist?g(E,S.host_whitelist):E===""&&!S.require_host?!0:!(!(0,i.default)(E)&&!(0,n.default)(E,S)&&(!V||!(0,i.default)(V,6))||(E=E||V,S.host_blacklist&&g(E,S.host_blacklist)))}t.exports=e.default,t.exports.default=e.default})(gN,gN.exports);var L4e=gN.exports,ID={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.localStorageClearIdentity=t.localStorageStoreIdentity=t.localStorageGetIdentity=t.createMessage=t.SINGLE_SIGN_ON_TARGET=t.Action=void 0;var e;(function(o){o.GET="get",o.STORE="store",o.CLEAR="clear",o.PING="ping"})(e||(t.Action=e={})),t.SINGLE_SIGN_ON_TARGET="single-sign-on";function r(o){return{target:t.SINGLE_SIGN_ON_TARGET,...o}}t.createMessage=r;function n(o){const c=localStorage.getItem(s(o));if(!c)return null;let u;try{u=JSON.parse(c)}catch{return a(o),null}return u.expiration=new Date(u.expiration),u.expiration.getTime()<=Date.now()?(a(o),null):u}t.localStorageGetIdentity=n;function i(o,c){new Date(c.expiration).getTime()>Date.now()&&localStorage.setItem(s(o),JSON.stringify(c))}t.localStorageStoreIdentity=i;function a(o){localStorage.removeItem(s(o))}t.localStorageClearIdentity=a;function s(o){if(!/^0x[a-fA-F0-9]{40}$/.test(o))throw new Error("User must be a valid ethereum address");return`single-sign-on-${o.toLowerCase()}`}})(ID);Object.defineProperty(qc,"__esModule",{value:!0});qc.clearIdentity=qc.storeIdentity=qc.getIdentity=qc.init=void 0;const j4e=L4e,Qc=ID,cte=Qc.SINGLE_SIGN_ON_TARGET,Qz=500,U4e=5;let Yz=0,rx="";const F4e={protocols:["https"],require_protocol:!0};function B4e(t,e={}){if(!(0,j4e.default)(t,{...F4e,...e}))throw new Error(`Invalid url: ${t}`);if(rx)throw new Error("Already initialized");const r=document.createElement("iframe");r.id=cte,r.src=t,r.style.width="0",r.style.height="0",r.style.border="none",r.style.position="absolute",document.body.appendChild(r),rx=t}qc.init=B4e;async function q4e(t){let e;try{e=(await fA(await OD(),Qc.Action.GET,{user:t})).identity??null}catch(r){PD(r),e=(0,Qc.localStorageGetIdentity)(t)}return e}qc.getIdentity=q4e;async function H4e(t,e){try{await fA(await OD(),Qc.Action.STORE,{user:t,identity:e})}catch(r){PD(r),(0,Qc.localStorageStoreIdentity)(t,e)}}qc.storeIdentity=H4e;async function z4e(t){try{await fA(await OD(),Qc.Action.CLEAR,{user:t})}catch(e){PD(e),(0,Qc.localStorageClearIdentity)(t)}}qc.clearIdentity=z4e;async function OD(){if(!rx)throw new Error("Not initialized");for(let t=0;t<U4e;t++){const e=document.getElementById(cte),r=e==null?void 0:e.contentWindow;if(!r){await V4e(Qz);continue}try{await fA(r,Qc.Action.PING,{},Qz)}catch{continue}return r}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function fA(t,e,r,n=0){Yz++;const i=Yz;let a=null;const s=new Promise((o,c)=>{a=({data:u})=>{!u||u.target!==Qc.SINGLE_SIGN_ON_TARGET||u.id!==i||(u.error?c(new Error(u.error)):o(u))},window.addEventListener("message",a)});t.postMessage((0,Qc.createMessage)({id:i,action:e,...r}),rx);try{return await(n?Promise.race([s,new Promise((o,c)=>setTimeout(()=>c(new Error("Did not receive a response in time")),n))]):s)}catch(o){throw o}finally{a&&window.removeEventListener("message",a)}}function V4e(t){return new Promise(e=>setTimeout(e,t))}function PD(t){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",t.message)}(function(t){var e=ke&&ke.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=ke&&ke.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(qc,t),r(ID,t)})(pN);const G4e=60*24*30,K4e=Pf.getConfiguration().magic.apiKey;function W4e(t){switch(t){case mi.DISCORD:case mi.X:case mi.GOOGLE:case mi.APPLE:return sc.ProviderType.MAGIC;case mi.WALLET_CONNECT:case mi.METAMASK_MOBILE:return sc.ProviderType.WALLET_CONNECT_V2;case mi.COINBASE:case mi.WALLET_LINK:return sc.ProviderType.WALLET_LINK;case mi.FORTMATIC:return sc.ProviderType.FORTMATIC;case mi.METAMASK:case mi.DAPPER:case mi.SAMSUNG:return sc.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function Q4e(t,e){const r=new LR(e),n=BR.createRandom(),i={address:n.address.toString(),publicKey:_t(n.publicKey),privateKey:_t(n.privateKey)},a=await r.getSigner();return Kee.Authenticator.initializeAuthChain(t,i,G4e,s=>a.signMessage(s))}async function Y4e(t){const e=W4e(t);if(sc.ProviderType.MAGIC===e){const{Magic:n}=await ub(()=>Promise.resolve().then(()=>nD),void 0),{OAuthExtension:i}=await ub(()=>Promise.resolve().then(()=>aD),void 0),a=new n(K4e,{extensions:[new i]}),s=new URL(window.location.href);s.pathname="/callback",await a.oauth.loginWithRedirect({provider:t,redirectURI:s.href})}const r=await Pf.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}async function J4e(t,e){let r;const n=await pN.getIdentity(t)&&null;return n?r=n:(r=await Q4e(t,e),await pN.storeIdentity(t,r)),r}const X4e="_main_r3wb8_1",Z4e="_left_r3wb8_7",eDe="_connection_r3wb8_16",tDe="_right_r3wb8_20",rDe="_footer_r3wb8_31",Uy={main:X4e,left:Z4e,connection:eDe,right:tDe,footer:rDe},nDe=()=>{const[t,e]=Ze.useState(Bu.CONNECTING_WALLET),[r,n]=Ze.useState(!1),[i,a]=Ze.useState(!1),s=Aee(),o=b8(),c=Ze.useCallback(()=>{n(!r)},[n,r]),u=Ze.useCallback(async h=>{var m;a(!0),e(Bu.CONNECTING_WALLET);try{const y=await Y4e(h);e(Bu.WAITING_FOR_SIGNATURE),await J4e(((m=y.account)==null?void 0:m.toLowerCase())??"",y.provider),s?window.location.href=s:o("/user"),a(!1)}catch{e(Bu.ERROR)}},[e,a,s]),f=Ze.useCallback(()=>{a(!1),e(Bu.CONNECTING_WALLET)},[a]);return ft.jsxs("main",{className:Uy.main,children:[ft.jsx(K5e,{open:r,onClose:c}),ft.jsx(U5e,{open:i,state:t,onClose:f,onTryAgain:()=>console.log("On try again")}),ft.jsx("div",{className:Uy.left,children:ft.jsx(i5e,{className:Uy.connection,onLearnMore:c,onConnect:u,socialOptions:{primary:mi.GOOGLE,secondary:[mi.DISCORD,mi.APPLE,mi.X]},web3Options:{primary:mi.METAMASK,secondary:[mi.FORTMATIC,mi.COINBASE,mi.WALLET_CONNECT]}})}),ft.jsx("div",{className:Uy.right,children:ft.jsxs("div",{className:Uy.footer,children:[ft.jsx("p",{children:"Want better graphics and faster speed?"}),ft.jsxs("span",{children:["👉 ",ft.jsx("a",{href:"https://decentraland.org/download/",target:"_blank",rel:"noreferrer",children:ft.jsx("b",{children:"Download desktop client"})})]})]})})]})};Nue.render(ft.jsx(hV.StrictMode,{children:ft.jsx(xle,{children:ft.jsxs(_le,{children:[ft.jsx(Vy,{path:"/login",element:ft.jsx(nDe,{})}),ft.jsx(Vy,{path:"/callback",element:ft.jsx(K6e,{})}),ft.jsx(Vy,{path:"/user",element:ft.jsx(N6e,{})}),ft.jsx(Vy,{path:"*",element:ft.jsx(z6e,{})})]})})}),document.getElementById("root"));export{V2e as _,Xn as a,Df as b,ke as c,Es as e,js as g,NX as r};
|
|
182
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(b,S){if(b){if(typeof b=="string")return f(b,S);var A=Object.prototype.toString.call(b).slice(8,-1);if(A==="Object"&&b.constructor&&(A=b.constructor.name),A==="Map"||A==="Set")return Array.from(b);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return f(b,S)}}function f(b,S){(S==null||S>b.length)&&(S=b.length);for(var A=0,I=new Array(S);A<S;A++)I[A]=b[A];return I}function h(b,S){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(b)))){var A=[],I=!0,E=!1,p=void 0;try{for(var O=b[Symbol.iterator](),N;!(I=(N=O.next()).done)&&(A.push(N.value),!(S&&A.length===S));I=!0);}catch(F){E=!0,p=F}finally{try{!I&&O.return!=null&&O.return()}finally{if(E)throw p}}return A}}function m(b){if(Array.isArray(b))return b}var y={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},w=/^\[([^\]]+)\](?::([0-9]+))?$/;function v(b){return Object.prototype.toString.call(b)==="[object RegExp]"}function g(b,S){for(var A=0;A<S.length;A++){var I=S[A];if(b===I||v(I)&&I.test(b))return!0}return!1}function _(b,S){if((0,r.default)(b),!b||/[\s<>]/.test(b)||b.indexOf("mailto:")===0||(S=(0,a.default)(S,y),S.validate_length&&b.length>=2083)||!S.allow_fragments&&b.includes("#")||!S.allow_query_components&&(b.includes("?")||b.includes("&")))return!1;var A,I,E,p,O,N,F,V;if(F=b.split("#"),b=F.shift(),F=b.split("?"),b=F.shift(),F=b.split("://"),F.length>1){if(A=F.shift().toLowerCase(),S.require_valid_protocol&&S.protocols.indexOf(A)===-1)return!1}else{if(S.require_protocol)return!1;if(b.slice(0,2)==="//"){if(!S.allow_protocol_relative_urls)return!1;F[0]=b.slice(2)}}if(b=F.join("://"),b==="")return!1;if(F=b.split("/"),b=F.shift(),b===""&&!S.require_host)return!0;if(F=b.split("@"),F.length>1){if(S.disallow_auth||F[0]===""||(I=F.shift(),I.indexOf(":")>=0&&I.split(":").length>2))return!1;var de=I.split(":"),ve=o(de,2),U=ve[0],L=ve[1];if(U===""&&L==="")return!1}p=F.join("@"),N=null,V=null;var Q=p.match(w);if(Q?(E="",V=Q[1],N=Q[2]||null):(F=p.split(":"),E=F.shift(),F.length&&(N=F.join(":"))),N!==null&&N.length>0){if(O=parseInt(N,10),!/^[0-9]+$/.test(N)||O<=0||O>65535)return!1}else if(S.require_port)return!1;return S.host_whitelist?g(E,S.host_whitelist):E===""&&!S.require_host?!0:!(!(0,i.default)(E)&&!(0,n.default)(E,S)&&(!V||!(0,i.default)(V,6))||(E=E||V,S.host_blacklist&&g(E,S.host_blacklist)))}t.exports=e.default,t.exports.default=e.default})(gN,gN.exports);var L4e=gN.exports,ID={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.localStorageClearIdentity=t.localStorageStoreIdentity=t.localStorageGetIdentity=t.createMessage=t.SINGLE_SIGN_ON_TARGET=t.Action=void 0;var e;(function(o){o.GET="get",o.STORE="store",o.CLEAR="clear",o.PING="ping"})(e||(t.Action=e={})),t.SINGLE_SIGN_ON_TARGET="single-sign-on";function r(o){return{target:t.SINGLE_SIGN_ON_TARGET,...o}}t.createMessage=r;function n(o){const c=localStorage.getItem(s(o));if(!c)return null;let u;try{u=JSON.parse(c)}catch{return a(o),null}return u.expiration=new Date(u.expiration),u.expiration.getTime()<=Date.now()?(a(o),null):u}t.localStorageGetIdentity=n;function i(o,c){new Date(c.expiration).getTime()>Date.now()&&localStorage.setItem(s(o),JSON.stringify(c))}t.localStorageStoreIdentity=i;function a(o){localStorage.removeItem(s(o))}t.localStorageClearIdentity=a;function s(o){if(!/^0x[a-fA-F0-9]{40}$/.test(o))throw new Error("User must be a valid ethereum address");return`single-sign-on-${o.toLowerCase()}`}})(ID);Object.defineProperty(qc,"__esModule",{value:!0});qc.clearIdentity=qc.storeIdentity=qc.getIdentity=qc.init=void 0;const j4e=L4e,Qc=ID,cte=Qc.SINGLE_SIGN_ON_TARGET,Qz=500,U4e=5;let Yz=0,rx="";const F4e={protocols:["https"],require_protocol:!0};function B4e(t,e={}){if(!(0,j4e.default)(t,{...F4e,...e}))throw new Error(`Invalid url: ${t}`);if(rx)throw new Error("Already initialized");const r=document.createElement("iframe");r.id=cte,r.src=t,r.style.width="0",r.style.height="0",r.style.border="none",r.style.position="absolute",document.body.appendChild(r),rx=t}qc.init=B4e;async function q4e(t){let e;try{e=(await fA(await OD(),Qc.Action.GET,{user:t})).identity??null}catch(r){PD(r),e=(0,Qc.localStorageGetIdentity)(t)}return e}qc.getIdentity=q4e;async function H4e(t,e){try{await fA(await OD(),Qc.Action.STORE,{user:t,identity:e})}catch(r){PD(r),(0,Qc.localStorageStoreIdentity)(t,e)}}qc.storeIdentity=H4e;async function z4e(t){try{await fA(await OD(),Qc.Action.CLEAR,{user:t})}catch(e){PD(e),(0,Qc.localStorageClearIdentity)(t)}}qc.clearIdentity=z4e;async function OD(){if(!rx)throw new Error("Not initialized");for(let t=0;t<U4e;t++){const e=document.getElementById(cte),r=e==null?void 0:e.contentWindow;if(!r){await V4e(Qz);continue}try{await fA(r,Qc.Action.PING,{},Qz)}catch{continue}return r}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function fA(t,e,r,n=0){Yz++;const i=Yz;let a=null;const s=new Promise((o,c)=>{a=({data:u})=>{!u||u.target!==Qc.SINGLE_SIGN_ON_TARGET||u.id!==i||(u.error?c(new Error(u.error)):o(u))},window.addEventListener("message",a)});t.postMessage((0,Qc.createMessage)({id:i,action:e,...r}),rx);try{return await(n?Promise.race([s,new Promise((o,c)=>setTimeout(()=>c(new Error("Did not receive a response in time")),n))]):s)}catch(o){throw o}finally{a&&window.removeEventListener("message",a)}}function V4e(t){return new Promise(e=>setTimeout(e,t))}function PD(t){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",t.message)}(function(t){var e=ke&&ke.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a);var o=Object.getOwnPropertyDescriptor(i,a);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,s,o)}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=ke&&ke.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(qc,t),r(ID,t)})(pN);const G4e=60*24*30,K4e=Pf.getConfiguration().magic.apiKey;function W4e(t){switch(t){case mi.DISCORD:case mi.X:case mi.GOOGLE:case mi.APPLE:return sc.ProviderType.MAGIC;case mi.WALLET_CONNECT:case mi.METAMASK_MOBILE:return sc.ProviderType.WALLET_CONNECT_V2;case mi.COINBASE:case mi.WALLET_LINK:return sc.ProviderType.WALLET_LINK;case mi.FORTMATIC:return sc.ProviderType.FORTMATIC;case mi.METAMASK:case mi.DAPPER:case mi.SAMSUNG:return sc.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function Q4e(t,e){const r=new LR(e),n=BR.createRandom(),i={address:n.address.toString(),publicKey:_t(n.publicKey),privateKey:_t(n.privateKey)},a=await r.getSigner();return Kee.Authenticator.initializeAuthChain(t,i,G4e,s=>a.signMessage(s))}async function Y4e(t){const e=W4e(t);if(sc.ProviderType.MAGIC===e){const{Magic:n}=await ub(()=>Promise.resolve().then(()=>nD),void 0),{OAuthExtension:i}=await ub(()=>Promise.resolve().then(()=>aD),void 0),a=new n(K4e,{extensions:[new i]}),s=new URL(window.location.href);s.pathname="/callback",await a.oauth.loginWithRedirect({provider:t,redirectURI:s.href})}const r=await Pf.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}async function J4e(t,e){let r;const n=await pN.getIdentity(t)&&null;return n?r=n:(r=await Q4e(t,e),await pN.storeIdentity(t,r)),r}const X4e="_main_r3wb8_1",Z4e="_left_r3wb8_7",eDe="_connection_r3wb8_16",tDe="_right_r3wb8_20",rDe="_footer_r3wb8_31",Uy={main:X4e,left:Z4e,connection:eDe,right:tDe,footer:rDe},nDe=()=>{const[t,e]=Ze.useState(Bu.CONNECTING_WALLET),[r,n]=Ze.useState(!1),[i,a]=Ze.useState(!1),s=Aee(),o=b8(),c=Ze.useCallback(()=>{n(!r)},[n,r]),u=Ze.useCallback(async h=>{var m;a(!0),e(Bu.CONNECTING_WALLET);try{const y=await Y4e(h);e(Bu.WAITING_FOR_SIGNATURE),await J4e(((m=y.account)==null?void 0:m.toLowerCase())??"",y.provider),s?window.location.href=s:o("/user"),a(!1)}catch{e(Bu.ERROR)}},[e,a,s]),f=Ze.useCallback(()=>{a(!1),e(Bu.CONNECTING_WALLET)},[a]);return ft.jsxs("main",{className:Uy.main,children:[ft.jsx(K5e,{open:r,onClose:c}),ft.jsx(U5e,{open:i,state:t,onClose:f,onTryAgain:()=>console.log("On try again")}),ft.jsx("div",{className:Uy.left,children:ft.jsx(i5e,{className:Uy.connection,onLearnMore:c,onConnect:u,socialOptions:{primary:mi.GOOGLE,secondary:[mi.DISCORD,mi.APPLE,mi.X]},web3Options:{primary:mi.METAMASK,secondary:[mi.FORTMATIC,mi.COINBASE,mi.WALLET_CONNECT]}})}),ft.jsx("div",{className:Uy.right,children:ft.jsxs("div",{className:Uy.footer,children:[ft.jsx("p",{children:"Want better graphics and faster speed?"}),ft.jsxs("span",{children:["👉 ",ft.jsx("a",{href:"https://decentraland.org/download/",target:"_blank",rel:"noreferrer",children:ft.jsx("b",{children:"Download desktop client"})})]})]})})]})};const iDe=/^decentraland.(zone|org|today)$/.test(window.location.host)?"/auth":"/";Nue.render(ft.jsx(hV.StrictMode,{children:ft.jsx(xle,{basename:iDe,children:ft.jsxs(_le,{children:[ft.jsx(Vy,{path:"/login",element:ft.jsx(nDe,{})}),ft.jsx(Vy,{path:"/callback",element:ft.jsx(K6e,{})}),ft.jsx(Vy,{path:"/user",element:ft.jsx(N6e,{})}),ft.jsx(Vy,{path:"*",element:ft.jsx(z6e,{})})]})})}),document.getElementById("root"));export{V2e as _,Xn as a,Df as b,ke as c,Es as e,js as g,NX as r};
|