Files
to_session/text/3.65.22_0/scripts/ui/chunk-QVMDY4IS.js
Administrator a0720d80dc fefdwef
2025-11-12 12:54:37 +08:00

28 lines
1.4 MiB
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{a as jce}from"./chunk-ZKM5ZEJR.js";import{b as Rce}from"./chunk-BO2NVVQH.js";import{a as mce}from"./chunk-L625DEVK.js";import{qa as su,ra as iu}from"./chunk-GSIHKWLV.js";import{a as kce,b as Nce,c as wB,d as Ice}from"./chunk-4XEB4VJJ.js";import{b as c7,c as mB}from"./chunk-OKJNV4PS.js";import{a as yB}from"./chunk-EFTDVKCQ.js";import{a as Bce}from"./chunk-VUY7Z5T2.js";import{a as Oce}from"./chunk-5KLUABHD.js";import{a as jq}from"./chunk-KQL2BBUZ.js";import{a as wce,b as vce,c as Ace,d as Ece,e as Sce,f as Tce}from"./chunk-YUSIJWOC.js";import{a as xce}from"./chunk-YHVKZE66.js";import{k as Pce}from"./chunk-2DSLTDTL.js";import{a as _ce}from"./chunk-UVIVAH5I.js";import{a as Rq,b as yce}from"./chunk-ALIHWT7Z.js";import{a as fce,b as dce,e as lce,g as hce,h as bce,k as Iq,l as pce,m as gce}from"./chunk-IAFVNOEB.js";import{a as xB}from"./chunk-DUYWEMAT.js";import{d as o7,e as uce}from"./chunk-WMCBVXPA.js";import{a as Nq,c as R,g as ao,h as N,i as l,j as I,k as _,l as $s,m as $,o as b,p as v,q as p}from"./chunk-QTLWQ5AJ.js";var Kb=R(ze=>{"use strict";b();p();Object.defineProperty(ze,"__esModule",{value:!0});ze.bytes=ze.stringToBytes=ze.str=ze.bytesToString=ze.hex=ze.utf8=ze.bech32m=ze.bech32=ze.base58check=ze.base58xmr=ze.base58xrp=ze.base58flickr=ze.base58=ze.base64url=ze.base64=ze.base32crockford=ze.base32hex=ze.base32=ze.base16=ze.utils=ze.assertNumber=void 0;function ol(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}ze.assertNumber=ol;function au(...r){let e=(s,i)=>a=>s(i(a)),t=Array.from(r).reverse().reduce((s,i)=>s?e(s,i.encode):i.encode,void 0),n=r.reduce((s,i)=>s?e(s,i.decode):i.decode,void 0);return{encode:t,decode:n}}function vf(r){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(t=>{if(ol(t),t<0||t>=r.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${r.length})`);return r[t]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(t=>{if(typeof t!="string")throw new Error(`alphabet.decode: not string element=${t}`);let n=r.indexOf(t);if(n===-1)throw new Error(`Unknown letter: "${t}". Allowed: ${r}`);return n})}}}function Pf(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let t of e)if(typeof t!="string")throw new Error(`join.encode: non-string input=${t}`);return e.join(r)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(r)}}}function aw(r,e="="){if(ol(r),typeof e!="string")throw new Error("padding chr should be string");return{encode(t){if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;t.length*r%8;)t.push(e);return t},decode(t){if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("padding.encode input should be array of strings");for(let s of t)if(typeof s!="string")throw new Error(`padding.decode: non-string input=${s}`);let n=t.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&t[n-1]===e;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return t.slice(0,n)}}}function qq(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>r(e)}}function Mq(r,e,t){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(t<2)throw new Error(`convertRadix: wrong to=${t}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,s=[],i=Array.from(r);for(i.forEach(a=>{if(ol(a),a<0||a>=e)throw new Error(`Wrong integer: ${a}`)});;){let a=0,o=!0;for(let c=n;c<i.length;c++){let u=i[c],f=e*a+u;if(!Number.isSafeInteger(f)||e*a/e!==a||f-u!==e*a)throw new Error("convertRadix: carry overflow");if(a=f%t,i[c]=Math.floor(f/t),!Number.isSafeInteger(i[c])||i[c]*t+a!==f)throw new Error("convertRadix: carry overflow");if(o)i[c]?o=!1:n=c;else continue}if(s.push(a),o)break}for(let a=0;a<r.length-1&&r[a]===0;a++)s.push(0);return s.reverse()}var Dq=(r,e)=>e?Dq(e,r%e):r,u7=(r,e)=>r+(e-Dq(r,e));function vB(r,e,t,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(t<=0||t>32)throw new Error(`convertRadix2: wrong to=${t}`);if(u7(e,t)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${t} carryBits=${u7(e,t)}`);let s=0,i=0,a=2**t-1,o=[];for(let c of r){if(ol(c),c>=2**e)throw new Error(`convertRadix2: invalid data word=${c} from=${e}`);if(s=s<<e|c,i+e>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${e}`);for(i+=e;i>=t;i-=t)o.push((s>>i-t&a)>>>0);s&=2**i-1}if(s=s<<t-i&a,!n&&i>=e)throw new Error("Excess padding");if(!n&&s)throw new Error(`Non-zero padding: ${s}`);return n&&i>0&&o.push(s>>>0),o}function Hq(r){return ol(r),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return Mq(Array.from(e),2**8,r)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(Mq(e,r,2**8))}}}function D0(r,e=!1){if(ol(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(u7(8,r)>32||u7(r,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return vB(Array.from(t),8,r,!e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(vB(t,r,8,e))}}}function Cq(r){if(typeof r!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return r.apply(null,e)}catch{}}}function Kq(r,e){if(ol(r),typeof e!="function")throw new Error("checksum fn should be function");return{encode(t){if(!(t instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=e(t).slice(0,r),s=new Uint8Array(t.length+r);return s.set(t),s.set(n,t.length),s},decode(t){if(!(t instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=t.slice(0,-r),s=e(n).slice(0,r),i=t.slice(-r);for(let a=0;a<r;a++)if(s[a]!==i[a])throw new Error("Invalid checksum");return n}}}ze.utils={alphabet:vf,chain:au,checksum:Kq,radix:Hq,radix2:D0,join:Pf,padding:aw};ze.base16=au(D0(4),vf("0123456789ABCDEF"),Pf(""));ze.base32=au(D0(5),vf("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),aw(5),Pf(""));ze.base32hex=au(D0(5),vf("0123456789ABCDEFGHIJKLMNOPQRSTUV"),aw(5),Pf(""));ze.base32crockford=au(D0(5),vf("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Pf(""),qq(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));ze.base64=au(D0(6),vf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),aw(6),Pf(""));ze.base64url=au(D0(6),vf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),aw(6),Pf(""));var _B=r=>au(Hq(58),vf(r),Pf(""));ze.base58=_B("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");ze.base58flickr=_B("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");ze.base58xrp=_B("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var Lq=[0,2,3,5,6,7,9,10,11];ze.base58xmr={encode(r){let e="";for(let t=0;t<r.length;t+=8){let n=r.subarray(t,t+8);e+=ze.base58.encode(n).padStart(Lq[n.length],"1")}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=11){let n=r.slice(t,t+11),s=Lq.indexOf(n.length),i=ze.base58.decode(n);for(let a=0;a<i.length-s;a++)if(i[a]!==0)throw new Error("base58xmr: wrong padding");e=e.concat(Array.from(i.slice(i.length-s)))}return Uint8Array.from(e)}};var Mce=r=>au(Kq(4,e=>r(r(e))),ze.base58);ze.base58check=Mce;var PB=au(vf("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Pf("")),Uq=[996825010,642813549,513874426,1027748829,705979059];function sw(r){let e=r>>25,t=(r&33554431)<<5;for(let n=0;n<Uq.length;n++)(e>>n&1)===1&&(t^=Uq[n]);return t}function Fq(r,e,t=1){let n=r.length,s=1;for(let i=0;i<n;i++){let a=r.charCodeAt(i);if(a<33||a>126)throw new Error(`Invalid prefix (${r})`);s=sw(s)^a>>5}s=sw(s);for(let i=0;i<n;i++)s=sw(s)^r.charCodeAt(i)&31;for(let i of e)s=sw(s)^i;for(let i=0;i<6;i++)s=sw(s);return s^=t,PB.encode(vB([s%2**30],30,5,!1))}function Gq(r){let e=r==="bech32"?1:734539939,t=D0(5),n=t.decode,s=t.encode,i=Cq(n);function a(f,d,g=90){if(typeof f!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof f}`);if(!Array.isArray(d)||d.length&&typeof d[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof d}`);let h=f.length+7+d.length;if(g!==!1&&h>g)throw new TypeError(`Length ${h} exceeds limit ${g}`);return f=f.toLowerCase(),`${f}1${PB.encode(d)}${Fq(f,d,e)}`}function o(f,d=90){if(typeof f!="string")throw new Error(`bech32.decode input should be string, not ${typeof f}`);if(f.length<8||d!==!1&&f.length>d)throw new TypeError(`Wrong string length: ${f.length} (${f}). Expected (8..${d})`);let g=f.toLowerCase();if(f!==g&&f!==f.toUpperCase())throw new Error("String must be lowercase or uppercase");f=g;let h=f.lastIndexOf("1");if(h===0||h===-1)throw new Error('Letter "1" must be present between prefix and data only');let[m,y]=[f.slice(0,h),f.slice(h+1)];if(y.length<6)throw new Error("Data must be at least 6 characters long");let S=PB.decode(y).slice(0,-6),T=Fq(m,S,e);if(!y.endsWith(T))throw new Error(`Invalid checksum in ${f}: expected "${T}"`);return{prefix:m,words:S}}let c=Cq(o);function u(f){let{prefix:d,words:g}=o(f,!1);return{prefix:d,words:g,bytes:n(g)}}return{encode:a,decode:o,decodeToBytes:u,decodeUnsafe:c,fromWords:n,fromWordsUnsafe:i,toWords:s}}ze.bech32=Gq("bech32");ze.bech32m=Gq("bech32m");ze.utf8={encode:r=>new TextDecoder().decode(r),decode:r=>new TextEncoder().encode(r)};ze.hex=au(D0(4),vf("0123456789abcdef"),Pf(""),qq(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var iw={utf8:ze.utf8,hex:ze.hex,base16:ze.base16,base32:ze.base32,base64:ze.base64,base64url:ze.base64url,base58:ze.base58,base58xmr:ze.base58xmr},Vq=`Invalid encoding type. Available types: ${Object.keys(iw).join(", ")}`,Cce=(r,e)=>{if(typeof r!="string"||!iw.hasOwnProperty(r))throw new TypeError(Vq);if(!(e instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return iw[r].encode(e)};ze.bytesToString=Cce;ze.str=ze.bytesToString;var Lce=(r,e)=>{if(!iw.hasOwnProperty(r))throw new TypeError(Vq);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return iw[r].decode(e)};ze.stringToBytes=Lce;ze.bytes=ze.stringToBytes});var zq=R(cl=>{"use strict";b();p();Object.defineProperty(cl,"__esModule",{value:!0});cl.base58=cl.fromBase58=cl.toBase58=void 0;var AB=Kb();Object.defineProperty(cl,"base58",{enumerable:!0,get:function(){return AB.base58}});function Uce(r){let e=v.Buffer.from(r);return AB.base58.encode(Uint8Array.from(e))}cl.toBase58=Uce;function Fce(r){return AB.base58.decode(r)}cl.fromBase58=Fce});var Wq=R(f7=>{"use strict";b();p();Object.defineProperty(f7,"__esModule",{value:!0});f7.crypto=void 0;f7.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var bi=R((lt,ow)=>{"use strict";b();p();Object.defineProperty(lt,"__esModule",{value:!0});lt.randomBytes=lt.wrapConstructorWithOpts=lt.wrapConstructor=lt.checkOpts=lt.Hash=lt.assertHash=lt.assertBytes=lt.assertBool=lt.assertNumber=lt.concatBytes=lt.toBytes=lt.utf8ToBytes=lt.asyncLoop=lt.nextTick=lt.hexToBytes=lt.bytesToHex=lt.isLE=lt.rotr=lt.createView=lt.u32=lt.u8=void 0;var d7=Wq(),qce=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);lt.u8=qce;var Dce=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));lt.u32=Dce;var Hce=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);lt.createView=Hce;var Kce=(r,e)=>r<<32-e|r>>>e;lt.rotr=Kce;lt.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!lt.isLE)throw new Error("Non little-endian hardware is not supported");var Gce=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Vce(r){let e="";for(let t=0;t<r.length;t++)e+=Gce[r[t]];return e}lt.bytesToHex=Vce;function zce(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(r.length/2);for(let t=0;t<e.length;t++){let n=t*2,s=r.slice(n,n+2),i=Number.parseInt(s,16);if(Number.isNaN(i))throw new Error("Invalid byte sequence");e[t]=i}return e}lt.hexToBytes=zce;lt.nextTick=(()=>{let r=typeof ow<"u"&&typeof ow.require=="function"&&ow.require.bind(ow);try{if(r){let{setImmediate:e}=r("timers");return()=>new Promise(t=>e(t))}}catch{}return()=>new Promise(e=>setTimeout(e,0))})();async function Wce(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,lt.nextTick)(),n+=i)}}lt.asyncLoop=Wce;function $q(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}lt.utf8ToBytes=$q;function TB(r){if(typeof r=="string"&&(r=$q(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}lt.toBytes=TB;function $ce(...r){if(!r.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(r.length===1)return r[0];let e=r.reduce((n,s)=>n+s.length,0),t=new Uint8Array(e);for(let n=0,s=0;n<r.length;n++){let i=r[n];t.set(i,s),s+=i.length}return t}lt.concatBytes=$ce;function EB(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}lt.assertNumber=EB;function Jce(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}lt.assertBool=Jce;function Zce(r,...e){if(!(r instanceof Uint8Array&&(!e.length||e.includes(r.length))))throw new TypeError(`Expected ${e} bytes, not ${typeof r} with length=${r.length}`)}lt.assertBytes=Zce;function Qce(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");EB(r.outputLen),EB(r.blockLen)}lt.assertHash=Qce;var SB=class{clone(){return this._cloneInto()}};lt.Hash=SB;var Yce=r=>Object.prototype.toString.call(r)==="[object Object]"&&r.constructor===Object;function Xce(r,e){if(e!==void 0&&(typeof e!="object"||!Yce(e)))throw new TypeError("Options should be object or undefined");return Object.assign(r,e)}lt.checkOpts=Xce;function eue(r){let e=n=>r().update(TB(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}lt.wrapConstructor=eue;function tue(r){let e=(n,s)=>r(s).update(TB(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}lt.wrapConstructorWithOpts=tue;function rue(r=32){if(d7.crypto.web)return d7.crypto.web.getRandomValues(new Uint8Array(r));if(d7.crypto.node)return new Uint8Array(d7.crypto.node.randomBytes(r).buffer);throw new Error("The environment doesn't have randomBytes function")}lt.randomBytes=rue});var h7=R(l7=>{"use strict";b();p();Object.defineProperty(l7,"__esModule",{value:!0});l7.SHA2=void 0;var cw=bi();function nue(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),a=Number(t>>s&i),o=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,a,n),r.setUint32(e+u,o,n)}var OB=class extends cw.Hash{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,cw.createView)(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");let{view:t,buffer:n,blockLen:s,finished:i}=this;if(i)throw new Error("digest() was already called");e=(0,cw.toBytes)(e);let a=e.length;for(let o=0;o<a;){let c=Math.min(s-this.pos,a-o);if(c===s){let u=(0,cw.createView)(e);for(;s<=a-o;o+=s)this.process(u,o);continue}n.set(e.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let c=a;c<s;c++)t[c]=0;nue(n,s-8,BigInt(this.length*8),i),this.process(n,0);let o=(0,cw.createView)(e);this.get().forEach((c,u)=>o.setUint32(4*u,c,i))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:a,pos:o}=this;return e.length=s,e.pos=o,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(n),e}};l7.SHA2=OB});var Ix=R(b7=>{"use strict";b();p();Object.defineProperty(b7,"__esModule",{value:!0});b7.sha256=void 0;var sue=h7(),ou=bi(),iue=(r,e,t)=>r&e^~r&t,aue=(r,e,t)=>r&e^r&t^e&t,oue=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]),ul=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),fl=new Uint32Array(64),BB=class extends sue.SHA2{constructor(){super(64,32,8,!1),this.A=ul[0]|0,this.B=ul[1]|0,this.C=ul[2]|0,this.D=ul[3]|0,this.E=ul[4]|0,this.F=ul[5]|0,this.G=ul[6]|0,this.H=ul[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:a,G:o,H:c}=this;return[e,t,n,s,i,a,o,c]}set(e,t,n,s,i,a,o,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,t){for(let d=0;d<16;d++,t+=4)fl[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=fl[d-15],h=fl[d-2],m=(0,ou.rotr)(g,7)^(0,ou.rotr)(g,18)^g>>>3,y=(0,ou.rotr)(h,17)^(0,ou.rotr)(h,19)^h>>>10;fl[d]=y+fl[d-7]+m+fl[d-16]|0}let{A:n,B:s,C:i,D:a,E:o,F:c,G:u,H:f}=this;for(let d=0;d<64;d++){let g=(0,ou.rotr)(o,6)^(0,ou.rotr)(o,11)^(0,ou.rotr)(o,25),h=f+g+iue(o,c,u)+oue[d]+fl[d]|0,y=((0,ou.rotr)(n,2)^(0,ou.rotr)(n,13)^(0,ou.rotr)(n,22))+aue(n,s,i)|0;f=u,u=c,c=o,o=a+h|0,a=i,i=s,s=n,n=h+y|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+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,s,i,a,o,c,u,f)}roundClean(){fl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};b7.sha256=(0,ou.wrapConstructor)(()=>new BB)});var Rx=R(ht=>{"use strict";b();p();Object.defineProperty(ht,"__esModule",{value:!0});ht.add5H=ht.add5L=ht.add4H=ht.add4L=ht.add3H=ht.add3L=ht.add=ht.rotlBL=ht.rotlBH=ht.rotlSL=ht.rotlSH=ht.rotr32L=ht.rotr32H=ht.rotrBL=ht.rotrBH=ht.rotrSL=ht.rotrSH=ht.shrSL=ht.shrSH=ht.toBig=ht.split=ht.fromBig=void 0;var p7=BigInt(2**32-1),kB=BigInt(32);function Jq(r,e=!1){return e?{h:Number(r&p7),l:Number(r>>kB&p7)}:{h:Number(r>>kB&p7)|0,l:Number(r&p7)|0}}ht.fromBig=Jq;function cue(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:a}=Jq(r[s],e);[t[s],n[s]]=[i,a]}return[t,n]}ht.split=cue;var uue=(r,e)=>BigInt(r>>>0)<<kB|BigInt(e>>>0);ht.toBig=uue;var fue=(r,e,t)=>r>>>t;ht.shrSH=fue;var due=(r,e,t)=>r<<32-t|e>>>t;ht.shrSL=due;var lue=(r,e,t)=>r>>>t|e<<32-t;ht.rotrSH=lue;var hue=(r,e,t)=>r<<32-t|e>>>t;ht.rotrSL=hue;var bue=(r,e,t)=>r<<64-t|e>>>t-32;ht.rotrBH=bue;var pue=(r,e,t)=>r>>>t-32|e<<64-t;ht.rotrBL=pue;var gue=(r,e)=>e;ht.rotr32H=gue;var xue=(r,e)=>r;ht.rotr32L=xue;var yue=(r,e,t)=>r<<t|e>>>32-t;ht.rotlSH=yue;var mue=(r,e,t)=>e<<t|r>>>32-t;ht.rotlSL=mue;var wue=(r,e,t)=>e<<t-32|r>>>64-t;ht.rotlBH=wue;var vue=(r,e,t)=>r<<t-32|e>>>64-t;ht.rotlBL=vue;function Pue(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}ht.add=Pue;var _ue=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);ht.add3L=_ue;var Aue=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;ht.add3H=Aue;var Eue=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);ht.add4L=Eue;var Sue=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;ht.add4H=Sue;var Tue=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);ht.add5L=Tue;var Oue=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;ht.add5H=Oue});var g7=R(Ti=>{"use strict";b();p();var Bue=Ti&&Ti.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),kue=Ti&&Ti.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Nue=Ti&&Ti.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Bue(e,r,t);return kue(e,r),e};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.sha384=Ti.sha512_256=Ti.sha512=Ti.SHA512=void 0;var Iue=h7(),jt=Nue(Rx()),RB=bi(),[Rue,jue]=jt.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(r=>BigInt(r))),dl=new Uint32Array(80),ll=new Uint32Array(80),jx=class extends Iue.SHA2{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(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:a,Dh:o,Dl:c,Eh:u,El:f,Fh:d,Fl:g,Gh:h,Gl:m,Hh:y,Hl:S}=this;return[e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S]}set(e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=d|0,this.Fl=g|0,this.Gh=h|0,this.Gl=m|0,this.Hh=y|0,this.Hl=S|0}process(e,t){for(let C=0;C<16;C++,t+=4)dl[C]=e.getUint32(t),ll[C]=e.getUint32(t+=4);for(let C=16;C<80;C++){let J=dl[C-15]|0,z=ll[C-15]|0,W=jt.rotrSH(J,z,1)^jt.rotrSH(J,z,8)^jt.shrSH(J,z,7),Y=jt.rotrSL(J,z,1)^jt.rotrSL(J,z,8)^jt.shrSL(J,z,7),Z=dl[C-2]|0,se=ll[C-2]|0,q=jt.rotrSH(Z,se,19)^jt.rotrBH(Z,se,61)^jt.shrSH(Z,se,6),x=jt.rotrSL(Z,se,19)^jt.rotrBL(Z,se,61)^jt.shrSL(Z,se,6),O=jt.add4L(Y,x,ll[C-7],ll[C-16]),B=jt.add4H(O,W,q,dl[C-7],dl[C-16]);dl[C]=B|0,ll[C]=O|0}let{Ah:n,Al:s,Bh:i,Bl:a,Ch:o,Cl:c,Dh:u,Dl:f,Eh:d,El:g,Fh:h,Fl:m,Gh:y,Gl:S,Hh:T,Hl:H}=this;for(let C=0;C<80;C++){let J=jt.rotrSH(d,g,14)^jt.rotrSH(d,g,18)^jt.rotrBH(d,g,41),z=jt.rotrSL(d,g,14)^jt.rotrSL(d,g,18)^jt.rotrBL(d,g,41),W=d&h^~d&y,Y=g&m^~g&S,Z=jt.add5L(H,z,Y,jue[C],ll[C]),se=jt.add5H(Z,T,J,W,Rue[C],dl[C]),q=Z|0,x=jt.rotrSH(n,s,28)^jt.rotrBH(n,s,34)^jt.rotrBH(n,s,39),O=jt.rotrSL(n,s,28)^jt.rotrBL(n,s,34)^jt.rotrBL(n,s,39),B=n&i^n&o^i&o,A=s&a^s&c^a&c;T=y|0,H=S|0,y=h|0,S=m|0,h=d|0,m=g|0,{h:d,l:g}=jt.add(u|0,f|0,se|0,q|0),u=o|0,f=c|0,o=i|0,c=a|0,i=n|0,a=s|0;let E=jt.add3L(q,O,A);n=jt.add3H(E,se,x,B),s=E|0}({h:n,l:s}=jt.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:a}=jt.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:c}=jt.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:u,l:f}=jt.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:d,l:g}=jt.add(this.Eh|0,this.El|0,d|0,g|0),{h,l:m}=jt.add(this.Fh|0,this.Fl|0,h|0,m|0),{h:y,l:S}=jt.add(this.Gh|0,this.Gl|0,y|0,S|0),{h:T,l:H}=jt.add(this.Hh|0,this.Hl|0,T|0,H|0),this.set(n,s,i,a,o,c,u,f,d,g,h,m,y,S,T,H)}roundClean(){dl.fill(0),ll.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)}};Ti.SHA512=jx;var NB=class extends jx{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},IB=class extends jx{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};Ti.sha512=(0,RB.wrapConstructor)(()=>new jx);Ti.sha512_256=(0,RB.wrapConstructor)(()=>new NB);Ti.sha384=(0,RB.wrapConstructor)(()=>new IB)});var CB=R(Mx=>{"use strict";b();p();Object.defineProperty(Mx,"__esModule",{value:!0});Mx.ripemd160=Mx.RIPEMD160=void 0;var Mue=h7(),Cue=bi(),Lue=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Qq=Uint8Array.from({length:16},(r,e)=>e),Uue=Qq.map(r=>(9*r+5)%16),jB=[Qq],MB=[Uue];for(let r=0;r<4;r++)for(let e of[jB,MB])e.push(e[r].map(t=>Lue[t]));var Yq=[[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(r=>new Uint8Array(r)),Fue=jB.map((r,e)=>r.map(t=>Yq[e][t])),que=MB.map((r,e)=>r.map(t=>Yq[e][t])),Due=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Hue=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),x7=(r,e)=>r<<e|r>>>32-e;function Zq(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}var y7=new Uint32Array(16),m7=class extends Mue.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:s,h4:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=s|0,this.h4=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)y7[h]=e.getUint32(t,!0);let n=this.h0|0,s=n,i=this.h1|0,a=i,o=this.h2|0,c=o,u=this.h3|0,f=u,d=this.h4|0,g=d;for(let h=0;h<5;h++){let m=4-h,y=Due[h],S=Hue[h],T=jB[h],H=MB[h],C=Fue[h],J=que[h];for(let z=0;z<16;z++){let W=x7(n+Zq(h,i,o,u)+y7[T[z]]+y,C[z])+d|0;n=d,d=u,u=x7(o,10)|0,o=i,i=W}for(let z=0;z<16;z++){let W=x7(s+Zq(m,a,c,f)+y7[H[z]]+S,J[z])+g|0;s=g,g=f,f=x7(c,10)|0,c=a,a=W}}this.set(this.h1+o+f|0,this.h2+u+g|0,this.h3+d+s|0,this.h4+n+a|0,this.h0+i+c|0)}roundClean(){y7.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};Mx.RIPEMD160=m7;Mx.ripemd160=(0,Cue.wrapConstructor)(()=>new m7)});var w7=R(dr=>{"use strict";b();p();var Kue=dr&&dr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Gue=dr&&dr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Vue=dr&&dr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Kue(e,r,t);return Gue(e,r),e};Object.defineProperty(dr,"__esModule",{value:!0});dr.shake256=dr.shake128=dr.keccak_512=dr.keccak_384=dr.keccak_256=dr.keccak_224=dr.sha3_512=dr.sha3_384=dr.sha3_256=dr.sha3_224=dr.Keccak=dr.keccakP=void 0;var fw=Vue(Rx()),Gb=bi(),[tD,rD,nD]=[[],[],[]],zue=BigInt(0),uw=BigInt(1),Wue=BigInt(2),$ue=BigInt(7),Jue=BigInt(256),Zue=BigInt(113);for(let r=0,e=uw,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],tD.push(2*(5*n+t)),rD.push((r+1)*(r+2)/2%64);let s=zue;for(let i=0;i<7;i++)e=(e<<uw^(e>>$ue)*Zue)%Jue,e&Wue&&(s^=uw<<(uw<<BigInt(i))-uw);nD.push(s)}var[Que,Yue]=fw.split(nD,!0),Xq=(r,e,t)=>t>32?fw.rotlBH(r,e,t):fw.rotlSH(r,e,t),eD=(r,e,t)=>t>32?fw.rotlBL(r,e,t):fw.rotlSL(r,e,t);function sD(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)t[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){let o=(a+8)%10,c=(a+2)%10,u=t[c],f=t[c+1],d=Xq(u,f,1)^t[o],g=eD(u,f,1)^t[o+1];for(let h=0;h<50;h+=10)r[a+h]^=d,r[a+h+1]^=g}let s=r[2],i=r[3];for(let a=0;a<24;a++){let o=rD[a],c=Xq(s,i,o),u=eD(s,i,o),f=tD[a];s=r[f],i=r[f+1],r[f]=c,r[f+1]=u}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=r[a+o];for(let o=0;o<10;o++)r[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}r[0]^=Que[n],r[1]^=Yue[n]}t.fill(0)}dr.keccakP=sD;var Vb=class extends Gb.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Gb.assertNumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Gb.u32)(this.state)}keccak(){sD(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){if(this.destroyed)throw new Error("instance is destroyed");if(this.finished)throw new Error("digest() was already called");let{blockLen:t,state:n}=this;e=(0,Gb.toBytes)(e);let s=e.length;for(let i=0;i<s;){let a=Math.min(t-this.pos,s-i);for(let o=0;o<a;o++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array))throw new Error("Keccak: invalid output buffer");this.finish();for(let t=0,n=e.length;t<n;){this.posOut>=this.blockLen&&this.keccak();let s=Math.min(this.blockLen-this.posOut,n-t);e.set(this.state.subarray(this.posOut,this.posOut+s),t),this.posOut+=s,t+=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(0,Gb.assertNumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(e.length<this.outputLen)throw new Error("Keccak: invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.finish(),this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:a}=this;return e||(e=new Vb(t,n,s,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}};dr.Keccak=Vb;var hl=(r,e,t)=>(0,Gb.wrapConstructor)(()=>new Vb(e,r,t));dr.sha3_224=hl(6,144,224/8);dr.sha3_256=hl(6,136,256/8);dr.sha3_384=hl(6,104,384/8);dr.sha3_512=hl(6,72,512/8);dr.keccak_224=hl(1,144,224/8);dr.keccak_256=hl(1,136,256/8);dr.keccak_384=hl(1,104,384/8);dr.keccak_512=hl(1,72,512/8);var iD=(r,e,t)=>(0,Gb.wrapConstructorWithOpts)((n={})=>new Vb(e,r,n.dkLen!==void 0?n.dkLen:t,!0));dr.shake128=iD(31,168,128/8);dr.shake256=iD(31,136,256/8)});var v7=R(Cx=>{"use strict";b();p();Object.defineProperty(Cx,"__esModule",{value:!0});Cx.BLAKE2=Cx.SIGMA=void 0;var zb=bi();Cx.SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);var LB=class extends zb.Hash{constructor(e,t,n={},s,i,a){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,(0,zb.assertNumber)(e),(0,zb.assertNumber)(t),(0,zb.assertNumber)(s),t<0||t>s)throw new Error("Blake2: outputLen bigger than keyLen");if(n.key!==void 0&&(n.key.length<1||n.key.length>s))throw new Error(`Key should be up 1..${s} byte long or undefined`);if(n.salt!==void 0&&n.salt.length!==i)throw new Error(`Salt should be ${i} byte long or undefined`);if(n.personalization!==void 0&&n.personalization.length!==a)throw new Error(`Personalization should be ${a} byte long or undefined`);this.buffer32=(0,zb.u32)(this.buffer=new Uint8Array(e))}update(e){if(this.destroyed)throw new Error("instance is destroyed");let{finished:t,blockLen:n,buffer:s,buffer32:i}=this;if(t)throw new Error("digest() was already called");e=(0,zb.toBytes)(e);let a=e.length;for(let o=0;o<a;){this.pos===n&&(this.compress(i,0,!1),this.pos=0);let c=Math.min(n-this.pos,a-o),u=e.byteOffset+o;if(c===n&&!(u%4)&&o+c<a){let f=new Uint32Array(e.buffer,u,Math.floor((a-o)/4));for(let d=0;o+n<a;d+=i.length,o+=n)this.length+=n,this.compress(f,d,!1);continue}s.set(e.subarray(o,o+c),this.pos),this.pos+=c,this.length+=c,o+=c}return this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Blake2: Invalid output buffer");let{finished:t,pos:n,buffer32:s}=this;if(t)throw new Error("digest() was already called");this.finished=!0,this.buffer.subarray(n).fill(0),this.compress(s,0,!0);let i=(0,zb.u32)(e);this.get().forEach((a,o)=>i[o]=a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){let{buffer:t,length:n,finished:s,destroyed:i,outputLen:a,pos:o}=this;return e||(e=new this.constructor({dkLen:a})),e.set(...this.get()),e.length=n,e.finished=s,e.destroyed=i,e.outputLen=a,e.buffer.set(t),e.pos=o,e}};Cx.BLAKE2=LB});var FB=R(_f=>{"use strict";b();p();var Xue=_f&&_f.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),efe=_f&&_f.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),oD=_f&&_f.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Xue(e,r,t);return efe(e,r),e};Object.defineProperty(_f,"__esModule",{value:!0});_f.blake2b=void 0;var aD=oD(v7()),Qi=oD(Rx()),Lx=bi(),Ms=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Te=new Uint32Array(32);function bl(r,e,t,n,s,i){let a=s[i],o=s[i+1],c=Te[2*r],u=Te[2*r+1],f=Te[2*e],d=Te[2*e+1],g=Te[2*t],h=Te[2*t+1],m=Te[2*n],y=Te[2*n+1],S=Qi.add3L(c,f,a);u=Qi.add3H(S,u,d,o),c=S|0,{Dh:y,Dl:m}={Dh:y^u,Dl:m^c},{Dh:y,Dl:m}={Dh:Qi.rotr32H(y,m),Dl:Qi.rotr32L(y,m)},{h,l:g}=Qi.add(h,g,y,m),{Bh:d,Bl:f}={Bh:d^h,Bl:f^g},{Bh:d,Bl:f}={Bh:Qi.rotrSH(d,f,24),Bl:Qi.rotrSL(d,f,24)},Te[2*r]=c,Te[2*r+1]=u,Te[2*e]=f,Te[2*e+1]=d,Te[2*t]=g,Te[2*t+1]=h,Te[2*n]=m,Te[2*n+1]=y}function pl(r,e,t,n,s,i){let a=s[i],o=s[i+1],c=Te[2*r],u=Te[2*r+1],f=Te[2*e],d=Te[2*e+1],g=Te[2*t],h=Te[2*t+1],m=Te[2*n],y=Te[2*n+1],S=Qi.add3L(c,f,a);u=Qi.add3H(S,u,d,o),c=S|0,{Dh:y,Dl:m}={Dh:y^u,Dl:m^c},{Dh:y,Dl:m}={Dh:Qi.rotrSH(y,m,16),Dl:Qi.rotrSL(y,m,16)},{h,l:g}=Qi.add(h,g,y,m),{Bh:d,Bl:f}={Bh:d^h,Bl:f^g},{Bh:d,Bl:f}={Bh:Qi.rotrBH(d,f,63),Bl:Qi.rotrBL(d,f,63)},Te[2*r]=c,Te[2*r+1]=u,Te[2*e]=f,Te[2*e+1]=d,Te[2*t]=g,Te[2*t+1]=h,Te[2*n]=m,Te[2*n+1]=y}var UB=class extends aD.BLAKE2{constructor(e={}){super(128,e.dkLen===void 0?64:e.dkLen,e,64,16,16),this.v0l=Ms[0]|0,this.v0h=Ms[1]|0,this.v1l=Ms[2]|0,this.v1h=Ms[3]|0,this.v2l=Ms[4]|0,this.v2h=Ms[5]|0,this.v3l=Ms[6]|0,this.v3h=Ms[7]|0,this.v4l=Ms[8]|0,this.v4h=Ms[9]|0,this.v5l=Ms[10]|0,this.v5h=Ms[11]|0,this.v6l=Ms[12]|0,this.v6h=Ms[13]|0,this.v7l=Ms[14]|0,this.v7h=Ms[15]|0;let t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|1<<16|1<<24,e.salt){let n=(0,Lx.u32)((0,Lx.toBytes)(e.salt));this.v4l^=n[0],this.v4h^=n[1],this.v5l^=n[2],this.v5h^=n[3]}if(e.personalization){let n=(0,Lx.u32)((0,Lx.toBytes)(e.personalization));this.v6l^=n[0],this.v6h^=n[1],this.v7l^=n[2],this.v7h^=n[3]}if(e.key){let n=new Uint8Array(this.blockLen);n.set((0,Lx.toBytes)(e.key)),this.update(n)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:s,v2l:i,v2h:a,v3l:o,v3h:c,v4l:u,v4h:f,v5l:d,v5h:g,v6l:h,v6h:m,v7l:y,v7h:S}=this;return[e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S]}set(e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S){this.v0l=e|0,this.v0h=t|0,this.v1l=n|0,this.v1h=s|0,this.v2l=i|0,this.v2h=a|0,this.v3l=o|0,this.v3h=c|0,this.v4l=u|0,this.v4h=f|0,this.v5l=d|0,this.v5h=g|0,this.v6l=h|0,this.v6h=m|0,this.v7l=y|0,this.v7h=S|0}compress(e,t,n){this.get().forEach((c,u)=>Te[u]=c),Te.set(Ms,16);let{h:s,l:i}=Qi.fromBig(BigInt(this.length));Te[24]=Ms[8]^i,Te[25]=Ms[9]^s,n&&(Te[28]=~Te[28],Te[29]=~Te[29]);let a=0,o=aD.SIGMA;for(let c=0;c<12;c++)bl(0,4,8,12,e,t+2*o[a++]),pl(0,4,8,12,e,t+2*o[a++]),bl(1,5,9,13,e,t+2*o[a++]),pl(1,5,9,13,e,t+2*o[a++]),bl(2,6,10,14,e,t+2*o[a++]),pl(2,6,10,14,e,t+2*o[a++]),bl(3,7,11,15,e,t+2*o[a++]),pl(3,7,11,15,e,t+2*o[a++]),bl(0,5,10,15,e,t+2*o[a++]),pl(0,5,10,15,e,t+2*o[a++]),bl(1,6,11,12,e,t+2*o[a++]),pl(1,6,11,12,e,t+2*o[a++]),bl(2,7,8,13,e,t+2*o[a++]),pl(2,7,8,13,e,t+2*o[a++]),bl(3,4,9,14,e,t+2*o[a++]),pl(3,4,9,14,e,t+2*o[a++]);this.v0l^=Te[0]^Te[16],this.v0h^=Te[1]^Te[17],this.v1l^=Te[2]^Te[18],this.v1h^=Te[3]^Te[19],this.v2l^=Te[4]^Te[20],this.v2h^=Te[5]^Te[21],this.v3l^=Te[6]^Te[22],this.v3h^=Te[7]^Te[23],this.v4l^=Te[8]^Te[24],this.v4h^=Te[9]^Te[25],this.v5l^=Te[10]^Te[26],this.v5h^=Te[11]^Te[27],this.v6l^=Te[12]^Te[28],this.v6h^=Te[13]^Te[29],this.v7l^=Te[14]^Te[30],this.v7h^=Te[15]^Te[31],Te.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};_f.blake2b=(0,Lx.wrapConstructorWithOpts)(r=>new UB(r))});var dw=R(on=>{"use strict";b();p();Object.defineProperty(on,"__esModule",{value:!0});on.sha3_512=on.sha3_256=on.ripemd160=on.sha512=on.sha256=on.magicHash=on.blake2=on.keccak256=on.keccak=on.hash160=on.doubleSha256=void 0;var P7=Ix();Object.defineProperty(on,"sha256",{enumerable:!0,get:function(){return P7.sha256}});var tfe=g7();Object.defineProperty(on,"sha512",{enumerable:!0,get:function(){return tfe.sha512}});var uD=CB();Object.defineProperty(on,"ripemd160",{enumerable:!0,get:function(){return uD.ripemd160}});var Ux=w7();Object.defineProperty(on,"sha3_256",{enumerable:!0,get:function(){return Ux.sha3_256}});Object.defineProperty(on,"sha3_512",{enumerable:!0,get:function(){return Ux.sha3_512}});var rfe=FB();function fD(r){let e=(0,P7.sha256)(r);return(0,P7.sha256)(e)}on.doubleSha256=fD;function nfe(r){let e=(0,P7.sha256)(r);return(0,uD.ripemd160)(e)}on.hash160=nfe;var sfe=function(r,e=256){let t=v.Buffer.from(r);switch(e){case 224:return v.Buffer.from((0,Ux.keccak_224)(t));case 256:return v.Buffer.from((0,Ux.keccak_256)(t));case 384:return v.Buffer.from((0,Ux.keccak_384)(t));case 512:return v.Buffer.from((0,Ux.keccak_512)(t));default:throw new Error(`Invald algorithm: keccak${e}`)}};on.keccak=sfe;var ife=function(r){return(0,on.keccak)(r)};on.keccak256=ife;function afe(r,e,t){let n=Math.ceil(e/8);return(0,rfe.blake2b)(r,{dkLen:n,key:t})}on.blake2=afe;function cD(r){let e;return r<253?(e=v.Buffer.alloc(1),e.writeUInt8(r,0)):r<65536?(e=v.Buffer.alloc(1+2),e.writeUInt8(253,0),e.writeUInt16LE(r,1)):r<4294967296?(e=v.Buffer.alloc(1+4),e.writeUInt8(254,0),e.writeUInt32LE(r,1)):(e=v.Buffer.alloc(1+8),e.writeUInt8(255,0),e.writeInt32LE(r&-1,1),e.writeUInt32LE(Math.floor(r/4294967296),5)),e}var ofe=v.Buffer.from(`Bitcoin Signed Message:
`);function cfe(r,e){let t=e?v.Buffer.from(e,"utf8"):ofe,n=cD(t.length),s=v.Buffer.from(r),i=cD(s.length),a=v.Buffer.concat([n,t,i,s]);return fD(a)}on.magicHash=cfe});var hD=R(Fx=>{"use strict";b();p();Object.defineProperty(Fx,"__esModule",{value:!0});Fx.fromBase58Check=Fx.toBase58Check=void 0;var dD=dw(),kke=dce(),lD=Kb();function ufe(r){return(0,lD.base58check)(dD.sha256).encode(v.Buffer.from(r))}Fx.toBase58Check=ufe;function ffe(r){let e=(0,lD.base58check)(dD.sha256);return v.Buffer.from(e.decode(r))}Fx.fromBase58Check=ffe});var bD=R(qx=>{"use strict";b();p();Object.defineProperty(qx,"__esModule",{value:!0});qx.fromBech32=qx.toBech32=void 0;var _7=Kb();function dfe(r,e,t){let n=v.Buffer.from(e),s=_7.bech32.toWords(Uint8Array.from(n));return _7.bech32.encode(r,s,t)}qx.toBech32=dfe;function lfe(r,e){let t=_7.bech32.decode(r,e),n=_7.bech32.fromWords(t.words);return[t.prefix,v.Buffer.from(n)]}qx.fromBech32=lfe});var pD=R(Af=>{"use strict";b();p();Object.defineProperty(Af,"__esModule",{value:!0});Af.isHexPrefixed=Af.stripHexPrefix=Af.fromHex=Af.toHex=void 0;function hfe(r,e=!1){let t=v.Buffer.from(r);return e?"0x"+t.toString("hex"):t.toString("hex")}Af.toHex=hfe;function bfe(r){return r.startsWith("0x")&&(r=r.substring(2)),v.Buffer.from(r,"hex")}Af.fromHex=bfe;function pfe(r){return r.startsWith("0x")?r.substring(2):r}Af.stripHexPrefix=pfe;function gfe(r){return r.startsWith("0x")}Af.isHexPrefixed=gfe});var xD=R(Dx=>{"use strict";b();p();Object.defineProperty(Dx,"__esModule",{value:!0});Dx.fromBase64=Dx.toBase64=void 0;var gD=Kb();function xfe(r){let e=v.Buffer.from(r);return gD.base64.encode(Uint8Array.from(e))}Dx.toBase64=xfe;function yfe(r){return gD.base64.decode(r)}Dx.fromBase64=yfe});var hw=R(lw=>{"use strict";b();p();Object.defineProperty(lw,"__esModule",{value:!0});lw.hmac=void 0;var A7=bi(),E7=class extends A7.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,A7.assertHash)(e);let n=(0,A7.toBytes)(t);if(this.iHash=e.create(),!(this.iHash instanceof A7.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");let s=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;let i=new Uint8Array(s);i.set(n.length>this.iHash.blockLen?e.create().update(n).digest():n);for(let a=0;a<i.length;a++)i[a]^=54;this.iHash.update(i),this.oHash=e.create();for(let a=0;a<i.length;a++)i[a]^=106;this.oHash.update(i),i.fill(0)}update(e){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(e),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:n,finished:s,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},mfe=(r,e,t)=>new E7(r,e).update(t).digest();lw.hmac=mfe;lw.hmac.create=(r,e)=>new E7(r,e)});var wD=R(Hx=>{"use strict";b();p();Object.defineProperty(Hx,"__esModule",{value:!0});Hx.hmacSHA512=Hx.hmacSHA256=void 0;var yD=hw(),mD=dw();function wfe(r,e){return v.Buffer.from((0,yD.hmac)(mD.sha256,r,e))}Hx.hmacSHA256=wfe;function vfe(r,e){return v.Buffer.from((0,yD.hmac)(mD.sha512,r,e))}Hx.hmacSHA512=vfe});var vD=R(Kx=>{"use strict";b();p();Object.defineProperty(Kx,"__esModule",{value:!0});Kx.fromUtf8=Kx.toUtf8=void 0;function Pfe(r){return new TextEncoder().encode(r)}Kx.toUtf8=Pfe;function _fe(r){return new TextDecoder("utf-8",{fatal:!0}).decode(r)}Kx.fromUtf8=_fe});var DB=R(gl=>{"use strict";b();p();Object.defineProperty(gl,"__esModule",{value:!0});gl.checkIsUndefined=gl.checkIsDefined=gl.check=void 0;var qB=(r,e)=>{if(!r)throw e=e||"Invalid statement",e=e instanceof Error?e:new Error(e),e};gl.check=qB;var Afe=(r,e)=>(qB(typeof r<"u",e||"Expect defined but actually undefined"),r);gl.checkIsDefined=Afe;var Efe=(r,e)=>{qB(typeof r>"u",e||`Expect undefined but actually ${r}`)};gl.checkIsUndefined=Efe});var _D=R(Ef=>{"use strict";b();p();Object.defineProperty(Ef,"__esModule",{value:!0});Ef.string2BigNumber=Ef.bigNumber2String=Ef.fromBigIntHex=Ef.toBigIntHex=void 0;var PD=qr(),Sfe=DB(),Tfe=r=>{let e=r.integerValue().toString(16);return e="0x"+e,e};Ef.toBigIntHex=Tfe;var Ofe=r=>((0,Sfe.check)(r&&r.startsWith("0x"),`Invalid hex string. value: ${r}`),new PD.BigNumber(r).integerValue());Ef.fromBigIntHex=Ofe;var Bfe=(r,e)=>r.integerValue().toString(e);Ef.bigNumber2String=Bfe;var kfe=(r,e)=>new PD.BigNumber(r,e);Ef.string2BigNumber=kfe});var Cs=R((AD,HB)=>{b();p();(function(r,e){"use strict";function t(q,x){if(!q)throw new Error(x||"Assertion failed")}function n(q,x){q.super_=x;var O=function(){};O.prototype=x.prototype,q.prototype=new O,q.prototype.constructor=q}function s(q,x,O){if(s.isBN(q))return q;this.negative=0,this.words=null,this.length=0,this.red=null,q!==null&&((x==="le"||x==="be")&&(O=x,x=10),this._init(q||0,x||10,O||"be"))}typeof r=="object"?r.exports=s:e.BN=s,s.BN=s,s.wordSize=26;var i;try{typeof window<"u"&&typeof window.Buffer<"u"?i=window.Buffer:i=o7().Buffer}catch{}s.isBN=function(x){return x instanceof s?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===s.wordSize&&Array.isArray(x.words)},s.max=function(x,O){return x.cmp(O)>0?x:O},s.min=function(x,O){return x.cmp(O)<0?x:O},s.prototype._init=function(x,O,B){if(typeof x=="number")return this._initNumber(x,O,B);if(typeof x=="object")return this._initArray(x,O,B);O==="hex"&&(O=16),t(O===(O|0)&&O>=2&&O<=36),x=x.toString().replace(/\s+/g,"");var A=0;x[0]==="-"&&(A++,this.negative=1),A<x.length&&(O===16?this._parseHex(x,A,B):(this._parseBase(x,O,A),B==="le"&&this._initArray(this.toArray(),O,B)))},s.prototype._initNumber=function(x,O,B){x<0&&(this.negative=1,x=-x),x<67108864?(this.words=[x&67108863],this.length=1):x<4503599627370496?(this.words=[x&67108863,x/67108864&67108863],this.length=2):(t(x<9007199254740992),this.words=[x&67108863,x/67108864&67108863,1],this.length=3),B==="le"&&this._initArray(this.toArray(),O,B)},s.prototype._initArray=function(x,O,B){if(t(typeof x.length=="number"),x.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(x.length/3),this.words=new Array(this.length);for(var A=0;A<this.length;A++)this.words[A]=0;var E,j,G=0;if(B==="be")for(A=x.length-1,E=0;A>=0;A-=3)j=x[A]|x[A-1]<<8|x[A-2]<<16,this.words[E]|=j<<G&67108863,this.words[E+1]=j>>>26-G&67108863,G+=24,G>=26&&(G-=26,E++);else if(B==="le")for(A=0,E=0;A<x.length;A+=3)j=x[A]|x[A+1]<<8|x[A+2]<<16,this.words[E]|=j<<G&67108863,this.words[E+1]=j>>>26-G&67108863,G+=24,G>=26&&(G-=26,E++);return this.strip()};function a(q,x){var O=q.charCodeAt(x);return O>=65&&O<=70?O-55:O>=97&&O<=102?O-87:O-48&15}function o(q,x,O){var B=a(q,O);return O-1>=x&&(B|=a(q,O-1)<<4),B}s.prototype._parseHex=function(x,O,B){this.length=Math.ceil((x.length-O)/6),this.words=new Array(this.length);for(var A=0;A<this.length;A++)this.words[A]=0;var E=0,j=0,G;if(B==="be")for(A=x.length-1;A>=O;A-=2)G=o(x,O,A)<<E,this.words[j]|=G&67108863,E>=18?(E-=18,j+=1,this.words[j]|=G>>>26):E+=8;else{var M=x.length-O;for(A=M%2===0?O+1:O;A<x.length;A+=2)G=o(x,O,A)<<E,this.words[j]|=G&67108863,E>=18?(E-=18,j+=1,this.words[j]|=G>>>26):E+=8}this.strip()};function c(q,x,O,B){for(var A=0,E=Math.min(q.length,O),j=x;j<E;j++){var G=q.charCodeAt(j)-48;A*=B,G>=49?A+=G-49+10:G>=17?A+=G-17+10:A+=G}return A}s.prototype._parseBase=function(x,O,B){this.words=[0],this.length=1;for(var A=0,E=1;E<=67108863;E*=O)A++;A--,E=E/O|0;for(var j=x.length-B,G=j%A,M=Math.min(j,j-G)+B,P=0,K=B;K<M;K+=A)P=c(x,K,K+A,O),this.imuln(E),this.words[0]+P<67108864?this.words[0]+=P:this._iaddn(P);if(G!==0){var re=1;for(P=c(x,K,x.length,O),K=0;K<G;K++)re*=O;this.imuln(re),this.words[0]+P<67108864?this.words[0]+=P:this._iaddn(P)}this.strip()},s.prototype.copy=function(x){x.words=new Array(this.length);for(var O=0;O<this.length;O++)x.words[O]=this.words[O];x.length=this.length,x.negative=this.negative,x.red=this.red},s.prototype.clone=function(){var x=new s(null);return this.copy(x),x},s.prototype._expand=function(x){for(;this.length<x;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(x,O){x=x||10,O=O|0||1;var B;if(x===16||x==="hex"){B="";for(var A=0,E=0,j=0;j<this.length;j++){var G=this.words[j],M=((G<<A|E)&16777215).toString(16);E=G>>>24-A&16777215,E!==0||j!==this.length-1?B=u[6-M.length]+M+B:B=M+B,A+=2,A>=26&&(A-=26,j--)}for(E!==0&&(B=E.toString(16)+B);B.length%O!==0;)B="0"+B;return this.negative!==0&&(B="-"+B),B}if(x===(x|0)&&x>=2&&x<=36){var P=f[x],K=d[x];B="";var re=this.clone();for(re.negative=0;!re.isZero();){var ie=re.modn(K).toString(x);re=re.idivn(K),re.isZero()?B=ie+B:B=u[P-ie.length]+ie+B}for(this.isZero()&&(B="0"+B);B.length%O!==0;)B="0"+B;return this.negative!==0&&(B="-"+B),B}t(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=this.words[1]*67108864:this.length===3&&this.words[2]===1?x+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(x,O){return t(typeof i<"u"),this.toArrayLike(i,x,O)},s.prototype.toArray=function(x,O){return this.toArrayLike(Array,x,O)},s.prototype.toArrayLike=function(x,O,B){var A=this.byteLength(),E=B||Math.max(1,A);t(A<=E,"byte array longer than desired length"),t(E>0,"Requested array length <= 0"),this.strip();var j=O==="le",G=new x(E),M,P,K=this.clone();if(j){for(P=0;!K.isZero();P++)M=K.andln(255),K.iushrn(8),G[P]=M;for(;P<E;P++)G[P]=0}else{for(P=0;P<E-A;P++)G[P]=0;for(P=0;!K.isZero();P++)M=K.andln(255),K.iushrn(8),G[E-P-1]=M}return G},Math.clz32?s.prototype._countBits=function(x){return 32-Math.clz32(x)}:s.prototype._countBits=function(x){var O=x,B=0;return O>=4096&&(B+=13,O>>>=13),O>=64&&(B+=7,O>>>=7),O>=8&&(B+=4,O>>>=4),O>=2&&(B+=2,O>>>=2),B+O},s.prototype._zeroBits=function(x){if(x===0)return 26;var O=x,B=0;return(O&8191)===0&&(B+=13,O>>>=13),(O&127)===0&&(B+=7,O>>>=7),(O&15)===0&&(B+=4,O>>>=4),(O&3)===0&&(B+=2,O>>>=2),(O&1)===0&&B++,B},s.prototype.bitLength=function(){var x=this.words[this.length-1],O=this._countBits(x);return(this.length-1)*26+O};function g(q){for(var x=new Array(q.bitLength()),O=0;O<x.length;O++){var B=O/26|0,A=O%26;x[O]=(q.words[B]&1<<A)>>>A}return x}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,O=0;O<this.length;O++){var B=this._zeroBits(this.words[O]);if(x+=B,B!==26)break}return x},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(x){return this.negative!==0?this.abs().inotn(x).iaddn(1):this.clone()},s.prototype.fromTwos=function(x){return this.testn(x-1)?this.notn(x).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(x){for(;this.length<x.length;)this.words[this.length++]=0;for(var O=0;O<x.length;O++)this.words[O]=this.words[O]|x.words[O];return this.strip()},s.prototype.ior=function(x){return t((this.negative|x.negative)===0),this.iuor(x)},s.prototype.or=function(x){return this.length>x.length?this.clone().ior(x):x.clone().ior(this)},s.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},s.prototype.iuand=function(x){var O;this.length>x.length?O=x:O=this;for(var B=0;B<O.length;B++)this.words[B]=this.words[B]&x.words[B];return this.length=O.length,this.strip()},s.prototype.iand=function(x){return t((this.negative|x.negative)===0),this.iuand(x)},s.prototype.and=function(x){return this.length>x.length?this.clone().iand(x):x.clone().iand(this)},s.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},s.prototype.iuxor=function(x){var O,B;this.length>x.length?(O=this,B=x):(O=x,B=this);for(var A=0;A<B.length;A++)this.words[A]=O.words[A]^B.words[A];if(this!==O)for(;A<O.length;A++)this.words[A]=O.words[A];return this.length=O.length,this.strip()},s.prototype.ixor=function(x){return t((this.negative|x.negative)===0),this.iuxor(x)},s.prototype.xor=function(x){return this.length>x.length?this.clone().ixor(x):x.clone().ixor(this)},s.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},s.prototype.inotn=function(x){t(typeof x=="number"&&x>=0);var O=Math.ceil(x/26)|0,B=x%26;this._expand(O),B>0&&O--;for(var A=0;A<O;A++)this.words[A]=~this.words[A]&67108863;return B>0&&(this.words[A]=~this.words[A]&67108863>>26-B),this.strip()},s.prototype.notn=function(x){return this.clone().inotn(x)},s.prototype.setn=function(x,O){t(typeof x=="number"&&x>=0);var B=x/26|0,A=x%26;return this._expand(B+1),O?this.words[B]=this.words[B]|1<<A:this.words[B]=this.words[B]&~(1<<A),this.strip()},s.prototype.iadd=function(x){var O;if(this.negative!==0&&x.negative===0)return this.negative=0,O=this.isub(x),this.negative^=1,this._normSign();if(this.negative===0&&x.negative!==0)return x.negative=0,O=this.isub(x),x.negative=1,O._normSign();var B,A;this.length>x.length?(B=this,A=x):(B=x,A=this);for(var E=0,j=0;j<A.length;j++)O=(B.words[j]|0)+(A.words[j]|0)+E,this.words[j]=O&67108863,E=O>>>26;for(;E!==0&&j<B.length;j++)O=(B.words[j]|0)+E,this.words[j]=O&67108863,E=O>>>26;if(this.length=B.length,E!==0)this.words[this.length]=E,this.length++;else if(B!==this)for(;j<B.length;j++)this.words[j]=B.words[j];return this},s.prototype.add=function(x){var O;return x.negative!==0&&this.negative===0?(x.negative=0,O=this.sub(x),x.negative^=1,O):x.negative===0&&this.negative!==0?(this.negative=0,O=x.sub(this),this.negative=1,O):this.length>x.length?this.clone().iadd(x):x.clone().iadd(this)},s.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var O=this.iadd(x);return x.negative=1,O._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var B=this.cmp(x);if(B===0)return this.negative=0,this.length=1,this.words[0]=0,this;var A,E;B>0?(A=this,E=x):(A=x,E=this);for(var j=0,G=0;G<E.length;G++)O=(A.words[G]|0)-(E.words[G]|0)+j,j=O>>26,this.words[G]=O&67108863;for(;j!==0&&G<A.length;G++)O=(A.words[G]|0)+j,j=O>>26,this.words[G]=O&67108863;if(j===0&&G<A.length&&A!==this)for(;G<A.length;G++)this.words[G]=A.words[G];return this.length=Math.max(this.length,G),A!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(x){return this.clone().isub(x)};function h(q,x,O){O.negative=x.negative^q.negative;var B=q.length+x.length|0;O.length=B,B=B-1|0;var A=q.words[0]|0,E=x.words[0]|0,j=A*E,G=j&67108863,M=j/67108864|0;O.words[0]=G;for(var P=1;P<B;P++){for(var K=M>>>26,re=M&67108863,ie=Math.min(P,x.length-1),ce=Math.max(0,P-q.length+1);ce<=ie;ce++){var oe=P-ce|0;A=q.words[oe]|0,E=x.words[ce]|0,j=A*E+re,K+=j/67108864|0,re=j&67108863}O.words[P]=re|0,M=K|0}return M!==0?O.words[P]=M|0:O.length--,O.strip()}var m=function(x,O,B){var A=x.words,E=O.words,j=B.words,G=0,M,P,K,re=A[0]|0,ie=re&8191,ce=re>>>13,oe=A[1]|0,we=oe&8191,He=oe>>>13,yt=A[2]|0,mt=yt&8191,Qe=yt>>>13,Cr=A[3]|0,sr=Cr&8191,We=Cr>>>13,rn=A[4]|0,$t=rn&8191,vr=rn>>>13,_a=A[5]|0,Mn=_a&8191,Tr=_a>>>13,Db=A[6]|0,Cn=Db&8191,mn=Db>>>13,Bx=A[7]|0,nn=Bx&8191,wn=Bx>>>13,Hb=A[8]|0,vn=Hb&8191,Pn=Hb>>>13,rw=A[9]|0,Dn=rw&8191,_n=rw>>>13,kx=E[0]|0,sn=kx&8191,Lr=kx>>>13,q0=E[1]|0,Ur=q0&8191,an=q0>>>13,al=E[2]|0,Fr=al&8191,An=al>>>13,nw=E[3]|0,Hn=nw&8191,Kn=nw>>>13,Ro=E[4]|0,Or=Ro&8191,Rr=Ro>>>13,Nx=E[5]|0,En=Nx&8191,Ln=Nx>>>13,a7=E[6]|0,ir=a7&8191,Un=a7>>>13,k=E[7]|0,D=k&8191,F=k>>>13,w=E[8]|0,V=w&8191,X=w>>>13,ee=E[9]|0,ae=ee&8191,de=ee>>>13;B.negative=x.negative^O.negative,B.length=19,M=Math.imul(ie,sn),P=Math.imul(ie,Lr),P=P+Math.imul(ce,sn)|0,K=Math.imul(ce,Lr);var qe=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(qe>>>26)|0,qe&=67108863,M=Math.imul(we,sn),P=Math.imul(we,Lr),P=P+Math.imul(He,sn)|0,K=Math.imul(He,Lr),M=M+Math.imul(ie,Ur)|0,P=P+Math.imul(ie,an)|0,P=P+Math.imul(ce,Ur)|0,K=K+Math.imul(ce,an)|0;var Ae=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,M=Math.imul(mt,sn),P=Math.imul(mt,Lr),P=P+Math.imul(Qe,sn)|0,K=Math.imul(Qe,Lr),M=M+Math.imul(we,Ur)|0,P=P+Math.imul(we,an)|0,P=P+Math.imul(He,Ur)|0,K=K+Math.imul(He,an)|0,M=M+Math.imul(ie,Fr)|0,P=P+Math.imul(ie,An)|0,P=P+Math.imul(ce,Fr)|0,K=K+Math.imul(ce,An)|0;var Jt=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,M=Math.imul(sr,sn),P=Math.imul(sr,Lr),P=P+Math.imul(We,sn)|0,K=Math.imul(We,Lr),M=M+Math.imul(mt,Ur)|0,P=P+Math.imul(mt,an)|0,P=P+Math.imul(Qe,Ur)|0,K=K+Math.imul(Qe,an)|0,M=M+Math.imul(we,Fr)|0,P=P+Math.imul(we,An)|0,P=P+Math.imul(He,Fr)|0,K=K+Math.imul(He,An)|0,M=M+Math.imul(ie,Hn)|0,P=P+Math.imul(ie,Kn)|0,P=P+Math.imul(ce,Hn)|0,K=K+Math.imul(ce,Kn)|0;var Oe=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,M=Math.imul($t,sn),P=Math.imul($t,Lr),P=P+Math.imul(vr,sn)|0,K=Math.imul(vr,Lr),M=M+Math.imul(sr,Ur)|0,P=P+Math.imul(sr,an)|0,P=P+Math.imul(We,Ur)|0,K=K+Math.imul(We,an)|0,M=M+Math.imul(mt,Fr)|0,P=P+Math.imul(mt,An)|0,P=P+Math.imul(Qe,Fr)|0,K=K+Math.imul(Qe,An)|0,M=M+Math.imul(we,Hn)|0,P=P+Math.imul(we,Kn)|0,P=P+Math.imul(He,Hn)|0,K=K+Math.imul(He,Kn)|0,M=M+Math.imul(ie,Or)|0,P=P+Math.imul(ie,Rr)|0,P=P+Math.imul(ce,Or)|0,K=K+Math.imul(ce,Rr)|0;var tt=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(tt>>>26)|0,tt&=67108863,M=Math.imul(Mn,sn),P=Math.imul(Mn,Lr),P=P+Math.imul(Tr,sn)|0,K=Math.imul(Tr,Lr),M=M+Math.imul($t,Ur)|0,P=P+Math.imul($t,an)|0,P=P+Math.imul(vr,Ur)|0,K=K+Math.imul(vr,an)|0,M=M+Math.imul(sr,Fr)|0,P=P+Math.imul(sr,An)|0,P=P+Math.imul(We,Fr)|0,K=K+Math.imul(We,An)|0,M=M+Math.imul(mt,Hn)|0,P=P+Math.imul(mt,Kn)|0,P=P+Math.imul(Qe,Hn)|0,K=K+Math.imul(Qe,Kn)|0,M=M+Math.imul(we,Or)|0,P=P+Math.imul(we,Rr)|0,P=P+Math.imul(He,Or)|0,K=K+Math.imul(He,Rr)|0,M=M+Math.imul(ie,En)|0,P=P+Math.imul(ie,Ln)|0,P=P+Math.imul(ce,En)|0,K=K+Math.imul(ce,Ln)|0;var rt=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(rt>>>26)|0,rt&=67108863,M=Math.imul(Cn,sn),P=Math.imul(Cn,Lr),P=P+Math.imul(mn,sn)|0,K=Math.imul(mn,Lr),M=M+Math.imul(Mn,Ur)|0,P=P+Math.imul(Mn,an)|0,P=P+Math.imul(Tr,Ur)|0,K=K+Math.imul(Tr,an)|0,M=M+Math.imul($t,Fr)|0,P=P+Math.imul($t,An)|0,P=P+Math.imul(vr,Fr)|0,K=K+Math.imul(vr,An)|0,M=M+Math.imul(sr,Hn)|0,P=P+Math.imul(sr,Kn)|0,P=P+Math.imul(We,Hn)|0,K=K+Math.imul(We,Kn)|0,M=M+Math.imul(mt,Or)|0,P=P+Math.imul(mt,Rr)|0,P=P+Math.imul(Qe,Or)|0,K=K+Math.imul(Qe,Rr)|0,M=M+Math.imul(we,En)|0,P=P+Math.imul(we,Ln)|0,P=P+Math.imul(He,En)|0,K=K+Math.imul(He,Ln)|0,M=M+Math.imul(ie,ir)|0,P=P+Math.imul(ie,Un)|0,P=P+Math.imul(ce,ir)|0,K=K+Math.imul(ce,Un)|0;var dt=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(dt>>>26)|0,dt&=67108863,M=Math.imul(nn,sn),P=Math.imul(nn,Lr),P=P+Math.imul(wn,sn)|0,K=Math.imul(wn,Lr),M=M+Math.imul(Cn,Ur)|0,P=P+Math.imul(Cn,an)|0,P=P+Math.imul(mn,Ur)|0,K=K+Math.imul(mn,an)|0,M=M+Math.imul(Mn,Fr)|0,P=P+Math.imul(Mn,An)|0,P=P+Math.imul(Tr,Fr)|0,K=K+Math.imul(Tr,An)|0,M=M+Math.imul($t,Hn)|0,P=P+Math.imul($t,Kn)|0,P=P+Math.imul(vr,Hn)|0,K=K+Math.imul(vr,Kn)|0,M=M+Math.imul(sr,Or)|0,P=P+Math.imul(sr,Rr)|0,P=P+Math.imul(We,Or)|0,K=K+Math.imul(We,Rr)|0,M=M+Math.imul(mt,En)|0,P=P+Math.imul(mt,Ln)|0,P=P+Math.imul(Qe,En)|0,K=K+Math.imul(Qe,Ln)|0,M=M+Math.imul(we,ir)|0,P=P+Math.imul(we,Un)|0,P=P+Math.imul(He,ir)|0,K=K+Math.imul(He,Un)|0,M=M+Math.imul(ie,D)|0,P=P+Math.imul(ie,F)|0,P=P+Math.imul(ce,D)|0,K=K+Math.imul(ce,F)|0;var at=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(at>>>26)|0,at&=67108863,M=Math.imul(vn,sn),P=Math.imul(vn,Lr),P=P+Math.imul(Pn,sn)|0,K=Math.imul(Pn,Lr),M=M+Math.imul(nn,Ur)|0,P=P+Math.imul(nn,an)|0,P=P+Math.imul(wn,Ur)|0,K=K+Math.imul(wn,an)|0,M=M+Math.imul(Cn,Fr)|0,P=P+Math.imul(Cn,An)|0,P=P+Math.imul(mn,Fr)|0,K=K+Math.imul(mn,An)|0,M=M+Math.imul(Mn,Hn)|0,P=P+Math.imul(Mn,Kn)|0,P=P+Math.imul(Tr,Hn)|0,K=K+Math.imul(Tr,Kn)|0,M=M+Math.imul($t,Or)|0,P=P+Math.imul($t,Rr)|0,P=P+Math.imul(vr,Or)|0,K=K+Math.imul(vr,Rr)|0,M=M+Math.imul(sr,En)|0,P=P+Math.imul(sr,Ln)|0,P=P+Math.imul(We,En)|0,K=K+Math.imul(We,Ln)|0,M=M+Math.imul(mt,ir)|0,P=P+Math.imul(mt,Un)|0,P=P+Math.imul(Qe,ir)|0,K=K+Math.imul(Qe,Un)|0,M=M+Math.imul(we,D)|0,P=P+Math.imul(we,F)|0,P=P+Math.imul(He,D)|0,K=K+Math.imul(He,F)|0,M=M+Math.imul(ie,V)|0,P=P+Math.imul(ie,X)|0,P=P+Math.imul(ce,V)|0,K=K+Math.imul(ce,X)|0;var nt=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(nt>>>26)|0,nt&=67108863,M=Math.imul(Dn,sn),P=Math.imul(Dn,Lr),P=P+Math.imul(_n,sn)|0,K=Math.imul(_n,Lr),M=M+Math.imul(vn,Ur)|0,P=P+Math.imul(vn,an)|0,P=P+Math.imul(Pn,Ur)|0,K=K+Math.imul(Pn,an)|0,M=M+Math.imul(nn,Fr)|0,P=P+Math.imul(nn,An)|0,P=P+Math.imul(wn,Fr)|0,K=K+Math.imul(wn,An)|0,M=M+Math.imul(Cn,Hn)|0,P=P+Math.imul(Cn,Kn)|0,P=P+Math.imul(mn,Hn)|0,K=K+Math.imul(mn,Kn)|0,M=M+Math.imul(Mn,Or)|0,P=P+Math.imul(Mn,Rr)|0,P=P+Math.imul(Tr,Or)|0,K=K+Math.imul(Tr,Rr)|0,M=M+Math.imul($t,En)|0,P=P+Math.imul($t,Ln)|0,P=P+Math.imul(vr,En)|0,K=K+Math.imul(vr,Ln)|0,M=M+Math.imul(sr,ir)|0,P=P+Math.imul(sr,Un)|0,P=P+Math.imul(We,ir)|0,K=K+Math.imul(We,Un)|0,M=M+Math.imul(mt,D)|0,P=P+Math.imul(mt,F)|0,P=P+Math.imul(Qe,D)|0,K=K+Math.imul(Qe,F)|0,M=M+Math.imul(we,V)|0,P=P+Math.imul(we,X)|0,P=P+Math.imul(He,V)|0,K=K+Math.imul(He,X)|0,M=M+Math.imul(ie,ae)|0,P=P+Math.imul(ie,de)|0,P=P+Math.imul(ce,ae)|0,K=K+Math.imul(ce,de)|0;var it=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(it>>>26)|0,it&=67108863,M=Math.imul(Dn,Ur),P=Math.imul(Dn,an),P=P+Math.imul(_n,Ur)|0,K=Math.imul(_n,an),M=M+Math.imul(vn,Fr)|0,P=P+Math.imul(vn,An)|0,P=P+Math.imul(Pn,Fr)|0,K=K+Math.imul(Pn,An)|0,M=M+Math.imul(nn,Hn)|0,P=P+Math.imul(nn,Kn)|0,P=P+Math.imul(wn,Hn)|0,K=K+Math.imul(wn,Kn)|0,M=M+Math.imul(Cn,Or)|0,P=P+Math.imul(Cn,Rr)|0,P=P+Math.imul(mn,Or)|0,K=K+Math.imul(mn,Rr)|0,M=M+Math.imul(Mn,En)|0,P=P+Math.imul(Mn,Ln)|0,P=P+Math.imul(Tr,En)|0,K=K+Math.imul(Tr,Ln)|0,M=M+Math.imul($t,ir)|0,P=P+Math.imul($t,Un)|0,P=P+Math.imul(vr,ir)|0,K=K+Math.imul(vr,Un)|0,M=M+Math.imul(sr,D)|0,P=P+Math.imul(sr,F)|0,P=P+Math.imul(We,D)|0,K=K+Math.imul(We,F)|0,M=M+Math.imul(mt,V)|0,P=P+Math.imul(mt,X)|0,P=P+Math.imul(Qe,V)|0,K=K+Math.imul(Qe,X)|0,M=M+Math.imul(we,ae)|0,P=P+Math.imul(we,de)|0,P=P+Math.imul(He,ae)|0,K=K+Math.imul(He,de)|0;var st=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(st>>>26)|0,st&=67108863,M=Math.imul(Dn,Fr),P=Math.imul(Dn,An),P=P+Math.imul(_n,Fr)|0,K=Math.imul(_n,An),M=M+Math.imul(vn,Hn)|0,P=P+Math.imul(vn,Kn)|0,P=P+Math.imul(Pn,Hn)|0,K=K+Math.imul(Pn,Kn)|0,M=M+Math.imul(nn,Or)|0,P=P+Math.imul(nn,Rr)|0,P=P+Math.imul(wn,Or)|0,K=K+Math.imul(wn,Rr)|0,M=M+Math.imul(Cn,En)|0,P=P+Math.imul(Cn,Ln)|0,P=P+Math.imul(mn,En)|0,K=K+Math.imul(mn,Ln)|0,M=M+Math.imul(Mn,ir)|0,P=P+Math.imul(Mn,Un)|0,P=P+Math.imul(Tr,ir)|0,K=K+Math.imul(Tr,Un)|0,M=M+Math.imul($t,D)|0,P=P+Math.imul($t,F)|0,P=P+Math.imul(vr,D)|0,K=K+Math.imul(vr,F)|0,M=M+Math.imul(sr,V)|0,P=P+Math.imul(sr,X)|0,P=P+Math.imul(We,V)|0,K=K+Math.imul(We,X)|0,M=M+Math.imul(mt,ae)|0,P=P+Math.imul(mt,de)|0,P=P+Math.imul(Qe,ae)|0,K=K+Math.imul(Qe,de)|0;var Be=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Be>>>26)|0,Be&=67108863,M=Math.imul(Dn,Hn),P=Math.imul(Dn,Kn),P=P+Math.imul(_n,Hn)|0,K=Math.imul(_n,Kn),M=M+Math.imul(vn,Or)|0,P=P+Math.imul(vn,Rr)|0,P=P+Math.imul(Pn,Or)|0,K=K+Math.imul(Pn,Rr)|0,M=M+Math.imul(nn,En)|0,P=P+Math.imul(nn,Ln)|0,P=P+Math.imul(wn,En)|0,K=K+Math.imul(wn,Ln)|0,M=M+Math.imul(Cn,ir)|0,P=P+Math.imul(Cn,Un)|0,P=P+Math.imul(mn,ir)|0,K=K+Math.imul(mn,Un)|0,M=M+Math.imul(Mn,D)|0,P=P+Math.imul(Mn,F)|0,P=P+Math.imul(Tr,D)|0,K=K+Math.imul(Tr,F)|0,M=M+Math.imul($t,V)|0,P=P+Math.imul($t,X)|0,P=P+Math.imul(vr,V)|0,K=K+Math.imul(vr,X)|0,M=M+Math.imul(sr,ae)|0,P=P+Math.imul(sr,de)|0,P=P+Math.imul(We,ae)|0,K=K+Math.imul(We,de)|0;var Ke=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,M=Math.imul(Dn,Or),P=Math.imul(Dn,Rr),P=P+Math.imul(_n,Or)|0,K=Math.imul(_n,Rr),M=M+Math.imul(vn,En)|0,P=P+Math.imul(vn,Ln)|0,P=P+Math.imul(Pn,En)|0,K=K+Math.imul(Pn,Ln)|0,M=M+Math.imul(nn,ir)|0,P=P+Math.imul(nn,Un)|0,P=P+Math.imul(wn,ir)|0,K=K+Math.imul(wn,Un)|0,M=M+Math.imul(Cn,D)|0,P=P+Math.imul(Cn,F)|0,P=P+Math.imul(mn,D)|0,K=K+Math.imul(mn,F)|0,M=M+Math.imul(Mn,V)|0,P=P+Math.imul(Mn,X)|0,P=P+Math.imul(Tr,V)|0,K=K+Math.imul(Tr,X)|0,M=M+Math.imul($t,ae)|0,P=P+Math.imul($t,de)|0,P=P+Math.imul(vr,ae)|0,K=K+Math.imul(vr,de)|0;var Ee=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,M=Math.imul(Dn,En),P=Math.imul(Dn,Ln),P=P+Math.imul(_n,En)|0,K=Math.imul(_n,Ln),M=M+Math.imul(vn,ir)|0,P=P+Math.imul(vn,Un)|0,P=P+Math.imul(Pn,ir)|0,K=K+Math.imul(Pn,Un)|0,M=M+Math.imul(nn,D)|0,P=P+Math.imul(nn,F)|0,P=P+Math.imul(wn,D)|0,K=K+Math.imul(wn,F)|0,M=M+Math.imul(Cn,V)|0,P=P+Math.imul(Cn,X)|0,P=P+Math.imul(mn,V)|0,K=K+Math.imul(mn,X)|0,M=M+Math.imul(Mn,ae)|0,P=P+Math.imul(Mn,de)|0,P=P+Math.imul(Tr,ae)|0,K=K+Math.imul(Tr,de)|0;var Ie=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,M=Math.imul(Dn,ir),P=Math.imul(Dn,Un),P=P+Math.imul(_n,ir)|0,K=Math.imul(_n,Un),M=M+Math.imul(vn,D)|0,P=P+Math.imul(vn,F)|0,P=P+Math.imul(Pn,D)|0,K=K+Math.imul(Pn,F)|0,M=M+Math.imul(nn,V)|0,P=P+Math.imul(nn,X)|0,P=P+Math.imul(wn,V)|0,K=K+Math.imul(wn,X)|0,M=M+Math.imul(Cn,ae)|0,P=P+Math.imul(Cn,de)|0,P=P+Math.imul(mn,ae)|0,K=K+Math.imul(mn,de)|0;var Le=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(Le>>>26)|0,Le&=67108863,M=Math.imul(Dn,D),P=Math.imul(Dn,F),P=P+Math.imul(_n,D)|0,K=Math.imul(_n,F),M=M+Math.imul(vn,V)|0,P=P+Math.imul(vn,X)|0,P=P+Math.imul(Pn,V)|0,K=K+Math.imul(Pn,X)|0,M=M+Math.imul(nn,ae)|0,P=P+Math.imul(nn,de)|0,P=P+Math.imul(wn,ae)|0,K=K+Math.imul(wn,de)|0;var _e=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(_e>>>26)|0,_e&=67108863,M=Math.imul(Dn,V),P=Math.imul(Dn,X),P=P+Math.imul(_n,V)|0,K=Math.imul(_n,X),M=M+Math.imul(vn,ae)|0,P=P+Math.imul(vn,de)|0,P=P+Math.imul(Pn,ae)|0,K=K+Math.imul(Pn,de)|0;var te=(G+M|0)+((P&8191)<<13)|0;G=(K+(P>>>13)|0)+(te>>>26)|0,te&=67108863,M=Math.imul(Dn,ae),P=Math.imul(Dn,de),P=P+Math.imul(_n,ae)|0,K=Math.imul(_n,de);var ne=(G+M|0)+((P&8191)<<13)|0;return G=(K+(P>>>13)|0)+(ne>>>26)|0,ne&=67108863,j[0]=qe,j[1]=Ae,j[2]=Jt,j[3]=Oe,j[4]=tt,j[5]=rt,j[6]=dt,j[7]=at,j[8]=nt,j[9]=it,j[10]=st,j[11]=Be,j[12]=Ke,j[13]=Ee,j[14]=Ie,j[15]=Le,j[16]=_e,j[17]=te,j[18]=ne,G!==0&&(j[19]=G,B.length++),B};Math.imul||(m=h);function y(q,x,O){O.negative=x.negative^q.negative,O.length=q.length+x.length;for(var B=0,A=0,E=0;E<O.length-1;E++){var j=A;A=0;for(var G=B&67108863,M=Math.min(E,x.length-1),P=Math.max(0,E-q.length+1);P<=M;P++){var K=E-P,re=q.words[K]|0,ie=x.words[P]|0,ce=re*ie,oe=ce&67108863;j=j+(ce/67108864|0)|0,oe=oe+G|0,G=oe&67108863,j=j+(oe>>>26)|0,A+=j>>>26,j&=67108863}O.words[E]=G,B=j,j=A}return B!==0?O.words[E]=B:O.length--,O.strip()}function S(q,x,O){var B=new T;return B.mulp(q,x,O)}s.prototype.mulTo=function(x,O){var B,A=this.length+x.length;return this.length===10&&x.length===10?B=m(this,x,O):A<63?B=h(this,x,O):A<1024?B=y(this,x,O):B=S(this,x,O),B};function T(q,x){this.x=q,this.y=x}T.prototype.makeRBT=function(x){for(var O=new Array(x),B=s.prototype._countBits(x)-1,A=0;A<x;A++)O[A]=this.revBin(A,B,x);return O},T.prototype.revBin=function(x,O,B){if(x===0||x===B-1)return x;for(var A=0,E=0;E<O;E++)A|=(x&1)<<O-E-1,x>>=1;return A},T.prototype.permute=function(x,O,B,A,E,j){for(var G=0;G<j;G++)A[G]=O[x[G]],E[G]=B[x[G]]},T.prototype.transform=function(x,O,B,A,E,j){this.permute(j,x,O,B,A,E);for(var G=1;G<E;G<<=1)for(var M=G<<1,P=Math.cos(2*Math.PI/M),K=Math.sin(2*Math.PI/M),re=0;re<E;re+=M)for(var ie=P,ce=K,oe=0;oe<G;oe++){var we=B[re+oe],He=A[re+oe],yt=B[re+oe+G],mt=A[re+oe+G],Qe=ie*yt-ce*mt;mt=ie*mt+ce*yt,yt=Qe,B[re+oe]=we+yt,A[re+oe]=He+mt,B[re+oe+G]=we-yt,A[re+oe+G]=He-mt,oe!==M&&(Qe=P*ie-K*ce,ce=P*ce+K*ie,ie=Qe)}},T.prototype.guessLen13b=function(x,O){var B=Math.max(O,x)|1,A=B&1,E=0;for(B=B/2|0;B;B=B>>>1)E++;return 1<<E+1+A},T.prototype.conjugate=function(x,O,B){if(!(B<=1))for(var A=0;A<B/2;A++){var E=x[A];x[A]=x[B-A-1],x[B-A-1]=E,E=O[A],O[A]=-O[B-A-1],O[B-A-1]=-E}},T.prototype.normalize13b=function(x,O){for(var B=0,A=0;A<O/2;A++){var E=Math.round(x[2*A+1]/O)*8192+Math.round(x[2*A]/O)+B;x[A]=E&67108863,E<67108864?B=0:B=E/67108864|0}return x},T.prototype.convert13b=function(x,O,B,A){for(var E=0,j=0;j<O;j++)E=E+(x[j]|0),B[2*j]=E&8191,E=E>>>13,B[2*j+1]=E&8191,E=E>>>13;for(j=2*O;j<A;++j)B[j]=0;t(E===0),t((E&-8192)===0)},T.prototype.stub=function(x){for(var O=new Array(x),B=0;B<x;B++)O[B]=0;return O},T.prototype.mulp=function(x,O,B){var A=2*this.guessLen13b(x.length,O.length),E=this.makeRBT(A),j=this.stub(A),G=new Array(A),M=new Array(A),P=new Array(A),K=new Array(A),re=new Array(A),ie=new Array(A),ce=B.words;ce.length=A,this.convert13b(x.words,x.length,G,A),this.convert13b(O.words,O.length,K,A),this.transform(G,j,M,P,A,E),this.transform(K,j,re,ie,A,E);for(var oe=0;oe<A;oe++){var we=M[oe]*re[oe]-P[oe]*ie[oe];P[oe]=M[oe]*ie[oe]+P[oe]*re[oe],M[oe]=we}return this.conjugate(M,P,A),this.transform(M,P,ce,j,A,E),this.conjugate(ce,j,A),this.normalize13b(ce,A),B.negative=x.negative^O.negative,B.length=x.length+O.length,B.strip()},s.prototype.mul=function(x){var O=new s(null);return O.words=new Array(this.length+x.length),this.mulTo(x,O)},s.prototype.mulf=function(x){var O=new s(null);return O.words=new Array(this.length+x.length),S(this,x,O)},s.prototype.imul=function(x){return this.clone().mulTo(x,this)},s.prototype.imuln=function(x){t(typeof x=="number"),t(x<67108864);for(var O=0,B=0;B<this.length;B++){var A=(this.words[B]|0)*x,E=(A&67108863)+(O&67108863);O>>=26,O+=A/67108864|0,O+=E>>>26,this.words[B]=E&67108863}return O!==0&&(this.words[B]=O,this.length++),this},s.prototype.muln=function(x){return this.clone().imuln(x)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(x){var O=g(x);if(O.length===0)return new s(1);for(var B=this,A=0;A<O.length&&O[A]===0;A++,B=B.sqr());if(++A<O.length)for(var E=B.sqr();A<O.length;A++,E=E.sqr())O[A]!==0&&(B=B.mul(E));return B},s.prototype.iushln=function(x){t(typeof x=="number"&&x>=0);var O=x%26,B=(x-O)/26,A=67108863>>>26-O<<26-O,E;if(O!==0){var j=0;for(E=0;E<this.length;E++){var G=this.words[E]&A,M=(this.words[E]|0)-G<<O;this.words[E]=M|j,j=G>>>26-O}j&&(this.words[E]=j,this.length++)}if(B!==0){for(E=this.length-1;E>=0;E--)this.words[E+B]=this.words[E];for(E=0;E<B;E++)this.words[E]=0;this.length+=B}return this.strip()},s.prototype.ishln=function(x){return t(this.negative===0),this.iushln(x)},s.prototype.iushrn=function(x,O,B){t(typeof x=="number"&&x>=0);var A;O?A=(O-O%26)/26:A=0;var E=x%26,j=Math.min((x-E)/26,this.length),G=67108863^67108863>>>E<<E,M=B;if(A-=j,A=Math.max(0,A),M){for(var P=0;P<j;P++)M.words[P]=this.words[P];M.length=j}if(j!==0)if(this.length>j)for(this.length-=j,P=0;P<this.length;P++)this.words[P]=this.words[P+j];else this.words[0]=0,this.length=1;var K=0;for(P=this.length-1;P>=0&&(K!==0||P>=A);P--){var re=this.words[P]|0;this.words[P]=K<<26-E|re>>>E,K=re&G}return M&&K!==0&&(M.words[M.length++]=K),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(x,O,B){return t(this.negative===0),this.iushrn(x,O,B)},s.prototype.shln=function(x){return this.clone().ishln(x)},s.prototype.ushln=function(x){return this.clone().iushln(x)},s.prototype.shrn=function(x){return this.clone().ishrn(x)},s.prototype.ushrn=function(x){return this.clone().iushrn(x)},s.prototype.testn=function(x){t(typeof x=="number"&&x>=0);var O=x%26,B=(x-O)/26,A=1<<O;if(this.length<=B)return!1;var E=this.words[B];return!!(E&A)},s.prototype.imaskn=function(x){t(typeof x=="number"&&x>=0);var O=x%26,B=(x-O)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=B)return this;if(O!==0&&B++,this.length=Math.min(B,this.length),O!==0){var A=67108863^67108863>>>O<<O;this.words[this.length-1]&=A}return this.strip()},s.prototype.maskn=function(x){return this.clone().imaskn(x)},s.prototype.iaddn=function(x){return t(typeof x=="number"),t(x<67108864),x<0?this.isubn(-x):this.negative!==0?this.length===1&&(this.words[0]|0)<x?(this.words[0]=x-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(x),this.negative=1,this):this._iaddn(x)},s.prototype._iaddn=function(x){this.words[0]+=x;for(var O=0;O<this.length&&this.words[O]>=67108864;O++)this.words[O]-=67108864,O===this.length-1?this.words[O+1]=1:this.words[O+1]++;return this.length=Math.max(this.length,O+1),this},s.prototype.isubn=function(x){if(t(typeof x=="number"),t(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var O=0;O<this.length&&this.words[O]<0;O++)this.words[O]+=67108864,this.words[O+1]-=1;return this.strip()},s.prototype.addn=function(x){return this.clone().iaddn(x)},s.prototype.subn=function(x){return this.clone().isubn(x)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(x,O,B){var A=x.length+B,E;this._expand(A);var j,G=0;for(E=0;E<x.length;E++){j=(this.words[E+B]|0)+G;var M=(x.words[E]|0)*O;j-=M&67108863,G=(j>>26)-(M/67108864|0),this.words[E+B]=j&67108863}for(;E<this.length-B;E++)j=(this.words[E+B]|0)+G,G=j>>26,this.words[E+B]=j&67108863;if(G===0)return this.strip();for(t(G===-1),G=0,E=0;E<this.length;E++)j=-(this.words[E]|0)+G,G=j>>26,this.words[E]=j&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(x,O){var B=this.length-x.length,A=this.clone(),E=x,j=E.words[E.length-1]|0,G=this._countBits(j);B=26-G,B!==0&&(E=E.ushln(B),A.iushln(B),j=E.words[E.length-1]|0);var M=A.length-E.length,P;if(O!=="mod"){P=new s(null),P.length=M+1,P.words=new Array(P.length);for(var K=0;K<P.length;K++)P.words[K]=0}var re=A.clone()._ishlnsubmul(E,1,M);re.negative===0&&(A=re,P&&(P.words[M]=1));for(var ie=M-1;ie>=0;ie--){var ce=(A.words[E.length+ie]|0)*67108864+(A.words[E.length+ie-1]|0);for(ce=Math.min(ce/j|0,67108863),A._ishlnsubmul(E,ce,ie);A.negative!==0;)ce--,A.negative=0,A._ishlnsubmul(E,1,ie),A.isZero()||(A.negative^=1);P&&(P.words[ie]=ce)}return P&&P.strip(),A.strip(),O!=="div"&&B!==0&&A.iushrn(B),{div:P||null,mod:A}},s.prototype.divmod=function(x,O,B){if(t(!x.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var A,E,j;return this.negative!==0&&x.negative===0?(j=this.neg().divmod(x,O),O!=="mod"&&(A=j.div.neg()),O!=="div"&&(E=j.mod.neg(),B&&E.negative!==0&&E.iadd(x)),{div:A,mod:E}):this.negative===0&&x.negative!==0?(j=this.divmod(x.neg(),O),O!=="mod"&&(A=j.div.neg()),{div:A,mod:j.mod}):(this.negative&x.negative)!==0?(j=this.neg().divmod(x.neg(),O),O!=="div"&&(E=j.mod.neg(),B&&E.negative!==0&&E.isub(x)),{div:j.div,mod:E}):x.length>this.length||this.cmp(x)<0?{div:new s(0),mod:this}:x.length===1?O==="div"?{div:this.divn(x.words[0]),mod:null}:O==="mod"?{div:null,mod:new s(this.modn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new s(this.modn(x.words[0]))}:this._wordDiv(x,O)},s.prototype.div=function(x){return this.divmod(x,"div",!1).div},s.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},s.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},s.prototype.divRound=function(x){var O=this.divmod(x);if(O.mod.isZero())return O.div;var B=O.div.negative!==0?O.mod.isub(x):O.mod,A=x.ushrn(1),E=x.andln(1),j=B.cmp(A);return j<0||E===1&&j===0?O.div:O.div.negative!==0?O.div.isubn(1):O.div.iaddn(1)},s.prototype.modn=function(x){t(x<=67108863);for(var O=(1<<26)%x,B=0,A=this.length-1;A>=0;A--)B=(O*B+(this.words[A]|0))%x;return B},s.prototype.idivn=function(x){t(x<=67108863);for(var O=0,B=this.length-1;B>=0;B--){var A=(this.words[B]|0)+O*67108864;this.words[B]=A/x|0,O=A%x}return this.strip()},s.prototype.divn=function(x){return this.clone().idivn(x)},s.prototype.egcd=function(x){t(x.negative===0),t(!x.isZero());var O=this,B=x.clone();O.negative!==0?O=O.umod(x):O=O.clone();for(var A=new s(1),E=new s(0),j=new s(0),G=new s(1),M=0;O.isEven()&&B.isEven();)O.iushrn(1),B.iushrn(1),++M;for(var P=B.clone(),K=O.clone();!O.isZero();){for(var re=0,ie=1;(O.words[0]&ie)===0&&re<26;++re,ie<<=1);if(re>0)for(O.iushrn(re);re-- >0;)(A.isOdd()||E.isOdd())&&(A.iadd(P),E.isub(K)),A.iushrn(1),E.iushrn(1);for(var ce=0,oe=1;(B.words[0]&oe)===0&&ce<26;++ce,oe<<=1);if(ce>0)for(B.iushrn(ce);ce-- >0;)(j.isOdd()||G.isOdd())&&(j.iadd(P),G.isub(K)),j.iushrn(1),G.iushrn(1);O.cmp(B)>=0?(O.isub(B),A.isub(j),E.isub(G)):(B.isub(O),j.isub(A),G.isub(E))}return{a:j,b:G,gcd:B.iushln(M)}},s.prototype._invmp=function(x){t(x.negative===0),t(!x.isZero());var O=this,B=x.clone();O.negative!==0?O=O.umod(x):O=O.clone();for(var A=new s(1),E=new s(0),j=B.clone();O.cmpn(1)>0&&B.cmpn(1)>0;){for(var G=0,M=1;(O.words[0]&M)===0&&G<26;++G,M<<=1);if(G>0)for(O.iushrn(G);G-- >0;)A.isOdd()&&A.iadd(j),A.iushrn(1);for(var P=0,K=1;(B.words[0]&K)===0&&P<26;++P,K<<=1);if(P>0)for(B.iushrn(P);P-- >0;)E.isOdd()&&E.iadd(j),E.iushrn(1);O.cmp(B)>=0?(O.isub(B),A.isub(E)):(B.isub(O),E.isub(A))}var re;return O.cmpn(1)===0?re=A:re=E,re.cmpn(0)<0&&re.iadd(x),re},s.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var O=this.clone(),B=x.clone();O.negative=0,B.negative=0;for(var A=0;O.isEven()&&B.isEven();A++)O.iushrn(1),B.iushrn(1);do{for(;O.isEven();)O.iushrn(1);for(;B.isEven();)B.iushrn(1);var E=O.cmp(B);if(E<0){var j=O;O=B,B=j}else if(E===0||B.cmpn(1)===0)break;O.isub(B)}while(!0);return B.iushln(A)},s.prototype.invm=function(x){return this.egcd(x).a.umod(x)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(x){return this.words[0]&x},s.prototype.bincn=function(x){t(typeof x=="number");var O=x%26,B=(x-O)/26,A=1<<O;if(this.length<=B)return this._expand(B+1),this.words[B]|=A,this;for(var E=A,j=B;E!==0&&j<this.length;j++){var G=this.words[j]|0;G+=E,E=G>>>26,G&=67108863,this.words[j]=G}return E!==0&&(this.words[j]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(x){var O=x<0;if(this.negative!==0&&!O)return-1;if(this.negative===0&&O)return 1;this.strip();var B;if(this.length>1)B=1;else{O&&(x=-x),t(x<=67108863,"Number is too big");var A=this.words[0]|0;B=A===x?0:A<x?-1:1}return this.negative!==0?-B|0:B},s.prototype.cmp=function(x){if(this.negative!==0&&x.negative===0)return-1;if(this.negative===0&&x.negative!==0)return 1;var O=this.ucmp(x);return this.negative!==0?-O|0:O},s.prototype.ucmp=function(x){if(this.length>x.length)return 1;if(this.length<x.length)return-1;for(var O=0,B=this.length-1;B>=0;B--){var A=this.words[B]|0,E=x.words[B]|0;if(A!==E){A<E?O=-1:A>E&&(O=1);break}}return O},s.prototype.gtn=function(x){return this.cmpn(x)===1},s.prototype.gt=function(x){return this.cmp(x)===1},s.prototype.gten=function(x){return this.cmpn(x)>=0},s.prototype.gte=function(x){return this.cmp(x)>=0},s.prototype.ltn=function(x){return this.cmpn(x)===-1},s.prototype.lt=function(x){return this.cmp(x)===-1},s.prototype.lten=function(x){return this.cmpn(x)<=0},s.prototype.lte=function(x){return this.cmp(x)<=0},s.prototype.eqn=function(x){return this.cmpn(x)===0},s.prototype.eq=function(x){return this.cmp(x)===0},s.red=function(x){return new Z(x)},s.prototype.toRed=function(x){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},s.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(x){return this.red=x,this},s.prototype.forceRed=function(x){return t(!this.red,"Already a number in reduction context"),this._forceRed(x)},s.prototype.redAdd=function(x){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},s.prototype.redIAdd=function(x){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},s.prototype.redSub=function(x){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},s.prototype.redISub=function(x){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},s.prototype.redShl=function(x){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},s.prototype.redMul=function(x){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},s.prototype.redIMul=function(x){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},s.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(x){return t(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var H={k256:null,p224:null,p192:null,p25519:null};function C(q,x){this.name=q,this.p=new s(x,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}C.prototype._tmp=function(){var x=new s(null);return x.words=new Array(Math.ceil(this.n/13)),x},C.prototype.ireduce=function(x){var O=x,B;do this.split(O,this.tmp),O=this.imulK(O),O=O.iadd(this.tmp),B=O.bitLength();while(B>this.n);var A=B<this.n?-1:O.ucmp(this.p);return A===0?(O.words[0]=0,O.length=1):A>0?O.isub(this.p):O.strip!==void 0?O.strip():O._strip(),O},C.prototype.split=function(x,O){x.iushrn(this.n,0,O)},C.prototype.imulK=function(x){return x.imul(this.k)};function J(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(J,C),J.prototype.split=function(x,O){for(var B=4194303,A=Math.min(x.length,9),E=0;E<A;E++)O.words[E]=x.words[E];if(O.length=A,x.length<=9){x.words[0]=0,x.length=1;return}var j=x.words[9];for(O.words[O.length++]=j&B,E=10;E<x.length;E++){var G=x.words[E]|0;x.words[E-10]=(G&B)<<4|j>>>22,j=G}j>>>=22,x.words[E-10]=j,j===0&&x.length>10?x.length-=10:x.length-=9},J.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var O=0,B=0;B<x.length;B++){var A=x.words[B]|0;O+=A*977,x.words[B]=O&67108863,O=A*64+(O/67108864|0)}return x.words[x.length-1]===0&&(x.length--,x.words[x.length-1]===0&&x.length--),x};function z(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(z,C);function W(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(W,C);function Y(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(Y,C),Y.prototype.imulK=function(x){for(var O=0,B=0;B<x.length;B++){var A=(x.words[B]|0)*19+O,E=A&67108863;A>>>=26,x.words[B]=E,O=A}return O!==0&&(x.words[x.length++]=O),x},s._prime=function(x){if(H[x])return H[x];var O;if(x==="k256")O=new J;else if(x==="p224")O=new z;else if(x==="p192")O=new W;else if(x==="p25519")O=new Y;else throw new Error("Unknown prime "+x);return H[x]=O,O};function Z(q){if(typeof q=="string"){var x=s._prime(q);this.m=x.p,this.prime=x}else t(q.gtn(1),"modulus must be greater than 1"),this.m=q,this.prime=null}Z.prototype._verify1=function(x){t(x.negative===0,"red works only with positives"),t(x.red,"red works only with red numbers")},Z.prototype._verify2=function(x,O){t((x.negative|O.negative)===0,"red works only with positives"),t(x.red&&x.red===O.red,"red works only with red numbers")},Z.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):x.umod(this.m)._forceRed(this)},Z.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},Z.prototype.add=function(x,O){this._verify2(x,O);var B=x.add(O);return B.cmp(this.m)>=0&&B.isub(this.m),B._forceRed(this)},Z.prototype.iadd=function(x,O){this._verify2(x,O);var B=x.iadd(O);return B.cmp(this.m)>=0&&B.isub(this.m),B},Z.prototype.sub=function(x,O){this._verify2(x,O);var B=x.sub(O);return B.cmpn(0)<0&&B.iadd(this.m),B._forceRed(this)},Z.prototype.isub=function(x,O){this._verify2(x,O);var B=x.isub(O);return B.cmpn(0)<0&&B.iadd(this.m),B},Z.prototype.shl=function(x,O){return this._verify1(x),this.imod(x.ushln(O))},Z.prototype.imul=function(x,O){return this._verify2(x,O),this.imod(x.imul(O))},Z.prototype.mul=function(x,O){return this._verify2(x,O),this.imod(x.mul(O))},Z.prototype.isqr=function(x){return this.imul(x,x.clone())},Z.prototype.sqr=function(x){return this.mul(x,x)},Z.prototype.sqrt=function(x){if(x.isZero())return x.clone();var O=this.m.andln(3);if(t(O%2===1),O===3){var B=this.m.add(new s(1)).iushrn(2);return this.pow(x,B)}for(var A=this.m.subn(1),E=0;!A.isZero()&&A.andln(1)===0;)E++,A.iushrn(1);t(!A.isZero());var j=new s(1).toRed(this),G=j.redNeg(),M=this.m.subn(1).iushrn(1),P=this.m.bitLength();for(P=new s(2*P*P).toRed(this);this.pow(P,M).cmp(G)!==0;)P.redIAdd(G);for(var K=this.pow(P,A),re=this.pow(x,A.addn(1).iushrn(1)),ie=this.pow(x,A),ce=E;ie.cmp(j)!==0;){for(var oe=ie,we=0;oe.cmp(j)!==0;we++)oe=oe.redSqr();t(we<ce);var He=this.pow(K,new s(1).iushln(ce-we-1));re=re.redMul(He),K=He.redSqr(),ie=ie.redMul(K),ce=we}return re},Z.prototype.invm=function(x){var O=x._invmp(this.m);return O.negative!==0?(O.negative=0,this.imod(O).redNeg()):this.imod(O)},Z.prototype.pow=function(x,O){if(O.isZero())return new s(1).toRed(this);if(O.cmpn(1)===0)return x.clone();var B=4,A=new Array(1<<B);A[0]=new s(1).toRed(this),A[1]=x;for(var E=2;E<A.length;E++)A[E]=this.mul(A[E-1],x);var j=A[0],G=0,M=0,P=O.bitLength()%26;for(P===0&&(P=26),E=O.length-1;E>=0;E--){for(var K=O.words[E],re=P-1;re>=0;re--){var ie=K>>re&1;if(j!==A[0]&&(j=this.sqr(j)),ie===0&&G===0){M=0;continue}G<<=1,G|=ie,M++,!(M!==B&&(E!==0||re!==0))&&(j=this.mul(j,A[G]),M=0,G=0)}P=26}return j},Z.prototype.convertTo=function(x){var O=x.umod(this.m);return O===x?O.clone():O},Z.prototype.convertFrom=function(x){var O=x.clone();return O.red=null,O},s.mont=function(x){return new se(x)};function se(q){Z.call(this,q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(se,Z),se.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},se.prototype.convertFrom=function(x){var O=this.imod(x.mul(this.rinv));return O.red=null,O},se.prototype.imul=function(x,O){if(x.isZero()||O.isZero())return x.words[0]=0,x.length=1,x;var B=x.imul(O),A=B.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=B.isub(A).iushrn(this.shift),j=E;return E.cmp(this.m)>=0?j=E.isub(this.m):E.cmpn(0)<0&&(j=E.iadd(this.m)),j._forceRed(this)},se.prototype.mul=function(x,O){if(x.isZero()||O.isZero())return new s(0)._forceRed(this);var B=x.mul(O),A=B.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=B.isub(A).iushrn(this.shift),j=E;return E.cmp(this.m)>=0?j=E.isub(this.m):E.cmpn(0)<0&&(j=E.iadd(this.m)),j._forceRed(this)},se.prototype.invm=function(x){var O=this.imod(x._invmp(this.m).mul(this.r2));return O._forceRed(this)}})(typeof HB>"u"||HB,AD)});var OD=R(Aa=>{"use strict";b();p();var Nfe=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});Aa.stripHexPrefix=Aa.isHexPrefixed=Aa.getLength=Aa.decode=Aa.encode=void 0;var Ife=Nfe(Cs());function SD(r){if(Array.isArray(r)){let e=[];for(let n=0;n<r.length;n++)e.push(SD(r[n]));let t=v.Buffer.concat(e);return v.Buffer.concat([ED(t.length,192),t])}else{let e=WB(r);return e.length===1&&e[0]<128?e:v.Buffer.concat([ED(e.length,128),e])}}Aa.encode=SD;function KB(r,e){if(r[0]==="0"&&r[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(r,e)}function ED(r,e){if(r<56)return v.Buffer.from([r+e]);{let t=VB(r),n=t.length/2,s=VB(e+55+n);return v.Buffer.from(s+t,"hex")}}function Rfe(r,e=!1){if(!r||r.length===0)return v.Buffer.from([]);let t=WB(r),n=GB(t);if(e)return n;if(n.remainder.length!==0)throw new Error("invalid remainder");return n.data}Aa.decode=Rfe;function jfe(r){if(!r||r.length===0)return v.Buffer.from([]);let e=WB(r),t=e[0];if(t<=127)return e.length;if(t<=183)return t-127;if(t<=191)return t-182;if(t<=247)return t-191;{let n=t-246,s=KB(e.slice(1,n).toString("hex"),16);return n+s}}Aa.getLength=jfe;function GB(r){let e,t,n,s,i,a=[],o=r[0];if(o<=127)return{data:r.slice(0,1),remainder:r.slice(1)};if(o<=183){if(e=o-127,o===128?n=v.Buffer.from([]):n=r.slice(1,e),e===2&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:r.slice(e)}}else if(o<=191){if(t=o-182,r.length-1<t)throw new Error("invalid RLP: not enough bytes for string length");if(e=KB(r.slice(1,t).toString("hex"),16),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(n=r.slice(t,e+t),n.length<e)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:r.slice(e+t)}}else if(o<=247){for(e=o-191,s=r.slice(1,e);s.length;)i=GB(s),a.push(i.data),s=i.remainder;return{data:a,remainder:r.slice(e)}}else{t=o-246,e=KB(r.slice(1,t).toString("hex"),16);let c=t+e;if(c>r.length)throw new Error("invalid rlp: total length is larger than the data");if(s=r.slice(t,c),s.length===0)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)i=GB(s),a.push(i.data),s=i.remainder;return{data:a,remainder:r.slice(c)}}}function zB(r){return r.slice(0,2)==="0x"}Aa.isHexPrefixed=zB;function TD(r){return zB(r)?r.slice(2):r}Aa.stripHexPrefix=TD;function VB(r){if(r<0)throw new Error("Invalid integer as argument, must be unsigned!");let e=r.toString(16);return e.length%2?`0${e}`:e}function Mfe(r){return r.length%2?`0${r}`:r}function Cfe(r){let e=VB(r);return v.Buffer.from(e,"hex")}function WB(r){if(!v.Buffer.isBuffer(r)){if(typeof r=="string")return zB(r)?v.Buffer.from(Mfe(TD(r)),"hex"):v.Buffer.from(r);if(typeof r=="number"||typeof r=="bigint")return r?Cfe(r):v.Buffer.from([]);if(r==null)return v.Buffer.from([]);if(r instanceof Uint8Array)return v.Buffer.from(r);if(Ife.default.isBN(r))return v.Buffer.from(r.toArray());throw new Error("invalid type")}return r}});var BD=R(Gx=>{"use strict";b();p();Object.defineProperty(Gx,"__esModule",{value:!0});Gx.validateHexString=Gx.isHexString=void 0;function Lfe(r,e){return r.match(/^0x[0-9A-Fa-f]*$/)?!(e&&r.length!==2+2*e):!1}Gx.isHexString=Lfe;function Ufe(r){if(!r)return!1;let e=r.toLowerCase().startsWith("0x")?r.substring(2).toLowerCase():r.toLowerCase();return!(e.length===0||e.length%2!==0||!e.match(/^[0-9A-Fa-f]*$/))}Gx.validateHexString=Ufe});var kD=R(S7=>{"use strict";b();p();Object.defineProperty(S7,"__esModule",{value:!0});S7.encode=void 0;function Ffe(r){var e="0123456789abcdef";function t(z){var W,Y="";for(W=0;W<=3;W++)Y+=e.charAt(z>>W*8+4&15)+e.charAt(z>>W*8&15);return Y}function n(z,W){var Y=(z&65535)+(W&65535),Z=(z>>16)+(W>>16)+(Y>>16);return Z<<16|Y&65535}function s(z,W){return z<<W|z>>>32-W}function i(z,W,Y,Z,se,q){return n(s(n(n(W,z),n(Z,q)),se),Y)}function a(z,W,Y,Z,se,q,x){return i(W&Y|~W&Z,z,W,se,q,x)}function o(z,W,Y,Z,se,q,x){return i(W&Z|Y&~Z,z,W,se,q,x)}function c(z,W,Y,Z,se,q,x){return i(W^Y^Z,z,W,se,q,x)}function u(z,W,Y,Z,se,q,x){return i(Y^(W|~Z),z,W,se,q,x)}function f(z){var W,Y=(z.length+8>>6)+1,Z=new Array(Y*16);for(W=0;W<Y*16;W++)Z[W]=0;for(W=0;W<z.length;W++)Z[W>>2]|=z.charCodeAt(W)<<W%4*8;return Z[W>>2]|=128<<W%4*8,Z[Y*16-2]=z.length*8,Z}var d,g=f(""+r),h=1732584193,m=-271733879,y=-1732584194,S=271733878,T,H,C,J;for(d=0;d<g.length;d+=16)T=h,H=m,C=y,J=S,h=a(h,m,y,S,g[d+0],7,-680876936),S=a(S,h,m,y,g[d+1],12,-389564586),y=a(y,S,h,m,g[d+2],17,606105819),m=a(m,y,S,h,g[d+3],22,-1044525330),h=a(h,m,y,S,g[d+4],7,-176418897),S=a(S,h,m,y,g[d+5],12,1200080426),y=a(y,S,h,m,g[d+6],17,-1473231341),m=a(m,y,S,h,g[d+7],22,-45705983),h=a(h,m,y,S,g[d+8],7,1770035416),S=a(S,h,m,y,g[d+9],12,-1958414417),y=a(y,S,h,m,g[d+10],17,-42063),m=a(m,y,S,h,g[d+11],22,-1990404162),h=a(h,m,y,S,g[d+12],7,1804603682),S=a(S,h,m,y,g[d+13],12,-40341101),y=a(y,S,h,m,g[d+14],17,-1502002290),m=a(m,y,S,h,g[d+15],22,1236535329),h=o(h,m,y,S,g[d+1],5,-165796510),S=o(S,h,m,y,g[d+6],9,-1069501632),y=o(y,S,h,m,g[d+11],14,643717713),m=o(m,y,S,h,g[d+0],20,-373897302),h=o(h,m,y,S,g[d+5],5,-701558691),S=o(S,h,m,y,g[d+10],9,38016083),y=o(y,S,h,m,g[d+15],14,-660478335),m=o(m,y,S,h,g[d+4],20,-405537848),h=o(h,m,y,S,g[d+9],5,568446438),S=o(S,h,m,y,g[d+14],9,-1019803690),y=o(y,S,h,m,g[d+3],14,-187363961),m=o(m,y,S,h,g[d+8],20,1163531501),h=o(h,m,y,S,g[d+13],5,-1444681467),S=o(S,h,m,y,g[d+2],9,-51403784),y=o(y,S,h,m,g[d+7],14,1735328473),m=o(m,y,S,h,g[d+12],20,-1926607734),h=c(h,m,y,S,g[d+5],4,-378558),S=c(S,h,m,y,g[d+8],11,-2022574463),y=c(y,S,h,m,g[d+11],16,1839030562),m=c(m,y,S,h,g[d+14],23,-35309556),h=c(h,m,y,S,g[d+1],4,-1530992060),S=c(S,h,m,y,g[d+4],11,1272893353),y=c(y,S,h,m,g[d+7],16,-155497632),m=c(m,y,S,h,g[d+10],23,-1094730640),h=c(h,m,y,S,g[d+13],4,681279174),S=c(S,h,m,y,g[d+0],11,-358537222),y=c(y,S,h,m,g[d+3],16,-722521979),m=c(m,y,S,h,g[d+6],23,76029189),h=c(h,m,y,S,g[d+9],4,-640364487),S=c(S,h,m,y,g[d+12],11,-421815835),y=c(y,S,h,m,g[d+15],16,530742520),m=c(m,y,S,h,g[d+2],23,-995338651),h=u(h,m,y,S,g[d+0],6,-198630844),S=u(S,h,m,y,g[d+7],10,1126891415),y=u(y,S,h,m,g[d+14],15,-1416354905),m=u(m,y,S,h,g[d+5],21,-57434055),h=u(h,m,y,S,g[d+12],6,1700485571),S=u(S,h,m,y,g[d+3],10,-1894986606),y=u(y,S,h,m,g[d+10],15,-1051523),m=u(m,y,S,h,g[d+1],21,-2054922799),h=u(h,m,y,S,g[d+8],6,1873313359),S=u(S,h,m,y,g[d+15],10,-30611744),y=u(y,S,h,m,g[d+6],15,-1560198380),m=u(m,y,S,h,g[d+13],21,1309151649),h=u(h,m,y,S,g[d+4],6,-145523070),S=u(S,h,m,y,g[d+11],10,-1120210379),y=u(y,S,h,m,g[d+2],15,718787259),m=u(m,y,S,h,g[d+9],21,-343485551),h=n(h,T),m=n(m,H),y=n(y,C),S=n(S,J);return t(h)+t(m)+t(y)+t(S)}S7.encode=Ffe});var JB=R(Pr=>{"use strict";b();p();var qfe=Pr&&Pr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Dfe=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ID=Pr&&Pr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&qfe(e,r,t);return Dfe(e,r),e};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.blake2s=Pr.compress=Pr.IV=void 0;var Hfe=ID(Rx()),ND=ID(v7()),Sf=bi();Pr.IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function xl(r,e,t,n,s){return r=r+e+s|0,n=(0,Sf.rotr)(n^r,16),t=t+n|0,e=(0,Sf.rotr)(e^t,12),{a:r,b:e,c:t,d:n}}function yl(r,e,t,n,s){return r=r+e+s|0,n=(0,Sf.rotr)(n^r,8),t=t+n|0,e=(0,Sf.rotr)(e^t,7),{a:r,b:e,c:t,d:n}}function RD(r,e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S,T,H,C){let J=0;for(let z=0;z<n;z++)({a:s,b:c,c:g,d:S}=xl(s,c,g,S,t[e+r[J++]])),{a:s,b:c,c:g,d:S}=yl(s,c,g,S,t[e+r[J++]]),{a:i,b:u,c:h,d:T}=xl(i,u,h,T,t[e+r[J++]]),{a:i,b:u,c:h,d:T}=yl(i,u,h,T,t[e+r[J++]]),{a,b:f,c:m,d:H}=xl(a,f,m,H,t[e+r[J++]]),{a,b:f,c:m,d:H}=yl(a,f,m,H,t[e+r[J++]]),{a:o,b:d,c:y,d:C}=xl(o,d,y,C,t[e+r[J++]]),{a:o,b:d,c:y,d:C}=yl(o,d,y,C,t[e+r[J++]]),{a:s,b:u,c:m,d:C}=xl(s,u,m,C,t[e+r[J++]]),{a:s,b:u,c:m,d:C}=yl(s,u,m,C,t[e+r[J++]]),{a:i,b:f,c:y,d:S}=xl(i,f,y,S,t[e+r[J++]]),{a:i,b:f,c:y,d:S}=yl(i,f,y,S,t[e+r[J++]]),{a,b:d,c:g,d:T}=xl(a,d,g,T,t[e+r[J++]]),{a,b:d,c:g,d:T}=yl(a,d,g,T,t[e+r[J++]]),{a:o,b:c,c:h,d:H}=xl(o,c,h,H,t[e+r[J++]]),{a:o,b:c,c:h,d:H}=yl(o,c,h,H,t[e+r[J++]]);return{v0:s,v1:i,v2:a,v3:o,v4:c,v5:u,v6:f,v7:d,v8:g,v9:h,v10:m,v11:y,v12:S,v13:T,v14:H,v15:C}}Pr.compress=RD;var $B=class extends ND.BLAKE2{constructor(e={}){super(64,e.dkLen===void 0?32:e.dkLen,e,32,8,8),this.v0=Pr.IV[0]|0,this.v1=Pr.IV[1]|0,this.v2=Pr.IV[2]|0,this.v3=Pr.IV[3]|0,this.v4=Pr.IV[4]|0,this.v5=Pr.IV[5]|0,this.v6=Pr.IV[6]|0,this.v7=Pr.IV[7]|0;let t=e.key?e.key.length:0;if(this.v0^=this.outputLen|t<<8|1<<16|1<<24,e.salt){let n=(0,Sf.u32)((0,Sf.toBytes)(e.salt));this.v4^=n[0],this.v5^=n[1]}if(e.personalization){let n=(0,Sf.u32)((0,Sf.toBytes)(e.personalization));this.v6^=n[0],this.v7^=n[1]}if(e.key){let n=new Uint8Array(this.blockLen);n.set((0,Sf.toBytes)(e.key)),this.update(n)}}get(){let{v0:e,v1:t,v2:n,v3:s,v4:i,v5:a,v6:o,v7:c}=this;return[e,t,n,s,i,a,o,c]}set(e,t,n,s,i,a,o,c){this.v0=e|0,this.v1=t|0,this.v2=n|0,this.v3=s|0,this.v4=i|0,this.v5=a|0,this.v6=o|0,this.v7=c|0}compress(e,t,n){let{h:s,l:i}=Hfe.fromBig(BigInt(this.length)),{v0:a,v1:o,v2:c,v3:u,v4:f,v5:d,v6:g,v7:h,v8:m,v9:y,v10:S,v11:T,v12:H,v13:C,v14:J,v15:z}=RD(ND.SIGMA,t,e,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,Pr.IV[0],Pr.IV[1],Pr.IV[2],Pr.IV[3],i^Pr.IV[4],s^Pr.IV[5],n?~Pr.IV[6]:Pr.IV[6],Pr.IV[7]);this.v0^=a^m,this.v1^=o^y,this.v2^=c^S,this.v3^=u^T,this.v4^=f^H,this.v5^=d^C,this.v6^=g^J,this.v7^=h^z}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0)}};Pr.blake2s=(0,Sf.wrapConstructorWithOpts)(r=>new $B(r))});var T7=R(Vx=>{"use strict";b();p();Object.defineProperty(Vx,"__esModule",{value:!0});Vx.pbkdf2Async=Vx.pbkdf2=void 0;var Kfe=hw(),Tf=bi();function jD(r,e,t,n){(0,Tf.assertHash)(r);let s=(0,Tf.checkOpts)({dkLen:32,asyncTick:10},n),{c:i,dkLen:a,asyncTick:o}=s;if((0,Tf.assertNumber)(i),(0,Tf.assertNumber)(a),(0,Tf.assertNumber)(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=(0,Tf.toBytes)(e),u=(0,Tf.toBytes)(t),f=new Uint8Array(a),d=Kfe.hmac.create(r,c),g=d._cloneInto().update(u);return{c:i,dkLen:a,asyncTick:o,DK:f,PRF:d,PRFSalt:g}}function MD(r,e,t,n,s){return r.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),t}function Gfe(r,e,t,n){let{c:s,dkLen:i,DK:a,PRF:o,PRFSalt:c}=jD(r,e,t,n),u,f=new Uint8Array(4),d=(0,Tf.createView)(f),g=new Uint8Array(o.outputLen);for(let h=1,m=0;m<i;h++,m+=o.outputLen){let y=a.subarray(m,m+o.outputLen);d.setInt32(0,h,!1),(u=c._cloneInto(u)).update(f).digestInto(g),y.set(g.subarray(0,y.length));for(let S=1;S<s;S++){o._cloneInto(u).update(g).digestInto(g);for(let T=0;T<y.length;T++)y[T]^=g[T]}}return MD(o,c,a,u,g)}Vx.pbkdf2=Gfe;async function Vfe(r,e,t,n){let{c:s,dkLen:i,asyncTick:a,DK:o,PRF:c,PRFSalt:u}=jD(r,e,t,n),f,d=new Uint8Array(4),g=(0,Tf.createView)(d),h=new Uint8Array(c.outputLen);for(let m=1,y=0;y<i;m++,y+=c.outputLen){let S=o.subarray(y,y+c.outputLen);g.setInt32(0,m,!1),(f=u._cloneInto(f)).update(d).digestInto(h),S.set(h.subarray(0,S.length)),await(0,Tf.asyncLoop)(s-1,a,T=>{c._cloneInto(f).update(h).digestInto(h);for(let H=0;H<S.length;H++)S[H]^=h[H]})}return MD(c,u,o,f,h)}Vx.pbkdf2Async=Vfe});var DD=R(Wx=>{"use strict";b();p();Object.defineProperty(Wx,"__esModule",{value:!0});Wx.scryptAsync=Wx.scrypt=void 0;var LD=Ix(),UD=T7(),jo=bi(),lr=(r,e)=>r<<e|r>>>32-e;function CD(r,e,t,n,s,i){let a=r[e++]^t[n++],o=r[e++]^t[n++],c=r[e++]^t[n++],u=r[e++]^t[n++],f=r[e++]^t[n++],d=r[e++]^t[n++],g=r[e++]^t[n++],h=r[e++]^t[n++],m=r[e++]^t[n++],y=r[e++]^t[n++],S=r[e++]^t[n++],T=r[e++]^t[n++],H=r[e++]^t[n++],C=r[e++]^t[n++],J=r[e++]^t[n++],z=r[e++]^t[n++],W=a,Y=o,Z=c,se=u,q=f,x=d,O=g,B=h,A=m,E=y,j=S,G=T,M=H,P=C,K=J,re=z;for(let ie=0;ie<8;ie+=2)q^=lr(W+M|0,7),A^=lr(q+W|0,9),M^=lr(A+q|0,13),W^=lr(M+A|0,18),E^=lr(x+Y|0,7),P^=lr(E+x|0,9),Y^=lr(P+E|0,13),x^=lr(Y+P|0,18),K^=lr(j+O|0,7),Z^=lr(K+j|0,9),O^=lr(Z+K|0,13),j^=lr(O+Z|0,18),se^=lr(re+G|0,7),B^=lr(se+re|0,9),G^=lr(B+se|0,13),re^=lr(G+B|0,18),Y^=lr(W+se|0,7),Z^=lr(Y+W|0,9),se^=lr(Z+Y|0,13),W^=lr(se+Z|0,18),O^=lr(x+q|0,7),B^=lr(O+x|0,9),q^=lr(B+O|0,13),x^=lr(q+B|0,18),G^=lr(j+E|0,7),A^=lr(G+j|0,9),E^=lr(A+G|0,13),j^=lr(E+A|0,18),M^=lr(re+K|0,7),P^=lr(M+re|0,9),K^=lr(P+M|0,13),re^=lr(K+P|0,18);s[i++]=a+W|0,s[i++]=o+Y|0,s[i++]=c+Z|0,s[i++]=u+se|0,s[i++]=f+q|0,s[i++]=d+x|0,s[i++]=g+O|0,s[i++]=h+B|0,s[i++]=m+A|0,s[i++]=y+E|0,s[i++]=S+j|0,s[i++]=T+G|0,s[i++]=H+M|0,s[i++]=C+P|0,s[i++]=J+K|0,s[i++]=z+re|0}function zx(r,e,t,n,s){let i=n+0,a=n+16*s;for(let o=0;o<16;o++)t[a+o]=r[e+(2*s-1)*16+o];for(let o=0;o<s;o++,i+=16,e+=16)CD(t,a,r,e,t,i),o>0&&(a+=16),CD(t,i,r,e+=16,t,a)}function FD(r,e,t){let n=(0,jo.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:s,r:i,p:a,dkLen:o,asyncTick:c,maxmem:u,onProgress:f}=n;if((0,jo.assertNumber)(s),(0,jo.assertNumber)(i),(0,jo.assertNumber)(a),(0,jo.assertNumber)(o),(0,jo.assertNumber)(c),(0,jo.assertNumber)(u),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");let d=128*i,g=d/4;if(s<=1||(s&s-1)!==0||s>=2**(d/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/d)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");let h=d*(s+a);if(h>u)throw new Error(`Scrypt: parameters too large, ${h} (128 * r * (N + p)) > ${u} (maxmem)`);let m=(0,UD.pbkdf2)(LD.sha256,r,e,{c:1,dkLen:d*a}),y=(0,jo.u32)(m),S=(0,jo.u32)(new Uint8Array(d*s)),T=(0,jo.u32)(new Uint8Array(d)),H=()=>{};if(f){let C=2*s*a,J=Math.max(Math.floor(C/1e4),1),z=0;H=()=>{z++,f&&(!(z%J)||z===C)&&f(z/C)}}return{N:s,r:i,p:a,dkLen:o,blockSize32:g,V:S,B32:y,B:m,tmp:T,blockMixCb:H,asyncTick:c}}function qD(r,e,t,n,s){let i=(0,UD.pbkdf2)(LD.sha256,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),s.fill(0),i}function zfe(r,e,t){let{N:n,r:s,p:i,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:d,blockMixCb:g}=FD(r,e,t);for(let h=0;h<i;h++){let m=o*h;for(let y=0;y<o;y++)c[y]=u[m+y];for(let y=0,S=0;y<n-1;y++)zx(c,S,c,S+=o,s),g();zx(c,(n-1)*o,u,m,s),g();for(let y=0;y<n;y++){let S=u[m+o-16]%n;for(let T=0;T<o;T++)d[T]=u[m+T]^c[S*o+T];zx(d,0,u,m,s),g()}}return qD(r,a,f,c,d)}Wx.scrypt=zfe;async function Wfe(r,e,t){let{N:n,r:s,p:i,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:d,blockMixCb:g,asyncTick:h}=FD(r,e,t);for(let m=0;m<i;m++){let y=o*m;for(let T=0;T<o;T++)c[T]=u[y+T];let S=0;await(0,jo.asyncLoop)(n-1,h,T=>{zx(c,S,c,S+=o,s),g()}),zx(c,(n-1)*o,u,y,s),g(),await(0,jo.asyncLoop)(n,h,T=>{let H=u[y+o-16]%n;for(let C=0;C<o;C++)d[C]=u[y+C]^c[H*o+C];zx(d,0,u,y,s),g()})}return qD(r,a,f,c,d)}Wx.scryptAsync=Wfe});var GD=R(Of=>{"use strict";b();p();var $fe=Of&&Of.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Jfe=Of&&Of.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ZB=Of&&Of.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$fe(e,r,t);return Jfe(e,r),e};Object.defineProperty(Of,"__esModule",{value:!0});Of.blake3=void 0;var HD=ZB(Rx()),Zfe=ZB(v7()),cu=ZB(JB()),Wb=bi(),Mo;(function(r){r[r.CHUNK_START=1]="CHUNK_START",r[r.CHUNK_END=2]="CHUNK_END",r[r.PARENT=4]="PARENT",r[r.ROOT=8]="ROOT",r[r.KEYED_HASH=16]="KEYED_HASH",r[r.DERIVE_KEY_CONTEXT=32]="DERIVE_KEY_CONTEXT",r[r.DERIVE_KEY_MATERIAL=64]="DERIVE_KEY_MATERIAL"})(Mo||(Mo={}));var KD=(()=>{let r=Array.from({length:16},(n,s)=>s),e=n=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(s=>n[s]),t=[];for(let n=0,s=r;n<7;n++,s=e(s))t.push(...s);return Uint8Array.from(t)})(),bw=class extends Zfe.BLAKE2{constructor(e={},t=0){if(super(64,e.dkLen===void 0?32:e.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=e.dkLen===void 0?32:e.dkLen,(0,Wb.assertNumber)(this.outputLen),e.key!==void 0&&e.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(e.key!==void 0){let n=(0,Wb.toBytes)(e.key);if(n.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=(0,Wb.u32)(n),this.flags=t|Mo.KEYED_HASH}else if(e.context!==void 0){let n=new bw({dkLen:32},Mo.DERIVE_KEY_CONTEXT).update(e.context).digest();this.IV=(0,Wb.u32)(n),this.flags=t|Mo.DERIVE_KEY_MATERIAL}else this.IV=cu.IV.slice(),this.flags=t;this.state=this.IV.slice(),this.bufferOut=(0,Wb.u8)(this.bufferOut32)}get(){return[]}set(){}b2Compress(e,t,n,s=0){let{state:i,pos:a}=this,{h:o,l:c}=HD.fromBig(BigInt(e),!0),{v0:u,v1:f,v2:d,v3:g,v4:h,v5:m,v6:y,v7:S,v8:T,v9:H,v10:C,v11:J,v12:z,v13:W,v14:Y,v15:Z}=cu.compress(KD,s,n,7,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],cu.IV[0],cu.IV[1],cu.IV[2],cu.IV[3],o,c,a,t);i[0]=u^T,i[1]=f^H,i[2]=d^C,i[3]=g^J,i[4]=h^z,i[5]=m^W,i[6]=y^Y,i[7]=S^Z}compress(e,t=0,n=!1){let s=this.flags;if(this.chunkPos||(s|=Mo.CHUNK_START),(this.chunkPos===15||n)&&(s|=Mo.CHUNK_END),n||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,s,e,t),this.chunkPos+=1,this.chunkPos===16||n){let i=this.state;this.state=this.IV.slice();for(let a,o=this.chunksDone+1;(n||!(o&1))&&(a=this.stack.pop());o>>=1)this.buffer32.set(a,0),this.buffer32.set(i,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|Mo.PARENT,this.buffer32,0),i=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(i)}this.pos=0}_cloneInto(e){e=super._cloneInto(e);let{IV:t,flags:n,state:s,chunkPos:i,posOut:a,chunkOut:o,stack:c,chunksDone:u}=this;return e.state.set(s.slice()),e.stack=c.map(f=>Uint32Array.from(f)),e.IV.set(t),e.flags=n,e.chunkPos=i,e.chunksDone=u,e.posOut=a,e.chunkOut=o,e.enableXOF=this.enableXOF,e.bufferOut32.set(this.bufferOut32),e}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let e of this.stack)e.fill(0)}b2CompressOut(){let{state:e,pos:t,flags:n,buffer32:s,bufferOut32:i}=this,{h:a,l:o}=HD.fromBig(BigInt(this.chunkOut++)),{v0:c,v1:u,v2:f,v3:d,v4:g,v5:h,v6:m,v7:y,v8:S,v9:T,v10:H,v11:C,v12:J,v13:z,v14:W,v15:Y}=cu.compress(KD,0,s,7,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],cu.IV[0],cu.IV[1],cu.IV[2],cu.IV[3],o,a,t,n);i[0]=c^S,i[1]=u^T,i[2]=f^H,i[3]=d^C,i[4]=g^J,i[5]=h^z,i[6]=m^W,i[7]=y^Y,i[8]=e[0]^S,i[9]=e[1]^T,i[10]=e[2]^H,i[11]=e[3]^C,i[12]=e[4]^J,i[13]=e[5]^z,i[14]=e[6]^W,i[15]=e[7]^Y,this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let e=this.flags|Mo.ROOT;this.stack.length?(e|=Mo.PARENT,this.compress(this.buffer32,0,!0),this.chunksDone=0,this.pos=this.blockLen):e|=(this.chunkPos?0:Mo.CHUNK_START)|Mo.CHUNK_END,this.flags=e,this.b2CompressOut()}writeInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array))throw new Error("Blake3: Invalid output buffer");this.finish();let{blockLen:t,bufferOut:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=t&&this.b2CompressOut();let a=Math.min(this.blockLen-this.posOut,i-s);e.set(n.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF impossible after digest call");return this.writeInto(e)}xof(e){return(0,Wb.assertNumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(e.length<this.outputLen)throw new Error("Blake3: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}};Of.blake3=(0,Wb.wrapConstructorWithOpts)(r=>new bw(r))});var $b=R(St=>{"use strict";b();p();var VD=St&&St.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Qfe=St&&St.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Wn=St&&St.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&VD(e,r,t)},QB=St&&St.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&VD(e,r,t);return Qfe(e,r),e};Object.defineProperty(St,"__esModule",{value:!0});St.randomBytes=St.concatBytes=St.reverseBuffer=St.md5=St.rlp=void 0;Wn(zq(),St);Wn(hD(),St);Wn(bD(),St);Wn(pD(),St);Wn(xD(),St);Wn(dw(),St);Wn(wD(),St);Wn(vD(),St);Wn(_D(),St);Wn(DB(),St);St.rlp=QB(OD());Wn(BD(),St);St.md5=QB(kD());Wn(Kb(),St);Wn(Ix(),St);Wn(hw(),St);Wn(CB(),St);Wn(g7(),St);Wn(w7(),St);Wn(FB(),St);Wn(JB(),St);Wn(T7(),St);Wn(DD(),St);Wn(GD(),St);var Yfe=QB(bi()),Xfe=fce();function e0e(r){if(r.length<1)return r;let e=r.length-1,t=0;for(let n=0;n<r.length/2;n++)t=r[n],r[n]=r[e],r[e]=t,e--;return r}St.reverseBuffer=e0e;function t0e(r,e){return Yfe.concatBytes(Uint8Array.from(r),Uint8Array.from(e))}St.concatBytes=t0e;function r0e(r){return Xfe(r)}St.randomBytes=r0e});var oo=R(zD=>{"use strict";b();p();var uu=zD,n0e=Cs(),s0e=lce(),O7=bce();uu.assert=s0e;uu.toArray=O7.toArray;uu.zero2=O7.zero2;uu.toHex=O7.toHex;uu.encode=O7.encode;function i0e(r,e,t){var n=new Array(Math.max(r.bitLength(),t)+1);n.fill(0);for(var s=1<<e+1,i=r.clone(),a=0;a<n.length;a++){var o,c=i.andln(s-1);i.isOdd()?(c>(s>>1)-1?o=(s>>1)-c:o=c,i.isubn(o)):o=0,n[a]=o,i.iushrn(1)}return n}uu.getNAF=i0e;function a0e(r,e){var t=[[],[]];r=r.clone(),e=e.clone();for(var n=0,s=0,i;r.cmpn(-n)>0||e.cmpn(-s)>0;){var a=r.andln(3)+n&3,o=e.andln(3)+s&3;a===3&&(a=-1),o===3&&(o=-1);var c;(a&1)===0?c=0:(i=r.andln(7)+n&7,(i===3||i===5)&&o===2?c=-a:c=a),t[0].push(c);var u;(o&1)===0?u=0:(i=e.andln(7)+s&7,(i===3||i===5)&&a===2?u=-o:u=o),t[1].push(u),2*n===c+1&&(n=1-n),2*s===u+1&&(s=1-s),r.iushrn(1),e.iushrn(1)}return t}uu.getJSF=a0e;function o0e(r,e,t){var n="_"+e;r.prototype[e]=function(){return this[n]!==void 0?this[n]:this[n]=t.call(this)}}uu.cachedProperty=o0e;function c0e(r){return typeof r=="string"?uu.toArray(r,"hex"):r}uu.parseBytes=c0e;function u0e(r){return new n0e(r,"hex","le")}uu.intFromLE=u0e});var gw=R((RNe,WD)=>{"use strict";b();p();var pw=oo(),Jb=Cs(),B7=pw.getNAF,f0e=pw.getJSF,k7=pw.assert;function ml(r,e){this.type=r,this.p=new Jb(e.p,16),this.red=e.prime?Jb.red(e.prime):Jb.mont(this.p),this.zero=new Jb(0).toRed(this.red),this.one=new Jb(1).toRed(this.red),this.two=new Jb(2).toRed(this.red),this.n=e.n&&new Jb(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}WD.exports=ml;ml.prototype.point=function(){throw new Error("Not implemented")};ml.prototype.validate=function(){throw new Error("Not implemented")};ml.prototype._fixedNafMul=function(e,t){k7(e.precomputed);var n=e._getDoubles(),s=B7(t,1,this._bitLength),i=(1<<n.step+1)-(n.step%2===0?2:1);i/=3;var a=[],o,c;for(o=0;o<s.length;o+=n.step){c=0;for(var u=o+n.step-1;u>=o;u--)c=(c<<1)+s[u];a.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),g=i;g>0;g--){for(o=0;o<a.length;o++)c=a[o],c===g?d=d.mixedAdd(n.points[o]):c===-g&&(d=d.mixedAdd(n.points[o].neg()));f=f.add(d)}return f.toP()};ml.prototype._wnafMul=function(e,t){var n=4,s=e._getNAFPoints(n);n=s.wnd;for(var i=s.points,a=B7(t,n,this._bitLength),o=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var u=0;c>=0&&a[c]===0;c--)u++;if(c>=0&&u++,o=o.dblp(u),c<0)break;var f=a[c];k7(f!==0),e.type==="affine"?f>0?o=o.mixedAdd(i[f-1>>1]):o=o.mixedAdd(i[-f-1>>1].neg()):f>0?o=o.add(i[f-1>>1]):o=o.add(i[-f-1>>1].neg())}return e.type==="affine"?o.toP():o};ml.prototype._wnafMulAdd=function(e,t,n,s,i){var a=this._wnafT1,o=this._wnafT2,c=this._wnafT3,u=0,f,d,g;for(f=0;f<s;f++){g=t[f];var h=g._getNAFPoints(e);a[f]=h.wnd,o[f]=h.points}for(f=s-1;f>=1;f-=2){var m=f-1,y=f;if(a[m]!==1||a[y]!==1){c[m]=B7(n[m],a[m],this._bitLength),c[y]=B7(n[y],a[y],this._bitLength),u=Math.max(c[m].length,u),u=Math.max(c[y].length,u);continue}var S=[t[m],null,null,t[y]];t[m].y.cmp(t[y].y)===0?(S[1]=t[m].add(t[y]),S[2]=t[m].toJ().mixedAdd(t[y].neg())):t[m].y.cmp(t[y].y.redNeg())===0?(S[1]=t[m].toJ().mixedAdd(t[y]),S[2]=t[m].add(t[y].neg())):(S[1]=t[m].toJ().mixedAdd(t[y]),S[2]=t[m].toJ().mixedAdd(t[y].neg()));var T=[-3,-1,-5,-7,0,7,5,1,3],H=f0e(n[m],n[y]);for(u=Math.max(H[0].length,u),c[m]=new Array(u),c[y]=new Array(u),d=0;d<u;d++){var C=H[0][d]|0,J=H[1][d]|0;c[m][d]=T[(C+1)*3+(J+1)],c[y][d]=0,o[m]=S}}var z=this.jpoint(null,null,null),W=this._wnafT4;for(f=u;f>=0;f--){for(var Y=0;f>=0;){var Z=!0;for(d=0;d<s;d++)W[d]=c[d][f]|0,W[d]!==0&&(Z=!1);if(!Z)break;Y++,f--}if(f>=0&&Y++,z=z.dblp(Y),f<0)break;for(d=0;d<s;d++){var se=W[d];se!==0&&(se>0?g=o[d][se-1>>1]:se<0&&(g=o[d][-se-1>>1].neg()),g.type==="affine"?z=z.mixedAdd(g):z=z.add(g))}}for(f=0;f<s;f++)o[f]=null;return i?z:z.toP()};function Co(r,e){this.curve=r,this.type=e,this.precomputed=null}ml.BasePoint=Co;Co.prototype.eq=function(){throw new Error("Not implemented")};Co.prototype.validate=function(){return this.curve.validate(this)};ml.prototype.decodePoint=function(e,t){e=pw.toArray(e,t);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?k7(e[e.length-1]%2===0):e[0]===7&&k7(e[e.length-1]%2===1);var s=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return s}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};Co.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Co.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))};Co.prototype.encode=function(e,t){return pw.encode(this._encode(t),e)};Co.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this};Co.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1};Co.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],s=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)s=s.dbl();n.push(s)}return{step:e,points:n}};Co.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,s=n===1?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(s);return{wnd:e,points:t}};Co.prototype._getBeta=function(){return null};Co.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t}});var JD=R((CNe,$D)=>{"use strict";b();p();var d0e=oo(),$n=Cs(),YB=xB(),$x=gw(),l0e=d0e.assert;function Lo(r){$x.call(this,"short",r),this.a=new $n(r.a,16).toRed(this.red),this.b=new $n(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}YB(Lo,$x);$D.exports=Lo;Lo.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,n;if(e.beta)t=new $n(e.beta,16).toRed(this.red);else{var s=this._getEndoRoots(this.p);t=s[0].cmp(s[1])<0?s[0]:s[1],t=t.toRed(this.red)}if(e.lambda)n=new $n(e.lambda,16);else{var i=this._getEndoRoots(this.n);this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))===0?n=i[0]:(n=i[1],l0e(this.g.mul(n).x.cmp(this.g.x.redMul(t))===0))}var a;return e.basis?a=e.basis.map(function(o){return{a:new $n(o.a,16),b:new $n(o.b,16)}}):a=this._getEndoBasis(n),{beta:t,lambda:n,basis:a}}};Lo.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:$n.mont(e),n=new $n(2).toRed(t).redInvm(),s=n.redNeg(),i=new $n(3).toRed(t).redNeg().redSqrt().redMul(n),a=s.redAdd(i).fromRed(),o=s.redSub(i).fromRed();return[a,o]};Lo.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,s=this.n.clone(),i=new $n(1),a=new $n(0),o=new $n(0),c=new $n(1),u,f,d,g,h,m,y,S=0,T,H;n.cmpn(0)!==0;){var C=s.div(n);T=s.sub(C.mul(n)),H=o.sub(C.mul(i));var J=c.sub(C.mul(a));if(!d&&T.cmp(t)<0)u=y.neg(),f=i,d=T.neg(),g=H;else if(d&&++S===2)break;y=T,s=n,n=T,o=i,i=H,c=a,a=J}h=T.neg(),m=H;var z=d.sqr().add(g.sqr()),W=h.sqr().add(m.sqr());return W.cmp(z)>=0&&(h=u,m=f),d.negative&&(d=d.neg(),g=g.neg()),h.negative&&(h=h.neg(),m=m.neg()),[{a:d,b:g},{a:h,b:m}]};Lo.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],s=t[1],i=s.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),c=a.mul(s.a),u=i.mul(n.b),f=a.mul(s.b),d=e.sub(o).sub(c),g=u.add(f).neg();return{k1:d,k2:g}};Lo.prototype.pointFromX=function(e,t){e=new $n(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),s=n.redSqrt();if(s.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var i=s.fromRed().isOdd();return(t&&!i||!t&&i)&&(s=s.redNeg()),this.point(e,s)};Lo.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,s=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(s).redIAdd(this.b);return n.redSqr().redISub(i).cmpn(0)===0};Lo.prototype._endoWnafMulAdd=function(e,t,n){for(var s=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),c=e[a],u=c._getBeta();o.k1.negative&&(o.k1.ineg(),c=c.neg(!0)),o.k2.negative&&(o.k2.ineg(),u=u.neg(!0)),s[a*2]=c,s[a*2+1]=u,i[a*2]=o.k1,i[a*2+1]=o.k2}for(var f=this._wnafMulAdd(1,s,i,a*2,n),d=0;d<a*2;d++)s[d]=null,i[d]=null;return f};function Js(r,e,t,n){$x.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new $n(e,16),this.y=new $n(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}YB(Js,$x.BasePoint);Lo.prototype.point=function(e,t,n){return new Js(this,e,t,n)};Lo.prototype.pointFromJSON=function(e,t){return Js.fromJSON(this,e,t)};Js.prototype._getBeta=function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,s=function(i){return n.point(i.x.redMul(n.endo.beta),i.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(s)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(s)}}}return t}};Js.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Js.fromJSON=function(e,t,n){typeof t=="string"&&(t=JSON.parse(t));var s=e.point(t[0],t[1],n);if(!t[2])return s;function i(o){return e.point(o[0],o[1],n)}var a=t[2];return s.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[s].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[s].concat(a.naf.points.map(i))}},s};Js.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Js.prototype.isInfinity=function(){return this.inf};Js.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),s=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,s)};Js.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),s=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(s),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)};Js.prototype.getX=function(){return this.x.fromRed()};Js.prototype.getY=function(){return this.y.fromRed()};Js.prototype.mul=function(e){return e=new $n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Js.prototype.mulAdd=function(e,t,n){var s=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(s,i):this.curve._wnafMulAdd(1,s,i,2)};Js.prototype.jmulAdd=function(e,t,n){var s=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(s,i,!0):this.curve._wnafMulAdd(1,s,i,2,!0)};Js.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Js.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,s=function(i){return i.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(s)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(s)}}}return t};Js.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function pi(r,e,t,n){$x.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new $n(0)):(this.x=new $n(e,16),this.y=new $n(t,16),this.z=new $n(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}YB(pi,$x.BasePoint);Lo.prototype.jpoint=function(e,t,n){return new pi(this,e,t,n)};pi.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),s=this.y.redMul(t).redMul(e);return this.curve.point(n,s)};pi.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};pi.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),s=this.x.redMul(t),i=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),c=s.redSub(i),u=a.redSub(o);if(c.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),d=f.redMul(c),g=s.redMul(f),h=u.redSqr().redIAdd(d).redISub(g).redISub(g),m=u.redMul(g.redISub(h)).redISub(a.redMul(d)),y=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,m,y)};pi.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,s=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=n.redSub(s),c=i.redSub(a);if(o.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),f=u.redMul(o),d=n.redMul(u),g=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(g)).redISub(i.redMul(f)),m=this.z.redMul(o);return this.curve.jpoint(g,h,m)};pi.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var s=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,c=this.z,u=c.redSqr().redSqr(),f=o.redAdd(o);for(t=0;t<e;t++){var d=a.redSqr(),g=f.redSqr(),h=g.redSqr(),m=d.redAdd(d).redIAdd(d).redIAdd(s.redMul(u)),y=a.redMul(g),S=m.redSqr().redISub(y.redAdd(y)),T=y.redISub(S),H=m.redMul(T);H=H.redIAdd(H).redISub(h);var C=f.redMul(c);t+1<e&&(u=u.redMul(h)),a=S,c=C,f=H}return this.curve.jpoint(a,f.redMul(i),c)};pi.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};pi.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var s=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(s).redISub(a);o=o.redIAdd(o);var c=s.redAdd(s).redIAdd(s),u=c.redSqr().redISub(o).redISub(o),f=a.redIAdd(a);f=f.redIAdd(f),f=f.redIAdd(f),e=u,t=c.redMul(o.redISub(u)).redISub(f),n=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),g=this.y.redSqr(),h=g.redSqr(),m=this.x.redAdd(g).redSqr().redISub(d).redISub(h);m=m.redIAdd(m);var y=d.redAdd(d).redIAdd(d),S=y.redSqr(),T=h.redIAdd(h);T=T.redIAdd(T),T=T.redIAdd(T),e=S.redISub(m).redISub(m),t=y.redMul(m.redISub(e)).redISub(T),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,t,n)};pi.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var s=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(s).redISub(a);o=o.redIAdd(o);var c=s.redAdd(s).redIAdd(s).redIAdd(this.curve.a),u=c.redSqr().redISub(o).redISub(o);e=u;var f=a.redIAdd(a);f=f.redIAdd(f),f=f.redIAdd(f),t=c.redMul(o.redISub(u)).redISub(f),n=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),g=this.y.redSqr(),h=this.x.redMul(g),m=this.x.redSub(d).redMul(this.x.redAdd(d));m=m.redAdd(m).redIAdd(m);var y=h.redIAdd(h);y=y.redIAdd(y);var S=y.redAdd(y);e=m.redSqr().redISub(S),n=this.y.redAdd(this.z).redSqr().redISub(g).redISub(d);var T=g.redSqr();T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T),t=m.redMul(y.redISub(e)).redISub(T)}return this.curve.jpoint(e,t,n)};pi.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,s=this.z,i=s.redSqr().redSqr(),a=t.redSqr(),o=n.redSqr(),c=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),u=t.redAdd(t);u=u.redIAdd(u);var f=u.redMul(o),d=c.redSqr().redISub(f.redAdd(f)),g=f.redISub(d),h=o.redSqr();h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var m=c.redMul(g).redISub(h),y=n.redAdd(n).redMul(s);return this.curve.jpoint(d,m,y)};pi.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),s=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(s);o=o.redIAdd(o),o=o.redAdd(o).redIAdd(o),o=o.redISub(a);var c=o.redSqr(),u=s.redIAdd(s);u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var f=i.redIAdd(o).redSqr().redISub(a).redISub(c).redISub(u),d=t.redMul(f);d=d.redIAdd(d),d=d.redIAdd(d);var g=this.x.redMul(c).redISub(d);g=g.redIAdd(g),g=g.redIAdd(g);var h=this.y.redMul(f.redMul(u.redISub(f)).redISub(o.redMul(c)));h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var m=this.z.redAdd(o).redSqr().redISub(n).redISub(c);return this.curve.jpoint(g,h,m)};pi.prototype.mul=function(e,t){return e=new $n(e,t),this.curve._wnafMul(this,e)};pi.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var s=t.redMul(this.z),i=n.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(s)).cmpn(0)===0};pi.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(n)===0)return!0;for(var s=e.clone(),i=this.curve.redN.redMul(t);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),this.x.cmp(n)===0)return!0}};pi.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};pi.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var YD=R((FNe,QD)=>{"use strict";b();p();var Jx=Cs(),ZD=xB(),N7=gw(),h0e=oo();function Zx(r){N7.call(this,"mont",r),this.a=new Jx(r.a,16).toRed(this.red),this.b=new Jx(r.b,16).toRed(this.red),this.i4=new Jx(4).toRed(this.red).redInvm(),this.two=new Jx(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}ZD(Zx,N7);QD.exports=Zx;Zx.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),s=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t),i=s.redSqrt();return i.redSqr().cmp(s)===0};function Zs(r,e,t){N7.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Jx(e,16),this.z=new Jx(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}ZD(Zs,N7.BasePoint);Zx.prototype.decodePoint=function(e,t){return this.point(h0e.toArray(e,t),1)};Zx.prototype.point=function(e,t){return new Zs(this,e,t)};Zx.prototype.pointFromJSON=function(e){return Zs.fromJSON(this,e)};Zs.prototype.precompute=function(){};Zs.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Zs.fromJSON=function(e,t){return new Zs(e,t[0],t[1]||e.one)};Zs.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Zs.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Zs.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),n=this.x.redSub(this.z),s=n.redSqr(),i=t.redSub(s),a=t.redMul(s),o=i.redMul(s.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,o)};Zs.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Zs.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),s=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z),o=a.redMul(n),c=i.redMul(s),u=t.z.redMul(o.redAdd(c).redSqr()),f=t.x.redMul(o.redISub(c).redSqr());return this.curve.point(u,f)};Zs.prototype.mul=function(e){for(var t=e.clone(),n=this,s=this.curve.point(null,null),i=this,a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var o=a.length-1;o>=0;o--)a[o]===0?(n=n.diffAdd(s,i),s=s.dbl()):(s=n.diffAdd(s,i),n=n.dbl());return s};Zs.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Zs.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Zs.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Zs.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Zs.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var tH=R((HNe,eH)=>{"use strict";b();p();var b0e=oo(),H0=Cs(),XD=xB(),I7=gw(),p0e=b0e.assert;function Bf(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,I7.call(this,"edwards",r),this.a=new H0(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new H0(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new H0(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),p0e(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}XD(Bf,I7);eH.exports=Bf;Bf.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Bf.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Bf.prototype.jpoint=function(e,t,n,s){return this.point(e,t,n,s)};Bf.prototype.pointFromX=function(e,t){e=new H0(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),s=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=s.redMul(i.redInvm()),o=a.redSqrt();if(o.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var c=o.fromRed().isOdd();return(t&&!c||!t&&c)&&(o=o.redNeg()),this.point(e,o)};Bf.prototype.pointFromY=function(e,t){e=new H0(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),s=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=s.redMul(i.redInvm());if(a.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(o.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)};Bf.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),s=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return s.cmp(i)===0};function Dr(r,e,t,n,s){I7.BasePoint.call(this,r,"projective"),e===null&&t===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new H0(e,16),this.y=new H0(t,16),this.z=n?new H0(n,16):this.curve.one,this.t=s&&new H0(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}XD(Dr,I7.BasePoint);Bf.prototype.pointFromJSON=function(e){return Dr.fromJSON(this,e)};Bf.prototype.point=function(e,t,n,s){return new Dr(this,e,t,n,s)};Dr.fromJSON=function(e,t){return new Dr(e,t[0],t[1],t[2])};Dr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Dr.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Dr.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var s=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=s.redAdd(t),o=a.redSub(n),c=s.redSub(t),u=i.redMul(o),f=a.redMul(c),d=i.redMul(c),g=o.redMul(a);return this.curve.point(u,f,g,d)};Dr.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),n=this.y.redSqr(),s,i,a,o,c,u;if(this.curve.twisted){o=this.curve._mulA(t);var f=o.redAdd(n);this.zOne?(s=e.redSub(t).redSub(n).redMul(f.redSub(this.curve.two)),i=f.redMul(o.redSub(n)),a=f.redSqr().redSub(f).redSub(f)):(c=this.z.redSqr(),u=f.redSub(c).redISub(c),s=e.redSub(t).redISub(n).redMul(u),i=f.redMul(o.redSub(n)),a=f.redMul(u))}else o=t.redAdd(n),c=this.curve._mulC(this.z).redSqr(),u=o.redSub(c).redSub(c),s=this.curve._mulC(e.redISub(o)).redMul(u),i=this.curve._mulC(o).redMul(t.redISub(n)),a=o.redMul(u);return this.curve.point(s,i,a)};Dr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Dr.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),s=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(t),o=i.redSub(s),c=i.redAdd(s),u=n.redAdd(t),f=a.redMul(o),d=c.redMul(u),g=a.redMul(u),h=o.redMul(c);return this.curve.point(f,d,h,g)};Dr.prototype._projAdd=function(e){var t=this.z.redMul(e.z),n=t.redSqr(),s=this.x.redMul(e.x),i=this.y.redMul(e.y),a=this.curve.d.redMul(s).redMul(i),o=n.redSub(a),c=n.redAdd(a),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(i),f=t.redMul(o).redMul(u),d,g;return this.curve.twisted?(d=t.redMul(c).redMul(i.redSub(this.curve._mulA(s))),g=o.redMul(c)):(d=t.redMul(c).redMul(i.redSub(s)),g=this.curve._mulC(o).redMul(c)),this.curve.point(f,d,g)};Dr.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Dr.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Dr.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)};Dr.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)};Dr.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Dr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Dr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Dr.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Dr.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Dr.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var n=e.clone(),s=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(s),this.x.cmp(t)===0)return!0}};Dr.prototype.toP=Dr.prototype.normalize;Dr.prototype.mixedAdd=Dr.prototype.add});var XB=R(rH=>{"use strict";b();p();var R7=rH;R7.base=gw();R7.short=JD();R7.mont=YD();R7.edwards=tH()});var sH=R(($Ne,nH)=>{"use strict";b();p();nH.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var j7=R(oH=>{"use strict";b();p();var tk=oH,wl=Iq(),ek=XB(),g0e=oo(),iH=g0e.assert;function aH(r){r.type==="short"?this.curve=new ek.short(r):r.type==="edwards"?this.curve=new ek.edwards(r):this.curve=new ek.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,iH(this.g.validate(),"Invalid curve"),iH(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}tk.PresetCurve=aH;function vl(r,e){Object.defineProperty(tk,r,{configurable:!0,enumerable:!0,get:function(){var t=new aH(e);return Object.defineProperty(tk,r,{configurable:!0,enumerable:!0,value:t}),t}})}vl("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:wl.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});vl("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:wl.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});vl("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:wl.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});vl("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:wl.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});vl("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:wl.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});vl("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:wl.sha256,gRed:!1,g:["9"]});vl("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:wl.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var rk;try{rk=sH()}catch{rk=void 0}vl("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:wl.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",rk]})});var uH=R((eIe,cH)=>{"use strict";b();p();var x0e=Cs(),y0e=oo(),nk=y0e.assert;function Oi(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}cH.exports=Oi;Oi.fromPublic=function(e,t,n){return t instanceof Oi?t:new Oi(e,{pub:t,pubEnc:n})};Oi.fromPrivate=function(e,t,n){return t instanceof Oi?t:new Oi(e,{priv:t,privEnc:n})};Oi.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Oi.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub};Oi.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Oi.prototype._importPrivate=function(e,t){this.priv=new x0e(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)};Oi.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?nk(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&nk(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};Oi.prototype.derive=function(e){return e.validate()||nk(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Oi.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)};Oi.prototype.verify=function(e,t){return this.ec.verify(e,t,this)};Oi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var lH=R((nIe,dH)=>{"use strict";b();p();var M7=Cs(),ak=oo(),m0e=ak.assert;function xw(r,e,t){if(e instanceof xw)return e;this._importDER(e,t)||(m0e(e.r&&e.s,"Signature without r or s"),this.r=new M7(e.r,16),this.s=new M7(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam,this.curve=r,this.byteLength=this.curve.n.byteLength())}dH.exports=xw;function w0e(){this.place=0}function sk(r,e){var t=r[e.place++];if(!(t&128))return t;var n=t&15;if(n===0||n>4)return!1;for(var s=0,i=0,a=e.place;i<n;i++,a++)s<<=8,s|=r[a],s>>>=0;return s<=127?!1:(e.place=a,s)}function fH(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}xw.prototype._importDER=function(e,t){e=ak.toArray(e,t);var n=new w0e;if(e[n.place++]!==48)return!1;var s=sk(e,n);if(s===!1||s+n.place!==e.length||e[n.place++]!==2)return!1;var i=sk(e,n);if(i===!1)return!1;var a=e.slice(n.place,i+n.place);if(n.place+=i,e[n.place++]!==2)return!1;var o=sk(e,n);if(o===!1||e.length!==o+n.place)return!1;var c=e.slice(n.place,o+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;return this.r=new M7(a),this.s=new M7(c),this.recoveryParam=null,!0};function ik(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}xw.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),n[0]&128&&(n=[0].concat(n)),t=fH(t),n=fH(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var s=[2];ik(s,t.length),s=s.concat(t),s.push(2),ik(s,n.length);var i=s.concat(n),a=[48];return ik(a,i.length),a=a.concat(i),ak.encode(a,e)};xw.prototype.toBytes=function(){let e=this.r.toArray("be",this.byteLength),t=this.s.toArray("be",this.byteLength);return e.concat(t)}});var gH=R((aIe,pH)=>{"use strict";b();p();var Zb=Cs(),hH=pce(),v0e=oo(),ok=j7(),P0e=hce(),bH=v0e.assert,ck=uH(),C7=lH();function Uo(r){if(!(this instanceof Uo))return new Uo(r);typeof r=="string"&&(bH(Object.prototype.hasOwnProperty.call(ok,r),"Unknown curve "+r),r=ok[r]),r instanceof ok.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}pH.exports=Uo;Uo.prototype.keyPair=function(e){return new ck(this,e)};Uo.prototype.keyFromPrivate=function(e,t){return ck.fromPrivate(this,e,t)};Uo.prototype.keyFromPublic=function(e,t){return ck.fromPublic(this,e,t)};Uo.prototype.genKeyPair=function(e){e||(e={});for(var t=new hH({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||P0e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),s=this.n.sub(new Zb(2));;){var i=new Zb(t.generate(n));if(!(i.cmp(s)>0))return i.iaddn(1),this.keyFromPrivate(i)}};Uo.prototype._truncateToN=function(e,t){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};Uo.prototype.sign=function(e,t,n,s){typeof n=="object"&&(s=n,n=null),s||(s={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new Zb(e,16));for(var i=this.n.byteLength(),a=t.getPrivate().toArray("be",i),o=e.toArray("be",i),c=new hH({hash:this.hash,entropy:a,nonce:o,pers:s.pers,persEnc:s.persEnc||"utf8"}),u=this.n.sub(new Zb(1)),f=0;;f++){var d=s.k?s.k(f):new Zb(c.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(u)>=0)){var g=this.g.mul(d);if(!g.isInfinity()){var h=g.getX(),m=h.umod(this.n);if(m.cmpn(0)!==0){var y=d.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(y=y.umod(this.n),y.cmpn(0)!==0){var S=(g.getY().isOdd()?1:0)|(h.cmp(m)!==0?2:0);return s.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),S^=1),new C7(this.curve,{r:m,s:y,recoveryParam:S})}}}}}};Uo.prototype.verify=function(e,t,n,s){e=this._truncateToN(new Zb(e,16)),n=this.keyFromPublic(n,s),t=new C7(this.curve,t,"hex");var i=t.r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o=a.invm(this.n),c=o.mul(e).umod(this.n),u=o.mul(i).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(i)):(f=this.g.mulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(i)===0)};Uo.prototype.recoverPubKey=function(r,e,t,n){bH((3&t)===t,"The recovery param is more than two bits"),e=new C7(this.curve,e,n);var s=this.n,i=new Zb(r),a=e.r,o=e.s,c=t&1,u=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?a=this.curve.pointFromX(a.add(this.curve.n),c):a=this.curve.pointFromX(a,c);var f=e.r.invm(s),d=s.sub(i).mul(f).umod(s),g=o.mul(f).umod(s);return this.g.mulAdd(d,a,g)};Uo.prototype.getKeyRecoveryParam=function(r,e,t,n){if(e=new C7(this.curve,e,n),e.recoveryParam!==null)return e.recoveryParam;for(var s=0;s<4;s++){var i;try{i=this.recoverPubKey(r,e,s)}catch{continue}if(i.eq(t))return s}throw new Error("Unable to find valid recovery factor")}});var wH=R((uIe,mH)=>{"use strict";b();p();var yw=oo(),yH=yw.assert,xH=yw.parseBytes,Qx=yw.cachedProperty;function Qs(r,e){this.eddsa=r,this._secret=xH(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=xH(e.pub)}Qs.fromPublic=function(e,t){return t instanceof Qs?t:new Qs(e,{pub:t})};Qs.fromSecret=function(e,t){return t instanceof Qs?t:new Qs(e,{secret:t})};Qs.prototype.secret=function(){return this._secret};Qx(Qs,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Qx(Qs,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Qx(Qs,"privBytes",function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,s=t.slice(0,e.encodingLength);return s[0]&=248,s[n]&=127,s[n]|=64,s});Qx(Qs,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Qx(Qs,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Qx(Qs,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Qs.prototype.sign=function(e){return yH(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Qs.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)};Qs.prototype.getSecret=function(e){return yH(this._secret,"KeyPair is public only"),yw.encode(this.secret(),e)};Qs.prototype.getPublic=function(e){return yw.encode(this.pubBytes(),e)};mH.exports=Qs});var PH=R((lIe,vH)=>{"use strict";b();p();var _0e=Cs(),L7=oo(),A0e=L7.assert,U7=L7.cachedProperty,E0e=L7.parseBytes;function Qb(r,e){this.eddsa=r,typeof e!="object"&&(e=E0e(e)),Array.isArray(e)&&(e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),A0e(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof _0e&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}U7(Qb,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});U7(Qb,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});U7(Qb,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});U7(Qb,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Qb.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Qb.prototype.toHex=function(){return L7.encode(this.toBytes(),"hex").toUpperCase()};vH.exports=Qb});var TH=R((pIe,SH)=>{"use strict";b();p();var S0e=Iq(),T0e=j7(),Yx=oo(),O0e=Yx.assert,AH=Yx.parseBytes,EH=wH(),_H=PH();function Ea(r){if(O0e(r==="ed25519","only tested with ed25519 so far"),!(this instanceof Ea))return new Ea(r);r=T0e[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=S0e.sha512}SH.exports=Ea;Ea.prototype.sign=function(e,t){e=AH(e);var n=this.keyFromSecret(t),s=this.hashInt(n.messagePrefix(),e),i=this.g.mul(s),a=this.encodePoint(i),o=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),c=s.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:a})};Ea.prototype.verify=function(e,t,n){e=AH(e),t=this.makeSignature(t);var s=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),s.pubBytes(),e),a=this.g.mul(t.S()),o=t.R().add(s.pub().mul(i));return o.eq(a)};Ea.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return Yx.intFromLE(e.digest()).umod(this.curve.n)};Ea.prototype.keyFromPublic=function(e){return EH.fromPublic(this,e)};Ea.prototype.keyFromSecret=function(e){return EH.fromSecret(this,e)};Ea.prototype.makeSignature=function(e){return e instanceof _H?e:new _H(this,e)};Ea.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t};Ea.prototype.decodePoint=function(e){e=Yx.parseBytes(e);var t=e.length-1,n=e.slice(0,t).concat(e[t]&-129),s=(e[t]&128)!==0,i=Yx.intFromLE(n);return this.curve.pointFromY(i,s)};Ea.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};Ea.prototype.decodeInt=function(e){return Yx.intFromLE(e)};Ea.prototype.isPoint=function(e){return e instanceof this.pointClass}});var Xx=R(Fo=>{"use strict";b();p();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.utils=Fo.curves=Fo.curve=Fo.eddsa=Fo.ec=void 0;var B0e=XB();Fo.curve=B0e;var k0e=j7();Fo.curves=k0e;var N0e=gH();Fo.ec=N0e;var I0e=TH();Fo.eddsa=I0e;var R0e=oo();Fo.utils=R0e});var kH=R((OH,BH)=>{"use strict";b();p();Object.defineProperty(OH,"__esModule",{value:!0});var j0e=Xx(),kf=new j0e.ec("secp256k1"),er=kf.curve,Hr=Cs();function M0e(r,e){let t=new Hr(e);if(t.cmp(er.p)>=0)return null;t=t.toRed(er.red);let n=t.redSqr().redIMul(t).redIAdd(er.b).redSqrt();r===3!==n.isOdd()&&(n=n.redNeg());let s=t.redSqr().redIMul(t);return n.redSqr().redISub(s.redIAdd(er.b)).isZero()?kf.keyPair({pub:{x:t,y:n}}):null}function C0e(r,e,t){let n=new Hr(e),s=new Hr(t);if(n.cmp(er.p)>=0||s.cmp(er.p)>=0||(n=n.toRed(er.red),s=s.toRed(er.red),(r===6||r===7)&&s.isOdd()!==(r===7)))return null;let i=n.redSqr().redIMul(n);return s.redSqr().redISub(i.redIAdd(er.b)).isZero()?kf.keyPair({pub:{x:n,y:s}}):null}function Pl(r){let e=r[0];switch(e){case 2:case 3:return r.length!==33?null:M0e(e,r.subarray(1,33));case 4:case 6:case 7:return r.length!==65?null:C0e(e,r.subarray(1,33),r.subarray(33,65));default:return null}}BH.exports={contextRandomize(){return 0},privateKeyVerify(r){let e=new Hr(r);return e.cmp(er.n)<0&&!e.isZero()},privateKeyNegate(r){let e=new Hr(r);return v.Buffer.from(er.n.sub(e).umod(er.n).toArray("be",32))},privateKeyTweakAdd(r,e){let t=new Hr(e);return t.cmp(er.n)>=0||(t.iadd(new Hr(r)),t.cmp(er.n)>=0&&t.isub(er.n),t.isZero())?null:v.Buffer.from(t.toArray("be",32))},privateKeyTweakMul(r,e){let t=new Hr(e);return t.cmp(er.n)>=0||t.isZero()?1:(t.imul(new Hr(r)),t.cmp(er.n)>=0&&(t=t.umod(er.n)),v.Buffer.from(t.toArray("be",32)))},publicKeyVerify(r){let e=Pl(r);return e==null?null:e.validate().result},publicKeyCreate(r,e){let t=new Hr(r);if(t.cmp(er.n)>=0||t.isZero())return null;let n=kf.keyFromPrivate(r,null).getPublic();return v.Buffer.from(n.encode(null,e))},publicKeyConvert(r,e){let n=Pl(r).getPublic();return v.Buffer.from(n.encode(null,e))},publicKeyNegate(r,e){let t=Pl(r);if(t===null)return 1;let n=t.getPublic();return n.y=n.y.redNeg(),v.Buffer.from(n.encode(null,e))},publicKeyCombine(r,e){let t=new Array(r.length);for(let s=0;s<r.length;++s)if(t[s]=Pl(r[s]),t[s]===null)return null;let n=t[0].getPublic();for(let s=1;s<t.length;++s)n=n.add(t[s].pub);return n.isInfinity()?null:v.Buffer.from(n.encode(null,e))},publicKeyTweakAdd(r,e,t){let n=Pl(r);if(n===null||new Hr(e).cmp(er.n)>=0)return null;let i=n.getPublic().add(er.g.mul(e));return i.isInfinity()?null:v.Buffer.from(i.encode(null,t))},publicKeyTweakMul(r,e,t){let n=Pl(r);if(n===null)return null;let s=new Hr(e);if(s.cmp(er.n)>=0||s.isZero())return null;let i=n.getPublic().mul(e);return v.Buffer.from(i.encode(null,t))},signatureNormalize(r){let e=new Hr(r.subarray(0,32)),t=new Hr(r.subarray(32,64));return e.cmp(er.n)>=0||t.cmp(er.n)>=0?null:(t.cmp(kf.nh)===1&&r.set(er.n.sub(t).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(r,e){let t=e.subarray(0,32),n=e.subarray(32,64);if(new Hr(t).cmp(er.n)>=0||new Hr(n).cmp(er.n)>=0)return 1;let{output:s}=r,i=s.subarray(4,4+33);i[0]=0,i.set(t,1);let a=33,o=0;for(;a>1&&i[o]===0&&!(i[o+1]&128);--a,++o);if(i=i.subarray(o),i[0]&128||a>1&&i[0]===0&&!(i[1]&128))return 1;let c=s.subarray(6+33,6+33+33);c[0]=0,c.set(n,1);let u=33,f=0;for(;u>1&&c[f]===0&&!(c[f+1]&128);--u,++f);return c=c.subarray(f),c[0]&128||u>1&&c[0]===0&&!(c[1]&128)?1:(r.outputlen=6+a+u,s[0]=48,s[1]=r.outputlen-2,s[2]=2,s[3]=i.length,s.set(i,4),s[4+a]=2,s[5+a]=c.length,s.set(c,6+a),0)},signatureImport(r,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;let t=e[3];if(t===0||5+t>=e.length||e[4+t]!==2)return 1;let n=e[5+t];if(n===0||6+t+n!==e.length||e[4]&128||t>1&&e[4]===0&&!(e[5]&128)||e[t+6]&128||n>1&&e[t+6]===0&&!(e[t+7]&128))return 1;let s=e.subarray(4,4+t);if(s.length===33&&s[0]===0&&(s=s.subarray(1)),s.length>32)return 1;let i=e.subarray(6+t);if(i.length===33&&i[0]===0&&(i=i.slice(1)),i.length>32)throw new Error("S length is too long");let a=new Hr(s);a.cmp(er.n)>=0&&(a=new Hr(0));let o=new Hr(e.subarray(6+t));return o.cmp(er.n)>=0&&(o=new Hr(0)),r.set(a.toArrayLike(Uint8Array,"be",32),0),r.set(o.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(r,e){let t=new Hr(e);return t.cmp(er.n)>=0||t.isZero()?null:kf.sign(r,e,{canonical:!0}).toBytes()},ecdsaVerify(r,e,t){let n={r:r.subarray(0,32),s:r.subarray(32,64)},s=new Hr(n.r),i=new Hr(n.s);if(s.cmp(er.n)>=0||i.cmp(er.n)>=0)return 1;if(i.cmp(kf.nh)===1||s.isZero()||i.isZero())return 3;let a=Pl(t);if(a===null)return 2;let o=a.getPublic();return kf.verify(e,n,o)},ecdsaRecover(r,e,t,n){let s={r:r.slice(0,32),s:r.slice(32,64)},i=new Hr(s.r),a=new Hr(s.s);if(i.cmp(er.n)>=0||a.cmp(er.n)>=0)return 1;if(i.isZero()||a.isZero())return 2;let o;try{o=kf.recoverPubKey(t,s,e,null)}catch{return 2}return v.Buffer.from(o.encode(null,n))},ecdh(r,e,t,n,s,i,a){let o=Pl(e);if(o===null)return 1;let c=new Hr(t);if(c.cmp(er.n)>=0||c.isZero())return 2;let u=o.getPublic().mul(c);if(s===void 0){let f=u.encode(null,!0),d=kf.hash().update(f).digest();for(let g=0;g<32;++g)r[g]=d[g]}else{i||(i=new Uint8Array(32));let f=u.getX().toArray("be",32);for(let m=0;m<32;++m)i[m]=f[m];a||(a=new Uint8Array(32));let d=u.getY().toArray("be",32);for(let m=0;m<32;++m)a[m]=d[m];let g=s(i,a,n);if(!(g instanceof Uint8Array&&g.length===r.length))return 2;r.set(g)}return 0}}});var MH=R(Ys=>{"use strict";b();p();var L0e=Ys&&Ys.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),U0e=Ys&&Ys.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),F0e=Ys&&Ys.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&L0e(e,r,t);return U0e(e,r),e};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.fromSeed=Ys.fromPublicKey=Ys.fromPrivateKey=Ys.fromBase58=Ys.tinySecp256k1Interface=void 0;var uk=F0e($b()),q0e=Kb(),D0e=dw(),IH=(0,q0e.base58check)(D0e.sha256),RH=kH(),gi=Rq(),H0e=yce();function K0e(r){return{isPoint:e=>r.publicKeyVerify(e),isPrivate:e=>r.privateKeyVerify(e),pointAddScalar:(e,t,n)=>r.publicKeyTweakAdd(e,t,n),pointFromScalar:(e,t)=>r.publicKeyCreate(e,t),privateAdd:(e,t)=>r.privateKeyTweakAdd(new Uint8Array(e),t),sign:(e,t)=>r.ecdsaSign(e,t),verify:(e,t,n)=>r.ecdsaVerify(n,e,t)}}function G0e(r){return{isPoint:e=>r.publicKeyVerify(e),pointCompress:(e,t)=>Uint8Array.from(r.publicKeyConvert(e,t??!0)),isPrivate:e=>r.privateKeyVerify(e),pointFromScalar:(e,t)=>{let n=r.publicKeyCreate(e,t??!0);return n==null?null:Uint8Array.from(n)},sign:(e,t,n)=>Uint8Array.from(r.ecdsaSign(e,t)),verify:(e,t,n,s)=>r.ecdsaVerify(n,e,t)}}var _l=K0e(RH);Ys.tinySecp256k1Interface=G0e(RH);var fk=gi.BufferN(32),V0e=gi.compile({wif:gi.UInt8,bip32:{public:gi.UInt32,private:gi.UInt32}}),D7={messagePrefix:`Bitcoin Signed Message:
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},NH=2147483648,z0e=Math.pow(2,31)-1;function W0e(r){return gi.String(r)&&r.match(/^(m\/)?(\d+'?\/)*\d+'?$/)!==null}function $0e(r){return gi.UInt32(r)&&r<=z0e}var F7=class{constructor(e,t,n,s,i=0,a=0,o=0){this.__D=e,this.__Q=t,this.chainCode=n,this.network=s,this.__DEPTH=i,this.__INDEX=a,this.__PARENT_FINGERPRINT=o,gi(V0e,s),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return this.__Q===void 0&&(this.__Q=v.Buffer.from(_l.pointFromScalar(this.__D,!0))),this.__Q}get privateKey(){return this.__D}get identifier(){return v.Buffer.from(uk.hash160(this.publicKey))}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return this.__D===void 0}neutered(){return q7(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){let e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,n=v.Buffer.allocUnsafe(78);return n.writeUInt32BE(t,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),IH.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return H0e.encode(this.network.wif,this.privateKey,!0)}derive(e){gi(gi.UInt32,e);let t=e>=NH,n=v.Buffer.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");n[0]=0,this.privateKey.copy(n,1),n.writeUInt32BE(e,33)}else this.publicKey.copy(n,0),n.writeUInt32BE(e,33);let s=uk.hmacSHA512(this.chainCode,n),i=s.slice(0,32),a=s.slice(32);if(!_l.isPrivate(i))return this.derive(e+1);let o;if(this.isNeutered()){let c=_l.pointAddScalar(this.publicKey,i,!0);if(c===null)return this.derive(e+1);o=q7(c,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{let c=_l.privateAdd(this.privateKey,i);if(c==null)return this.derive(e+1);o=dk(c,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return o}deriveHardened(e){return gi($0e,e),this.derive(e+NH)}derivePath(e){gi(W0e,e);let t=e.split("/");if(t[0]==="m"){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((n,s)=>{let i;return s.slice(-1)==="'"?(i=parseInt(s.slice(0,-1),10),n.deriveHardened(i)):(i=parseInt(s,10),n.derive(i))},this)}sign(e){if(!this.privateKey)throw new Error("Missing private key");return _l.sign(e,this.privateKey)}verify(e,t){return _l.verify(e,this.publicKey,t)}};function J0e(r,e){let t=v.Buffer.from(IH.decode(r));if(t.length!==78)throw new TypeError("Invalid buffer length");e=e||D7;let n=t.readUInt32BE(0);if(n!==e.bip32.private&&n!==e.bip32.public)throw new TypeError("Invalid network version");let s=t[4],i=t.readUInt32BE(5);if(s===0&&i!==0)throw new TypeError("Invalid parent fingerprint");let a=t.readUInt32BE(9);if(s===0&&a!==0)throw new TypeError("Invalid index");let o=t.slice(13,45),c;if(n===e.bip32.private){if(t.readUInt8(45)!==0)throw new TypeError("Invalid private key");let u=t.slice(46,78);c=dk(u,o,e,s,a,i)}else{let u=t.slice(45,78);c=q7(u,o,e,s,a,i)}return c}Ys.fromBase58=J0e;function jH(r,e,t){return dk(r,e,t)}Ys.fromPrivateKey=jH;function dk(r,e,t,n,s,i){if(gi({privateKey:fk,chainCode:fk},{privateKey:r,chainCode:e}),t=t||D7,!_l.isPrivate(r))throw new TypeError("Private key not in range [1, n)");return new F7(r,void 0,e,t,n,s,i)}function Z0e(r,e,t){return q7(r,e,t)}Ys.fromPublicKey=Z0e;function q7(r,e,t,n,s,i){if(gi({publicKey:gi.BufferN(33),chainCode:fk},{publicKey:r,chainCode:e}),t=t||D7,!_l.isPoint(r))throw new TypeError("Point is not on the curve");return new F7(void 0,r,e,t,n,s,i)}function Q0e(r,e){if(gi(gi.Buffer,r),r.length<16)throw new TypeError("Seed should be at least 128 bits");if(r.length>64)throw new TypeError("Seed should be at most 512 bits");e=e||D7;let t=uk.hmacSHA512(v.Buffer.from("Bitcoin seed","utf8"),r),n=t.slice(0,32),s=t.slice(32);return jH(n,s,e)}Ys.fromSeed=Q0e});var CH=R(qo=>{"use strict";b();p();Object.defineProperty(qo,"__esModule",{value:!0});qo.fromPrivateKey=qo.fromPublicKey=qo.fromBase58=qo.fromSeed=qo.tinySecp256k1Interface=void 0;var mw=MH();Object.defineProperty(qo,"tinySecp256k1Interface",{enumerable:!0,get:function(){return mw.tinySecp256k1Interface}});Object.defineProperty(qo,"fromSeed",{enumerable:!0,get:function(){return mw.fromSeed}});Object.defineProperty(qo,"fromBase58",{enumerable:!0,get:function(){return mw.fromBase58}});Object.defineProperty(qo,"fromPublicKey",{enumerable:!0,get:function(){return mw.fromPublicKey}});Object.defineProperty(qo,"fromPrivateKey",{enumerable:!0,get:function(){return mw.fromPrivateKey}})});var LH=R((BIe,Y0e)=>{Y0e.exports=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]});var hk=R(Yb=>{"use strict";b();p();Object.defineProperty(Yb,"__esModule",{value:!0});Yb._default=Yb.wordlists=void 0;var lk={};Yb.wordlists=lk;var H7;Yb._default=H7;try{Yb._default=H7=LH(),lk.english=H7,lk.EN=H7}catch{}});var bk=R(ls=>{"use strict";b();p();Object.defineProperty(ls,"__esModule",{value:!0});ls.wordlists=ls.getDefaultWordlist=ls.setDefaultWordlist=ls.validateMnemonic=ls.generateMnemonic=ls.entropyToMnemonic=ls.mnemonicToEntropy=ls.mnemonicToSeed=ls.mnemonicToSeedSync=void 0;var FH=$b(),qH=T7(),K7=hk(),DH=g7(),ww=K7._default,UH="Invalid mnemonic",Xb="Invalid entropy",X0e="Invalid mnemonic checksum",HH=`A wordlist is required but a default could not be found.
Please pass a 2048 word array explicitly.`;function ede(r,e,t,n,s){let i=(0,qH.pbkdf2)(DH.sha512,r,e,{c:t,dkLen:n});return Promise.resolve(v.Buffer.from(i))}function vw(r){return(r||"").normalize("NFKD")}function KH(r,e,t){for(;r.length<t;)r=e+r;return r}function GH(r){return parseInt(r,2)}function VH(r){return r.map(e=>KH(e.toString(2),"0",8)).join("")}function zH(r){let t=r.length*8/32,n=(0,FH.sha256)(r);return VH(Array.from(n)).slice(0,t)}function WH(r){return"mnemonic"+(r||"")}function tde(r,e){let t=v.Buffer.from(vw(r),"utf8"),n=v.Buffer.from(WH(vw(e)),"utf8"),s=(0,qH.pbkdf2)(DH.sha512,t,n,{c:2048,dkLen:64});return v.Buffer.from(s)}ls.mnemonicToSeedSync=tde;function rde(r,e){return Promise.resolve().then(()=>{let t=v.Buffer.from(vw(r),"utf8"),n=v.Buffer.from(WH(vw(e)),"utf8");return ede(t,n,2048,64,"sha512")})}ls.mnemonicToSeed=rde;function $H(r,e){if(e=e||ww,!e)throw new Error(HH);let t=vw(r).split(" ");if(t.length%3!==0)throw new Error(UH);let n=t.map(f=>{let d=e.indexOf(f);if(d===-1)throw new Error(UH);return KH(d.toString(2),"0",11)}).join(""),s=Math.floor(n.length/33)*32,i=n.slice(0,s),a=n.slice(s),o=i.match(/(.{1,8})/g).map(GH);if(o.length<16)throw new Error(Xb);if(o.length>32)throw new Error(Xb);if(o.length%4!==0)throw new Error(Xb);let c=v.Buffer.from(o);if(zH(c)!==a)throw new Error(X0e);return c.toString("hex")}ls.mnemonicToEntropy=$H;function JH(r,e){if(v.Buffer.isBuffer(r)||(r=v.Buffer.from(r,"hex")),e=e||ww,!e)throw new Error(HH);if(r.length<16)throw new TypeError(Xb);if(r.length>32)throw new TypeError(Xb);if(r.length%4!==0)throw new TypeError(Xb);let t=VH(Array.from(r)),n=zH(r),a=(t+n).match(/(.{1,11})/g).map(o=>{let c=GH(o);return e[c]});return e[0]==="\u3042\u3044\u3053\u304F\u3057\u3093"?a.join("\u3000"):a.join(" ")}ls.entropyToMnemonic=JH;function nde(r,e,t){if(r=r||128,r%32!==0)throw new TypeError(Xb);return e=e||FH.randomBytes,JH(e(r/8),t)}ls.generateMnemonic=nde;function sde(r,e){try{$H(r,e)}catch{return!1}return!0}ls.validateMnemonic=sde;function ide(r){let e=K7.wordlists[r];if(e)ww=e;else throw new Error('Could not find wordlist for language "'+r+'"')}ls.setDefaultWordlist=ide;function ade(){if(!ww)throw new Error("No Default Wordlist set");return Object.keys(K7.wordlists).filter(r=>r==="JA"||r==="EN"?!1:K7.wordlists[r].every((e,t)=>e===ww[t]))[0]}ls.getDefaultWordlist=ade;var ode=hk();Object.defineProperty(ls,"wordlists",{enumerable:!0,get:function(){return ode.wordlists}})});var QH=R(Bi=>{"use strict";b();p();Object.defineProperty(Bi,"__esModule",{value:!0});Bi.unpadBuffer=Bi.stripZeros=Bi.setLengthRight=Bi.setLengthLeft=Bi.zeros=Bi.assertIsBuffer=void 0;var cde=function(r){if(!v.Buffer.isBuffer(r)){let e=`This method only supports Buffer but input was: ${r}`;throw new Error(e)}};Bi.assertIsBuffer=cde;var ude=function(r){return v.Buffer.allocUnsafe(r).fill(0)};Bi.zeros=ude;var ZH=function(r,e,t){let n=(0,Bi.zeros)(e);return t?r.length<e?(r.copy(n),n):r.slice(0,e):r.length<e?(r.copy(n,e-r.length),n):r.slice(-e)},fde=function(r,e){return v.Buffer.isBuffer(r)||(r=v.Buffer.from(r)),ZH(r,e,!1)};Bi.setLengthLeft=fde;var dde=function(r,e){return v.Buffer.isBuffer(r)||(r=v.Buffer.from(r)),ZH(r,e,!0)};Bi.setLengthRight=dde;var lde=function(r){let e=r[0];for(;r.length>0&&e.toString()==="0";)r=r.slice(1),e=r[0];return r};Bi.stripZeros=lde;var hde=function(r){return v.Buffer.isBuffer(r)||(r=v.Buffer.from(r)),(0,Bi.stripZeros)(r)};Bi.unpadBuffer=hde});var G7=R(Jn=>{"use strict";b();p();Object.defineProperty(Jn,"__esModule",{value:!0});Jn.isHexString=Jn.getKeys=Jn.fromAscii=Jn.fromUtf8=Jn.toAscii=Jn.arrayContainsArray=Jn.getBinarySize=Jn.padToEven=Jn.stripHexPrefix=Jn.isHexPrefixed=void 0;function YH(r){if(typeof r!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof r}`);return r[0]==="0"&&r[1]==="x"}Jn.isHexPrefixed=YH;var bde=r=>{if(typeof r!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof r}`);return YH(r)?r.slice(2):r};Jn.stripHexPrefix=bde;function XH(r){let e=r;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}Jn.padToEven=XH;function pde(r){if(typeof r!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof r}`);return v.Buffer.byteLength(r,"utf8")}Jn.getBinarySize=pde;function gde(r,e,t){if(Array.isArray(r)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof r}'`);if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof e}'`);return e[t===!0?"some":"every"](n=>r.indexOf(n)>=0)}Jn.arrayContainsArray=gde;function xde(r){let e="",t=0,n=r.length;for(r.substring(0,2)==="0x"&&(t=2);t<n;t+=2){let s=parseInt(r.substr(t,2),16);e+=String.fromCharCode(s)}return e}Jn.toAscii=xde;function yde(r){let e=v.Buffer.from(r,"utf8");return`0x${XH(e.toString("hex")).replace(/^0+|0+$/g,"")}`}Jn.fromUtf8=yde;function mde(r){let e="";for(let t=0;t<r.length;t++){let s=r.charCodeAt(t).toString(16);e+=s.length<2?`0${s}`:s}return`0x${e}`}Jn.fromAscii=mde;function wde(r,e,t){if(!Array.isArray(r))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof r}`);if(typeof e!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof r}`);let n=[];for(let s=0;s<r.length;s++){let i=r[s][e];if(t===!0&&!i)i="";else if(typeof i!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof i}`);n.push(i)}return n}Jn.getKeys=wde;function vde(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e<"u"&&e>0&&r.length!==2+2*e)}Jn.isHexString=vde});var eK=R(Nf=>{"use strict";b();p();Object.defineProperty(Nf,"__esModule",{value:!0});Nf.assertIsString=Nf.assertIsArray=Nf.assertIsBuffer=Nf.assertIsHexString=void 0;var Pde=G7(),_de=function(r){if(!(0,Pde.isHexString)(r)){let e=`This method only supports 0x-prefixed hex strings but input was: ${r}`;throw new Error(e)}};Nf.assertIsHexString=_de;var Ade=function(r){if(!v.Buffer.isBuffer(r)){let e=`This method only supports Buffer but input was: ${r}`;throw new Error(e)}};Nf.assertIsBuffer=Ade;var Ede=function(r){if(!Array.isArray(r)){let e=`This method only supports number arrays but input was: ${r}`;throw new Error(e)}};Nf.assertIsArray=Ede;var Sde=function(r){if(typeof r!="string"){let e=`This method only supports strings but input was: ${r}`;throw new Error(e)}};Nf.assertIsString=Sde});var sK=R(De=>{"use strict";b();p();Object.defineProperty(De,"__esModule",{value:!0});De.intToUnpaddedBuffer=De.bigIntToUnpaddedBuffer=De.bigIntToHex=De.bufArrToArr=De.arrToBufArr=De.validateNoLeadingZeroes=De.baToJSON=De.toUtf8=De.short=De.addHexPrefix=De.toUnsigned=De.fromSigned=De.bufferToInt=De.bigIntToBuffer=De.bufferToBigInt=De.bufferToHex=De.toBuffer=De.unpadHexString=De.unpadArray=De.unpadBuffer=De.setLengthRight=De.setLengthLeft=De.zeros=De.intToBuffer=De.intToHex=void 0;var Pw=eK(),ep=G7(),Tde=function(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Received an invalid integer type: ${r}`);return`0x${r.toString(16)}`};De.intToHex=Tde;var Ode=function(r){let e=(0,De.intToHex)(r);return v.Buffer.from((0,ep.padToEven)(e.slice(2)),"hex")};De.intToBuffer=Ode;var Bde=function(r){return v.Buffer.allocUnsafe(r).fill(0)};De.zeros=Bde;var tK=function(r,e,t){let n=(0,De.zeros)(e);return t?r.length<e?(r.copy(n),n):r.slice(0,e):r.length<e?(r.copy(n,e-r.length),n):r.slice(-e)},kde=function(r,e){return(0,Pw.assertIsBuffer)(r),tK(r,e,!1)};De.setLengthLeft=kde;var Nde=function(r,e){return(0,Pw.assertIsBuffer)(r),tK(r,e,!0)};De.setLengthRight=Nde;var pk=function(r){let e=r[0];for(;r.length>0&&e.toString()==="0";)r=r.slice(1),e=r[0];return r},Ide=function(r){return(0,Pw.assertIsBuffer)(r),pk(r)};De.unpadBuffer=Ide;var Rde=function(r){return(0,Pw.assertIsArray)(r),pk(r)};De.unpadArray=Rde;var jde=function(r){return(0,Pw.assertIsHexString)(r),r=(0,ep.stripHexPrefix)(r),"0x"+pk(r)};De.unpadHexString=jde;var Mde=function(r){if(r==null)return v.Buffer.allocUnsafe(0);if(v.Buffer.isBuffer(r))return v.Buffer.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return v.Buffer.from(r);if(typeof r=="string"){if(!(0,ep.isHexString)(r))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${r}`);return v.Buffer.from((0,ep.padToEven)((0,ep.stripHexPrefix)(r)),"hex")}if(typeof r=="number")return(0,De.intToBuffer)(r);if(typeof r=="bigint"){if(r<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${r}`);let e=r.toString(16);return e.length%2&&(e="0"+e),v.Buffer.from(e,"hex")}if(r.toArray)return v.Buffer.from(r.toArray());if(r.toBuffer)return v.Buffer.from(r.toBuffer());throw new Error("invalid type")};De.toBuffer=Mde;var Cde=function(r){return r=(0,De.toBuffer)(r),"0x"+r.toString("hex")};De.bufferToHex=Cde;function gk(r){let e=(0,De.bufferToHex)(r);return BigInt(e==="0x"?0:e)}De.bufferToBigInt=gk;function xk(r){return(0,De.toBuffer)("0x"+r.toString(16))}De.bigIntToBuffer=xk;var Lde=function(r){let e=Number(gk(r));if(!Number.isSafeInteger(e))throw new Error("Number exceeds 53 bits");return e};De.bufferToInt=Lde;var Ude=function(r){return BigInt.asIntN(256,gk(r))};De.fromSigned=Ude;var Fde=function(r){return xk(BigInt.asUintN(256,r))};De.toUnsigned=Fde;var qde=function(r){return typeof r!="string"||(0,ep.isHexPrefixed)(r)?r:"0x"+r};De.addHexPrefix=qde;function Dde(r,e=50){let t=v.Buffer.isBuffer(r)?r.toString("hex"):r;return t.length<=e?t:t.slice(0,e)+"\u2026"}De.short=Dde;var Hde=function(r){let e=/^(00)+|(00)+$/g;if(r=(0,ep.stripHexPrefix)(r),r.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return v.Buffer.from(r.replace(e,""),"hex").toString("utf8")};De.toUtf8=Hde;var Kde=function(r){if(v.Buffer.isBuffer(r))return`0x${r.toString("hex")}`;if(r instanceof Array){let e=[];for(let t=0;t<r.length;t++)e.push((0,De.baToJSON)(r[t]));return e}};De.baToJSON=Kde;var Gde=function(r){for(let[e,t]of Object.entries(r))if(t!==void 0&&t.length>0&&t[0]===0)throw new Error(`${e} cannot have leading zeroes, received: ${t.toString("hex")}`)};De.validateNoLeadingZeroes=Gde;function rK(r){return Array.isArray(r)?r.map(e=>rK(e)):v.Buffer.from(r)}De.arrToBufArr=rK;function nK(r){return Array.isArray(r)?r.map(e=>nK(e)):Uint8Array.from(r??[])}De.bufArrToArr=nK;var Vde=r=>"0x"+r.toString(16);De.bigIntToHex=Vde;function zde(r){return(0,De.unpadBuffer)(xk(r))}De.bigIntToUnpaddedBuffer=zde;function Wde(r){return(0,De.unpadBuffer)((0,De.intToBuffer)(r))}De.intToUnpaddedBuffer=Wde});var cK=R(($Ie,oK)=>{"use strict";b();p();var V7=QH(),ey=$b(),Sa=Cs(),{isHexString:$de,stripHexPrefix:Jde,padToEven:Zde}=G7(),{intToBuffer:Qde,addHexPrefix:Yde,bufferToHex:Xde}=sK(),Sn=function(){};function z7(r){return r.startsWith("int[")?"int256"+r.slice(3):r==="int"?"int256":r.startsWith("uint[")?"uint256"+r.slice(4):r==="uint"?"uint256":r.startsWith("fixed[")?"fixed128x128"+r.slice(5):r==="fixed"?"fixed128x128":r.startsWith("ufixed[")?"ufixed128x128"+r.slice(6):r==="ufixed"?"ufixed128x128":r}function yk(r){if(r==null)return v.Buffer.allocUnsafe(0);if(v.Buffer.isBuffer(r))return v.Buffer.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return v.Buffer.from(r);if(typeof r=="string"){if(!$de(r))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${r}`);return v.Buffer.from(Zde(Jde(r)),"hex")}if(typeof r=="number")return Qde(r);if(typeof r=="bigint"){if(r<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${r}`);let e=r.toString(16);return e.length%2&&(e="0"+e),v.Buffer.from(e,"hex")}if(r.toArray)return v.Buffer.from(r.toArray());if(r.toBuffer)return v.Buffer.from(r.toBuffer());throw new Error("invalid type")}function ele(r){if(!!r){if(typeof r=="number"){if(r<0)return"0x";let e=yk(r);r=Xde(e)}if(typeof r!="string"){let e="eth-sig-util.normalize() requires hex string or integer input.";throw e+=` received ${typeof r}: ${r}`,new Error(e)}return Yde(r.toLowerCase())}}Sn.eventID=function(r,e){var t=r+"("+e.map(z7).join(",")+")";return ey.keccak256(v.Buffer.from(t))};Sn.methodID=function(r,e){return Sn.eventID(r,e).slice(0,4)};function Al(r){return parseInt(/^\D+(\d+)$/.exec(r)[1],10)}function mk(r){var e=/^\D+(\d+)x(\d+)$/.exec(r);return[parseInt(e[1],10),parseInt(e[2],10)]}function Aw(r){var e=r.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function tp(r){var e=typeof r;if(e==="string")return ey.isHexPrefixed(r)?new Sa(ey.stripHexPrefix(r),16):new Sa(r,10);if(e==="number")return new Sa(r);if(r.toArray)return r;throw new Error("Argument is not a number")}function aK(r){var e=/^(\w+)\((.*)\)$/.exec(r);if(e.length!==3)throw new Error("Invalid method signature");var t=/^(.+)\):\((.+)$/.exec(e[2]);if(t!==null&&t.length===3)return{method:e[1],args:t[1].split(","),retargs:t[2].split(",")};var n=e[2].split(",");return n.length===1&&n[0]===""&&(n=[]),{method:e[1],args:n}}function If(r,e){var t,n,s,i;if(r==="address")return If("uint160",tp(e));if(r==="bool")return If("uint8",e?1:0);if(r==="string")return If("bytes",v.Buffer.from(e,"utf8"));if(_w(r)){if(typeof e.length>"u")throw new Error("Not an array?");if(t=Aw(r),t!=="dynamic"&&t!==0&&e.length>t)throw new Error("Elements exceed array size: "+t);s=[],r=r.slice(0,r.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(i in e)s.push(If(r,e[i]));if(t==="dynamic"){var a=If("uint256",e.length);s.unshift(a)}return v.Buffer.concat(s)}else{if(r==="bytes")return e=v.Buffer.from(e),s=v.Buffer.concat([If("uint256",e.length),e]),e.length%32!==0&&(s=v.Buffer.concat([s,V7.zeros(32-e.length%32)])),s;if(r.startsWith("bytes")){if(t=Al(r),t<1||t>32)throw new Error("Invalid bytes<N> width: "+t);return V7.setLengthRight(e,32)}else if(r.startsWith("uint")){if(t=Al(r),t%8||t<8||t>256)throw new Error("Invalid uint<N> width: "+t);if(n=tp(e),n.bitLength()>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(v.Buffer,"be",32)}else if(r.startsWith("int")){if(t=Al(r),t%8||t<8||t>256)throw new Error("Invalid int<N> width: "+t);if(n=tp(e),n.bitLength()>t)throw new Error("Supplied int exceeds width: "+t+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(v.Buffer,"be",32)}else if(r.startsWith("ufixed")){if(t=mk(r),n=tp(e),n<0)throw new Error("Supplied ufixed is negative");return If("uint256",n.mul(new Sa(2).pow(new Sa(t[1]))))}else if(r.startsWith("fixed"))return t=mk(r),If("int256",tp(e).mul(new Sa(2).pow(new Sa(t[1]))))}throw new Error("Unsupported or invalid type: "+r)}function fu(r,e,t){typeof r=="string"&&(r=wk(r));var n,s,i,a;if(r.name==="address")return fu(r.rawType,e,t).toArrayLike(v.Buffer,"be",20).toString("hex");if(r.name==="bool")return fu(r.rawType,e,t).toString()===new Sa(1).toString();if(r.name==="string"){var o=fu(r.rawType,e,t);return v.Buffer.from(o,"utf8").toString()}else if(r.isArray){for(i=[],n=r.size,r.size==="dynamic"&&(t=fu("uint256",e,t).toNumber(),n=fu("uint256",e,t).toNumber(),t=t+32),a=0;a<n;a++){var c=fu(r.subArray,e,t);i.push(c),t+=r.subArray.memoryUsage}return i}else{if(r.name==="bytes")return t=fu("uint256",e,t).toNumber(),n=fu("uint256",e,t).toNumber(),e.slice(t+32,t+32+n);if(r.name.startsWith("bytes"))return e.slice(t,t+r.size);if(r.name.startsWith("uint")){if(s=new Sa(e.slice(t,t+32),16,"be"),s.bitLength()>r.size)throw new Error("Decoded int exceeds width: "+r.size+" vs "+s.bitLength());return s}else if(r.name.startsWith("int")){if(s=new Sa(e.slice(t,t+32),16,"be").fromTwos(256),s.bitLength()>r.size)throw new Error("Decoded uint exceeds width: "+r.size+" vs "+s.bitLength());return s}else if(r.name.startsWith("ufixed")){if(n=new Sa(2).pow(new Sa(r.size[1])),s=fu("uint256",e,t),!s.mod(n).isZero())throw new Error("Decimals not supported yet");return s.div(n)}else if(r.name.startsWith("fixed")){if(n=new Sa(2).pow(new Sa(r.size[1])),s=fu("int256",e,t),!s.mod(n).isZero())throw new Error("Decimals not supported yet");return s.div(n)}}throw new Error("Unsupported or invalid type: "+r.name)}function wk(r){var e,t;if(_w(r)){e=Aw(r);var n=r.slice(0,r.lastIndexOf("["));return n=wk(n),t={isArray:!0,name:r,size:e,memoryUsage:e==="dynamic"?32:n.memoryUsage*e,subArray:n},t}else{var s;switch(r){case"address":s="uint160";break;case"bool":s="uint8";break;case"string":s="bytes";break}if(t={rawType:s,name:r,memoryUsage:32},r.startsWith("bytes")&&r!=="bytes"||r.startsWith("uint")||r.startsWith("int")?t.size=Al(r):(r.startsWith("ufixed")||r.startsWith("fixed"))&&(t.size=mk(r)),r.startsWith("bytes")&&r!=="bytes"&&(t.size<1||t.size>32))throw new Error("Invalid bytes<N> width: "+t.size);if((r.startsWith("uint")||r.startsWith("int"))&&(t.size%8||t.size<8||t.size>256))throw new Error("Invalid int/uint<N> width: "+t.size);return t}}function tle(r){return r==="string"||r==="bytes"||Aw(r)==="dynamic"}function _w(r){return r.lastIndexOf("]")===r.length-1}Sn.rawEncode=function(r,e){var t=[],n=[],s=0;r.forEach(function(u){if(_w(u)){var f=Aw(u);f!=="dynamic"?s+=32*f:s+=32}else s+=32});for(var i=0;i<r.length;i++){var a=z7(r[i]),o=e[i],c=If(a,o);tle(a)?(t.push(If("uint256",s)),n.push(c),s+=c.length):t.push(c)}return v.Buffer.concat(t.concat(n))};Sn.rawDecode=function(r,e){var t=[];e=v.Buffer.from(e);for(var n=0,s=0;s<r.length;s++){var i=z7(r[s]),a=wk(i,e,n),o=fu(a,e,n);n+=a.memoryUsage,t.push(o)}return t};Sn.simpleEncode=function(r){var e=Array.prototype.slice.call(arguments).slice(1),t=aK(r);if(e.length!==t.args.length)throw new Error("Argument count mismatch");return v.Buffer.concat([Sn.methodID(t.method,t.args),Sn.rawEncode(t.args,e)])};Sn.simpleDecode=function(r,e){var t=aK(r);if(!t.retargs)throw new Error("No return values in method");return Sn.rawDecode(t.retargs,e)};function iK(r,e){return r.startsWith("address")||r.startsWith("bytes")?"0x"+e.toString("hex"):e.toString()}Sn.stringify=function(r,e){var t=[];for(var n in r){var s=r[n],i=e[n];/^[^\[]+\[.*\]$/.test(s)?i=i.map(function(a){return iK(s,a)}).join(", "):i=iK(s,i),t.push(i)}return t};Sn.solidityHexValue=function(r,e,t){var n,s;if(_w(r)){var i=r.replace(/\[.*?\]/,"");if(!_w(i)){var a=Aw(r);if(a!=="dynamic"&&a!==0&&e.length>a)throw new Error("Elements exceed array size: "+a)}var o=e.map(function(f){return Sn.solidityHexValue(i,f,256)});return v.Buffer.concat(o)}else{if(r==="bytes")return e;if(r==="string")return v.Buffer.from(e,"utf8");if(r==="bool"){t=t||8;var c=Array(t/4).join("0");return v.Buffer.from(e?c+"1":c+"0","hex")}else if(r==="address"){var u=20;return t&&(u=t/8),V7.setLengthLeft(yk(e),u)}else if(r.startsWith("bytes")){if(n=Al(r),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return typeof e=="number"&&(e=ele(e)),V7.setLengthRight(yk(e),n)}else if(r.startsWith("uint")){if(n=Al(r),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(s=tp(e),s.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s.bitLength());return t=t||n,s.toArrayLike(v.Buffer,"be",t/8)}else if(r.startsWith("int")){if(n=Al(r),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(s=tp(e),s.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s.bitLength());return t=t||n,s.toTwos(n).toArrayLike(v.Buffer,"be",t/8)}else throw new Error("Unsupported or invalid type: "+r)}};Sn.solidityPack=function(r,e){if(r.length!==e.length)throw new Error("Number of types are not matching the values");for(var t=[],n=0;n<r.length;n++){var s=z7(r[n]),i=e[n];t.push(Sn.solidityHexValue(s,i,null))}return v.Buffer.concat(t)};Sn.soliditySHA3=function(r,e){return ey.keccak256(Sn.solidityPack(r,e))};Sn.soliditySHA256=function(r,e){return ey.sha256(Sn.solidityPack(r,e))};Sn.solidityRIPEMD160=function(r,e){return ey.ripemd160(Sn.solidityPack(r,e),!0)};function rle(r){return r>="0"&&r<="9"}Sn.fromSerpent=function(r){for(var e=[],t=0;t<r.length;t++){var n=r[t];if(n==="s")e.push("bytes");else if(n==="b"){for(var s="bytes",i=t+1;i<r.length&&rle(r[i]);)s+=r[i]-"0",i++;t=i-1,e.push(s)}else if(n==="i")e.push("int256");else if(n==="a")e.push("int256[]");else throw new Error("Unsupported or invalid type: "+n)}return e};Sn.toSerpent=function(r){for(var e=[],t=0;t<r.length;t++){var n=r[t];if(n==="bytes")e.push("s");else if(n.startsWith("bytes"))e.push("b"+Al(n));else if(n==="int256")e.push("i");else if(n==="int256[]")e.push("a");else throw new Error("Unsupported or invalid type: "+n)}return e.join("")};oK.exports=Sn});var uK=R(El=>{"use strict";b();p();Object.defineProperty(El,"__esModule",{value:!0});El.SoliditySHA3=El.RawEncode=El.ABI=void 0;var vk=cK();El.ABI=vk;function nle(r,e){return vk.rawEncode(r,e)}El.RawEncode=nle;function sle(r,e){return vk.soliditySHA3(r,e)}El.SoliditySHA3=sle});var pK=R(cr=>{"use strict";b();p();var ile=cr&&cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ale=cr&&cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ole=cr&&cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&ile(e,r,t);return ale(e,r),e},cle=cr&&cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cr,"__esModule",{value:!0});cr.loadUncompressedPublicKey=cr.loadCompressedPublicKey=cr.publicKeyConvert=cr.publicKeyCreate=cr.publicKeyVerify=cr.privateKeyVerify=cr.loadPublicKey=cr.recover=cr.verifyWithNoRecovery=cr.verify=cr.getV=cr.sign=void 0;var ule=ole(Xx()),Ls=new ule.ec("secp256k1"),fK=$b(),ty=cle(Cs());function fle(r,e,t=!0){let n=Ls.sign(Array.from(r),v.Buffer.from(e),{canonical:t});return{signature:n.toBytes(),recovery:n.recoveryParam}}cr.sign=fle;function dle(r,e,t,n,s=!0){let i=Ew(n);if(i==null)throw new Error("pubkey error");let a=Ls.keyPair({pub:{x:i.x,y:i.y}}).getPublic();return Ls.getKeyRecoveryParam(r,{r:e,s:t},a,s)}cr.getV=dle;function lle(r,e,t,n){let s=dK(e,t,r,!0);if(s==null)return!1;let i=lK(n,!0);return i==null?!1:s.equals(i)}cr.verify=lle;function hle(r,e,t){let n=Ew(t);if(n==null)throw new Error("pubkey error");let s=Ls.keyPair({pub:{x:n.x,y:n.y}}),i={r:(0,fK.toHex)(e.slice(0,32)),s:(0,fK.toHex)(e.slice(32,64))};return s.verify(r,i)}cr.verifyWithNoRecovery=hle;function dK(r,e,t,n){let s={r:Array.from(r.slice(0,32)),s:Array.from(r.slice(32,64))},i=new ty.default(s.r),a=new ty.default(s.s);if(i.cmp(Ls.curve.n)>=0||a.cmp(Ls.curve.n)>=0||i.isZero()||a.isZero())return null;let o;try{o=Ls.recoverPubKey(Array.from(t),s,e,null)}catch{return null}return v.Buffer.from(o.encode(null,n))}cr.recover=dK;function Ew(r){let e=v.Buffer.from(r),t=e[0];switch(t){case 2:case 3:return e.length!==33?null:hK(t,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:bK(t,e.subarray(1,33),e.subarray(33,65));default:return null}}cr.loadPublicKey=Ew;function ble(r){let e=new ty.default(Array.from(r));return e.cmp(Ls.curve.n)<0&&!e.isZero()}cr.privateKeyVerify=ble;function ple(r){return Ew(r)!==null}cr.publicKeyVerify=ple;function gle(r,e){let t=Ls.keyFromPrivate(Array.from(r),"bytes").getPublic();return v.Buffer.from(t.encode(null,e))}cr.publicKeyCreate=gle;function lK(r,e){let t=Ew(r);if(t==null)return null;let n=Ls.keyPair({pub:{x:t.x,y:t.y}}).getPublic();return v.Buffer.from(n.encode(null,e))}cr.publicKeyConvert=lK;function hK(r,e){let t=new ty.default(Array.from(e));if(t.cmp(Ls.curve.p)>=0)return null;let n=t.toRed(Ls.curve.red),s=n.redSqr().redIMul(n).redIAdd(Ls.curve.b).redSqrt();r===3!==s.isOdd()&&(s=s.redNeg());let i=n.redSqr().redIMul(n);return s.redSqr().redISub(i.redIAdd(Ls.curve.b)).isZero()?{x:n,y:s}:null}cr.loadCompressedPublicKey=hK;function bK(r,e,t){let n=new ty.default(Array.from(e)),s=new ty.default(Array.from(t));if(n.cmp(Ls.curve.p)>=0||s.cmp(Ls.curve.p)>=0)return null;let i=n.toRed(Ls.curve.red),a=s.toRed(Ls.curve.red);if((r===6||r===7)&&a.isOdd()!==(r===7))return null;let o=i.redSqr().redIMul(i);return a.redSqr().redISub(o.redIAdd(Ls.curve.b)).isZero()?{x:i,y:a}:null}cr.loadUncompressedPublicKey=bK});var _K=R(tr=>{"use strict";b();p();var xle=tr&&tr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yle=tr&&tr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),mle=tr&&tr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&xle(e,r,t);return yle(e,r),e},wle=tr&&tr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tr,"__esModule",{value:!0});tr.ed25519_getDerivedPrivateKey=tr.isValidPath=tr.ed25519_getRandomPrivateKey=tr.ed25519SignTest=tr.fromSecret=tr.fromSeed=tr.privateKeyVerify=tr.publicKeyVerify=tr.publicKeyCreate=tr.verify=tr.sign=tr.ed25519MulBase=void 0;var gK=mle(Xx()),du=$b(),vle=wle(Cs()),Ple=bk(),K0=new gK.eddsa("ed25519"),xK=K0.curve;function _le(r){let e=K0.curve.g;return K0.encodePoint(e.mul(gK.utils.intFromLE(r)))}tr.ed25519MulBase=_le;function yK(r,e){let t=e;t.length==64&&(t=t.slice(0,32));let s=K0.keyFromSecret(Array.from(t)).sign(Array.from(r)).toBytes();return Uint8Array.from(s)}tr.sign=yK;function mK(r,e,t){return K0.keyFromPublic(Array.from(t)).verify(Array.from(r),Array.from(e))}tr.verify=mK;function W7(r){let e=r;e.length==64&&(e=e.slice(0,32));let n=K0.keyFromSecret(Array.from(e)).getPublic();if(r.length==64&&!Ale(r.slice(32,64),n))throw new Error("invalid public key");return Uint8Array.from(n)}tr.publicKeyCreate=W7;function Ale(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function Ele(r){let e=K0.decodePoint(Array.from(r));return xK.validate(e)}tr.publicKeyVerify=Ele;function wK(r){let e=new vle.default(Array.from(r));return e.cmp(xK.n)<0&&!e.isZero()}tr.privateKeyVerify=wK;function Sle(r){let e=K0.keyFromSecret(Array.from(r)),t=Uint8Array.from(e.getPublic());return{publicKey:t,secretKey:(0,du.concatBytes)(r,t)}}tr.fromSeed=Sle;function Tle(r){let e=r.slice(0,32),t=K0.keyFromSecret(Array.from(e));return{publicKey:Uint8Array.from(t.getPublic()),secretKey:Uint8Array.from(e)}}tr.fromSecret=Tle;function vK(r){let e=(0,du.sha256)("ed25519-test"),t=W7(r),n=yK(e,r);return mK(e,n,t)}tr.ed25519SignTest=vK;function Ole(r,e){for(;;){let t=(0,du.randomBytes)(32);if(wK(t)&&vK(t)){let n=W7(t),s=r?(0,du.concatBytes)(t,n):t;return e==="base58"?(0,du.toBase58)(s):(0,du.toHex)(s)}}}tr.ed25519_getRandomPrivateKey=Ole;var Ble=new RegExp("^m(\\/[0-9]+')+$"),PK=r=>r.replace("'",""),kle=2147483648;function Nle(r){let e=(0,du.hmacSHA512)("ed25519 seed",r),t=e.slice(0,32),n=e.slice(32);return{key:t,chainCode:n}}function Ile({key:r,chainCode:e},t){let n=v.Buffer.allocUnsafe(4);n.writeUInt32BE(t,0);let s=v.Buffer.concat([v.Buffer.alloc(1,0),r,n]),i=(0,du.hmacSHA512)(e,s),a=i.slice(0,32),o=i.slice(32);return{key:a,chainCode:o}}var Rle=r=>Ble.test(r)?!r.split("/").slice(1).map(PK).some(isNaN):!1;tr.isValidPath=Rle;function jle(r,e,t=kle){if(!(0,tr.isValidPath)(r))throw new Error("Invalid derivation path");let{key:n,chainCode:s}=Nle(e);return r.split("/").slice(1).map(PK).map(a=>parseInt(a,10)).reduce((a,o)=>Ile(a,o+t),{key:n,chainCode:s})}async function Mle(r,e,t,n){let s=await(0,Ple.mnemonicToSeed)(r),i=jle(e,s).key,a=W7(i),o=t?(0,du.concatBytes)(i,a):i;return n==="base58"?Promise.resolve((0,du.toBase58)(o)):Promise.resolve((0,du.toHex)(o))}tr.ed25519_getDerivedPrivateKey=Mle});var TK=R(Ar=>{"use strict";b();p();var Cle=Ar&&Ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Lle=Ar&&Ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ule=Ar&&Ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Cle(e,r,t);return Lle(e,r),e},Fle=Ar&&Ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.loadUncompressedPublicKey=Ar.loadCompressedPublicKey=Ar.publicKeyConvert=Ar.publicKeyCreate=Ar.publicKeyVerify=Ar.privateKeyVerify=Ar.loadPublicKey=Ar.recover=Ar.verify=Ar.sign=void 0;var qle=Ule(Xx()),Yi=new qle.ec("p256"),ry=Fle(Cs());function Dle(r,e,t=!0){let n=Yi.sign(Array.from(r),v.Buffer.from(e),{canonical:t});return{signature:n.toBytes(),recovery:n.recoveryParam}}Ar.sign=Dle;function Hle(r,e,t,n){let s=AK(e,t,r,!1);return s==null?!1:s.equals(n)}Ar.verify=Hle;function AK(r,e,t,n){let s={r:Array.from(r.slice(0,32)),s:Array.from(r.slice(32,64))},i=new ry.default(s.r),a=new ry.default(s.s);if(i.cmp(Yi.curve.n)>=0||a.cmp(Yi.curve.n)>=0||i.isZero()||a.isZero())return null;let o;try{o=Yi.recoverPubKey(Array.from(t),s,e,null)}catch{return null}return v.Buffer.from(o.encode(null,n))}Ar.recover=AK;function Pk(r){let e=v.Buffer.from(r),t=e[0];switch(t){case 2:case 3:return e.length!==33?null:EK(t,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:SK(t,e.subarray(1,33),e.subarray(33,65));default:return null}}Ar.loadPublicKey=Pk;function Kle(r){let e=new ry.default(Array.from(r));return e.cmp(Yi.curve.n)<0&&!e.isZero()}Ar.privateKeyVerify=Kle;function Gle(r){return Pk(r)!==null}Ar.publicKeyVerify=Gle;function Vle(r,e){let t=Yi.keyFromPrivate(Array.from(r),"bytes").getPublic();return v.Buffer.from(t.encode(null,e))}Ar.publicKeyCreate=Vle;function zle(r,e){let t=Pk(r);if(t==null)return null;let n=Yi.keyPair({pub:{x:t.x,y:t.y}}).getPublic();return v.Buffer.from(n.encode(null,e))}Ar.publicKeyConvert=zle;function EK(r,e){let t=new ry.default(Array.from(e));if(t.cmp(Yi.curve.p)>=0)return null;let n=t.toRed(Yi.curve.red),s=n.redSqr().redIMul(n).redIAdd(Yi.curve.b).redSqrt();return r===3!==s.isOdd()&&(s=s.redNeg()),{x:n,y:s}}Ar.loadCompressedPublicKey=EK;function SK(r,e,t){let n=new ry.default(Array.from(e)),s=new ry.default(Array.from(t));if(n.cmp(Yi.curve.p)>=0||s.cmp(Yi.curve.p)>=0)return null;let i=n.toRed(Yi.curve.red),a=s.toRed(Yi.curve.red);if((r===6||r===7)&&a.isOdd()!==(r===7))return null;let o=i.redSqr().redIMul(i);return a.redSqr().redISub(o.redIAdd(Yi.curve.b)).isZero()?{x:i,y:a}:null}Ar.loadUncompressedPublicKey=SK});var G0=R(It=>{"use strict";b();p();Object.defineProperty(It,"__esModule",{value:!0});It.validateObject=It.createHmacDrbg=It.bitMask=It.bitSet=It.bitGet=It.bitLen=It.utf8ToBytes=It.equalBytes=It.concatBytes=It.ensureBytes=It.numberToVarBytesBE=It.numberToBytesLE=It.numberToBytesBE=It.bytesToNumberLE=It.bytesToNumberBE=It.hexToBytes=It.hexToNumber=It.numberToHexUnpadded=It.bytesToHex=void 0;var BK=BigInt(0),$7=BigInt(1),Wle=BigInt(2),J7=r=>r instanceof Uint8Array,$le=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Ak(r){if(!J7(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=$le[r[t]];return e}It.bytesToHex=Ak;function kK(r){let e=r.toString(16);return e.length&1?`0${e}`:e}It.numberToHexUnpadded=kK;function Ek(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}It.hexToNumber=Ek;function Z7(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);if(r.length%2)throw new Error("hex string is invalid: unpadded "+r.length);let e=new Uint8Array(r.length/2);for(let t=0;t<e.length;t++){let n=t*2,s=r.slice(n,n+2),i=Number.parseInt(s,16);if(Number.isNaN(i)||i<0)throw new Error("invalid byte sequence");e[t]=i}return e}It.hexToBytes=Z7;function Jle(r){return Ek(Ak(r))}It.bytesToNumberBE=Jle;function Zle(r){if(!J7(r))throw new Error("Uint8Array expected");return Ek(Ak(Uint8Array.from(r).reverse()))}It.bytesToNumberLE=Zle;var Qle=(r,e)=>Z7(r.toString(16).padStart(e*2,"0"));It.numberToBytesBE=Qle;var Yle=(r,e)=>(0,It.numberToBytesBE)(r,e).reverse();It.numberToBytesLE=Yle;var Xle=r=>Z7(kK(r));It.numberToVarBytesBE=Xle;function ehe(r,e,t){let n;if(typeof e=="string")try{n=Z7(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(J7(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}It.ensureBytes=ehe;function NK(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!J7(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}It.concatBytes=NK;function the(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}It.equalBytes=the;function rhe(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}It.utf8ToBytes=rhe;function nhe(r){let e;for(e=0;r>BK;r>>=$7,e+=1);return e}It.bitLen=nhe;var she=(r,e)=>r>>BigInt(e)&$7;It.bitGet=she;var ihe=(r,e,t)=>r|(t?$7:BK)<<BigInt(e);It.bitSet=ihe;var ahe=r=>(Wle<<BigInt(r-1))-$7;It.bitMask=ahe;var _k=r=>new Uint8Array(r),OK=r=>Uint8Array.from(r);function ohe(r,e,t){if(typeof r!="number"||r<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 t!="function")throw new Error("hmacFn must be a function");let n=_k(r),s=_k(r),i=0,a=()=>{n.fill(1),s.fill(0),i=0},o=(...d)=>t(s,n,...d),c=(d=_k())=>{s=o(OK([0]),d),n=o(),d.length!==0&&(s=o(OK([1]),d),n=o())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,g=[];for(;d<e;){n=o();let h=n.slice();g.push(h),d+=n.length}return NK(...g)};return(d,g)=>{a(),c(d);let h;for(;!(h=g(u()));)c();return a(),h}}It.createHmacDrbg=ohe;var che={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function uhe(r,e,t={}){let n=(s,i,a)=>{let o=che[i];if(typeof o!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(a&&c===void 0)&&!o(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}It.validateObject=uhe});var rp=R(Qt=>{"use strict";b();p();Object.defineProperty(Qt,"__esModule",{value:!0});Qt.hashToPrivateScalar=Qt.FpSqrtEven=Qt.FpSqrtOdd=Qt.Field=Qt.nLength=Qt.FpIsSquare=Qt.FpDiv=Qt.FpInvertBatch=Qt.FpPow=Qt.validateField=Qt.isNegativeLE=Qt.FpSqrt=Qt.tonelliShanks=Qt.invert=Qt.pow2=Qt.pow=Qt.mod=void 0;var V0=G0(),Us=BigInt(0),cn=BigInt(1),Sl=BigInt(2),fhe=BigInt(3),Sk=BigInt(4),IK=BigInt(5),RK=BigInt(8),dhe=BigInt(9),lhe=BigInt(16);function Do(r,e){let t=r%e;return t>=Us?t:e+t}Qt.mod=Do;function jK(r,e,t){if(t<=Us||e<Us)throw new Error("Expected power/modulo > 0");if(t===cn)return Us;let n=cn;for(;e>Us;)e&cn&&(n=n*r%t),r=r*r%t,e>>=cn;return n}Qt.pow=jK;function hhe(r,e,t){let n=r;for(;e-- >Us;)n*=n,n%=t;return n}Qt.pow2=hhe;function Q7(r,e){if(r===Us||e<=Us)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=Do(r,e),n=e,s=Us,i=cn,a=cn,o=Us;for(;t!==Us;){let u=n/t,f=n%t,d=s-a*u,g=i-o*u;n=t,t=f,s=a,i=o,a=d,o=g}if(n!==cn)throw new Error("invert: does not exist");return Do(s,e)}Qt.invert=Q7;function MK(r){let e=(r-cn)/Sl,t,n,s;for(t=r-cn,n=0;t%Sl===Us;t/=Sl,n++);for(s=Sl;s<r&&jK(s,e,r)!==r-cn;s++);if(n===1){let a=(r+cn)/Sk;return function(c,u){let f=c.pow(u,a);if(!c.eql(c.sqr(f),u))throw new Error("Cannot find square root");return f}}let i=(t+cn)/Sl;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,s),t),d=o.pow(c,i),g=o.pow(c,t);for(;!o.eql(g,o.ONE);){if(o.eql(g,o.ZERO))return o.ZERO;let h=1;for(let y=o.sqr(g);h<u&&!o.eql(y,o.ONE);h++)y=o.sqr(y);let m=o.pow(f,cn<<BigInt(u-h-1));f=o.sqr(m),d=o.mul(d,m),g=o.mul(g,f),u=h}return d}}Qt.tonelliShanks=MK;function CK(r){if(r%Sk===fhe){let e=(r+cn)/Sk;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%RK===IK){let e=(r-IK)/RK;return function(n,s){let i=n.mul(s,Sl),a=n.pow(i,e),o=n.mul(s,a),c=n.mul(n.mul(o,Sl),a),u=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%lhe,MK(r)}Qt.FpSqrt=CK;var bhe=(r,e)=>(Do(r,e)&cn)===cn;Qt.isNegativeLE=bhe;var phe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ghe(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=phe.reduce((n,s)=>(n[s]="function",n),e);return(0,V0.validateObject)(r,t)}Qt.validateField=ghe;function LK(r,e,t){if(t<Us)throw new Error("Expected power > 0");if(t===Us)return r.ONE;if(t===cn)return e;let n=r.ONE,s=e;for(;t>Us;)t&cn&&(n=r.mul(n,s)),s=r.sqr(s),t>>=cn;return n}Qt.FpPow=LK;function UK(r,e){let t=new Array(e.length),n=e.reduce((i,a,o)=>r.is0(a)?i:(t[o]=i,r.mul(i,a)),r.ONE),s=r.inv(n);return e.reduceRight((i,a,o)=>r.is0(a)?i:(t[o]=r.mul(i,t[o]),r.mul(i,a)),s),t}Qt.FpInvertBatch=UK;function xhe(r,e,t){return r.mul(e,typeof t=="bigint"?Q7(t,r.ORDER):r.inv(t))}Qt.FpDiv=xhe;function yhe(r){let e=(r.ORDER-cn)/Sl;return t=>{let n=r.pow(t,e);return r.eql(n,r.ZERO)||r.eql(n,r.ONE)}}Qt.FpIsSquare=yhe;function Tk(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}Qt.nLength=Tk;function mhe(r,e,t=!1,n={}){if(r<=Us)throw new Error(`Expected Fp ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=Tk(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=CK(r),o=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:(0,V0.bitMask)(s),ZERO:Us,ONE:cn,create:c=>Do(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Us<=c&&c<r},is0:c=>c===Us,isOdd:c=>(c&cn)===cn,neg:c=>Do(-c,r),eql:(c,u)=>c===u,sqr:c=>Do(c*c,r),add:(c,u)=>Do(c+u,r),sub:(c,u)=>Do(c-u,r),mul:(c,u)=>Do(c*u,r),pow:(c,u)=>LK(o,c,u),div:(c,u)=>Do(c*Q7(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Q7(c,r),sqrt:n.sqrt||(c=>a(o,c)),invertBatch:c=>UK(o,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>t?(0,V0.numberToBytesLE)(c,i):(0,V0.numberToBytesBE)(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?(0,V0.bytesToNumberLE)(c):(0,V0.bytesToNumberBE)(c)}});return Object.freeze(o)}Qt.Field=mhe;function whe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?t:r.neg(t)}Qt.FpSqrtOdd=whe;function vhe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}Qt.FpSqrtEven=vhe;function Phe(r,e,t=!1){r=(0,V0.ensureBytes)("privateHash",r);let n=r.length,s=Tk(e).nByteLength+8;if(s<24||n<s||n>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${n}`);let i=t?(0,V0.bytesToNumberLE)(r):(0,V0.bytesToNumberBE)(r);return Do(i,e-cn)+cn}Qt.hashToPrivateScalar=Phe});var qK=R(ny=>{"use strict";b();p();Object.defineProperty(ny,"__esModule",{value:!0});ny.validateBasic=ny.wNAF=void 0;var FK=rp(),_he=G0(),Ahe=BigInt(0),Ok=BigInt(1);function Ehe(r,e){let t=(s,i)=>{let a=i.negate();return s?a:i},n=s=>{let i=Math.ceil(e/s)+1,a=2**(s-1);return{windows:i,windowSize:a}};return{constTimeNegate:t,unsafeLadder(s,i){let a=r.ZERO,o=s;for(;i>Ahe;)i&Ok&&(a=a.add(o)),o=o.double(),i>>=Ok;return a},precomputeWindow(s,i){let{windows:a,windowSize:o}=n(i),c=[],u=s,f=u;for(let d=0;d<a;d++){f=u,c.push(f);for(let g=1;g<o;g++)f=f.add(u),c.push(f);u=f.double()}return c},wNAF(s,i,a){let{windows:o,windowSize:c}=n(s),u=r.ZERO,f=r.BASE,d=BigInt(2**s-1),g=2**s,h=BigInt(s);for(let m=0;m<o;m++){let y=m*c,S=Number(a&d);a>>=h,S>c&&(S-=g,a+=Ok);let T=y,H=y+Math.abs(S)-1,C=m%2!==0,J=S<0;S===0?f=f.add(t(C,i[T])):u=u.add(t(J,i[H]))}return{p:u,f}},wNAFCached(s,i,a,o){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,o(u))),this.wNAF(c,u,a)}}}ny.wNAF=Ehe;function She(r){return(0,FK.validateField)(r.Fp),(0,_he.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,FK.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}ny.validateBasic=She});var X7=R(un=>{"use strict";b();p();var The=un&&un.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ohe=un&&un.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),HK=un&&un.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&The(e,r,t);return Ohe(e,r),e};Object.defineProperty(un,"__esModule",{value:!0});un.mapToCurveSimpleSWU=un.SWUFpSqrtRatio=un.weierstrass=un.weierstrassPoints=un.DER=void 0;var Sw=HK(rp()),hs=HK(G0()),Rf=G0(),Bk=qK();function Bhe(r){let e=(0,Bk.validateBasic)(r);hs.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:khe,hexToBytes:Nhe}=hs;un.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=un.DER;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)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:khe(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=un.DER,t=typeof r=="string"?Nhe(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=un.DER._parseInt(t.subarray(2)),{d:a,l:o}=un.DER._parseInt(i);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let f=u.toString(16);return f.length&1?`0${f}`:f},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,a=s.length/2,o=t(i),c=t(a);return`30${t(a+i+4)}02${c}${s}02${o}${n}`}};var lu=BigInt(0),Zn=BigInt(1),Tl=BigInt(2),Y7=BigInt(3),DK=BigInt(4);function KK(r){let e=Bhe(r),{Fp:t}=e,n=e.toBytes||((m,y,S)=>{let T=y.toAffine();return hs.concatBytes(Uint8Array.from([4]),t.toBytes(T.x),t.toBytes(T.y))}),s=e.fromBytes||(m=>{let y=m.subarray(1),S=t.fromBytes(y.subarray(0,t.BYTES)),T=t.fromBytes(y.subarray(t.BYTES,2*t.BYTES));return{x:S,y:T}});function i(m){let{a:y,b:S}=e,T=t.sqr(m),H=t.mul(T,m);return t.add(t.add(H,t.mul(m,y)),S)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function a(m){return typeof m=="bigint"&&lu<m&&m<e.n}function o(m){if(!a(m))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(m){let{allowedPrivateKeyLengths:y,nByteLength:S,wrapPrivateKey:T,n:H}=e;if(y&&typeof m!="bigint"){if(m instanceof Uint8Array&&(m=hs.bytesToHex(m)),typeof m!="string"||!y.includes(m.length))throw new Error("Invalid key");m=m.padStart(S*2,"0")}let C;try{C=typeof m=="bigint"?m:hs.bytesToNumberBE((0,Rf.ensureBytes)("private key",m,S))}catch{throw new Error(`private key must be ${S} bytes, hex or bigint, not ${typeof m}`)}return T&&(C=Sw.mod(C,H)),o(C),C}let u=new Map;function f(m){if(!(m instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(y,S,T){if(this.px=y,this.py=S,this.pz=T,y==null||!t.isValid(y))throw new Error("x required");if(S==null||!t.isValid(S))throw new Error("y required");if(T==null||!t.isValid(T))throw new Error("z required")}static fromAffine(y){let{x:S,y:T}=y||{};if(!y||!t.isValid(S)||!t.isValid(T))throw new Error("invalid affine point");if(y instanceof d)throw new Error("projective point not allowed");let H=C=>t.eql(C,t.ZERO);return H(S)&&H(T)?d.ZERO:new d(S,T,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){let S=t.invertBatch(y.map(T=>T.pz));return y.map((T,H)=>T.toAffine(S[H])).map(d.fromAffine)}static fromHex(y){let S=d.fromAffine(s((0,Rf.ensureBytes)("pointHex",y)));return S.assertValidity(),S}static fromPrivateKey(y){return d.BASE.multiply(c(y))}_setWindowSize(y){this._WINDOW_SIZE=y,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}let{x:y,y:S}=this.toAffine();if(!t.isValid(y)||!t.isValid(S))throw new Error("bad point: x or y not FE");let T=t.sqr(S),H=i(y);if(!t.eql(T,H))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y}=this.toAffine();if(t.isOdd)return!t.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(y){f(y);let{px:S,py:T,pz:H}=this,{px:C,py:J,pz:z}=y,W=t.eql(t.mul(S,z),t.mul(C,H)),Y=t.eql(t.mul(T,z),t.mul(J,H));return W&&Y}negate(){return new d(this.px,t.neg(this.py),this.pz)}double(){let{a:y,b:S}=e,T=t.mul(S,Y7),{px:H,py:C,pz:J}=this,z=t.ZERO,W=t.ZERO,Y=t.ZERO,Z=t.mul(H,H),se=t.mul(C,C),q=t.mul(J,J),x=t.mul(H,C);return x=t.add(x,x),Y=t.mul(H,J),Y=t.add(Y,Y),z=t.mul(y,Y),W=t.mul(T,q),W=t.add(z,W),z=t.sub(se,W),W=t.add(se,W),W=t.mul(z,W),z=t.mul(x,z),Y=t.mul(T,Y),q=t.mul(y,q),x=t.sub(Z,q),x=t.mul(y,x),x=t.add(x,Y),Y=t.add(Z,Z),Z=t.add(Y,Z),Z=t.add(Z,q),Z=t.mul(Z,x),W=t.add(W,Z),q=t.mul(C,J),q=t.add(q,q),Z=t.mul(q,x),z=t.sub(z,Z),Y=t.mul(q,se),Y=t.add(Y,Y),Y=t.add(Y,Y),new d(z,W,Y)}add(y){f(y);let{px:S,py:T,pz:H}=this,{px:C,py:J,pz:z}=y,W=t.ZERO,Y=t.ZERO,Z=t.ZERO,se=e.a,q=t.mul(e.b,Y7),x=t.mul(S,C),O=t.mul(T,J),B=t.mul(H,z),A=t.add(S,T),E=t.add(C,J);A=t.mul(A,E),E=t.add(x,O),A=t.sub(A,E),E=t.add(S,H);let j=t.add(C,z);return E=t.mul(E,j),j=t.add(x,B),E=t.sub(E,j),j=t.add(T,H),W=t.add(J,z),j=t.mul(j,W),W=t.add(O,B),j=t.sub(j,W),Z=t.mul(se,E),W=t.mul(q,B),Z=t.add(W,Z),W=t.sub(O,Z),Z=t.add(O,Z),Y=t.mul(W,Z),O=t.add(x,x),O=t.add(O,x),B=t.mul(se,B),E=t.mul(q,E),O=t.add(O,B),B=t.sub(x,B),B=t.mul(se,B),E=t.add(E,B),x=t.mul(O,E),Y=t.add(Y,x),x=t.mul(j,E),W=t.mul(A,W),W=t.sub(W,x),x=t.mul(A,O),Z=t.mul(j,Z),Z=t.add(Z,x),new d(W,Y,Z)}subtract(y){return this.add(y.negate())}is0(){return this.equals(d.ZERO)}wNAF(y){return h.wNAFCached(this,u,y,S=>{let T=t.invertBatch(S.map(H=>H.pz));return S.map((H,C)=>H.toAffine(T[C])).map(d.fromAffine)})}multiplyUnsafe(y){let S=d.ZERO;if(y===lu)return S;if(o(y),y===Zn)return this;let{endo:T}=e;if(!T)return h.unsafeLadder(this,y);let{k1neg:H,k1:C,k2neg:J,k2:z}=T.splitScalar(y),W=S,Y=S,Z=this;for(;C>lu||z>lu;)C&Zn&&(W=W.add(Z)),z&Zn&&(Y=Y.add(Z)),Z=Z.double(),C>>=Zn,z>>=Zn;return H&&(W=W.negate()),J&&(Y=Y.negate()),Y=new d(t.mul(Y.px,T.beta),Y.py,Y.pz),W.add(Y)}multiply(y){o(y);let S=y,T,H,{endo:C}=e;if(C){let{k1neg:J,k1:z,k2neg:W,k2:Y}=C.splitScalar(S),{p:Z,f:se}=this.wNAF(z),{p:q,f:x}=this.wNAF(Y);Z=h.constTimeNegate(J,Z),q=h.constTimeNegate(W,q),q=new d(t.mul(q.px,C.beta),q.py,q.pz),T=Z.add(q),H=se.add(x)}else{let{p:J,f:z}=this.wNAF(S);T=J,H=z}return d.normalizeZ([T,H])[0]}multiplyAndAddUnsafe(y,S,T){let H=d.BASE,C=(z,W)=>W===lu||W===Zn||!z.equals(H)?z.multiplyUnsafe(W):z.multiply(W),J=C(this,S).add(C(y,T));return J.is0()?void 0:J}toAffine(y){let{px:S,py:T,pz:H}=this,C=this.is0();y==null&&(y=C?t.ONE:t.inv(H));let J=t.mul(S,y),z=t.mul(T,y),W=t.mul(H,y);if(C)return{x:t.ZERO,y:t.ZERO};if(!t.eql(W,t.ONE))throw new Error("invZ was invalid");return{x:J,y:z}}isTorsionFree(){let{h:y,isTorsionFree:S}=e;if(y===Zn)return!0;if(S)return S(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:y,clearCofactor:S}=e;return y===Zn?this:S?S(d,this):this.multiplyUnsafe(e.h)}toRawBytes(y=!0){return this.assertValidity(),n(d,this,y)}toHex(y=!0){return hs.bytesToHex(this.toRawBytes(y))}}d.BASE=new d(e.Gx,e.Gy,t.ONE),d.ZERO=new d(t.ZERO,t.ONE,t.ZERO);let g=e.nBitLength,h=(0,Bk.wNAF)(d,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:a}}un.weierstrassPoints=KK;function Ihe(r){let e=(0,Bk.validateBasic)(r);return hs.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Rhe(r){let e=Ihe(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function a(E){return lu<E&&E<t.ORDER}function o(E){return Sw.mod(E,n)}function c(E){return Sw.invert(E,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:d,isWithinCurveOrder:g}=KK({...e,toBytes(E,j,G){let M=j.toAffine(),P=t.toBytes(M.x),K=hs.concatBytes;return G?K(Uint8Array.from([j.hasEvenY()?2:3]),P):K(Uint8Array.from([4]),P,t.toBytes(M.y))},fromBytes(E){let j=E.length,G=E[0],M=E.subarray(1);if(j===s&&(G===2||G===3)){let P=hs.bytesToNumberBE(M);if(!a(P))throw new Error("Point is not on curve");let K=d(P),re=t.sqrt(K),ie=(re&Zn)===Zn;return(G&1)===1!==ie&&(re=t.neg(re)),{x:P,y:re}}else if(j===i&&G===4){let P=t.fromBytes(M.subarray(0,t.BYTES)),K=t.fromBytes(M.subarray(t.BYTES,2*t.BYTES));return{x:P,y:K}}else throw new Error(`Point of length ${j} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=E=>hs.bytesToHex(hs.numberToBytesBE(E,e.nByteLength));function m(E){let j=n>>Zn;return E>j}function y(E){return m(E)?o(-E):E}let S=(E,j,G)=>hs.bytesToNumberBE(E.slice(j,G));class T{constructor(j,G,M){this.r=j,this.s=G,this.recovery=M,this.assertValidity()}static fromCompact(j){let G=e.nByteLength;return j=(0,Rf.ensureBytes)("compactSignature",j,G*2),new T(S(j,0,G),S(j,G,2*G))}static fromDER(j){let{r:G,s:M}=un.DER.toSig((0,Rf.ensureBytes)("DER",j));return new T(G,M)}assertValidity(){if(!g(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!g(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(j){return new T(this.r,this.s,j)}recoverPublicKey(j){let{r:G,s:M,recovery:P}=this,K=Y((0,Rf.ensureBytes)("msgHash",j));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");let re=P===2||P===3?G+e.n:G;if(re>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let ie=(P&1)===0?"02":"03",ce=u.fromHex(ie+h(re)),oe=c(re),we=o(-K*oe),He=o(M*oe),yt=u.BASE.multiplyAndAddUnsafe(ce,we,He);if(!yt)throw new Error("point at infinify");return yt.assertValidity(),yt}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return hs.hexToBytes(this.toDERHex())}toDERHex(){return un.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hs.hexToBytes(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let H={isValidPrivateKey(E){try{return f(E),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let E=e.randomBytes(t.BYTES+8),j=Sw.hashToPrivateScalar(E,n);return hs.numberToBytesBE(j,e.nByteLength)},precompute(E=8,j=u.BASE){return j._setWindowSize(E),j.multiply(BigInt(3)),j}};function C(E,j=!0){return u.fromPrivateKey(E).toRawBytes(j)}function J(E){let j=E instanceof Uint8Array,G=typeof E=="string",M=(j||G)&&E.length;return j?M===s||M===i:G?M===2*s||M===2*i:E instanceof u}function z(E,j,G=!0){if(J(E))throw new Error("first arg must be private key");if(!J(j))throw new Error("second arg must be public key");return u.fromHex(j).multiply(f(E)).toRawBytes(G)}let W=e.bits2int||function(E){let j=hs.bytesToNumberBE(E),G=E.length*8-e.nBitLength;return G>0?j>>BigInt(G):j},Y=e.bits2int_modN||function(E){return o(W(E))},Z=hs.bitMask(e.nBitLength);function se(E){if(typeof E!="bigint")throw new Error("bigint expected");if(!(lu<=E&&E<Z))throw new Error(`bigint expected < 2^${e.nBitLength}`);return hs.numberToBytesBE(E,e.nByteLength)}function q(E,j,G=x){if(["recovered","canonical"].some(Qe=>Qe in G))throw new Error("sign() legacy options not supported");let{hash:M,randomBytes:P}=e,{lowS:K,prehash:re,extraEntropy:ie}=G;K==null&&(K=!0),E=(0,Rf.ensureBytes)("msgHash",E),re&&(E=(0,Rf.ensureBytes)("prehashed msgHash",M(E)));let ce=Y(E),oe=f(j),we=[se(oe),se(ce)];if(ie!=null){let Qe=ie===!0?P(t.BYTES):ie;we.push((0,Rf.ensureBytes)("extraEntropy",Qe,t.BYTES))}let He=hs.concatBytes(...we),yt=ce;function mt(Qe){let Cr=W(Qe);if(!g(Cr))return;let sr=c(Cr),We=u.BASE.multiply(Cr).toAffine(),rn=o(We.x);if(rn===lu)return;let $t=o(sr*o(yt+rn*oe));if($t===lu)return;let vr=(We.x===rn?0:2)|Number(We.y&Zn),_a=$t;return K&&m($t)&&(_a=y($t),vr^=1),new T(rn,_a,vr)}return{seed:He,k2sig:mt}}let x={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};function B(E,j,G=x){let{seed:M,k2sig:P}=q(E,j,G),K=e;return hs.createHmacDrbg(K.hash.outputLen,K.nByteLength,K.hmac)(M,P)}u.BASE._setWindowSize(8);function A(E,j,G,M=O){let P=E;if(j=(0,Rf.ensureBytes)("msgHash",j),G=(0,Rf.ensureBytes)("publicKey",G),"strict"in M)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:re}=M,ie,ce;try{if(typeof P=="string"||P instanceof Uint8Array)try{ie=T.fromDER(P)}catch(We){if(!(We instanceof un.DER.Err))throw We;ie=T.fromCompact(P)}else if(typeof P=="object"&&typeof P.r=="bigint"&&typeof P.s=="bigint"){let{r:We,s:rn}=P;ie=new T(We,rn)}else throw new Error("PARSE");ce=u.fromHex(G)}catch(We){if(We.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&ie.hasHighS())return!1;re&&(j=e.hash(j));let{r:oe,s:we}=ie,He=Y(j),yt=c(we),mt=o(He*yt),Qe=o(oe*yt),Cr=u.BASE.multiplyAndAddUnsafe(ce,mt,Qe)?.toAffine();return Cr?o(Cr.x)===oe:!1}return{CURVE:e,getPublicKey:C,getSharedSecret:z,sign:B,verify:A,ProjectivePoint:u,Signature:T,utils:H}}un.weierstrass=Rhe;function GK(r,e){let t=r.ORDER,n=lu;for(let m=t-Zn;m%Tl===lu;m/=Tl)n+=Zn;let s=n,i=Tl<<s-Zn-Zn,a=i*Tl,o=(t-Zn)/a,c=(o-Zn)/Tl,u=a-Zn,f=i,d=r.pow(e,o),g=r.pow(e,(o+Zn)/Tl),h=(m,y)=>{let S=d,T=r.pow(y,u),H=r.sqr(T);H=r.mul(H,y);let C=r.mul(m,H);C=r.pow(C,c),C=r.mul(C,T),T=r.mul(C,y),H=r.mul(C,m);let J=r.mul(H,T);C=r.pow(J,f);let z=r.eql(C,r.ONE);T=r.mul(H,g),C=r.mul(J,S),H=r.cmov(T,H,z),J=r.cmov(C,J,z);for(let W=s;W>Zn;W--){let Y=W-Tl;Y=Tl<<Y-Zn;let Z=r.pow(J,Y),se=r.eql(Z,r.ONE);T=r.mul(H,S),S=r.mul(S,S),Z=r.mul(J,S),H=r.cmov(T,H,se),J=r.cmov(Z,J,se)}return{isValid:z,value:H}};if(r.ORDER%DK===Y7){let m=(r.ORDER-Y7)/DK,y=r.sqrt(r.neg(e));h=(S,T)=>{let H=r.sqr(T),C=r.mul(S,T);H=r.mul(H,C);let J=r.pow(H,m);J=r.mul(J,C);let z=r.mul(J,y),W=r.mul(r.sqr(J),T),Y=r.eql(W,S),Z=r.cmov(z,J,Y);return{isValid:Y,value:Z}}}return h}un.SWUFpSqrtRatio=GK;function jhe(r,e){if(Sw.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let t=GK(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,i,a,o,c,u,f,d;s=r.sqr(n),s=r.mul(s,e.Z),i=r.sqr(s),i=r.add(i,s),a=r.add(i,r.ONE),a=r.mul(a,e.B),o=r.cmov(e.Z,r.neg(i),!r.eql(i,r.ZERO)),o=r.mul(o,e.A),i=r.sqr(a),u=r.sqr(o),c=r.mul(u,e.A),i=r.add(i,c),i=r.mul(i,a),u=r.mul(u,o),c=r.mul(u,e.B),i=r.add(i,c),f=r.mul(s,a);let{isValid:g,value:h}=t(i,u);d=r.mul(s,n),d=r.mul(d,h),f=r.cmov(f,a,g),d=r.cmov(d,h,g);let m=r.isOdd(n)===r.isOdd(d);return d=r.cmov(r.neg(d),d,m),f=r.div(f,o),{x:f,y:d}}}un.mapToCurveSimpleSWU=jhe});var WK=R(Ho=>{"use strict";b();p();Object.defineProperty(Ho,"__esModule",{value:!0});Ho.createHasher=Ho.isogenyMap=Ho.hash_to_field=Ho.expand_message_xof=Ho.expand_message_xmd=void 0;var Mhe=rp(),hu=G0();function Che(r){if(r instanceof Uint8Array)return r;if(typeof r=="string")return(0,hu.utf8ToBytes)(r);throw new Error("DST must be Uint8Array or string")}var Lhe=hu.bytesToNumberBE;function Ol(r,e){if(r<0||r>=1<<8*e)throw new Error(`bad I2OSP call: value=${r} length=${e}`);let t=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)t[n]=r&255,r>>>=8;return new Uint8Array(t)}function Uhe(r,e){let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}function Tw(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected")}function Nk(r){if(!Number.isSafeInteger(r))throw new Error("number expected")}function VK(r,e,t,n){Tw(r),Tw(e),Nk(t),e.length>255&&(e=n((0,hu.concatBytes)((0,hu.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:s,blockLen:i}=n,a=Math.ceil(t/s);if(a>255)throw new Error("Invalid xmd length");let o=(0,hu.concatBytes)(e,Ol(e.length,1)),c=Ol(0,i),u=Ol(t,2),f=new Array(a),d=n((0,hu.concatBytes)(c,r,u,Ol(0,1),o));f[0]=n((0,hu.concatBytes)(d,Ol(1,1),o));for(let h=1;h<=a;h++){let m=[Uhe(d,f[h-1]),Ol(h+1,1),o];f[h]=n((0,hu.concatBytes)(...m))}return(0,hu.concatBytes)(...f).slice(0,t)}Ho.expand_message_xmd=VK;function zK(r,e,t,n,s){if(Tw(r),Tw(e),Nk(t),e.length>255){let i=Math.ceil(2*n/8);e=s.create({dkLen:i}).update((0,hu.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(t>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:t}).update(r).update(Ol(t,2)).update(e).update(Ol(e.length,1)).digest()}Ho.expand_message_xof=zK;function kk(r,e,t){(0,hu.validateObject)(t,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:s,m:i,hash:a,expand:o,DST:c}=t;Tw(r),Nk(e);let u=Che(c),f=n.toString(2).length,d=Math.ceil((f+s)/8),g=e*i*d,h;if(o==="xmd")h=VK(r,u,g,a);else if(o==="xof")h=zK(r,u,g,s,a);else if(o==="_internal_pass")h=r;else throw new Error('expand must be "xmd" or "xof"');let m=new Array(e);for(let y=0;y<e;y++){let S=new Array(i);for(let T=0;T<i;T++){let H=d*(T+y*i),C=h.subarray(H,H+d);S[T]=(0,Mhe.mod)(Lhe(C),n)}m[y]=S}return m}Ho.hash_to_field=kk;function Fhe(r,e){let t=e.map(n=>Array.from(n).reverse());return(n,s)=>{let[i,a,o,c]=t.map(u=>u.reduce((f,d)=>r.add(r.mul(f,n),d)));return n=r.div(i,a),s=r.mul(s,r.div(o,c)),{x:n,y:s}}}Ho.isogenyMap=Fhe;function qhe(r,e,t){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,s){let i=kk(n,2,{...t,DST:t.DST,...s}),a=r.fromAffine(e(i[0])),o=r.fromAffine(e(i[1])),c=a.add(o).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,s){let i=kk(n,1,{...t,DST:t.encodeDST,...s}),a=r.fromAffine(e(i[0])).clearCofactor();return a.assertValidity(),a}}}Ho.createHasher=qhe});var Ik=R(sy=>{"use strict";b();p();Object.defineProperty(sy,"__esModule",{value:!0});sy.createCurve=sy.getHash=void 0;var Dhe=hw(),$K=bi(),Hhe=X7();function JK(r){return{hash:r,hmac:(e,...t)=>(0,Dhe.hmac)(r,e,(0,$K.concatBytes)(...t)),randomBytes:$K.randomBytes}}sy.getHash=JK;function Khe(r,e){let t=n=>(0,Hhe.weierstrass)({...r,...JK(n)});return Object.freeze({...t(e),create:t})}sy.createCurve=Khe});var iG=R(bs=>{"use strict";b();p();var Ghe=bs&&bs.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Vhe=bs&&bs.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zhe=bs&&bs.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Ghe(e,r,t);return Vhe(e,r),e},Rk;Object.defineProperty(bs,"__esModule",{value:!0});bs.encodeToCurve=bs.hashToCurve=bs.schnorr=bs.secp256k1=void 0;var e9=Ix(),Whe=bi(),Xs=rp(),$he=X7(),ki=G0(),YK=zhe(WK()),Jhe=Ik(),s9=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),t9=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),XK=BigInt(1),r9=BigInt(2),ZK=(r,e)=>(r+e/r9)/e;function eG(r){let e=s9,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),u=r*r*r%e,f=u*u*r%e,d=(0,Xs.pow2)(f,t,e)*f%e,g=(0,Xs.pow2)(d,t,e)*f%e,h=(0,Xs.pow2)(g,r9,e)*u%e,m=(0,Xs.pow2)(h,s,e)*h%e,y=(0,Xs.pow2)(m,i,e)*m%e,S=(0,Xs.pow2)(y,o,e)*y%e,T=(0,Xs.pow2)(S,c,e)*S%e,H=(0,Xs.pow2)(T,o,e)*y%e,C=(0,Xs.pow2)(H,t,e)*f%e,J=(0,Xs.pow2)(C,a,e)*m%e,z=(0,Xs.pow2)(J,n,e)*u%e,W=(0,Xs.pow2)(z,r9,e);if(!Bl.eql(Bl.sqr(W),r))throw new Error("Cannot find square root");return W}var Bl=(0,Xs.Field)(s9,void 0,void 0,{sqrt:eG});bs.secp256k1=(0,Jhe.createCurve)({a:BigInt(0),b:BigInt(7),Fp:Bl,n:t9,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=t9,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-XK*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,a=BigInt("0x100000000000000000000000000000000"),o=ZK(i*r,e),c=ZK(-n*r,e),u=(0,Xs.mod)(r-o*t-c*s,e),f=(0,Xs.mod)(-o*n-c*i,e),d=u>a,g=f>a;if(d&&(u=e-u),g&&(f=e-f),u>a||f>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:d,k1:u,k2neg:g,k2:f}}}},e9.sha256);var i9=BigInt(0),tG=r=>typeof r=="bigint"&&i9<r&&r<s9,Zhe=r=>typeof r=="bigint"&&i9<r&&r<t9,QK={};function n9(r,...e){let t=QK[r];if(t===void 0){let n=(0,e9.sha256)(Uint8Array.from(r,s=>s.charCodeAt(0)));t=(0,ki.concatBytes)(n,n),QK[r]=t}return(0,e9.sha256)((0,ki.concatBytes)(t,...e))}var Lk=r=>r.toRawBytes(!0).slice(1),Mk=r=>(0,ki.numberToBytesBE)(r,32),jk=r=>(0,Xs.mod)(r,s9),Ow=r=>(0,Xs.mod)(r,t9),Uk=bs.secp256k1.ProjectivePoint,Qhe=(r,e,t)=>Uk.BASE.multiplyAndAddUnsafe(r,e,t);function Ck(r){let e=bs.secp256k1.utils.normPrivateKeyToScalar(r),t=Uk.fromPrivateKey(e);return{scalar:t.hasEvenY()?e:Ow(-e),bytes:Lk(t)}}function rG(r){if(!tG(r))throw new Error("bad x: need 0 < x < p");let e=jk(r*r),t=jk(e*r+BigInt(7)),n=eG(t);n%r9!==i9&&(n=jk(-n));let s=new Uk(r,n,XK);return s.assertValidity(),s}function nG(...r){return Ow((0,ki.bytesToNumberBE)(n9("BIP0340/challenge",...r)))}function Yhe(r){return Ck(r).bytes}function Xhe(r,e,t=(0,Whe.randomBytes)(32)){let n=(0,ki.ensureBytes)("message",r),{bytes:s,scalar:i}=Ck(e),a=(0,ki.ensureBytes)("auxRand",t,32),o=Mk(i^(0,ki.bytesToNumberBE)(n9("BIP0340/aux",a))),c=n9("BIP0340/nonce",o,s,n),u=Ow((0,ki.bytesToNumberBE)(c));if(u===i9)throw new Error("sign failed: k is zero");let{bytes:f,scalar:d}=Ck(u),g=nG(f,s,n),h=new Uint8Array(64);if(h.set(f,0),h.set(Mk(Ow(d+g*i)),32),!sG(h,n,s))throw new Error("sign: Invalid signature produced");return h}function sG(r,e,t){let n=(0,ki.ensureBytes)("signature",r,64),s=(0,ki.ensureBytes)("message",e),i=(0,ki.ensureBytes)("publicKey",t,32);try{let a=rG((0,ki.bytesToNumberBE)(i)),o=(0,ki.bytesToNumberBE)(n.subarray(0,32));if(!tG(o))return!1;let c=(0,ki.bytesToNumberBE)(n.subarray(32,64));if(!Zhe(c))return!1;let u=nG(Mk(o),Lk(a),s),f=Qhe(a,c,Ow(-u));return!(!f||!f.hasEvenY()||f.toAffine().x!==o)}catch{return!1}}bs.schnorr={getPublicKey:Yhe,sign:Xhe,verify:sG,utils:{randomPrivateKey:bs.secp256k1.utils.randomPrivateKey,lift_x:rG,pointToBytes:Lk,numberToBytesBE:ki.numberToBytesBE,bytesToNumberBE:ki.bytesToNumberBE,taggedHash:n9,mod:Xs.mod}};var ebe=YK.isogenyMap(Bl,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(r=>r.map(e=>BigInt(e)))),tbe=(0,$he.mapToCurveSimpleSWU)(Bl,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Bl.create(BigInt("-11"))});Rk=YK.createHasher(bs.secp256k1.ProjectivePoint,r=>{let{x:e,y:t}=tbe(Bl.create(r[0]));return ebe(e,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Bl.ORDER,m:1,k:128,expand:"xmd",hash:e9.sha256}),bs.hashToCurve=Rk.hashToCurve,bs.encodeToCurve=Rk.encodeToCurve});var cG=R(kl=>{"use strict";b();p();Object.defineProperty(kl,"__esModule",{value:!0});kl.poseidon=kl.splitConstants=kl.validateOpts=void 0;var aG=rp();function oG(r){let{Fp:e}=r;(0,aG.validateField)(e);for(let c of["t","roundsFull","roundsPartial"])if(typeof r[c]!="number"||!Number.isSafeInteger(r[c]))throw new Error(`Poseidon: invalid param ${c}=${r[c]} (${typeof r[c]})`);if(r.reversePartialPowIdx!==void 0&&typeof r.reversePartialPowIdx!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${r.reversePartialPowIdx}`);let t=r.sboxPower;if(t===void 0&&(t=5),typeof t!="number"||!Number.isSafeInteger(t))throw new Error(`Poseidon wrong sboxPower=${t}`);let n=BigInt(t),s=c=>(0,aG.FpPow)(e,c,n);if(t===3?s=c=>e.mul(e.sqrN(c),c):t===5&&(s=c=>e.mul(e.sqrN(e.sqrN(c)),c)),r.roundsFull%2!==0)throw new Error(`Poseidon roundsFull is not even: ${r.roundsFull}`);let i=r.roundsFull+r.roundsPartial;if(!Array.isArray(r.roundConstants)||r.roundConstants.length!==i)throw new Error("Poseidon: wrong round constants");let a=r.roundConstants.map(c=>{if(!Array.isArray(c)||c.length!==r.t)throw new Error(`Poseidon wrong round constants: ${c}`);return c.map(u=>{if(typeof u!="bigint"||!e.isValid(u))throw new Error(`Poseidon wrong round constant=${u}`);return e.create(u)})});if(!Array.isArray(r.mds)||r.mds.length!==r.t)throw new Error("Poseidon: wrong MDS matrix");let o=r.mds.map(c=>{if(!Array.isArray(c)||c.length!==r.t)throw new Error(`Poseidon MDS matrix row: ${c}`);return c.map(u=>{if(typeof u!="bigint")throw new Error(`Poseidon MDS matrix value=${u}`);return e.create(u)})});return Object.freeze({...r,rounds:i,sboxFn:s,roundConstants:a,mds:o})}kl.validateOpts=oG;function rbe(r,e){if(typeof e!="number")throw new Error("poseidonSplitConstants: wrong t");if(!Array.isArray(r)||r.length%e)throw new Error("poseidonSplitConstants: wrong rc");let t=[],n=[];for(let s=0;s<r.length;s++)n.push(r[s]),n.length===e&&(t.push(n),n=[]);return t}kl.splitConstants=rbe;function nbe(r){let{t:e,Fp:t,rounds:n,sboxFn:s,reversePartialPowIdx:i}=oG(r),a=Math.floor(r.roundsFull/2),o=i?e-1:0,c=(f,d,g)=>(f=f.map((h,m)=>t.add(h,r.roundConstants[g][m])),d?f=f.map(h=>s(h)):f[o]=s(f[o]),f=r.mds.map(h=>h.reduce((m,y,S)=>t.add(m,t.mulN(y,f[S])),t.ZERO)),f),u=function(d){if(!Array.isArray(d)||d.length!==e)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${e})`);d=d.map(h=>{if(typeof h!="bigint")throw new Error(`Poseidon: wrong value=${h} (${typeof h})`);return t.create(h)});let g=0;for(let h=0;h<a;h++)d=c(d,!0,g++);for(let h=0;h<r.roundsPartial;h++)d=c(d,!1,g++);for(let h=0;h<a;h++)d=c(d,!0,g++);if(g!==n)throw new Error(`Poseidon: wrong number of rounds: last round=${g}, total=${n}`);return d};return u.roundConstants=r.roundConstants,u}kl.poseidon=nbe});var vG=R(Ce=>{"use strict";b();p();var sbe=Ce&&Ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ibe=Ce&&Ce.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),abe=Ce&&Ce.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&sbe(e,r,t);return ibe(e,r),e};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.poseidonHashMany=Ce.poseidonHashSingle=Ce.poseidonHashFunc=Ce.poseidonHash=Ce.poseidonSmall=Ce.poseidonCreate=Ce.poseidonBasic=Ce._poseidonMDS=Ce.Fp251=Ce.Fp253=Ce.keccak=Ce.computeHashOnElements=Ce.hashChain=Ce.pedersen=Ce.getAccountPath=Ce.ethSigToPrivate=Ce.getStarkKey=Ce.grindKey=Ce.utils=Ce.Signature=Ce.ProjectivePoint=Ce.CURVE=Ce.verify=Ce.sign=Ce.getSharedSecret=Ce.getPublicKey=Ce._starkCurve=void 0;var obe=w7(),Dk=Ix(),cbe=bi(),sp=rp(),ube=cG(),fbe=X7(),Ni=abe(G0()),dbe=Ik(),o9=BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"),dG=252;function uG(r){for(;r[0]===0;)r=r.subarray(1);let e=r.length*8-dG,t=Ni.bytesToNumberBE(r);return e>0?t>>BigInt(e):t}function lG(r){return typeof r=="string"&&(r=Kk(r),r.length&1&&(r="0"+r)),Ni.hexToBytes(r)}var ip=(0,fbe.weierstrass)({a:BigInt(1),b:BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),Fp:(0,sp.Field)(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),n:o9,nBitLength:dG,Gx:BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),Gy:BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),h:BigInt(1),lowS:!1,...(0,dbe.getHash)(Dk.sha256),bits2int:uG,bits2int_modN:r=>{let e=Ni.bytesToNumberBE(r).toString(16);return e.length===63&&(r=lG(e+"0")),(0,sp.mod)(uG(r),o9)}});Ce._starkCurve=ip;function np(r){return Ni.ensureBytes("",typeof r=="string"?lG(r):r)}function Hk(r){return Ni.bytesToHex(np(r)).padStart(64,"0")}function hG(r,e=!1){return ip.getPublicKey(Hk(r),e)}Ce.getPublicKey=hG;function lbe(r,e){return ip.getSharedSecret(Hk(r),e)}Ce.getSharedSecret=lbe;function hbe(r,e,t){return ip.sign(np(r),Hk(e),t)}Ce.sign=hbe;function bbe(r,e,t){let n=r instanceof bG?r:np(r);return ip.verify(n,np(e),np(t))}Ce.verify=bbe;var{CURVE:pbe,ProjectivePoint:iy,Signature:bG,utils:gbe}=ip;Ce.CURVE=pbe;Ce.ProjectivePoint=iy;Ce.Signature=bG;Ce.utils=gbe;function pG(r){return`0x${Ni.bytesToHex(r.subarray(1)).replace(/^0+/gm,"")}`}function Kk(r){return r.replace(/^0x/i,"")}function xbe(r){return`0x${r.toString(16)}`}function gG(r){let e=np(r),t=2n**256n,n=t-(0,sp.mod)(t,o9);for(let s=0;;s++){let i=Fk(Ni.concatBytes(e,Ni.numberToVarBytesBE(BigInt(s))));if(i<n)return(0,sp.mod)(i,o9).toString(16);if(s===1e5)throw new Error("grindKey is broken: tried 100k vals")}}Ce.grindKey=gG;function ybe(r){return pG(hG(r,!0))}Ce.getStarkKey=ybe;function mbe(r){if(r=Kk(r),r.length!==130)throw new Error("Wrong ethereum signature");return gG(r.substring(0,64))}Ce.ethSigToPrivate=mbe;var wbe=2n**31n-1n,a9=r=>Number(r&wbe);function vbe(r,e,t,n){let s=a9(Fk(r)),i=a9(Fk(e)),a=Ni.hexToNumber(Kk(t));return`m/2645'/${s}'/${i}'/${a9(a)}'/${a9(a>>31n)}'/${n}`}Ce.getAccountPath=vbe;var Bw=[new iy(2089986280348253421170679821480865132823066470938446095505822317253594081284n,1713931329540660377023406109199410414810705867260802078187082345529207694986n,1n),new iy(996781205833008774514500082376783249102396023663454813447423147977397232763n,1668503676786377725805489344771023921079126552019160156920634619255970485781n,1n),new iy(2251563274489750535117886426533222435294046428347329203627021249169616184184n,1798716007562728905295480679789526322175868328062420237419143593021674992973n,1n),new iy(2138414695194151160943305727036575959195309218611738193261179310511854807447n,113410276730064486255102093846540133784865286929052426931474106396135072156n,1n),new iy(2379962749567351885752724891227938183011949129833673362440656643086021394946n,776496453633298175483985398648758586525933812536653089401905292063708816422n,1n)];function xG(r,e){let t=[],n=r;for(let s=0;s<248;s++)t.push(n),n=n.double();n=e;for(let s=0;s<4;s++)t.push(n),n=n.double();return t}var Pbe=xG(Bw[1],Bw[2]),_be=xG(Bw[3],Bw[4]);function yG(r){let e;if(typeof r=="bigint")e=r;else if(typeof r=="number"){if(!Number.isSafeInteger(r))throw new Error(`Invalid pedersenArg: ${r}`);e=BigInt(r)}else e=Ni.bytesToNumberBE(np(r));if(!(0n<=e&&e<ip.CURVE.Fp.ORDER))throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${e}`);return e}function fG(r,e,t){let n=yG(e);for(let s=0;s<252;s++){let i=t[s];if(i.equals(r))throw new Error("Same point");(n&1n)!==0n&&(r=r.add(i)),n>>=1n}return r}function Gk(r,e){let t=Bw[0];return t=fG(t,r,Pbe),t=fG(t,e,_be),pG(t.toRawBytes(!0))}Ce.pedersen=Gk;function Abe(r,e=Gk){if(!Array.isArray(r)||r.length<1)throw new Error("data should be array of at least 1 element");return r.length===1?xbe(yG(r[0])):Array.from(r).reverse().reduce((t,n)=>e(n,t))}Ce.hashChain=Abe;var Ebe=(r,e=Gk)=>[0,...r,r.length].reduce((t,n)=>e(t,n));Ce.computeHashOnElements=Ebe;var Sbe=Ni.bitMask(250),Tbe=r=>Ni.bytesToNumberBE((0,obe.keccak_256)(r))&Sbe;Ce.keccak=Tbe;var Fk=r=>Ni.bytesToNumberBE((0,Dk.sha256)(r));Ce.Fp253=(0,sp.Field)(BigInt("14474011154664525231415395255581126252639794253786371766033694892385558855681"));Ce.Fp251=(0,sp.Field)(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));function qk(r,e,t){let n=r.fromBytes((0,Dk.sha256)((0,cbe.utf8ToBytes)(`${e}${t}`)));return r.create(n)}function mG(r,e,t,n=0){let s=[],i=[];for(let a=0;a<t;a++)s.push(qk(r,`${e}x`,n*t+a)),i.push(qk(r,`${e}y`,n*t+a));if(new Set([...s,...i]).size!==2*t)throw new Error("X and Y values are not distinct");return s.map(a=>i.map(o=>r.inv(r.sub(a,o))))}Ce._poseidonMDS=mG;var Obe=[[3,1,1],[1,-1,1],[1,1,-2]].map(r=>r.map(BigInt));function Vk(r,e){if((0,sp.validateField)(r.Fp),!Number.isSafeInteger(r.rate)||!Number.isSafeInteger(r.capacity))throw new Error(`Wrong poseidon opts: ${r}`);let t=r.rate+r.capacity,n=r.roundsFull+r.roundsPartial,s=[];for(let a=0;a<n;a++){let o=[];for(let c=0;c<t;c++)o.push(qk(r.Fp,"Hades",t*a+c));s.push(o)}let i=(0,ube.poseidon)({...r,t,sboxPower:3,reversePartialPowIdx:!0,mds:e,roundConstants:s});return i.m=t,i.rate=r.rate,i.capacity=r.capacity,i}Ce.poseidonBasic=Vk;function Bbe(r,e=0){let t=r.rate+r.capacity;if(!Number.isSafeInteger(e))throw new Error(`Wrong mdsAttempt=${e}`);return Vk(r,mG(r.Fp,"HadesMDS",t,e))}Ce.poseidonCreate=Bbe;Ce.poseidonSmall=Vk({Fp:Ce.Fp251,rate:2,capacity:1,roundsFull:8,roundsPartial:83},Obe);function wG(r,e,t=Ce.poseidonSmall){return t([r,e,2n])[0]}Ce.poseidonHash=wG;function kbe(r,e,t=Ce.poseidonSmall){return Ni.numberToVarBytesBE(wG(Ni.bytesToNumberBE(r),Ni.bytesToNumberBE(e),t))}Ce.poseidonHashFunc=kbe;function Nbe(r,e=Ce.poseidonSmall){return e([r,0n,1n])[0]}Ce.poseidonHashSingle=Nbe;function Ibe(r,e=Ce.poseidonSmall){let{m:t,rate:n}=e;if(!Array.isArray(r))throw new Error("bigint array expected in values");let s=Array.from(r);for(s.push(1n);s.length%n!==0;)s.push(0n);let i=new Array(t).fill(0n);for(let a=0;a<s.length;a+=n){for(let o=0;o<n;o++)i[o]+=s[a+o];i=e(i)}return i[0]}Ce.poseidonHashMany=Ibe});var AG=R(Ii=>{"use strict";b();p();var Rbe=Ii&&Ii.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),jbe=Ii&&Ii.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),PG=Ii&&Ii.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Rbe(e,r,t);return jbe(e,r),e};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.bytesToHex=Ii.hexToBytes=Ii.stark=Ii.secp256k1=void 0;Ii.secp256k1=PG(iG());Ii.stark=PG(vG());var _G=G0();Object.defineProperty(Ii,"hexToBytes",{enumerable:!0,get:function(){return _G.hexToBytes}});Object.defineProperty(Ii,"bytesToHex",{enumerable:!0,get:function(){return _G.bytesToHex}})});var EG=R(Ri=>{"use strict";b();p();var Mbe=Ri&&Ri.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Cbe=Ri&&Ri.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),c9=Ri&&Ri.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Mbe(e,r,t);return Cbe(e,r),e};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.schnorr=Ri.p256=Ri.ed25519=Ri.secp256k1=void 0;Ri.secp256k1=c9(pK());Ri.ed25519=c9(_K());Ri.p256=c9(TK());Ri.schnorr=c9(AG())});var TG=R(ay=>{"use strict";b();p();var Lbe=ay&&ay.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ay,"__esModule",{value:!0});ay.Decimal=void 0;var ap=Lbe(Cs()),SG=100,ps=class{static fromUserInput(e,t){ps.verifyFractionalDigits(t);let n=e.match(/[^0-9.]/);if(n)throw new Error(`Invalid character at position ${n.index+1}`);let s,i;if(e.search(/\./)===-1)s=e,i="";else{let o=e.split(".");switch(o.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!o[1])throw new Error("Fractional part missing");s=o[0],i=o[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(i.length>t)throw new Error("Got more fractional digits than supported");let a=`${s}${i.padEnd(t,"0")}`;return new ps(a,t)}static fromAtomics(e,t){return ps.verifyFractionalDigits(t),new ps(e,t)}static zero(e){return ps.verifyFractionalDigits(e),new ps("0",e)}static one(e){return ps.verifyFractionalDigits(e),new ps("1"+"0".repeat(e),e)}static verifyFractionalDigits(e){if(!Number.isInteger(e))throw new Error("Fractional digits is not an integer");if(e<0)throw new Error("Fractional digits must not be negative");if(e>SG)throw new Error(`Fractional digits must not exceed ${SG}`)}static compare(e,t){if(e.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return e.data.atomics.cmp(new ap.default(t.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(e,t){this.data={atomics:new ap.default(e),fractionalDigits:t}}toString(){let e=new ap.default(10).pow(new ap.default(this.data.fractionalDigits)),t=this.data.atomics.div(e),n=this.data.atomics.mod(e);if(n.isZero())return t.toString();{let i=n.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${i}`}}toFloatApproximation(){let e=Number(this.toString());if(Number.isNaN(e))throw new Error("Conversion to number failed");return e}plus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");let t=this.data.atomics.add(new ap.default(e.atomics));return new ps(t.toString(),this.fractionalDigits)}minus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");let t=this.data.atomics.sub(new ap.default(e.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new ps(t.toString(),this.fractionalDigits)}multiply(e){let t=this.data.atomics.mul(new ap.default(e.toString()));return new ps(t.toString(),this.fractionalDigits)}equals(e){return ps.compare(this,e)===0}isLessThan(e){return ps.compare(this,e)<0}isLessThanOrEqual(e){return ps.compare(this,e)<=0}isGreaterThan(e){return ps.compare(this,e)>0}isGreaterThanOrEqual(e){return ps.compare(this,e)>=0}};ay.Decimal=ps});var OG=R(Ko=>{"use strict";b();p();var Ube=Ko&&Ko.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Uint64=Ko.Uint53=Ko.Int53=Ko.Uint32=void 0;var u9=Ube(Cs()),Fbe=new u9.default("18446744073709551615",10,"be"),op=class{static fromBigEndianBytes(e){return op.fromBytes(e)}static fromBytes(e,t="be"){if(e.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let s=0;s<e.length;++s)if(!Number.isInteger(e[s])||e[s]>255||e[s]<0)throw new Error("Invalid value in byte. Found: "+e[s]);let n=t==="be"?e:Array.from(e).reverse();return new op(n[0]*2**24+n[1]*2**16+n[2]*2**8+n[3])}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new op(Number.parseInt(e,10))}constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<0||e>4294967295)throw new Error("Input not in uint32 range: "+e.toString());this.data=e}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toString(){return this.data.toString()}};Ko.Uint32=op;var cp=class{static fromString(e){if(!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new cp(Number.parseInt(e,10))}constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+e.toString());this.data=e}toNumber(){return this.data}toString(){return this.data.toString()}};Ko.Int53=cp;var kw=class{static fromString(e){let t=cp.fromString(e);return new kw(t.toNumber())}constructor(e){let t=new cp(e);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}};Ko.Uint53=kw;var Nl=class{static fromBytesBigEndian(e){return Nl.fromBytes(e)}static fromBytes(e,t="be"){if(e.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let s=0;s<e.length;++s)if(!Number.isInteger(e[s])||e[s]>255||e[s]<0)throw new Error("Invalid value in byte. Found: "+e[s]);let n=t==="be"?Array.from(e):Array.from(e).reverse();return new Nl(new u9.default(n))}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new Nl(new u9.default(e,10,"be"))}static fromNumber(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");let t;try{t=new u9.default(e)}catch{throw new Error("Input is not a safe integer")}return new Nl(t)}constructor(e){if(e.isNeg())throw new Error("Input is negative");if(e.gt(Fbe))throw new Error("Input exceeds uint64 range");this.data=e}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toNumber(){return this.data.toNumber()}};Ko.Uint64=Nl});var BG=R(Go=>{"use strict";b();p();Object.defineProperty(Go,"__esModule",{value:!0});Go.Uint64=Go.Uint53=Go.Uint32=Go.Int53=Go.Decimal=void 0;var qbe=TG();Object.defineProperty(Go,"Decimal",{enumerable:!0,get:function(){return qbe.Decimal}});var f9=OG();Object.defineProperty(Go,"Int53",{enumerable:!0,get:function(){return f9.Int53}});Object.defineProperty(Go,"Uint32",{enumerable:!0,get:function(){return f9.Uint32}});Object.defineProperty(Go,"Uint53",{enumerable:!0,get:function(){return f9.Uint53}});Object.defineProperty(Go,"Uint64",{enumerable:!0,get:function(){return f9.Uint64}})});var IG=R((NG,zk)=>{b();p();var kG=function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function t(B,A,E){this.low=B|0,this.high=A|0,this.unsigned=!!E}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0});function n(B){return(B&&B.__isLong__)===!0}function s(B){var A=Math.clz32(B&-B);return B?31-A:A}t.isLong=n;var i={},a={};function o(B,A){var E,j,G;return A?(B>>>=0,(G=0<=B&&B<256)&&(j=a[B],j)?j:(E=u(B,0,!0),G&&(a[B]=E),E)):(B|=0,(G=-128<=B&&B<128)&&(j=i[B],j)?j:(E=u(B,B<0?-1:0,!1),G&&(i[B]=E),E))}t.fromInt=o;function c(B,A){if(isNaN(B))return A?J:C;if(A){if(B<0)return J;if(B>=S)return se}else{if(B<=-T)return q;if(B+1>=T)return Z}return B<0?c(-B,A).neg():u(B%y|0,B/y|0,A)}t.fromNumber=c;function u(B,A,E){return new t(B,A,E)}t.fromBits=u;var f=Math.pow;function d(B,A,E){if(B.length===0)throw Error("empty string");if(typeof A=="number"?(E=A,A=!1):A=!!A,B==="NaN"||B==="Infinity"||B==="+Infinity"||B==="-Infinity")return A?J:C;if(E=E||10,E<2||36<E)throw RangeError("radix");var j;if((j=B.indexOf("-"))>0)throw Error("interior hyphen");if(j===0)return d(B.substring(1),A,E).neg();for(var G=c(f(E,8)),M=C,P=0;P<B.length;P+=8){var K=Math.min(8,B.length-P),re=parseInt(B.substring(P,P+K),E);if(K<8){var ie=c(f(E,K));M=M.mul(ie).add(c(re))}else M=M.mul(G),M=M.add(c(re))}return M.unsigned=A,M}t.fromString=d;function g(B,A){return typeof B=="number"?c(B,A):typeof B=="string"?d(B,A):u(B.low,B.high,typeof A=="boolean"?A:B.unsigned)}t.fromValue=g;var h=1<<16,m=1<<24,y=h*h,S=y*y,T=S/2,H=o(m),C=o(0);t.ZERO=C;var J=o(0,!0);t.UZERO=J;var z=o(1);t.ONE=z;var W=o(1,!0);t.UONE=W;var Y=o(-1);t.NEG_ONE=Y;var Z=u(-1,2147483647,!1);t.MAX_VALUE=Z;var se=u(-1,-1,!0);t.MAX_UNSIGNED_VALUE=se;var q=u(0,-2147483648,!1);t.MIN_VALUE=q;var x=t.prototype;x.toInt=function(){return this.unsigned?this.low>>>0:this.low},x.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},x.toString=function(A){if(A=A||10,A<2||36<A)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(q)){var E=c(A),j=this.div(E),G=j.mul(E).sub(this);return j.toString(A)+G.toInt().toString(A)}else return"-"+this.neg().toString(A);for(var M=c(f(A,6),this.unsigned),P=this,K="";;){var re=P.div(M),ie=P.sub(re.mul(M)).toInt()>>>0,ce=ie.toString(A);if(P=re,P.isZero())return ce+K;for(;ce.length<6;)ce="0"+ce;K=""+ce+K}},x.getHighBits=function(){return this.high},x.getHighBitsUnsigned=function(){return this.high>>>0},x.getLowBits=function(){return this.low},x.getLowBitsUnsigned=function(){return this.low>>>0},x.getNumBitsAbs=function(){if(this.isNegative())return this.eq(q)?64:this.neg().getNumBitsAbs();for(var A=this.high!=0?this.high:this.low,E=31;E>0&&(A&1<<E)==0;E--);return this.high!=0?E+33:E+1},x.isZero=function(){return this.high===0&&this.low===0},x.eqz=x.isZero,x.isNegative=function(){return!this.unsigned&&this.high<0},x.isPositive=function(){return this.unsigned||this.high>=0},x.isOdd=function(){return(this.low&1)===1},x.isEven=function(){return(this.low&1)===0},x.equals=function(A){return n(A)||(A=g(A)),this.unsigned!==A.unsigned&&this.high>>>31===1&&A.high>>>31===1?!1:this.high===A.high&&this.low===A.low},x.eq=x.equals,x.notEquals=function(A){return!this.eq(A)},x.neq=x.notEquals,x.ne=x.notEquals,x.lessThan=function(A){return this.comp(A)<0},x.lt=x.lessThan,x.lessThanOrEqual=function(A){return this.comp(A)<=0},x.lte=x.lessThanOrEqual,x.le=x.lessThanOrEqual,x.greaterThan=function(A){return this.comp(A)>0},x.gt=x.greaterThan,x.greaterThanOrEqual=function(A){return this.comp(A)>=0},x.gte=x.greaterThanOrEqual,x.ge=x.greaterThanOrEqual,x.compare=function(A){if(n(A)||(A=g(A)),this.eq(A))return 0;var E=this.isNegative(),j=A.isNegative();return E&&!j?-1:!E&&j?1:this.unsigned?A.high>>>0>this.high>>>0||A.high===this.high&&A.low>>>0>this.low>>>0?-1:1:this.sub(A).isNegative()?-1:1},x.comp=x.compare,x.negate=function(){return!this.unsigned&&this.eq(q)?q:this.not().add(z)},x.neg=x.negate,x.add=function(A){n(A)||(A=g(A));var E=this.high>>>16,j=this.high&65535,G=this.low>>>16,M=this.low&65535,P=A.high>>>16,K=A.high&65535,re=A.low>>>16,ie=A.low&65535,ce=0,oe=0,we=0,He=0;return He+=M+ie,we+=He>>>16,He&=65535,we+=G+re,oe+=we>>>16,we&=65535,oe+=j+K,ce+=oe>>>16,oe&=65535,ce+=E+P,ce&=65535,u(we<<16|He,ce<<16|oe,this.unsigned)},x.subtract=function(A){return n(A)||(A=g(A)),this.add(A.neg())},x.sub=x.subtract,x.multiply=function(A){if(this.isZero())return this;if(n(A)||(A=g(A)),e){var E=e.mul(this.low,this.high,A.low,A.high);return u(E,e.get_high(),this.unsigned)}if(A.isZero())return this.unsigned?J:C;if(this.eq(q))return A.isOdd()?q:C;if(A.eq(q))return this.isOdd()?q:C;if(this.isNegative())return A.isNegative()?this.neg().mul(A.neg()):this.neg().mul(A).neg();if(A.isNegative())return this.mul(A.neg()).neg();if(this.lt(H)&&A.lt(H))return c(this.toNumber()*A.toNumber(),this.unsigned);var j=this.high>>>16,G=this.high&65535,M=this.low>>>16,P=this.low&65535,K=A.high>>>16,re=A.high&65535,ie=A.low>>>16,ce=A.low&65535,oe=0,we=0,He=0,yt=0;return yt+=P*ce,He+=yt>>>16,yt&=65535,He+=M*ce,we+=He>>>16,He&=65535,He+=P*ie,we+=He>>>16,He&=65535,we+=G*ce,oe+=we>>>16,we&=65535,we+=M*ie,oe+=we>>>16,we&=65535,we+=P*re,oe+=we>>>16,we&=65535,oe+=j*ce+G*ie+M*re+P*K,oe&=65535,u(He<<16|yt,oe<<16|we,this.unsigned)},x.mul=x.multiply,x.divide=function(A){if(n(A)||(A=g(A)),A.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&A.low===-1&&A.high===-1)return this;var E=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,A.low,A.high);return u(E,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?J:C;var j,G,M;if(this.unsigned){if(A.unsigned||(A=A.toUnsigned()),A.gt(this))return J;if(A.gt(this.shru(1)))return W;M=J}else{if(this.eq(q)){if(A.eq(z)||A.eq(Y))return q;if(A.eq(q))return z;var P=this.shr(1);return j=P.div(A).shl(1),j.eq(C)?A.isNegative()?z:Y:(G=this.sub(A.mul(j)),M=j.add(G.div(A)),M)}else if(A.eq(q))return this.unsigned?J:C;if(this.isNegative())return A.isNegative()?this.neg().div(A.neg()):this.neg().div(A).neg();if(A.isNegative())return this.div(A.neg()).neg();M=C}for(G=this;G.gte(A);){j=Math.max(1,Math.floor(G.toNumber()/A.toNumber()));for(var K=Math.ceil(Math.log(j)/Math.LN2),re=K<=48?1:f(2,K-48),ie=c(j),ce=ie.mul(A);ce.isNegative()||ce.gt(G);)j-=re,ie=c(j,this.unsigned),ce=ie.mul(A);ie.isZero()&&(ie=z),M=M.add(ie),G=G.sub(ce)}return M},x.div=x.divide,x.modulo=function(A){if(n(A)||(A=g(A)),e){var E=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,A.low,A.high);return u(E,e.get_high(),this.unsigned)}return this.sub(this.div(A).mul(A))},x.mod=x.modulo,x.rem=x.modulo,x.not=function(){return u(~this.low,~this.high,this.unsigned)},x.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},x.clz=x.countLeadingZeros,x.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},x.ctz=x.countTrailingZeros,x.and=function(A){return n(A)||(A=g(A)),u(this.low&A.low,this.high&A.high,this.unsigned)},x.or=function(A){return n(A)||(A=g(A)),u(this.low|A.low,this.high|A.high,this.unsigned)},x.xor=function(A){return n(A)||(A=g(A)),u(this.low^A.low,this.high^A.high,this.unsigned)},x.shiftLeft=function(A){return n(A)&&(A=A.toInt()),(A&=63)===0?this:A<32?u(this.low<<A,this.high<<A|this.low>>>32-A,this.unsigned):u(0,this.low<<A-32,this.unsigned)},x.shl=x.shiftLeft,x.shiftRight=function(A){return n(A)&&(A=A.toInt()),(A&=63)===0?this:A<32?u(this.low>>>A|this.high<<32-A,this.high>>A,this.unsigned):u(this.high>>A-32,this.high>=0?0:-1,this.unsigned)},x.shr=x.shiftRight,x.shiftRightUnsigned=function(A){return n(A)&&(A=A.toInt()),(A&=63)===0?this:A<32?u(this.low>>>A|this.high<<32-A,this.high>>>A,this.unsigned):A===32?u(this.high,0,this.unsigned):u(this.high>>>A-32,0,this.unsigned)},x.shru=x.shiftRightUnsigned,x.shr_u=x.shiftRightUnsigned,x.rotateLeft=function(A){var E;return n(A)&&(A=A.toInt()),(A&=63)===0?this:A===32?u(this.high,this.low,this.unsigned):A<32?(E=32-A,u(this.low<<A|this.high>>>E,this.high<<A|this.low>>>E,this.unsigned)):(A-=32,E=32-A,u(this.high<<A|this.low>>>E,this.low<<A|this.high>>>E,this.unsigned))},x.rotl=x.rotateLeft,x.rotateRight=function(A){var E;return n(A)&&(A=A.toInt()),(A&=63)===0?this:A===32?u(this.high,this.low,this.unsigned):A<32?(E=32-A,u(this.high<<E|this.low>>>A,this.low<<E|this.high>>>A,this.unsigned)):(A-=32,E=32-A,u(this.low<<E|this.high>>>A,this.high<<E|this.low>>>A,this.unsigned))},x.rotr=x.rotateRight,x.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},x.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},x.toBytes=function(A){return A?this.toBytesLE():this.toBytesBE()},x.toBytesLE=function(){var A=this.high,E=this.low;return[E&255,E>>>8&255,E>>>16&255,E>>>24,A&255,A>>>8&255,A>>>16&255,A>>>24]},x.toBytesBE=function(){var A=this.high,E=this.low;return[A>>>24,A>>>16&255,A>>>8&255,A&255,E>>>24,E>>>16&255,E>>>8&255,E&255]},t.fromBytes=function(A,E,j){return j?t.fromBytesLE(A,E):t.fromBytesBE(A,E)},t.fromBytesLE=function(A,E){return new t(A[0]|A[1]<<8|A[2]<<16|A[3]<<24,A[4]|A[5]<<8|A[6]<<16|A[7]<<24,E)},t.fromBytesBE=function(A,E){return new t(A[4]<<24|A[5]<<16|A[6]<<8|A[7],A[0]<<24|A[1]<<16|A[2]<<8|A[3],E)};var O=t;return r.default=O,"default"in r?r.default:r}({});typeof define=="function"&&define.amd?define([],function(){return kG}):typeof zk=="object"&&typeof NG=="object"&&(zk.exports=kG)});var qr=R(bt=>{"use strict";b();p();var RG=bt&&bt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Dbe=bt&&bt.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bu=bt&&bt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&RG(e,r,t);return Dbe(e,r),e},jG=bt&&bt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&RG(e,r,t)},d9=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bt,"__esModule",{value:!0});bt.secp256k1=bt.ed25519=bt.Long=bt._m0=bt.protobuf=bt.typeforce=bt.safeBuffer=bt.BigNumber=bt.BN=bt.math=bt.signUtil=bt.abi=bt.elliptic=bt.bip39=bt.bip32=bt.base=void 0;bt.base=bu($b());bt.bip32=bu(CH());bt.bip39=bu(bk());bt.elliptic=bu(Xx());bt.abi=bu(uK());bt.signUtil=bu(EG());bt.math=bu(BG());var Hbe=d9(Cs());bt.BN=Hbe.default;var Kbe=d9(xce());bt.BigNumber=Kbe.default;var Gbe=d9(uce());bt.safeBuffer=Gbe.default;var Vbe=Rq();bt.typeforce=Vbe;bt.protobuf=bu(wce());bt._m0=bu(vce());var zbe=d9(IG());bt.Long=zbe.default;bt.ed25519=bu(Pce());bt.secp256k1=bu(_ce());jG((Ece(),ao(Ace)),bt);jG((Tce(),ao(Sce)),bt)});var Wk=R(l9=>{"use strict";b();p();Object.defineProperty(l9,"__esModule",{value:!0});l9.validPrivateKey=void 0;var MG=qr();function Wbe(r){if(!MG.base.validateHexString(r))return!1;let e=MG.base.fromHex(r.toLowerCase());return!(e.length!=32||e.every(t=>t===0))}l9.validPrivateKey=Wbe});var $k=R(Nw=>{"use strict";b();p();Object.defineProperty(Nw,"__esModule",{value:!0});Nw.SignType=void 0;var $be;(function(r){r[r.Secp256k1=1]="Secp256k1",r[r.ECDSA_P256=2]="ECDSA_P256",r[r.ED25519=3]="ED25519",r[r.StarknetSignType=4]="StarknetSignType",r[r.TezosSignType=5]="TezosSignType"})($be=Nw.SignType||(Nw.SignType={}))});var CG=R(Vo=>{"use strict";b();p();Object.defineProperty(Vo,"__esModule",{value:!0});Vo.CoinCurveMap=Vo.MultiAddressCoins=Vo.segwitType=Vo.Currency=void 0;var Gt;(function(r){r[r.NULL=-1]="NULL",r[r.BTC=0]="BTC",r[r.TBTC=1]="TBTC",r[r.ETH=60]="ETH",r[r.LTC=2]="LTC",r[r.DOGE=3]="DOGE",r[r.BCH=145]="BCH",r[r.BSV=236]="BSV",r[r.TRX=195]="TRX",r[r.SOL=501]="SOL",r[r.APTOS=637]="APTOS",r[r.OMNI_USDT=20001]="OMNI_USDT",r[r.OMNI_USDT_TEST=20002]="OMNI_USDT_TEST",r[r.SUI=784]="SUI",r[r.ATOM=118]="ATOM",r[r.OSMO=1e3]="OSMO",r[r.EVMOS=1001]="EVMOS",r[r.AXL=1002]="AXL",r[r.CRO=1003]="CRO",r[r.Iris=1004]="Iris",r[r.Juno=1005]="Juno",r[r.Kava=1006]="Kava",r[r.Kujira=1007]="Kujira",r[r.SCRT=1008]="SCRT",r[r.Stargaze=1009]="Stargaze",r[r.Terra=1010]="Terra",r[r.ZKSPACE=1011]="ZKSPACE",r[r.ZKSYNC=804]="ZKSYNC",r[r.Stx=5757]="Stx",r[r.SEI=2837]="SEI",r[r.WAX=14001]="WAX",r[r.Starknet=9004]="Starknet",r[r.ADA=1815]="ADA",r[r.INJ=2892]="INJ",r[r.Celestia=2854]="Celestia",r[r.DYDX=2897]="DYDX",r[r.Kaspa=111111]="Kaspa",r[r.TON=607]="TON",r[r.NostrAssets=1237]="NostrAssets",r[r.Near=397]="Near",r[r.Kaia=8217]="Kaia",r[r.PI=70000074]="PI"})(Gt=Vo.Currency||(Vo.Currency={}));var Jbe;(function(r){r[r.SEGWIT_NESTED=1]="SEGWIT_NESTED",r[r.SEGWIT_NESTED_49=2]="SEGWIT_NESTED_49",r[r.SEGWIT_NATIVE=3]="SEGWIT_NATIVE",r[r.SEGWIT_TAPROOT=4]="SEGWIT_TAPROOT"})(Jbe=Vo.segwitType||(Vo.segwitType={}));Vo.MultiAddressCoins=[Gt.BTC,Gt.TBTC,Gt.LTC,Gt.DOGE,Gt.BSV,Gt.OMNI_USDT,Gt.OMNI_USDT_TEST];var Kr="secp256k1",Iw="ed25519";Vo.CoinCurveMap=new Map([[Gt.BTC,Kr],[Gt.TBTC,Kr],[Gt.ETH,Kr],[Gt.LTC,Kr],[Gt.DOGE,Kr],[Gt.BCH,Kr],[Gt.BSV,Kr],[Gt.TRX,Kr],[Gt.OMNI_USDT,Kr],[Gt.OMNI_USDT_TEST,Kr],[Gt.ATOM,Kr],[Gt.OSMO,Kr],[Gt.EVMOS,Kr],[Gt.AXL,Kr],[Gt.CRO,Kr],[Gt.Iris,Kr],[Gt.Juno,Kr],[Gt.Kava,Kr],[Gt.Kujira,Kr],[Gt.SCRT,Kr],[Gt.Stargaze,Kr],[Gt.Terra,Kr],[Gt.SEI,Kr],[Gt.Celestia,Kr],[Gt.DYDX,Kr],[Gt.Kaia,Kr],[Gt.SOL,Iw],[Gt.APTOS,Iw],[Gt.SUI,Iw],[Gt.TON,Iw],[Gt.PI,Iw]])});var Jk=R(Re=>{"use strict";b();p();Object.defineProperty(Re,"__esModule",{value:!0});Re.SignCommonMsgError=Re.EstimateFeeError=Re.validSignedTransactionError=Re.GetPayLoadError=Re.HardwareDerivePubKeyError=Re.CalcTxHashError=Re.SignMsgStep3Error=Re.SignMsgSetupError=Re.Ed25519Step3Error=Re.Ed25519Step2Error=Re.Ed25519Step1Error=Re.Ed25519SetupError=Re.EcdsaStep3Error=Re.EcdsaStep2Error=Re.EcdsaStep1Error=Re.EcdsaSetupError=Re.MPCShakeHandsError=Re.MPCStepError=Re.MPCAesKeyMissError=Re.GetHardWareMessageHashError=Re.GetHardwareSignedTransactionError=Re.GetHardwareRawTransactionError=Re.GetMpcTransactionError=Re.GetMpcRawTransactionError=Re.DerivePathError=Re.GenMnemonicError=Re.GenPrivateKeyError=Re.UnsupportedCoinError=Re.SignMsgError=Re.SignTxError=Re.ValidAddressError=Re.NewAddressError=Re.NotImplementedError=void 0;Re.NotImplementedError="no implementation method";Re.NewAddressError="generate address error";Re.ValidAddressError="valid address error";Re.SignTxError="sign tx error";Re.SignMsgError="sign message error";Re.UnsupportedCoinError="unsupported currency";Re.GenPrivateKeyError="generate private key error";Re.GenMnemonicError="generate mnemonic error";Re.DerivePathError="derive hdPath error";Re.GetMpcRawTransactionError="get mpc raw transaction error";Re.GetMpcTransactionError="get mpc transaction error";Re.GetHardwareRawTransactionError="get hardware raw transaction error";Re.GetHardwareSignedTransactionError="get hardware signed transaction error";Re.GetHardWareMessageHashError="get hardware message hash error";Re.MPCAesKeyMissError="mpc get aes key error";Re.MPCStepError="mpc step error";Re.MPCShakeHandsError="mpc shake hands error";Re.EcdsaSetupError="ecdsa setup error";Re.EcdsaStep1Error="ecdsa step1 error";Re.EcdsaStep2Error="ecdsa step2 error";Re.EcdsaStep3Error="ecdsa step3 error";Re.Ed25519SetupError="ed25519 setup error";Re.Ed25519Step1Error="ed25519 step1 error";Re.Ed25519Step2Error="ed25519 step2 error";Re.Ed25519Step3Error="ed25519 step3 error";Re.SignMsgSetupError="sign message setup error";Re.SignMsgStep3Error="sign message step3 error";Re.CalcTxHashError="calculate tx hash error";Re.HardwareDerivePubKeyError="derive sub pub key error";Re.GetPayLoadError="get payload error";Re.validSignedTransactionError="valid signed transaction error";Re.EstimateFeeError="estimate fee error";Re.SignCommonMsgError="sign common msg error"});var LG=R(Ta=>{"use strict";b();p();Object.defineProperty(Ta,"__esModule",{value:!0});Ta.jsonStringifyUniform=Ta.cloneObject=Ta.assertBufferLength=Ta.convert2BigNumber=Ta.convert2Number=Ta.buildCommonSignMsg=void 0;var h9=qr();function Zbe(r,e){return`OKX Wallet Sign In
publicKey: ${r}
walletId: ${e}
host: api.wallet.okx
OKX Wallet Sign In`}Ta.buildCommonSignMsg=Zbe;function Qbe(r){if(r!=null)return typeof r=="string"?parseInt(r):r}Ta.convert2Number=Qbe;function Ybe(r){if(r!=null)return h9.BigNumber.isBigNumber(r)?r:new h9.BigNumber(r)}Ta.convert2BigNumber=Ybe;function Xbe(r,e){if(r.length!=e)throw Error("buffer length is illegal")}Ta.assertBufferLength=Xbe;function epe(r){return JSON.parse(JSON.stringify(r))}Ta.cloneObject=epe;function tpe(r){return JSON.stringify(r,(e,t)=>t&&(t.type==="Buffer"||t instanceof Uint8Array?h9.base.toHex(t):typeof t=="bigint"?t.toString():t))}Ta.jsonStringifyUniform=tpe});var Zk=R(up=>{"use strict";b();p();var rpe=up&&up.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),npe=up&&up.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rpe(e,r,t)};Object.defineProperty(up,"__esModule",{value:!0});npe(LG(),up)});var HG=R(Tn=>{"use strict";b();p();Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SimpleWallet=Tn.BaseWallet=Tn.ecdsaSign=Tn.fromSigned=Tn.padWithZeroes=Tn.toUnsigned=Tn.intToHex=Tn.makeSignature=Tn.secp256k1SignTest=void 0;var gs=Jk(),oy=$k(),xs=qr(),spe=Zk();function UG(r){let e=xs.base.sha256("secp256k1-test"),t=xs.signUtil.secp256k1.publicKeyCreate(r,!1),{signature:n,recovery:s}=xs.signUtil.secp256k1.sign(v.Buffer.from(e),r);return xs.signUtil.secp256k1.verify(e,n,s,t)}Tn.secp256k1SignTest=UG;function FG(r,e,t){let n=(0,Tn.fromSigned)(e),s=(0,Tn.fromSigned)(t),i=r,a=Qk((0,Tn.toUnsigned)(n).toString("hex"),64),o=Qk((0,Tn.toUnsigned)(s).toString("hex"),64);return xs.base.stripHexPrefix(qG(i)).concat(a,o)}Tn.makeSignature=FG;function qG(r){return`0x${r.toString(16)}`}Tn.intToHex=qG;var ipe=function(r){return v.Buffer.from(r.toTwos(256).toArray())};Tn.toUnsigned=ipe;function Qk(r,e){if(r!==""&&!/^[a-f0-9]+$/iu.test(r))throw new Error(`Expected an unprefixed hex string. Received: ${r}`);if(e<0)throw new Error(`Expected a non-negative integer target length. Received: ${e}`);return String.prototype.padStart.call(r,e,"0")}Tn.padWithZeroes=Qk;var ape=function(r){return new xs.BN(r).fromTwos(256)};Tn.fromSigned=ape;function DG(r,e,t){let{signature:n,recovery:s}=xs.signUtil.secp256k1.sign(r,e),i=v.Buffer.from(n.slice(0,32)),a=v.Buffer.from(n.slice(32,64));if(t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{v:t?s+(t*2+35):s+27,r:i,s:a}}Tn.ecdsaSign=DG;var b9=class{getRandomPrivateKey(){try{for(;;){let e=xs.base.randomBytes(32);if(UG(e))return Promise.resolve(xs.base.toHex(e,!0))}}catch{}return Promise.reject(gs.GenPrivateKeyError)}getDerivedPrivateKey(e){return xs.bip39.mnemonicToSeed(e.mnemonic).then(t=>{let n=xs.bip32.fromSeed(t).derivePath(e.hdPath);if(n.privateKey){let s=xs.base.toHex(n.privateKey);return Promise.resolve("0x"+s)}else return Promise.reject(gs.GenPrivateKeyError)}).catch(t=>Promise.reject(gs.GenPrivateKeyError))}getDerivedPath(e){return Promise.reject(gs.NotImplementedError)}validPrivateKey(e){return Promise.reject(gs.NotImplementedError)}signMessage(e){return Promise.reject(gs.NotImplementedError)}async signCommonMsg(e){e.signType||(e.signType=oy.SignType.Secp256k1);let t;if(e.message.text)t=e.message.text;else{let o;if(e.publicKey?o=e.publicKey:o=(await this.getNewAddress({privateKey:e.privateKey,addressType:e.addressType,hrp:e.hrp,version:e.version})).publicKey,o.startsWith("0x")&&(o=o.substring(2)),!e.message.walletId)return Promise.reject("invalid walletId");t=(0,spe.buildCommonSignMsg)(o,e.message.walletId)}let n=xs.base.magicHash(t),s=e.privateKeyHex?e.privateKeyHex:e.privateKey,i=xs.base.fromHex(s);var a;switch(e.signType){case oy.SignType.Secp256k1:let{v:o,r:c,s:u}=DG(v.Buffer.from(n),i);return Promise.resolve(FG(o,c,u));case oy.SignType.ECDSA_P256:return a=xs.signUtil.p256.sign(v.Buffer.from(n),i).signature,Promise.resolve(xs.base.toHex(a));case oy.SignType.ED25519:return a=xs.signUtil.ed25519.sign(n,i),Promise.resolve(xs.base.toHex(a));case oy.SignType.StarknetSignType:return a=xs.signUtil.schnorr.stark.sign(n,i).toCompactRawBytes(),Promise.resolve(xs.base.toHex(a));case oy.SignType.TezosSignType:return Promise.reject("not support")}}verifyMessage(e){return Promise.reject(gs.NotImplementedError)}ecRecover(e,t){return Promise.reject(gs.NotImplementedError)}getAddressByPublicKey(e){return Promise.reject(gs.NotImplementedError)}getMPCRawTransaction(e){return Promise.reject(gs.NotImplementedError)}getMPCTransaction(e){return Promise.reject(gs.NotImplementedError)}getMPCRawMessage(e){return Promise.reject(gs.NotImplementedError)}getMPCSignedMessage(e){return Promise.reject(gs.NotImplementedError)}getHardWareRawTransaction(e){return Promise.reject(gs.NotImplementedError)}getHardWareSignedTransaction(e){return Promise.reject(gs.NotImplementedError)}getHardWareMessageHash(e){return Promise.reject(gs.NotImplementedError)}calcTxHash(e){return Promise.reject(gs.NotImplementedError)}getRawTransaction(e){return Promise.reject(gs.NotImplementedError)}validSignedTransaction(e){return Promise.reject(gs.NotImplementedError)}estimateFee(e){return Promise.reject(gs.NotImplementedError)}};Tn.BaseWallet=b9;var Yk=class extends b9{mockData(e,t){this.mockAddress=e,this.mockPublicKey=t}getNewAddress(e){return Promise.resolve({address:this.mockAddress,publicKey:this.mockPublicKey})}validAddress(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}};Tn.SimpleWallet=Yk});var KG=R(pu=>{"use strict";b();p();var ope=pu&&pu.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Rw=pu&&pu.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ope(e,r,t)};Object.defineProperty(pu,"__esModule",{value:!0});Rw($k(),pu);Rw(CG(),pu);Rw(Jk(),pu);Rw(HG(),pu);Rw(Zk(),pu)});var VG=R(cy=>{"use strict";b();p();Object.defineProperty(cy,"__esModule",{value:!0});cy.MAX_UINT64=cy.MAX_INTEGER=void 0;var Tje=o7().Buffer,GG=qr();cy.MAX_INTEGER=new GG.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16);cy.MAX_UINT64=new GG.BN("ffffffffffffffff",16)});var sN=R(zo=>{"use strict";b();p();Object.defineProperty(zo,"__esModule",{value:!0});zo.stripHexPrefix=zo.isHexPrefixed=zo.getLength=zo.decode=zo.encode=void 0;var cpe=qr();function WG(r){if(Array.isArray(r)){let e=[];for(let n=0;n<r.length;n++)e.push(WG(r[n]));let t=v.Buffer.concat(e);return v.Buffer.concat([zG(t.length,192),t])}else{let e=nN(r);return e.length===1&&e[0]<128?e:v.Buffer.concat([zG(e.length,128),e])}}zo.encode=WG;function Xk(r,e){if(r[0]==="0"&&r[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(r,e)}function zG(r,e){if(r<56)return v.Buffer.from([r+e]);{let t=tN(r),n=t.length/2,s=tN(e+55+n);return v.Buffer.from(s+t,"hex")}}function upe(r,e=!1){if(!r||r.length===0)return v.Buffer.from([]);let t=nN(r),n=eN(t);if(e)return n;if(n.remainder.length!==0)throw new Error("invalid remainder");return n.data}zo.decode=upe;function fpe(r){if(!r||r.length===0)return v.Buffer.from([]);let e=nN(r),t=e[0];if(t<=127)return e.length;if(t<=183)return t-127;if(t<=191)return t-182;if(t<=247)return t-191;{let n=t-246,s=Xk(e.slice(1,n).toString("hex"),16);return n+s}}zo.getLength=fpe;function eN(r){let e,t,n,s,i,a=[],o=r[0];if(o<=127)return{data:r.slice(0,1),remainder:r.slice(1)};if(o<=183){if(e=o-127,o===128?n=v.Buffer.from([]):n=r.slice(1,e),e===2&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:r.slice(e)}}else if(o<=191){if(t=o-182,r.length-1<t)throw new Error("invalid RLP: not enough bytes for string length");if(e=Xk(r.slice(1,t).toString("hex"),16),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(n=r.slice(t,e+t),n.length<e)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:r.slice(e+t)}}else if(o<=247){for(e=o-191,s=r.slice(1,e);s.length;)i=eN(s),a.push(i.data),s=i.remainder;return{data:a,remainder:r.slice(e)}}else{t=o-246,e=Xk(r.slice(1,t).toString("hex"),16);let c=t+e;if(c>r.length)throw new Error("invalid rlp: total length is larger than the data");if(s=r.slice(t,c),s.length===0)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)i=eN(s),a.push(i.data),s=i.remainder;return{data:a,remainder:r.slice(c)}}}function rN(r){return r.slice(0,2)==="0x"}zo.isHexPrefixed=rN;function $G(r){return typeof r!="string"?r:rN(r)?r.slice(2):r}zo.stripHexPrefix=$G;function tN(r){if(r<0)throw new Error("Invalid integer as argument, must be unsigned!");let e=r.toString(16);return e.length%2?`0${e}`:e}function dpe(r){return r.length%2?`0${r}`:r}function lpe(r){let e=tN(r);return v.Buffer.from(e,"hex")}function nN(r){if(!v.Buffer.isBuffer(r)){if(typeof r=="string")return rN(r)?v.Buffer.from(dpe($G(r)),"hex"):v.Buffer.from(r);if(typeof r=="number"||typeof r=="bigint")return r?lpe(r):v.Buffer.from([]);if(r==null)return v.Buffer.from([]);if(r instanceof Uint8Array)return v.Buffer.from(r);if(cpe.BN.isBN(r))return v.Buffer.from(r.toArray());throw new Error("invalid type")}return r}});var uy=R(On=>{"use strict";b();p();Object.defineProperty(On,"__esModule",{value:!0});On.numberToBuffer=On.isHexString=On.getKeys=On.fromAscii=On.fromUtf8=On.toAscii=On.toUtf8=On.getBinarySize=On.intToBuffer=On.intToHex=On.padToEven=void 0;var hpe=qr();function p9(r){let e=r;if(typeof e!="string")throw new Error(`[ethjs-util] while padding to even, value must be string, is currently ${typeof e}, while padToEven.`);return e.length%2&&(e=`0${e}`),e}On.padToEven=p9;function JG(r){return`0x${r.toString(16)}`}On.intToHex=JG;function bpe(r){let e=JG(r);return v.Buffer.from(p9(e.slice(2)),"hex")}On.intToBuffer=bpe;function ppe(r){if(typeof r!="string")throw new Error(`[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '${typeof r}'.`);return v.Buffer.byteLength(r,"utf8")}On.getBinarySize=ppe;function gpe(r){return new v.Buffer(p9(hpe.base.stripHexPrefix(r).replace(/^0+|0+$/g,"")),"hex").toString("utf8")}On.toUtf8=gpe;function xpe(r){var e="",t=0,n=r.length;for(r.substring(0,2)==="0x"&&(t=2);t<n;t+=2){let s=parseInt(r.substr(t,2),16);e+=String.fromCharCode(s)}return e}On.toAscii=xpe;function ype(r){let e=new v.Buffer(r,"utf8");return`0x${p9(e.toString("hex")).replace(/^0+|0+$/g,"")}`}On.fromUtf8=ype;function mpe(r){for(var e="",t=0;t<r.length;t++){let s=r.charCodeAt(t).toString(16);e+=s.length<2?`0${s}`:s}return`0x${e}`}On.fromAscii=mpe;function wpe(r,e,t){if(!Array.isArray(r))throw new Error(`[ethjs-util] method getKeys expecting type Array as 'params' input, got '${typeof r}'`);if(typeof e!="string")throw new Error(`[ethjs-util] method getKeys expecting type String for input 'key' got '${typeof e}'.`);for(var n=[],s=0;s<r.length;s++){var i=r[s][e];if(t&&!i)i="";else if(typeof i!="string")throw new Error("invalid abi");n.push(i)}return n}On.getKeys=wpe;function vpe(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}On.isHexString=vpe;function Ppe(r){let e=r.toString(16),t=e.length%2?"0":"";return v.Buffer.from(t+e,"hex")}On.numberToBuffer=Ppe});var jw=R(jf=>{"use strict";b();p();Object.defineProperty(jf,"__esModule",{value:!0});jf.assertIsString=jf.assertIsArray=jf.assertIsBuffer=jf.assertIsHexString=void 0;var _pe=uy(),Ape=function(r){if(!(0,_pe.isHexString)(r)){let e=`This method only supports 0x-prefixed hex strings but input was: ${r}`;throw new Error(e)}};jf.assertIsHexString=Ape;var Epe=function(r){if(!v.Buffer.isBuffer(r)){let e=`This method only supports Buffer but input was: ${r}`;throw new Error(e)}};jf.assertIsBuffer=Epe;var Spe=function(r){if(!Array.isArray(r)){let e=`This method only supports number arrays but input was: ${r}`;throw new Error(e)}};jf.assertIsArray=Spe;var Tpe=function(r){if(typeof r!="string"){let e=`This method only supports strings but input was: ${r}`;throw new Error(e)}};jf.assertIsString=Tpe});var g9=R(Fs=>{"use strict";b();p();var Ope=Fs&&Fs.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Bpe=Fs&&Fs.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),kpe=Fs&&Fs.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Ope(e,r,t);return Bpe(e,r),e};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.rlphash=Fs.keccakFromString=Fs.keccak256=Fs.keccak=void 0;var Npe=kpe(sN()),Ipe=jw(),Rpe=qr(),jpe=o7();Fs.keccak=Rpe.base.keccak;var Mpe=function(r){return(0,Fs.keccak)(r,256)};Fs.keccak256=Mpe;var Cpe=function(r,e=256){(0,Ipe.assertIsString)(r);let t=jpe.Buffer.from(r,"utf8");return(0,Fs.keccak)(t,e)};Fs.keccakFromString=Cpe;var Lpe=function(r){return(0,Fs.keccak)(Npe.encode(r))};Fs.rlphash=Lpe});var Mw=R(Gr=>{"use strict";b();p();Object.defineProperty(Gr,"__esModule",{value:!0});Gr.addHexPrefix=Gr.toUnsigned=Gr.fromSigned=Gr.bufferToHex=Gr.toBuffer=Gr.unpadArray=Gr.unpadBuffer=Gr.stripZeros=Gr.setLengthLeft=Gr.zeros=void 0;var ZG=qr(),QG=qr(),iN=uy(),aN=jw(),Upe=function(r){return v.Buffer.allocUnsafe(r).fill(0)};Gr.zeros=Upe;var Fpe=function(r,e,t){let n=(0,Gr.zeros)(e);return t?r.length<e?(r.copy(n),n):r.slice(0,e):r.length<e?(r.copy(n,e-r.length),n):r.slice(-e)},qpe=function(r,e){return(0,aN.assertIsBuffer)(r),Fpe(r,e,!1)};Gr.setLengthLeft=qpe;var Dpe=function(r){let e=r[0];for(;r.length>0&&e.toString()==="0";)r=r.slice(1),e=r[0];return r};Gr.stripZeros=Dpe;var Hpe=function(r){return(0,aN.assertIsBuffer)(r),(0,Gr.stripZeros)(r)};Gr.unpadBuffer=Hpe;var Kpe=function(r){return(0,aN.assertIsArray)(r),(0,Gr.stripZeros)(r)};Gr.unpadArray=Kpe;var Gpe=function(r){if(r==null)return v.Buffer.allocUnsafe(0);if(v.Buffer.isBuffer(r))return v.Buffer.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return v.Buffer.from(r);if(typeof r=="string"){if(!(0,iN.isHexString)(r))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${r}`);return v.Buffer.from((0,iN.padToEven)(QG.base.stripHexPrefix(r)),"hex")}if(typeof r=="number")return(0,iN.intToBuffer)(r);if(ZG.BN.isBN(r))return r.toArrayLike(v.Buffer);if(r.toArray)return v.Buffer.from(r.toArray());if(r.toBuffer)return v.Buffer.from(r.toBuffer());throw new Error("invalid type")};Gr.toBuffer=Gpe;var Vpe=function(r){return r=(0,Gr.toBuffer)(r),"0x"+r.toString("hex")};Gr.bufferToHex=Vpe;var zpe=function(r){return new ZG.BN(r).fromTwos(256)};Gr.fromSigned=zpe;var Wpe=function(r){return v.Buffer.from(r.toTwos(256).toArray())};Gr.toUnsigned=Wpe;var $pe=function(r){return typeof r!="string"||QG.base.isHexPrefixed(r)?r:"0x"+r};Gr.addHexPrefix=$pe});var y9=R(Xi=>{"use strict";b();p();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.toType=Xi.TypeOutput=Xi.bnToRlp=Xi.bnToUnpaddedBuffer=Xi.validateNoLeadingZeroes=Xi.bnToHex=void 0;var oN=qr(),Jpe=uy(),cN=Mw();function Zpe(r){return`0x${r.toString(16)}`}Xi.bnToHex=Zpe;var Qpe=function(r){for(let[e,t]of Object.entries(r))if(t!==void 0&&t.length>0&&t[0]===0)throw new Error(`${e} cannot have leading zeroes, received: ${t.toString("hex")}`)};Xi.validateNoLeadingZeroes=Qpe;function Ype(r){return(0,cN.unpadBuffer)(r.toArrayLike(v.Buffer))}Xi.bnToUnpaddedBuffer=Ype;function Xpe(r){return(0,cN.unpadBuffer)(r.toArrayLike(v.Buffer))}Xi.bnToRlp=Xpe;var x9;(function(r){r[r.Number=0]="Number",r[r.BN=1]="BN",r[r.Buffer=2]="Buffer",r[r.PrefixedHexString=3]="PrefixedHexString"})(x9=Xi.TypeOutput||(Xi.TypeOutput={}));function ege(r,e){if(typeof r=="string"&&!(0,Jpe.isHexString)(r))throw new Error(`A string must be provided with a 0x-prefix, given: ${r}`);if(typeof r=="number"&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");if(r=(0,cN.toBuffer)(r),e===x9.Buffer)return r;if(e===x9.BN)return new oN.BN(r);if(e===x9.Number){let t=new oN.BN(r),n=new oN.BN(Number.MAX_SAFE_INTEGER.toString());if(t.gt(n))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return t.toNumber()}else return`0x${r.toString("hex")}`}Xi.toType=ege});var uN=R(is=>{"use strict";b();p();var tge=is&&is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(is,"__esModule",{value:!0});is.privateToAddress=is.privateToPublicRaw=is.privateToPublic=is.publicToAddress=is.pubToAddress=is.toChecksumAddress=is.isValidAddress=void 0;var rge=tge(jq()),m9=qr(),XG=g9(),Cw=jw(),YG=y9(),nge=function(r){return(0,Cw.assertIsHexString)(r),/^0x[0-9a-fA-F]{40}$/.test(r)};is.isValidAddress=nge;var sge=function(r,e){(0,Cw.assertIsHexString)(r);let t=m9.base.stripHexPrefix(r).toLowerCase(),n="";e&&(n=(0,YG.toType)(e,YG.TypeOutput.BN).toString()+"0x");let s=(0,XG.keccakFromString)(n+t).toString("hex"),i="0x";for(let a=0;a<t.length;a++)parseInt(s[a],16)>=8?i+=t[a].toUpperCase():i+=t[a];return i};is.toChecksumAddress=sge;var ige=function(r,e=!1){if((0,Cw.assertIsBuffer)(r),e&&r.length!==64){let t=m9.signUtil.secp256k1.publicKeyConvert(r,!1);r=v.Buffer.from(t.slice(1))}return(0,rge.default)(r.length===64),(0,XG.keccak)(r).slice(-20)};is.pubToAddress=ige;is.publicToAddress=is.pubToAddress;var age=function(r){return(0,Cw.assertIsBuffer)(r),m9.signUtil.secp256k1.publicKeyCreate(r,!1).slice(1)};is.privateToPublic=age;var oge=function(r){return(0,Cw.assertIsBuffer)(r),m9.signUtil.secp256k1.publicKeyCreate(r,!1)};is.privateToPublicRaw=oge;var cge=function(r){return(0,is.publicToAddress)((0,is.privateToPublic)(r))};is.privateToAddress=cge});var tV=R(v9=>{"use strict";b();p();Object.defineProperty(v9,"__esModule",{value:!0});v9.Address=void 0;var w9=jq(),eV=Mw(),fN=uN(),z0=class{constructor(e){w9(e.length===20,"Invalid address length"),this.buf=e}static zero(){return new z0((0,eV.zeros)(20))}static fromString(e){return w9((0,fN.isValidAddress)(e),"Invalid address"),new z0((0,eV.toBuffer)(e))}static fromPublicKey(e){w9(v.Buffer.isBuffer(e),"Public key should be Buffer");let t=(0,fN.pubToAddress)(e);return new z0(t)}static fromPrivateKey(e){w9(v.Buffer.isBuffer(e),"Private key should be Buffer");let t=(0,fN.privateToAddress)(e);return new z0(t)}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(z0.zero())}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return v.Buffer.from(this.buf)}};v9.Address=z0});var gV=R(pt=>{"use strict";b();p();Object.defineProperty(pt,"__esModule",{value:!0});pt.typedSignatureHash=pt.TypedDataUtils=pt.TYPED_MESSAGE_SCHEMA=pt.getLength=pt.getErrorStack=pt.padStart=pt.bigIntToBytes=pt.remove0x=pt.add0x=pt.hexToBytes=pt.isStrictHexString=pt.assertIsHexString=pt.concatBytes=pt.valueToBytes=pt.isBytes=pt.stringToBytes=pt.numberToBytes=pt.assert=pt.SignTypedDataVersion=pt.StrictHexStruct=void 0;var Wo=gu(),uge=fp(),Lw=qr(),dN=Bce(),rV=48,nV=58,sV=87,fge=/^u?int(?<length>[0-9]*)?$/u,dge=32;pt.StrictHexStruct=(0,dN.pattern)((0,dN.string)(),/^0x[0-9a-f]+$/iu);var co;(function(r){r.V1="V1",r.V3="V3",r.V4="V4"})(co=pt.SignTypedDataVersion||(pt.SignTypedDataVersion={}));function uo(r,e){if(!r)throw new Error(e)}pt.assert=uo;function Uw(r){uo(typeof r=="number","Value must be a number."),uo(r>=0,"Value must be a non-negative number."),uo(Number.isSafeInteger(r),"Value is not a safe integer. Use `bigIntToBytes` instead.");let e=r.toString(16);return fy(e)}pt.numberToBytes=Uw;function _9(r){return uo(typeof r=="string","Value must be a string."),new TextEncoder().encode(r)}pt.stringToBytes=_9;function aV(r){return r instanceof Uint8Array}pt.isBytes=aV;function oV(r){if(typeof r=="bigint")return A9(r);if(typeof r=="number")return Uw(r);if(typeof r=="string")return r.startsWith("0x")?fy(r):_9(r);if(aV(r))return r;throw new TypeError(`Unsupported value type: "${typeof r}".`)}pt.valueToBytes=oV;function cV(r){let e=new Array(r.length),t=0;for(let s=0;s<r.length;s++){let i=oV(r[s]);e[s]=i,t+=i.length}let n=new Uint8Array(t);for(let s=0,i=0;s<e.length;s++)n.set(e[s],i),i+=e[s].length;return n}pt.concatBytes=cV;function uV(r){uo((0,Wo.isHexString)(r),"Value must be a hexadecimal string.")}pt.assertIsHexString=uV;function P9(r){return(0,dN.is)(r,pt.StrictHexStruct)}pt.isStrictHexString=P9;function fy(r){if(r?.toLowerCase?.()==="0x")return new Uint8Array;uV(r);let e=dV(r).toLowerCase(),t=e.length%2===0?e:`0${e}`,n=new Uint8Array(t.length/2);for(let s=0;s<n.length;s++){let i=t.charCodeAt(s*2),a=t.charCodeAt(s*2+1),o=i-(i<nV?rV:sV),c=a-(a<nV?rV:sV);n[s]=o*16+c}return n}pt.hexToBytes=fy;function fV(r){return r.startsWith("0x")?r:r.startsWith("0X")?`0x${r.substring(2)}`:`0x${r}`}pt.add0x=fV;function dV(r){return r.startsWith("0x")||r.startsWith("0X")?r.substring(2):r}pt.remove0x=dV;function A9(r){uo(typeof r=="bigint","Value must be a bigint."),uo(r>=BigInt(0),"Value must be a non-negative bigint.");let e=r.toString(16);return fy(e)}pt.bigIntToBytes=A9;function lN(r,e=dge){let t=new Uint8Array(Math.max(e-r.length,0)).fill(0);return cV([t,r])}pt.padStart=lN;var lge=r=>{if(r instanceof Error)return r.stack};pt.getErrorStack=lge;var hge=r=>{if(r==="int"||r==="uint")return 256;let e=r.match(fge);uo(e?.groups?.length,`Invalid number type. Expected a number type, but received "${r}".`);let t=parseInt(e.groups.length,10);return uo(t>=8&&t<=256,`Invalid number length. Expected a number between 8 and 256, but received "${r}".`),uo(t%8===0,`Invalid number length. Expected a multiple of 8, but received "${r}".`),t};pt.getLength=hge;pt.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:bge()}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]};function bge(){let r=["bool","address","string","bytes"],e=Array.from(new Array(32)).map((s,i)=>`int${(i+1)*8}`),t=Array.from(new Array(32)).map((s,i)=>`uint${(i+1)*8}`),n=Array.from(new Array(32)).map((s,i)=>`bytes${i+1}`);return[...r,...e,...t,...n]}function E9(r,e){if(Object.keys(co).includes(r)){if(e&&!e.includes(r))throw new Error(`SignTypedDataVersion not allowed: '${r}'. Allowed versions are: ${e.join(", ")}`)}else throw new Error(`Invalid version: '${r}'`)}function pge(r){let e=BigInt(0);for(let t=0;t<r.length;t++){let n=BigInt(r.charCodeAt(t)-48);e*=BigInt(10),n>=49?e+=n-BigInt(49)+BigInt(10):n>=17?e+=n-BigInt(17)+BigInt(10):e+=n}return lN(A9(e),20)}function gge(r,e){uo(e!==null,`Unable to encode value: Invalid number. Expected a valid number value, but received "${e}".`);let t=BigInt(e),n=(0,pt.getLength)(r),s=BigInt(2)**BigInt(n)-BigInt(1);return uo(t>=-s&&t<=s,`Unable to encode value: Number "${e}" is out of range for type "${r}".`),t}function lV(r,e,t,n,s){if(E9(s,[co.V3,co.V4]),r[t]!==void 0)return["bytes32",s===co.V4&&n==null?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,Wo.keccak)(hN(t,n,r,s))];if(t==="function")throw new Error('Unsupported or invalid type: "function"');if(n===void 0)throw new Error(`missing value for field ${e} of type ${t}`);if(t==="address"){if(typeof n=="number")return["address",lN(Uw(n),20)];if(P9(n))return["address",fV(n)];if(typeof n=="string")return["address",pge(n).subarray(0,20)]}if(t==="bool")return["bool",Boolean(n)];if(t==="bytes")return typeof n=="number"?n=Uw(n):P9(n)?n=fy(n):typeof n=="string"&&(n=_9(n)),["bytes32",(0,Wo.keccak)(n)];if(t.startsWith("bytes")&&t!=="bytes"&&!t.includes("["))return typeof n=="number"?n<0?["bytes32",new Uint8Array(32)]:["bytes32",A9(BigInt(n))]:P9(n)?["bytes32",fy(n)]:["bytes32",n];if(t.startsWith("int")&&!t.includes("[")){let i=gge(t,n);return i>=BigInt(0)?["uint256",i]:["int256",i]}if(t==="string")return typeof n=="number"?n=Uw(n):n=_9(n??""),["bytes32",(0,Wo.keccak)(n)];if(t.endsWith("]")){if(s===co.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");let i=t.slice(0,t.lastIndexOf("[")),a=n.map(u=>lV(r,e,i,u,s)),o=a.map(([u])=>u),c=a.map(([,u])=>u);return["bytes32",(0,Wo.keccak)(Lw.abi.RawEncode(o,c))]}return[t,n]}function hN(r,e,t,n){E9(n,[co.V3,co.V4]);let s=["bytes32"],i=[pV(r,t)];for(let a of t[r]){if(n===co.V3&&e[a.name]===void 0)continue;let[o,c]=lV(t,a.name,a.type,e[a.name],n);s.push(o),i.push(c)}return Lw.abi.RawEncode(s,i)}function hV(r,e){let t="",n=bV(r,e);n.delete(r);let s=[r,...Array.from(n).sort()];for(let i of s){if(!e[i])throw new Error(`No type definition specified: ${i}`);t+=`${i}(${e[i].map(({name:o,type:c})=>`${c} ${o}`).join(",")})`}return t}function bV(r,e,t=new Set){if([r]=r.match(/^\w*/u),t.has(r)||e[r]===void 0)return t;t.add(r);for(let n of e[r])bV(n.type,e,t);return t}function iV(r,e,t,n){return E9(n,[co.V3,co.V4]),(0,Wo.keccak)(hN(r,e,t,n))}function pV(r,e){return(0,Wo.keccak)(v.Buffer.from(hV(r,e)))}function xge(r){let e={};for(let t in pt.TYPED_MESSAGE_SCHEMA.properties)r[t]&&(e[t]=r[t]);return"types"in e&&(e.types={EIP712Domain:[],...e.types}),e}function yge(r,e){E9(e,[co.V3,co.V4]);let t=xge(r),n=[v.Buffer.from("1901","hex")];return n.push(iV("EIP712Domain",t.domain,t.types,e)),t.primaryType!=="EIP712Domain"&&n.push(iV(t.primaryType,t.message,t.types,e)),(0,Wo.keccak)(v.Buffer.concat(n))}pt.TypedDataUtils={encodeData:hN,encodeType:hV,hashType:pV,eip712Hash:yge};function mge(r){let e=wge(r);return(0,Wo.bufferToHex)(e)}pt.typedSignatureHash=mge;function wge(r){let e=new Error("Expect argument to be non-empty array");if(typeof r!="object"||!("length"in r)||!r.length)throw e;let t=r.map(function(f){return f.type!=="bytes"?f.value:(0,uge.legacyToBuffer)(f.value)}),n=r.map(function(f){return f.type}),s=r.map(function(f){if(!f.name)throw e;return`${f.type} ${f.name}`}),i=Lw.abi.ABI.solidityPack(new Array(r.length).fill("string"),s),a=Lw.abi.ABI.solidityPack(n,t),o=(0,Wo.keccak256)(i),c=(0,Wo.keccak256)(a),u=Lw.abi.ABI.solidityPack(["bytes32","bytes32"],[o,c]);return(0,Wo.keccak256)(u)}});var xV=R((sMe,S9)=>{"use strict";b();p();(function(r){"use strict";var e=function(k){var D,F=new Float64Array(16);if(k)for(D=0;D<k.length;D++)F[D]=k[D];return F},t=function(){throw new Error("no PRNG")},n=new Uint8Array(16),s=new Uint8Array(32);s[0]=9;var i=e(),a=e([1]),o=e([56129,1]),c=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(k,D,F,w){k[D]=F>>24&255,k[D+1]=F>>16&255,k[D+2]=F>>8&255,k[D+3]=F&255,k[D+4]=w>>24&255,k[D+5]=w>>16&255,k[D+6]=w>>8&255,k[D+7]=w&255}function m(k,D,F,w,V){var X,ee=0;for(X=0;X<V;X++)ee|=k[D+X]^F[w+X];return(1&ee-1>>>8)-1}function y(k,D,F,w){return m(k,D,F,w,16)}function S(k,D,F,w){return m(k,D,F,w,32)}function T(k,D,F,w){for(var V=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,X=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,ee=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,ae=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,de=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,qe=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Ae=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,Jt=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Oe=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,tt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,rt=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,dt=F[16]&255|(F[17]&255)<<8|(F[18]&255)<<16|(F[19]&255)<<24,at=F[20]&255|(F[21]&255)<<8|(F[22]&255)<<16|(F[23]&255)<<24,nt=F[24]&255|(F[25]&255)<<8|(F[26]&255)<<16|(F[27]&255)<<24,it=F[28]&255|(F[29]&255)<<8|(F[30]&255)<<16|(F[31]&255)<<24,st=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Be=V,Ke=X,Ee=ee,Ie=ae,Le=de,_e=qe,te=Ae,ne=Jt,be=Oe,ue=tt,fe=rt,xe=dt,Ye=at,At=nt,Nt=it,Et=st,Q,Kt=0;Kt<20;Kt+=2)Q=Be+Ye|0,Le^=Q<<7|Q>>>32-7,Q=Le+Be|0,be^=Q<<9|Q>>>32-9,Q=be+Le|0,Ye^=Q<<13|Q>>>32-13,Q=Ye+be|0,Be^=Q<<18|Q>>>32-18,Q=_e+Ke|0,ue^=Q<<7|Q>>>32-7,Q=ue+_e|0,At^=Q<<9|Q>>>32-9,Q=At+ue|0,Ke^=Q<<13|Q>>>32-13,Q=Ke+At|0,_e^=Q<<18|Q>>>32-18,Q=fe+te|0,Nt^=Q<<7|Q>>>32-7,Q=Nt+fe|0,Ee^=Q<<9|Q>>>32-9,Q=Ee+Nt|0,te^=Q<<13|Q>>>32-13,Q=te+Ee|0,fe^=Q<<18|Q>>>32-18,Q=Et+xe|0,Ie^=Q<<7|Q>>>32-7,Q=Ie+Et|0,ne^=Q<<9|Q>>>32-9,Q=ne+Ie|0,xe^=Q<<13|Q>>>32-13,Q=xe+ne|0,Et^=Q<<18|Q>>>32-18,Q=Be+Ie|0,Ke^=Q<<7|Q>>>32-7,Q=Ke+Be|0,Ee^=Q<<9|Q>>>32-9,Q=Ee+Ke|0,Ie^=Q<<13|Q>>>32-13,Q=Ie+Ee|0,Be^=Q<<18|Q>>>32-18,Q=_e+Le|0,te^=Q<<7|Q>>>32-7,Q=te+_e|0,ne^=Q<<9|Q>>>32-9,Q=ne+te|0,Le^=Q<<13|Q>>>32-13,Q=Le+ne|0,_e^=Q<<18|Q>>>32-18,Q=fe+ue|0,xe^=Q<<7|Q>>>32-7,Q=xe+fe|0,be^=Q<<9|Q>>>32-9,Q=be+xe|0,ue^=Q<<13|Q>>>32-13,Q=ue+be|0,fe^=Q<<18|Q>>>32-18,Q=Et+Nt|0,Ye^=Q<<7|Q>>>32-7,Q=Ye+Et|0,At^=Q<<9|Q>>>32-9,Q=At+Ye|0,Nt^=Q<<13|Q>>>32-13,Q=Nt+At|0,Et^=Q<<18|Q>>>32-18;Be=Be+V|0,Ke=Ke+X|0,Ee=Ee+ee|0,Ie=Ie+ae|0,Le=Le+de|0,_e=_e+qe|0,te=te+Ae|0,ne=ne+Jt|0,be=be+Oe|0,ue=ue+tt|0,fe=fe+rt|0,xe=xe+dt|0,Ye=Ye+at|0,At=At+nt|0,Nt=Nt+it|0,Et=Et+st|0,k[0]=Be>>>0&255,k[1]=Be>>>8&255,k[2]=Be>>>16&255,k[3]=Be>>>24&255,k[4]=Ke>>>0&255,k[5]=Ke>>>8&255,k[6]=Ke>>>16&255,k[7]=Ke>>>24&255,k[8]=Ee>>>0&255,k[9]=Ee>>>8&255,k[10]=Ee>>>16&255,k[11]=Ee>>>24&255,k[12]=Ie>>>0&255,k[13]=Ie>>>8&255,k[14]=Ie>>>16&255,k[15]=Ie>>>24&255,k[16]=Le>>>0&255,k[17]=Le>>>8&255,k[18]=Le>>>16&255,k[19]=Le>>>24&255,k[20]=_e>>>0&255,k[21]=_e>>>8&255,k[22]=_e>>>16&255,k[23]=_e>>>24&255,k[24]=te>>>0&255,k[25]=te>>>8&255,k[26]=te>>>16&255,k[27]=te>>>24&255,k[28]=ne>>>0&255,k[29]=ne>>>8&255,k[30]=ne>>>16&255,k[31]=ne>>>24&255,k[32]=be>>>0&255,k[33]=be>>>8&255,k[34]=be>>>16&255,k[35]=be>>>24&255,k[36]=ue>>>0&255,k[37]=ue>>>8&255,k[38]=ue>>>16&255,k[39]=ue>>>24&255,k[40]=fe>>>0&255,k[41]=fe>>>8&255,k[42]=fe>>>16&255,k[43]=fe>>>24&255,k[44]=xe>>>0&255,k[45]=xe>>>8&255,k[46]=xe>>>16&255,k[47]=xe>>>24&255,k[48]=Ye>>>0&255,k[49]=Ye>>>8&255,k[50]=Ye>>>16&255,k[51]=Ye>>>24&255,k[52]=At>>>0&255,k[53]=At>>>8&255,k[54]=At>>>16&255,k[55]=At>>>24&255,k[56]=Nt>>>0&255,k[57]=Nt>>>8&255,k[58]=Nt>>>16&255,k[59]=Nt>>>24&255,k[60]=Et>>>0&255,k[61]=Et>>>8&255,k[62]=Et>>>16&255,k[63]=Et>>>24&255}function H(k,D,F,w){for(var V=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,X=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,ee=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,ae=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,de=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,qe=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Ae=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,Jt=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Oe=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,tt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,rt=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,dt=F[16]&255|(F[17]&255)<<8|(F[18]&255)<<16|(F[19]&255)<<24,at=F[20]&255|(F[21]&255)<<8|(F[22]&255)<<16|(F[23]&255)<<24,nt=F[24]&255|(F[25]&255)<<8|(F[26]&255)<<16|(F[27]&255)<<24,it=F[28]&255|(F[29]&255)<<8|(F[30]&255)<<16|(F[31]&255)<<24,st=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Be=V,Ke=X,Ee=ee,Ie=ae,Le=de,_e=qe,te=Ae,ne=Jt,be=Oe,ue=tt,fe=rt,xe=dt,Ye=at,At=nt,Nt=it,Et=st,Q,Kt=0;Kt<20;Kt+=2)Q=Be+Ye|0,Le^=Q<<7|Q>>>32-7,Q=Le+Be|0,be^=Q<<9|Q>>>32-9,Q=be+Le|0,Ye^=Q<<13|Q>>>32-13,Q=Ye+be|0,Be^=Q<<18|Q>>>32-18,Q=_e+Ke|0,ue^=Q<<7|Q>>>32-7,Q=ue+_e|0,At^=Q<<9|Q>>>32-9,Q=At+ue|0,Ke^=Q<<13|Q>>>32-13,Q=Ke+At|0,_e^=Q<<18|Q>>>32-18,Q=fe+te|0,Nt^=Q<<7|Q>>>32-7,Q=Nt+fe|0,Ee^=Q<<9|Q>>>32-9,Q=Ee+Nt|0,te^=Q<<13|Q>>>32-13,Q=te+Ee|0,fe^=Q<<18|Q>>>32-18,Q=Et+xe|0,Ie^=Q<<7|Q>>>32-7,Q=Ie+Et|0,ne^=Q<<9|Q>>>32-9,Q=ne+Ie|0,xe^=Q<<13|Q>>>32-13,Q=xe+ne|0,Et^=Q<<18|Q>>>32-18,Q=Be+Ie|0,Ke^=Q<<7|Q>>>32-7,Q=Ke+Be|0,Ee^=Q<<9|Q>>>32-9,Q=Ee+Ke|0,Ie^=Q<<13|Q>>>32-13,Q=Ie+Ee|0,Be^=Q<<18|Q>>>32-18,Q=_e+Le|0,te^=Q<<7|Q>>>32-7,Q=te+_e|0,ne^=Q<<9|Q>>>32-9,Q=ne+te|0,Le^=Q<<13|Q>>>32-13,Q=Le+ne|0,_e^=Q<<18|Q>>>32-18,Q=fe+ue|0,xe^=Q<<7|Q>>>32-7,Q=xe+fe|0,be^=Q<<9|Q>>>32-9,Q=be+xe|0,ue^=Q<<13|Q>>>32-13,Q=ue+be|0,fe^=Q<<18|Q>>>32-18,Q=Et+Nt|0,Ye^=Q<<7|Q>>>32-7,Q=Ye+Et|0,At^=Q<<9|Q>>>32-9,Q=At+Ye|0,Nt^=Q<<13|Q>>>32-13,Q=Nt+At|0,Et^=Q<<18|Q>>>32-18;k[0]=Be>>>0&255,k[1]=Be>>>8&255,k[2]=Be>>>16&255,k[3]=Be>>>24&255,k[4]=_e>>>0&255,k[5]=_e>>>8&255,k[6]=_e>>>16&255,k[7]=_e>>>24&255,k[8]=fe>>>0&255,k[9]=fe>>>8&255,k[10]=fe>>>16&255,k[11]=fe>>>24&255,k[12]=Et>>>0&255,k[13]=Et>>>8&255,k[14]=Et>>>16&255,k[15]=Et>>>24&255,k[16]=te>>>0&255,k[17]=te>>>8&255,k[18]=te>>>16&255,k[19]=te>>>24&255,k[20]=ne>>>0&255,k[21]=ne>>>8&255,k[22]=ne>>>16&255,k[23]=ne>>>24&255,k[24]=be>>>0&255,k[25]=be>>>8&255,k[26]=be>>>16&255,k[27]=be>>>24&255,k[28]=ue>>>0&255,k[29]=ue>>>8&255,k[30]=ue>>>16&255,k[31]=ue>>>24&255}function C(k,D,F,w){T(k,D,F,w)}function J(k,D,F,w){H(k,D,F,w)}var z=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function W(k,D,F,w,V,X,ee){var ae=new Uint8Array(16),de=new Uint8Array(64),qe,Ae;for(Ae=0;Ae<16;Ae++)ae[Ae]=0;for(Ae=0;Ae<8;Ae++)ae[Ae]=X[Ae];for(;V>=64;){for(C(de,ae,ee,z),Ae=0;Ae<64;Ae++)k[D+Ae]=F[w+Ae]^de[Ae];for(qe=1,Ae=8;Ae<16;Ae++)qe=qe+(ae[Ae]&255)|0,ae[Ae]=qe&255,qe>>>=8;V-=64,D+=64,w+=64}if(V>0)for(C(de,ae,ee,z),Ae=0;Ae<V;Ae++)k[D+Ae]=F[w+Ae]^de[Ae];return 0}function Y(k,D,F,w,V){var X=new Uint8Array(16),ee=new Uint8Array(64),ae,de;for(de=0;de<16;de++)X[de]=0;for(de=0;de<8;de++)X[de]=w[de];for(;F>=64;){for(C(ee,X,V,z),de=0;de<64;de++)k[D+de]=ee[de];for(ae=1,de=8;de<16;de++)ae=ae+(X[de]&255)|0,X[de]=ae&255,ae>>>=8;F-=64,D+=64}if(F>0)for(C(ee,X,V,z),de=0;de<F;de++)k[D+de]=ee[de];return 0}function Z(k,D,F,w,V){var X=new Uint8Array(32);J(X,w,V,z);for(var ee=new Uint8Array(8),ae=0;ae<8;ae++)ee[ae]=w[ae+16];return Y(k,D,F,ee,X)}function se(k,D,F,w,V,X,ee){var ae=new Uint8Array(32);J(ae,X,ee,z);for(var de=new Uint8Array(8),qe=0;qe<8;qe++)de[qe]=X[qe+16];return W(k,D,F,w,V,de,ae)}var q=function(k){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;var D,F,w,V,X,ee,ae,de;D=k[0]&255|(k[1]&255)<<8,this.r[0]=D&8191,F=k[2]&255|(k[3]&255)<<8,this.r[1]=(D>>>13|F<<3)&8191,w=k[4]&255|(k[5]&255)<<8,this.r[2]=(F>>>10|w<<6)&7939,V=k[6]&255|(k[7]&255)<<8,this.r[3]=(w>>>7|V<<9)&8191,X=k[8]&255|(k[9]&255)<<8,this.r[4]=(V>>>4|X<<12)&255,this.r[5]=X>>>1&8190,ee=k[10]&255|(k[11]&255)<<8,this.r[6]=(X>>>14|ee<<2)&8191,ae=k[12]&255|(k[13]&255)<<8,this.r[7]=(ee>>>11|ae<<5)&8065,de=k[14]&255|(k[15]&255)<<8,this.r[8]=(ae>>>8|de<<8)&8191,this.r[9]=de>>>5&127,this.pad[0]=k[16]&255|(k[17]&255)<<8,this.pad[1]=k[18]&255|(k[19]&255)<<8,this.pad[2]=k[20]&255|(k[21]&255)<<8,this.pad[3]=k[22]&255|(k[23]&255)<<8,this.pad[4]=k[24]&255|(k[25]&255)<<8,this.pad[5]=k[26]&255|(k[27]&255)<<8,this.pad[6]=k[28]&255|(k[29]&255)<<8,this.pad[7]=k[30]&255|(k[31]&255)<<8};q.prototype.blocks=function(k,D,F){for(var w=this.fin?0:2048,V,X,ee,ae,de,qe,Ae,Jt,Oe,tt,rt,dt,at,nt,it,st,Be,Ke,Ee,Ie=this.h[0],Le=this.h[1],_e=this.h[2],te=this.h[3],ne=this.h[4],be=this.h[5],ue=this.h[6],fe=this.h[7],xe=this.h[8],Ye=this.h[9],At=this.r[0],Nt=this.r[1],Et=this.r[2],Q=this.r[3],Kt=this.r[4],ur=this.r[5],fr=this.r[6],Rt=this.r[7],ar=this.r[8],or=this.r[9];F>=16;)V=k[D+0]&255|(k[D+1]&255)<<8,Ie+=V&8191,X=k[D+2]&255|(k[D+3]&255)<<8,Le+=(V>>>13|X<<3)&8191,ee=k[D+4]&255|(k[D+5]&255)<<8,_e+=(X>>>10|ee<<6)&8191,ae=k[D+6]&255|(k[D+7]&255)<<8,te+=(ee>>>7|ae<<9)&8191,de=k[D+8]&255|(k[D+9]&255)<<8,ne+=(ae>>>4|de<<12)&8191,be+=de>>>1&8191,qe=k[D+10]&255|(k[D+11]&255)<<8,ue+=(de>>>14|qe<<2)&8191,Ae=k[D+12]&255|(k[D+13]&255)<<8,fe+=(qe>>>11|Ae<<5)&8191,Jt=k[D+14]&255|(k[D+15]&255)<<8,xe+=(Ae>>>8|Jt<<8)&8191,Ye+=Jt>>>5|w,Oe=0,tt=Oe,tt+=Ie*At,tt+=Le*(5*or),tt+=_e*(5*ar),tt+=te*(5*Rt),tt+=ne*(5*fr),Oe=tt>>>13,tt&=8191,tt+=be*(5*ur),tt+=ue*(5*Kt),tt+=fe*(5*Q),tt+=xe*(5*Et),tt+=Ye*(5*Nt),Oe+=tt>>>13,tt&=8191,rt=Oe,rt+=Ie*Nt,rt+=Le*At,rt+=_e*(5*or),rt+=te*(5*ar),rt+=ne*(5*Rt),Oe=rt>>>13,rt&=8191,rt+=be*(5*fr),rt+=ue*(5*ur),rt+=fe*(5*Kt),rt+=xe*(5*Q),rt+=Ye*(5*Et),Oe+=rt>>>13,rt&=8191,dt=Oe,dt+=Ie*Et,dt+=Le*Nt,dt+=_e*At,dt+=te*(5*or),dt+=ne*(5*ar),Oe=dt>>>13,dt&=8191,dt+=be*(5*Rt),dt+=ue*(5*fr),dt+=fe*(5*ur),dt+=xe*(5*Kt),dt+=Ye*(5*Q),Oe+=dt>>>13,dt&=8191,at=Oe,at+=Ie*Q,at+=Le*Et,at+=_e*Nt,at+=te*At,at+=ne*(5*or),Oe=at>>>13,at&=8191,at+=be*(5*ar),at+=ue*(5*Rt),at+=fe*(5*fr),at+=xe*(5*ur),at+=Ye*(5*Kt),Oe+=at>>>13,at&=8191,nt=Oe,nt+=Ie*Kt,nt+=Le*Q,nt+=_e*Et,nt+=te*Nt,nt+=ne*At,Oe=nt>>>13,nt&=8191,nt+=be*(5*or),nt+=ue*(5*ar),nt+=fe*(5*Rt),nt+=xe*(5*fr),nt+=Ye*(5*ur),Oe+=nt>>>13,nt&=8191,it=Oe,it+=Ie*ur,it+=Le*Kt,it+=_e*Q,it+=te*Et,it+=ne*Nt,Oe=it>>>13,it&=8191,it+=be*At,it+=ue*(5*or),it+=fe*(5*ar),it+=xe*(5*Rt),it+=Ye*(5*fr),Oe+=it>>>13,it&=8191,st=Oe,st+=Ie*fr,st+=Le*ur,st+=_e*Kt,st+=te*Q,st+=ne*Et,Oe=st>>>13,st&=8191,st+=be*Nt,st+=ue*At,st+=fe*(5*or),st+=xe*(5*ar),st+=Ye*(5*Rt),Oe+=st>>>13,st&=8191,Be=Oe,Be+=Ie*Rt,Be+=Le*fr,Be+=_e*ur,Be+=te*Kt,Be+=ne*Q,Oe=Be>>>13,Be&=8191,Be+=be*Et,Be+=ue*Nt,Be+=fe*At,Be+=xe*(5*or),Be+=Ye*(5*ar),Oe+=Be>>>13,Be&=8191,Ke=Oe,Ke+=Ie*ar,Ke+=Le*Rt,Ke+=_e*fr,Ke+=te*ur,Ke+=ne*Kt,Oe=Ke>>>13,Ke&=8191,Ke+=be*Q,Ke+=ue*Et,Ke+=fe*Nt,Ke+=xe*At,Ke+=Ye*(5*or),Oe+=Ke>>>13,Ke&=8191,Ee=Oe,Ee+=Ie*or,Ee+=Le*ar,Ee+=_e*Rt,Ee+=te*fr,Ee+=ne*ur,Oe=Ee>>>13,Ee&=8191,Ee+=be*Kt,Ee+=ue*Q,Ee+=fe*Et,Ee+=xe*Nt,Ee+=Ye*At,Oe+=Ee>>>13,Ee&=8191,Oe=(Oe<<2)+Oe|0,Oe=Oe+tt|0,tt=Oe&8191,Oe=Oe>>>13,rt+=Oe,Ie=tt,Le=rt,_e=dt,te=at,ne=nt,be=it,ue=st,fe=Be,xe=Ke,Ye=Ee,D+=16,F-=16;this.h[0]=Ie,this.h[1]=Le,this.h[2]=_e,this.h[3]=te,this.h[4]=ne,this.h[5]=be,this.h[6]=ue,this.h[7]=fe,this.h[8]=xe,this.h[9]=Ye},q.prototype.finish=function(k,D){var F=new Uint16Array(10),w,V,X,ee;if(this.leftover){for(ee=this.leftover,this.buffer[ee++]=1;ee<16;ee++)this.buffer[ee]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(w=this.h[1]>>>13,this.h[1]&=8191,ee=2;ee<10;ee++)this.h[ee]+=w,w=this.h[ee]>>>13,this.h[ee]&=8191;for(this.h[0]+=w*5,w=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=w,w=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=w,F[0]=this.h[0]+5,w=F[0]>>>13,F[0]&=8191,ee=1;ee<10;ee++)F[ee]=this.h[ee]+w,w=F[ee]>>>13,F[ee]&=8191;for(F[9]-=1<<13,V=(w^1)-1,ee=0;ee<10;ee++)F[ee]&=V;for(V=~V,ee=0;ee<10;ee++)this.h[ee]=this.h[ee]&V|F[ee];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,X=this.h[0]+this.pad[0],this.h[0]=X&65535,ee=1;ee<8;ee++)X=(this.h[ee]+this.pad[ee]|0)+(X>>>16)|0,this.h[ee]=X&65535;k[D+0]=this.h[0]>>>0&255,k[D+1]=this.h[0]>>>8&255,k[D+2]=this.h[1]>>>0&255,k[D+3]=this.h[1]>>>8&255,k[D+4]=this.h[2]>>>0&255,k[D+5]=this.h[2]>>>8&255,k[D+6]=this.h[3]>>>0&255,k[D+7]=this.h[3]>>>8&255,k[D+8]=this.h[4]>>>0&255,k[D+9]=this.h[4]>>>8&255,k[D+10]=this.h[5]>>>0&255,k[D+11]=this.h[5]>>>8&255,k[D+12]=this.h[6]>>>0&255,k[D+13]=this.h[6]>>>8&255,k[D+14]=this.h[7]>>>0&255,k[D+15]=this.h[7]>>>8&255},q.prototype.update=function(k,D,F){var w,V;if(this.leftover){for(V=16-this.leftover,V>F&&(V=F),w=0;w<V;w++)this.buffer[this.leftover+w]=k[D+w];if(F-=V,D+=V,this.leftover+=V,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(F>=16&&(V=F-F%16,this.blocks(k,D,V),D+=V,F-=V),F){for(w=0;w<F;w++)this.buffer[this.leftover+w]=k[D+w];this.leftover+=F}};function x(k,D,F,w,V,X){var ee=new q(X);return ee.update(F,w,V),ee.finish(k,D),0}function O(k,D,F,w,V,X){var ee=new Uint8Array(16);return x(ee,0,F,w,V,X),y(k,D,ee,0)}function B(k,D,F,w,V){var X;if(F<32)return-1;for(se(k,0,D,0,F,w,V),x(k,16,k,32,F-32,k),X=0;X<16;X++)k[X]=0;return 0}function A(k,D,F,w,V){var X,ee=new Uint8Array(32);if(F<32||(Z(ee,0,32,w,V),O(D,16,D,32,F-32,ee)!==0))return-1;for(se(k,0,D,0,F,w,V),X=0;X<32;X++)k[X]=0;return 0}function E(k,D){var F;for(F=0;F<16;F++)k[F]=D[F]|0}function j(k){var D,F,w=1;for(D=0;D<16;D++)F=k[D]+w+65535,w=Math.floor(F/65536),k[D]=F-w*65536;k[0]+=w-1+37*(w-1)}function G(k,D,F){for(var w,V=~(F-1),X=0;X<16;X++)w=V&(k[X]^D[X]),k[X]^=w,D[X]^=w}function M(k,D){var F,w,V,X=e(),ee=e();for(F=0;F<16;F++)ee[F]=D[F];for(j(ee),j(ee),j(ee),w=0;w<2;w++){for(X[0]=ee[0]-65517,F=1;F<15;F++)X[F]=ee[F]-65535-(X[F-1]>>16&1),X[F-1]&=65535;X[15]=ee[15]-32767-(X[14]>>16&1),V=X[15]>>16&1,X[14]&=65535,G(ee,X,1-V)}for(F=0;F<16;F++)k[2*F]=ee[F]&255,k[2*F+1]=ee[F]>>8}function P(k,D){var F=new Uint8Array(32),w=new Uint8Array(32);return M(F,k),M(w,D),S(F,0,w,0)}function K(k){var D=new Uint8Array(32);return M(D,k),D[0]&1}function re(k,D){var F;for(F=0;F<16;F++)k[F]=D[2*F]+(D[2*F+1]<<8);k[15]&=32767}function ie(k,D,F){for(var w=0;w<16;w++)k[w]=D[w]+F[w]}function ce(k,D,F){for(var w=0;w<16;w++)k[w]=D[w]-F[w]}function oe(k,D,F){var w,V,X=0,ee=0,ae=0,de=0,qe=0,Ae=0,Jt=0,Oe=0,tt=0,rt=0,dt=0,at=0,nt=0,it=0,st=0,Be=0,Ke=0,Ee=0,Ie=0,Le=0,_e=0,te=0,ne=0,be=0,ue=0,fe=0,xe=0,Ye=0,At=0,Nt=0,Et=0,Q=F[0],Kt=F[1],ur=F[2],fr=F[3],Rt=F[4],ar=F[5],or=F[6],ss=F[7],Er=F[8],Gn=F[9],Vn=F[10],zn=F[11],js=F[12],Ai=F[13],Ei=F[14],Si=F[15];w=D[0],X+=w*Q,ee+=w*Kt,ae+=w*ur,de+=w*fr,qe+=w*Rt,Ae+=w*ar,Jt+=w*or,Oe+=w*ss,tt+=w*Er,rt+=w*Gn,dt+=w*Vn,at+=w*zn,nt+=w*js,it+=w*Ai,st+=w*Ei,Be+=w*Si,w=D[1],ee+=w*Q,ae+=w*Kt,de+=w*ur,qe+=w*fr,Ae+=w*Rt,Jt+=w*ar,Oe+=w*or,tt+=w*ss,rt+=w*Er,dt+=w*Gn,at+=w*Vn,nt+=w*zn,it+=w*js,st+=w*Ai,Be+=w*Ei,Ke+=w*Si,w=D[2],ae+=w*Q,de+=w*Kt,qe+=w*ur,Ae+=w*fr,Jt+=w*Rt,Oe+=w*ar,tt+=w*or,rt+=w*ss,dt+=w*Er,at+=w*Gn,nt+=w*Vn,it+=w*zn,st+=w*js,Be+=w*Ai,Ke+=w*Ei,Ee+=w*Si,w=D[3],de+=w*Q,qe+=w*Kt,Ae+=w*ur,Jt+=w*fr,Oe+=w*Rt,tt+=w*ar,rt+=w*or,dt+=w*ss,at+=w*Er,nt+=w*Gn,it+=w*Vn,st+=w*zn,Be+=w*js,Ke+=w*Ai,Ee+=w*Ei,Ie+=w*Si,w=D[4],qe+=w*Q,Ae+=w*Kt,Jt+=w*ur,Oe+=w*fr,tt+=w*Rt,rt+=w*ar,dt+=w*or,at+=w*ss,nt+=w*Er,it+=w*Gn,st+=w*Vn,Be+=w*zn,Ke+=w*js,Ee+=w*Ai,Ie+=w*Ei,Le+=w*Si,w=D[5],Ae+=w*Q,Jt+=w*Kt,Oe+=w*ur,tt+=w*fr,rt+=w*Rt,dt+=w*ar,at+=w*or,nt+=w*ss,it+=w*Er,st+=w*Gn,Be+=w*Vn,Ke+=w*zn,Ee+=w*js,Ie+=w*Ai,Le+=w*Ei,_e+=w*Si,w=D[6],Jt+=w*Q,Oe+=w*Kt,tt+=w*ur,rt+=w*fr,dt+=w*Rt,at+=w*ar,nt+=w*or,it+=w*ss,st+=w*Er,Be+=w*Gn,Ke+=w*Vn,Ee+=w*zn,Ie+=w*js,Le+=w*Ai,_e+=w*Ei,te+=w*Si,w=D[7],Oe+=w*Q,tt+=w*Kt,rt+=w*ur,dt+=w*fr,at+=w*Rt,nt+=w*ar,it+=w*or,st+=w*ss,Be+=w*Er,Ke+=w*Gn,Ee+=w*Vn,Ie+=w*zn,Le+=w*js,_e+=w*Ai,te+=w*Ei,ne+=w*Si,w=D[8],tt+=w*Q,rt+=w*Kt,dt+=w*ur,at+=w*fr,nt+=w*Rt,it+=w*ar,st+=w*or,Be+=w*ss,Ke+=w*Er,Ee+=w*Gn,Ie+=w*Vn,Le+=w*zn,_e+=w*js,te+=w*Ai,ne+=w*Ei,be+=w*Si,w=D[9],rt+=w*Q,dt+=w*Kt,at+=w*ur,nt+=w*fr,it+=w*Rt,st+=w*ar,Be+=w*or,Ke+=w*ss,Ee+=w*Er,Ie+=w*Gn,Le+=w*Vn,_e+=w*zn,te+=w*js,ne+=w*Ai,be+=w*Ei,ue+=w*Si,w=D[10],dt+=w*Q,at+=w*Kt,nt+=w*ur,it+=w*fr,st+=w*Rt,Be+=w*ar,Ke+=w*or,Ee+=w*ss,Ie+=w*Er,Le+=w*Gn,_e+=w*Vn,te+=w*zn,ne+=w*js,be+=w*Ai,ue+=w*Ei,fe+=w*Si,w=D[11],at+=w*Q,nt+=w*Kt,it+=w*ur,st+=w*fr,Be+=w*Rt,Ke+=w*ar,Ee+=w*or,Ie+=w*ss,Le+=w*Er,_e+=w*Gn,te+=w*Vn,ne+=w*zn,be+=w*js,ue+=w*Ai,fe+=w*Ei,xe+=w*Si,w=D[12],nt+=w*Q,it+=w*Kt,st+=w*ur,Be+=w*fr,Ke+=w*Rt,Ee+=w*ar,Ie+=w*or,Le+=w*ss,_e+=w*Er,te+=w*Gn,ne+=w*Vn,be+=w*zn,ue+=w*js,fe+=w*Ai,xe+=w*Ei,Ye+=w*Si,w=D[13],it+=w*Q,st+=w*Kt,Be+=w*ur,Ke+=w*fr,Ee+=w*Rt,Ie+=w*ar,Le+=w*or,_e+=w*ss,te+=w*Er,ne+=w*Gn,be+=w*Vn,ue+=w*zn,fe+=w*js,xe+=w*Ai,Ye+=w*Ei,At+=w*Si,w=D[14],st+=w*Q,Be+=w*Kt,Ke+=w*ur,Ee+=w*fr,Ie+=w*Rt,Le+=w*ar,_e+=w*or,te+=w*ss,ne+=w*Er,be+=w*Gn,ue+=w*Vn,fe+=w*zn,xe+=w*js,Ye+=w*Ai,At+=w*Ei,Nt+=w*Si,w=D[15],Be+=w*Q,Ke+=w*Kt,Ee+=w*ur,Ie+=w*fr,Le+=w*Rt,_e+=w*ar,te+=w*or,ne+=w*ss,be+=w*Er,ue+=w*Gn,fe+=w*Vn,xe+=w*zn,Ye+=w*js,At+=w*Ai,Nt+=w*Ei,Et+=w*Si,X+=38*Ke,ee+=38*Ee,ae+=38*Ie,de+=38*Le,qe+=38*_e,Ae+=38*te,Jt+=38*ne,Oe+=38*be,tt+=38*ue,rt+=38*fe,dt+=38*xe,at+=38*Ye,nt+=38*At,it+=38*Nt,st+=38*Et,V=1,w=X+V+65535,V=Math.floor(w/65536),X=w-V*65536,w=ee+V+65535,V=Math.floor(w/65536),ee=w-V*65536,w=ae+V+65535,V=Math.floor(w/65536),ae=w-V*65536,w=de+V+65535,V=Math.floor(w/65536),de=w-V*65536,w=qe+V+65535,V=Math.floor(w/65536),qe=w-V*65536,w=Ae+V+65535,V=Math.floor(w/65536),Ae=w-V*65536,w=Jt+V+65535,V=Math.floor(w/65536),Jt=w-V*65536,w=Oe+V+65535,V=Math.floor(w/65536),Oe=w-V*65536,w=tt+V+65535,V=Math.floor(w/65536),tt=w-V*65536,w=rt+V+65535,V=Math.floor(w/65536),rt=w-V*65536,w=dt+V+65535,V=Math.floor(w/65536),dt=w-V*65536,w=at+V+65535,V=Math.floor(w/65536),at=w-V*65536,w=nt+V+65535,V=Math.floor(w/65536),nt=w-V*65536,w=it+V+65535,V=Math.floor(w/65536),it=w-V*65536,w=st+V+65535,V=Math.floor(w/65536),st=w-V*65536,w=Be+V+65535,V=Math.floor(w/65536),Be=w-V*65536,X+=V-1+37*(V-1),V=1,w=X+V+65535,V=Math.floor(w/65536),X=w-V*65536,w=ee+V+65535,V=Math.floor(w/65536),ee=w-V*65536,w=ae+V+65535,V=Math.floor(w/65536),ae=w-V*65536,w=de+V+65535,V=Math.floor(w/65536),de=w-V*65536,w=qe+V+65535,V=Math.floor(w/65536),qe=w-V*65536,w=Ae+V+65535,V=Math.floor(w/65536),Ae=w-V*65536,w=Jt+V+65535,V=Math.floor(w/65536),Jt=w-V*65536,w=Oe+V+65535,V=Math.floor(w/65536),Oe=w-V*65536,w=tt+V+65535,V=Math.floor(w/65536),tt=w-V*65536,w=rt+V+65535,V=Math.floor(w/65536),rt=w-V*65536,w=dt+V+65535,V=Math.floor(w/65536),dt=w-V*65536,w=at+V+65535,V=Math.floor(w/65536),at=w-V*65536,w=nt+V+65535,V=Math.floor(w/65536),nt=w-V*65536,w=it+V+65535,V=Math.floor(w/65536),it=w-V*65536,w=st+V+65535,V=Math.floor(w/65536),st=w-V*65536,w=Be+V+65535,V=Math.floor(w/65536),Be=w-V*65536,X+=V-1+37*(V-1),k[0]=X,k[1]=ee,k[2]=ae,k[3]=de,k[4]=qe,k[5]=Ae,k[6]=Jt,k[7]=Oe,k[8]=tt,k[9]=rt,k[10]=dt,k[11]=at,k[12]=nt,k[13]=it,k[14]=st,k[15]=Be}function we(k,D){oe(k,D,D)}function He(k,D){var F=e(),w;for(w=0;w<16;w++)F[w]=D[w];for(w=253;w>=0;w--)we(F,F),w!==2&&w!==4&&oe(F,F,D);for(w=0;w<16;w++)k[w]=F[w]}function yt(k,D){var F=e(),w;for(w=0;w<16;w++)F[w]=D[w];for(w=250;w>=0;w--)we(F,F),w!==1&&oe(F,F,D);for(w=0;w<16;w++)k[w]=F[w]}function mt(k,D,F){var w=new Uint8Array(32),V=new Float64Array(80),X,ee,ae=e(),de=e(),qe=e(),Ae=e(),Jt=e(),Oe=e();for(ee=0;ee<31;ee++)w[ee]=D[ee];for(w[31]=D[31]&127|64,w[0]&=248,re(V,F),ee=0;ee<16;ee++)de[ee]=V[ee],Ae[ee]=ae[ee]=qe[ee]=0;for(ae[0]=Ae[0]=1,ee=254;ee>=0;--ee)X=w[ee>>>3]>>>(ee&7)&1,G(ae,de,X),G(qe,Ae,X),ie(Jt,ae,qe),ce(ae,ae,qe),ie(qe,de,Ae),ce(de,de,Ae),we(Ae,Jt),we(Oe,ae),oe(ae,qe,ae),oe(qe,de,Jt),ie(Jt,ae,qe),ce(ae,ae,qe),we(de,ae),ce(qe,Ae,Oe),oe(ae,qe,o),ie(ae,ae,Ae),oe(qe,qe,ae),oe(ae,Ae,Oe),oe(Ae,de,V),we(de,Jt),G(ae,de,X),G(qe,Ae,X);for(ee=0;ee<16;ee++)V[ee+16]=ae[ee],V[ee+32]=qe[ee],V[ee+48]=de[ee],V[ee+64]=Ae[ee];var tt=V.subarray(32),rt=V.subarray(16);return He(tt,tt),oe(rt,rt,tt),M(k,rt),0}function Qe(k,D){return mt(k,D,s)}function Cr(k,D){return t(D,32),Qe(k,D)}function sr(k,D,F){var w=new Uint8Array(32);return mt(w,F,D),J(k,n,w,z)}var We=B,rn=A;function $t(k,D,F,w,V,X){var ee=new Uint8Array(32);return sr(ee,V,X),We(k,D,F,w,ee)}function vr(k,D,F,w,V,X){var ee=new Uint8Array(32);return sr(ee,V,X),rn(k,D,F,w,ee)}var _a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Mn(k,D,F,w){for(var V=new Int32Array(16),X=new Int32Array(16),ee,ae,de,qe,Ae,Jt,Oe,tt,rt,dt,at,nt,it,st,Be,Ke,Ee,Ie,Le,_e,te,ne,be,ue,fe,xe,Ye=k[0],At=k[1],Nt=k[2],Et=k[3],Q=k[4],Kt=k[5],ur=k[6],fr=k[7],Rt=D[0],ar=D[1],or=D[2],ss=D[3],Er=D[4],Gn=D[5],Vn=D[6],zn=D[7],js=0;w>=128;){for(Le=0;Le<16;Le++)_e=8*Le+js,V[Le]=F[_e+0]<<24|F[_e+1]<<16|F[_e+2]<<8|F[_e+3],X[Le]=F[_e+4]<<24|F[_e+5]<<16|F[_e+6]<<8|F[_e+7];for(Le=0;Le<80;Le++)if(ee=Ye,ae=At,de=Nt,qe=Et,Ae=Q,Jt=Kt,Oe=ur,tt=fr,rt=Rt,dt=ar,at=or,nt=ss,it=Er,st=Gn,Be=Vn,Ke=zn,te=fr,ne=zn,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=(Q>>>14|Er<<32-14)^(Q>>>18|Er<<32-18)^(Er>>>41-32|Q<<32-(41-32)),ne=(Er>>>14|Q<<32-14)^(Er>>>18|Q<<32-18)^(Q>>>41-32|Er<<32-(41-32)),be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,te=Q&Kt^~Q&ur,ne=Er&Gn^~Er&Vn,be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,te=_a[Le*2],ne=_a[Le*2+1],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,te=V[Le%16],ne=X[Le%16],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,Ee=fe&65535|xe<<16,Ie=be&65535|ue<<16,te=Ee,ne=Ie,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=(Ye>>>28|Rt<<32-28)^(Rt>>>34-32|Ye<<32-(34-32))^(Rt>>>39-32|Ye<<32-(39-32)),ne=(Rt>>>28|Ye<<32-28)^(Ye>>>34-32|Rt<<32-(34-32))^(Ye>>>39-32|Rt<<32-(39-32)),be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,te=Ye&At^Ye&Nt^At&Nt,ne=Rt&ar^Rt&or^ar&or,be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,tt=fe&65535|xe<<16,Ke=be&65535|ue<<16,te=qe,ne=nt,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=Ee,ne=Ie,be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,qe=fe&65535|xe<<16,nt=be&65535|ue<<16,At=ee,Nt=ae,Et=de,Q=qe,Kt=Ae,ur=Jt,fr=Oe,Ye=tt,ar=rt,or=dt,ss=at,Er=nt,Gn=it,Vn=st,zn=Be,Rt=Ke,Le%16===15)for(_e=0;_e<16;_e++)te=V[_e],ne=X[_e],be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=V[(_e+9)%16],ne=X[(_e+9)%16],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,Ee=V[(_e+1)%16],Ie=X[(_e+1)%16],te=(Ee>>>1|Ie<<32-1)^(Ee>>>8|Ie<<32-8)^Ee>>>7,ne=(Ie>>>1|Ee<<32-1)^(Ie>>>8|Ee<<32-8)^(Ie>>>7|Ee<<32-7),be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,Ee=V[(_e+14)%16],Ie=X[(_e+14)%16],te=(Ee>>>19|Ie<<32-19)^(Ie>>>61-32|Ee<<32-(61-32))^Ee>>>6,ne=(Ie>>>19|Ee<<32-19)^(Ee>>>61-32|Ie<<32-(61-32))^(Ie>>>6|Ee<<32-6),be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,V[_e]=fe&65535|xe<<16,X[_e]=be&65535|ue<<16;te=Ye,ne=Rt,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[0],ne=D[0],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[0]=Ye=fe&65535|xe<<16,D[0]=Rt=be&65535|ue<<16,te=At,ne=ar,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[1],ne=D[1],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[1]=At=fe&65535|xe<<16,D[1]=ar=be&65535|ue<<16,te=Nt,ne=or,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[2],ne=D[2],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[2]=Nt=fe&65535|xe<<16,D[2]=or=be&65535|ue<<16,te=Et,ne=ss,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[3],ne=D[3],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[3]=Et=fe&65535|xe<<16,D[3]=ss=be&65535|ue<<16,te=Q,ne=Er,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[4],ne=D[4],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[4]=Q=fe&65535|xe<<16,D[4]=Er=be&65535|ue<<16,te=Kt,ne=Gn,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[5],ne=D[5],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[5]=Kt=fe&65535|xe<<16,D[5]=Gn=be&65535|ue<<16,te=ur,ne=Vn,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[6],ne=D[6],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[6]=ur=fe&65535|xe<<16,D[6]=Vn=be&65535|ue<<16,te=fr,ne=zn,be=ne&65535,ue=ne>>>16,fe=te&65535,xe=te>>>16,te=k[7],ne=D[7],be+=ne&65535,ue+=ne>>>16,fe+=te&65535,xe+=te>>>16,ue+=be>>>16,fe+=ue>>>16,xe+=fe>>>16,k[7]=fr=fe&65535|xe<<16,D[7]=zn=be&65535|ue<<16,js+=128,w-=128}return w}function Tr(k,D,F){var w=new Int32Array(8),V=new Int32Array(8),X=new Uint8Array(256),ee,ae=F;for(w[0]=1779033703,w[1]=3144134277,w[2]=1013904242,w[3]=2773480762,w[4]=1359893119,w[5]=2600822924,w[6]=528734635,w[7]=1541459225,V[0]=4089235720,V[1]=2227873595,V[2]=4271175723,V[3]=1595750129,V[4]=2917565137,V[5]=725511199,V[6]=4215389547,V[7]=327033209,Mn(w,V,D,F),F%=128,ee=0;ee<F;ee++)X[ee]=D[ae-F+ee];for(X[F]=128,F=256-128*(F<112?1:0),X[F-9]=0,h(X,F-8,ae/536870912|0,ae<<3),Mn(w,V,X,F),ee=0;ee<8;ee++)h(k,8*ee,w[ee],V[ee]);return 0}function Db(k,D){var F=e(),w=e(),V=e(),X=e(),ee=e(),ae=e(),de=e(),qe=e(),Ae=e();ce(F,k[1],k[0]),ce(Ae,D[1],D[0]),oe(F,F,Ae),ie(w,k[0],k[1]),ie(Ae,D[0],D[1]),oe(w,w,Ae),oe(V,k[3],D[3]),oe(V,V,u),oe(X,k[2],D[2]),ie(X,X,X),ce(ee,w,F),ce(ae,X,V),ie(de,X,V),ie(qe,w,F),oe(k[0],ee,ae),oe(k[1],qe,de),oe(k[2],de,ae),oe(k[3],ee,qe)}function Cn(k,D,F){var w;for(w=0;w<4;w++)G(k[w],D[w],F)}function mn(k,D){var F=e(),w=e(),V=e();He(V,D[2]),oe(F,D[0],V),oe(w,D[1],V),M(k,w),k[31]^=K(F)<<7}function Bx(k,D,F){var w,V;for(E(k[0],i),E(k[1],a),E(k[2],a),E(k[3],i),V=255;V>=0;--V)w=F[V/8|0]>>(V&7)&1,Cn(k,D,w),Db(D,k),Db(k,k),Cn(k,D,w)}function nn(k,D){var F=[e(),e(),e(),e()];E(F[0],f),E(F[1],d),E(F[2],a),oe(F[3],f,d),Bx(k,F,D)}function wn(k,D,F){var w=new Uint8Array(64),V=[e(),e(),e(),e()],X;for(F||t(D,32),Tr(w,D,32),w[0]&=248,w[31]&=127,w[31]|=64,nn(V,w),mn(k,V),X=0;X<32;X++)D[X+32]=k[X];return 0}var Hb=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function vn(k,D){var F,w,V,X;for(w=63;w>=32;--w){for(F=0,V=w-32,X=w-12;V<X;++V)D[V]+=F-16*D[w]*Hb[V-(w-32)],F=Math.floor((D[V]+128)/256),D[V]-=F*256;D[V]+=F,D[w]=0}for(F=0,V=0;V<32;V++)D[V]+=F-(D[31]>>4)*Hb[V],F=D[V]>>8,D[V]&=255;for(V=0;V<32;V++)D[V]-=F*Hb[V];for(w=0;w<32;w++)D[w+1]+=D[w]>>8,k[w]=D[w]&255}function Pn(k){var D=new Float64Array(64),F;for(F=0;F<64;F++)D[F]=k[F];for(F=0;F<64;F++)k[F]=0;vn(k,D)}function rw(k,D,F,w){var V=new Uint8Array(64),X=new Uint8Array(64),ee=new Uint8Array(64),ae,de,qe=new Float64Array(64),Ae=[e(),e(),e(),e()];Tr(V,w,32),V[0]&=248,V[31]&=127,V[31]|=64;var Jt=F+64;for(ae=0;ae<F;ae++)k[64+ae]=D[ae];for(ae=0;ae<32;ae++)k[32+ae]=V[32+ae];for(Tr(ee,k.subarray(32),F+32),Pn(ee),nn(Ae,ee),mn(k,Ae),ae=32;ae<64;ae++)k[ae]=w[ae];for(Tr(X,k,F+64),Pn(X),ae=0;ae<64;ae++)qe[ae]=0;for(ae=0;ae<32;ae++)qe[ae]=ee[ae];for(ae=0;ae<32;ae++)for(de=0;de<32;de++)qe[ae+de]+=X[ae]*V[de];return vn(k.subarray(32),qe),Jt}function Dn(k,D){var F=e(),w=e(),V=e(),X=e(),ee=e(),ae=e(),de=e();return E(k[2],a),re(k[1],D),we(V,k[1]),oe(X,V,c),ce(V,V,k[2]),ie(X,k[2],X),we(ee,X),we(ae,ee),oe(de,ae,ee),oe(F,de,V),oe(F,F,X),yt(F,F),oe(F,F,V),oe(F,F,X),oe(F,F,X),oe(k[0],F,X),we(w,k[0]),oe(w,w,X),P(w,V)&&oe(k[0],k[0],g),we(w,k[0]),oe(w,w,X),P(w,V)?-1:(K(k[0])===D[31]>>7&&ce(k[0],i,k[0]),oe(k[3],k[0],k[1]),0)}function _n(k,D,F,w){var V,X=new Uint8Array(32),ee=new Uint8Array(64),ae=[e(),e(),e(),e()],de=[e(),e(),e(),e()];if(F<64||Dn(de,w))return-1;for(V=0;V<F;V++)k[V]=D[V];for(V=0;V<32;V++)k[V+32]=w[V];if(Tr(ee,k,F),Pn(ee),Bx(ae,de,ee),nn(de,D.subarray(32)),Db(ae,de),mn(X,ae),F-=64,S(D,0,X,0)){for(V=0;V<F;V++)k[V]=0;return-1}for(V=0;V<F;V++)k[V]=D[V+64];return F}var kx=32,sn=24,Lr=32,q0=16,Ur=32,an=32,al=32,Fr=32,An=32,nw=sn,Hn=Lr,Kn=q0,Ro=64,Or=32,Rr=64,Nx=32,En=64;r.lowlevel={crypto_core_hsalsa20:J,crypto_stream_xor:se,crypto_stream:Z,crypto_stream_salsa20_xor:W,crypto_stream_salsa20:Y,crypto_onetimeauth:x,crypto_onetimeauth_verify:O,crypto_verify_16:y,crypto_verify_32:S,crypto_secretbox:B,crypto_secretbox_open:A,crypto_scalarmult:mt,crypto_scalarmult_base:Qe,crypto_box_beforenm:sr,crypto_box_afternm:We,crypto_box:$t,crypto_box_open:vr,crypto_box_keypair:Cr,crypto_hash:Tr,crypto_sign:rw,crypto_sign_keypair:wn,crypto_sign_open:_n,crypto_secretbox_KEYBYTES:kx,crypto_secretbox_NONCEBYTES:sn,crypto_secretbox_ZEROBYTES:Lr,crypto_secretbox_BOXZEROBYTES:q0,crypto_scalarmult_BYTES:Ur,crypto_scalarmult_SCALARBYTES:an,crypto_box_PUBLICKEYBYTES:al,crypto_box_SECRETKEYBYTES:Fr,crypto_box_BEFORENMBYTES:An,crypto_box_NONCEBYTES:nw,crypto_box_ZEROBYTES:Hn,crypto_box_BOXZEROBYTES:Kn,crypto_sign_BYTES:Ro,crypto_sign_PUBLICKEYBYTES:Or,crypto_sign_SECRETKEYBYTES:Rr,crypto_sign_SEEDBYTES:Nx,crypto_hash_BYTES:En,gf:e,D:c,L:Hb,pack25519:M,unpack25519:re,M:oe,A:ie,S:we,Z:ce,pow2523:yt,add:Db,set25519:E,modL:vn,scalarmult:Bx,scalarbase:nn};function Ln(k,D){if(k.length!==kx)throw new Error("bad key size");if(D.length!==sn)throw new Error("bad nonce size")}function a7(k,D){if(k.length!==al)throw new Error("bad public key size");if(D.length!==Fr)throw new Error("bad secret key size")}function ir(){for(var k=0;k<arguments.length;k++)if(!(arguments[k]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Un(k){for(var D=0;D<k.length;D++)k[D]=0}r.randomBytes=function(k){var D=new Uint8Array(k);return t(D,k),D},r.secretbox=function(k,D,F){ir(k,D,F),Ln(F,D);for(var w=new Uint8Array(Lr+k.length),V=new Uint8Array(w.length),X=0;X<k.length;X++)w[X+Lr]=k[X];return B(V,w,w.length,D,F),V.subarray(q0)},r.secretbox.open=function(k,D,F){ir(k,D,F),Ln(F,D);for(var w=new Uint8Array(q0+k.length),V=new Uint8Array(w.length),X=0;X<k.length;X++)w[X+q0]=k[X];return w.length<32||A(V,w,w.length,D,F)!==0?null:V.subarray(Lr)},r.secretbox.keyLength=kx,r.secretbox.nonceLength=sn,r.secretbox.overheadLength=q0,r.scalarMult=function(k,D){if(ir(k,D),k.length!==an)throw new Error("bad n size");if(D.length!==Ur)throw new Error("bad p size");var F=new Uint8Array(Ur);return mt(F,k,D),F},r.scalarMult.base=function(k){if(ir(k),k.length!==an)throw new Error("bad n size");var D=new Uint8Array(Ur);return Qe(D,k),D},r.scalarMult.scalarLength=an,r.scalarMult.groupElementLength=Ur,r.box=function(k,D,F,w){var V=r.box.before(F,w);return r.secretbox(k,D,V)},r.box.before=function(k,D){ir(k,D),a7(k,D);var F=new Uint8Array(An);return sr(F,k,D),F},r.box.after=r.secretbox,r.box.open=function(k,D,F,w){var V=r.box.before(F,w);return r.secretbox.open(k,D,V)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var k=new Uint8Array(al),D=new Uint8Array(Fr);return Cr(k,D),{publicKey:k,secretKey:D}},r.box.keyPair.fromSecretKey=function(k){if(ir(k),k.length!==Fr)throw new Error("bad secret key size");var D=new Uint8Array(al);return Qe(D,k),{publicKey:D,secretKey:new Uint8Array(k)}},r.box.publicKeyLength=al,r.box.secretKeyLength=Fr,r.box.sharedKeyLength=An,r.box.nonceLength=nw,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(k,D){if(ir(k,D),D.length!==Rr)throw new Error("bad secret key size");var F=new Uint8Array(Ro+k.length);return rw(F,k,k.length,D),F},r.sign.open=function(k,D){if(ir(k,D),D.length!==Or)throw new Error("bad public key size");var F=new Uint8Array(k.length),w=_n(F,k,k.length,D);if(w<0)return null;for(var V=new Uint8Array(w),X=0;X<V.length;X++)V[X]=F[X];return V},r.sign.detached=function(k,D){for(var F=r.sign(k,D),w=new Uint8Array(Ro),V=0;V<w.length;V++)w[V]=F[V];return w},r.sign.detached.verify=function(k,D,F){if(ir(k,D,F),D.length!==Ro)throw new Error("bad signature size");if(F.length!==Or)throw new Error("bad public key size");var w=new Uint8Array(Ro+k.length),V=new Uint8Array(Ro+k.length),X;for(X=0;X<Ro;X++)w[X]=D[X];for(X=0;X<k.length;X++)w[X+Ro]=k[X];return _n(V,w,w.length,F)>=0},r.sign.keyPair=function(){var k=new Uint8Array(Or),D=new Uint8Array(Rr);return wn(k,D),{publicKey:k,secretKey:D}},r.sign.keyPair.fromSecretKey=function(k){if(ir(k),k.length!==Rr)throw new Error("bad secret key size");for(var D=new Uint8Array(Or),F=0;F<D.length;F++)D[F]=k[32+F];return{publicKey:D,secretKey:new Uint8Array(k)}},r.sign.keyPair.fromSeed=function(k){if(ir(k),k.length!==Nx)throw new Error("bad seed size");for(var D=new Uint8Array(Or),F=new Uint8Array(Rr),w=0;w<32;w++)F[w]=k[w];return wn(D,F,!0),{publicKey:D,secretKey:F}},r.sign.publicKeyLength=Or,r.sign.secretKeyLength=Rr,r.sign.seedLength=Nx,r.sign.signatureLength=Ro,r.hash=function(k){ir(k);var D=new Uint8Array(En);return Tr(D,k,k.length),D},r.hash.hashLength=En,r.verify=function(k,D){return ir(k,D),k.length===0||D.length===0||k.length!==D.length?!1:m(k,0,D,0,k.length)===0},r.setPRNG=function(k){t=k},function(){var k=typeof self<"u"?self.crypto||self.msCrypto:null;if(k&&k.getRandomValues){var D=65536;r.setPRNG(function(F,w){var V,X=new Uint8Array(w);for(V=0;V<w;V+=D)k.getRandomValues(X.subarray(V,V+Math.min(w-V,D)));for(V=0;V<w;V++)F[V]=X[V];Un(X)})}else typeof Nq<"u"&&(k=gce(),k&&k.randomBytes&&r.setPRNG(function(F,w){var V,X=k.randomBytes(w);for(V=0;V<w;V++)F[V]=X[V];Un(X)}))}()})(typeof S9<"u"&&S9.exports?S9.exports:self.nacl=self.nacl||{})});var mV=R((yV,T9)=>{"use strict";b();p();(function(r,e){"use strict";typeof T9<"u"&&T9.exports?T9.exports=e():(r.nacl||(r.nacl={}),r.nacl.util=e())})(yV,function(){"use strict";var r={};function e(t){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(t))throw new TypeError("invalid encoding")}return r.decodeUTF8=function(t){if(typeof t!="string")throw new TypeError("expected string");var n,s=unescape(encodeURIComponent(t)),i=new Uint8Array(s.length);for(n=0;n<s.length;n++)i[n]=s.charCodeAt(n);return i},r.encodeUTF8=function(t){var n,s=[];for(n=0;n<t.length;n++)s.push(String.fromCharCode(t[n]));return decodeURIComponent(escape(s.join("")))},typeof atob>"u"?typeof v.Buffer.from<"u"?(r.encodeBase64=function(t){return v.Buffer.from(t).toString("base64")},r.decodeBase64=function(t){return e(t),new Uint8Array(Array.prototype.slice.call(v.Buffer.from(t,"base64"),0))}):(r.encodeBase64=function(t){return new v.Buffer(t).toString("base64")},r.decodeBase64=function(t){return e(t),new Uint8Array(Array.prototype.slice.call(new v.Buffer(t,"base64"),0))}):(r.encodeBase64=function(t){var n,s=[],i=t.length;for(n=0;n<i;n++)s.push(String.fromCharCode(t[n]));return btoa(s.join(""))},r.decodeBase64=function(t){e(t);var n,s=atob(t),i=new Uint8Array(s.length);for(n=0;n<s.length;n++)i[n]=s.charCodeAt(n);return i}),r})});var _V=R($o=>{"use strict";b();p();Object.defineProperty($o,"__esModule",{value:!0});$o.getEncryptionPublicKey=$o.decryptSafely=$o.decrypt=$o.encryptSafely=$o.encrypt=void 0;var dp=xV(),xu=mV(),Mf=fp();function wV({publicKey:r,data:e,version:t}){if((0,Mf.isNullish)(r))throw new Error("Missing publicKey parameter");if((0,Mf.isNullish)(e))throw new Error("Missing data parameter");if((0,Mf.isNullish)(t))throw new Error("Missing version parameter");switch(t){case"x25519-xsalsa20-poly1305":{let n=dp.box.keyPair(),s;try{s=xu.decodeBase64(r)}catch{throw new Error("Bad public key")}let i=xu.decodeUTF8(e),a=dp.randomBytes(dp.box.nonceLength),o=dp.box(i,a,s,n.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:xu.encodeBase64(a),ephemPublicKey:xu.encodeBase64(n.publicKey),ciphertext:xu.encodeBase64(o)}}default:throw new Error("Encryption type/version not supported")}}$o.encrypt=wV;function vge({publicKey:r,data:e,version:t}){if((0,Mf.isNullish)(r))throw new Error("Missing publicKey parameter");if((0,Mf.isNullish)(e))throw new Error("Missing data parameter");if((0,Mf.isNullish)(t))throw new Error("Missing version parameter");let n=2**11,s=16;if(typeof e=="object"&&"toJSON"in e)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");let i={data:e,padding:""},o=v.Buffer.byteLength(JSON.stringify(i),"utf-8")%n,c=0;o>0&&(c=n-o-s),i.padding="0".repeat(c);let u=JSON.stringify(i);return wV({publicKey:r,data:u,version:t})}$o.encryptSafely=vge;function vV({encryptedData:r,privateKey:e}){if((0,Mf.isNullish)(r))throw new Error("Missing encryptedData parameter");if((0,Mf.isNullish)(e))throw new Error("Missing privateKey parameter");switch(r.version){case"x25519-xsalsa20-poly1305":{let t=PV(e),n=dp.box.keyPair.fromSecretKey(t).secretKey,s=xu.decodeBase64(r.nonce),i=xu.decodeBase64(r.ciphertext),a=xu.decodeBase64(r.ephemPublicKey),o=dp.box.open(i,s,a,n),c;try{c=xu.encodeUTF8(o)}catch{throw new Error("Decryption failed.")}if(c)return c;throw new Error("Decryption failed.")}default:throw new Error("Encryption type/version not supported.")}}$o.decrypt=vV;function Pge({encryptedData:r,privateKey:e}){if((0,Mf.isNullish)(r))throw new Error("Missing encryptedData parameter");if((0,Mf.isNullish)(e))throw new Error("Missing privateKey parameter");return JSON.parse(vV({encryptedData:r,privateKey:e})).data}$o.decryptSafely=Pge;function _ge(r){let e=PV(r),t=dp.box.keyPair.fromSecretKey(e).publicKey;return xu.encodeBase64(t)}$o.getEncryptionPublicKey=_ge;function PV(r){let e=v.Buffer.from(r,"hex").toString("base64");return xu.decodeBase64(e)}});var fp=R(Oa=>{"use strict";b();p();var Age=Oa&&Oa.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),EV=Oa&&Oa.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Age(e,r,t)};Object.defineProperty(Oa,"__esModule",{value:!0});Oa.isNullish=Oa.legacyToBuffer=Oa.padWithZeroes=void 0;EV(gV(),Oa);EV(_V(),Oa);var AV=gu();function Ege(r,e){if(r!==""&&!/^[a-f0-9]+$/iu.test(r))throw new Error(`Expected an unprefixed hex string. Received: ${r}`);if(e<0)throw new Error(`Expected a non-negative integer target length. Received: ${e}`);return String.prototype.padStart.call(r,e,"0")}Oa.padWithZeroes=Ege;function Sge(r){return typeof r=="string"&&!(0,AV.isHexString)(r)?v.Buffer.from(r):(0,AV.toBuffer)(r)}Oa.legacyToBuffer=Sge;function Tge(r){return r==null}Oa.isNullish=Tge});var BV=R(Ba=>{"use strict";b();p();Object.defineProperty(Ba,"__esModule",{value:!0});Ba.recoverFromSignature=Ba.ecdsaSign=Ba.makeSignature=Ba.calculateSigRecovery=Ba.isValidSigRecovery=Ba.hashPersonalMessage=void 0;var Oge=g9(),Bge=jw(),Fw=qr(),O9=y9(),qw=o7(),lp=Mw(),SV=fp(),kge=uy(),Nge=function(r){(0,Bge.assertIsBuffer)(r);let e=qw.Buffer.from(`Ethereum Signed Message:
${r.length.toString()}`,"utf-8");return(0,Oge.keccak)(qw.Buffer.concat([e,r]))};Ba.hashPersonalMessage=Nge;function TV(r){let e=new Fw.BN(r);return e.eqn(0)||e.eqn(1)}Ba.isValidSigRecovery=TV;function OV(r,e){let t=(0,O9.toType)(r,O9.TypeOutput.BN);if(!e)return t.subn(27);let n=(0,O9.toType)(e,O9.TypeOutput.BN);return t.sub(n.muln(2).addn(35))}Ba.calculateSigRecovery=OV;function Ige(r,e,t){let n=(0,lp.fromSigned)(e),s=(0,lp.fromSigned)(t),i=r,a=(0,SV.padWithZeroes)((0,lp.toUnsigned)(n).toString("hex"),64),o=(0,SV.padWithZeroes)((0,lp.toUnsigned)(s).toString("hex"),64),c=Fw.base.stripHexPrefix((0,kge.intToHex)(i));return(0,lp.addHexPrefix)(a.concat(o,c))}Ba.makeSignature=Ige;function Rge(r,e,t){let{signature:n,recovery:s}=Fw.signUtil.secp256k1.sign(r,e),i=qw.Buffer.from(n.slice(0,32)),a=qw.Buffer.from(n.slice(32,64));if(t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{v:t?s+(t*2+35):s+27,r:i,s:a}}Ba.ecdsaSign=Rge;function jge(r,e,t,n,s){let i=qw.Buffer.concat([(0,lp.setLengthLeft)(t,32),(0,lp.setLengthLeft)(n,32)],64),a=OV(e,s);if(!TV(a))throw new Error("Invalid signature v value");let o=Fw.signUtil.secp256k1.recover(i,a.toNumber(),r,!1);if(o==null)throw new Error("ecdsaRecover error");let c=Fw.signUtil.secp256k1.publicKeyConvert(o,!1);if(c==null)throw new Error("publicKeyConvert error");return c.slice(1)}Ba.recoverFromSignature=jge});var gu=R(ys=>{"use strict";b();p();var kV=ys&&ys.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Mge=ys&&ys.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Il=ys&&ys.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kV(e,r,t)},Cge=ys&&ys.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&kV(e,r,t);return Mge(e,r),e};Object.defineProperty(ys,"__esModule",{value:!0});ys.rlp=void 0;Il(VG(),ys);Il(uN(),ys);Il(tV(),ys);Il(g9(),ys);Il(BV(),ys);Il(Mw(),ys);Il(y9(),ys);ys.rlp=Cge(sN());Il(uy(),ys)});var B9=R(bp=>{"use strict";b();p();Object.defineProperty(bp,"__esModule",{value:!0});bp.BaseTransaction=bp.Chain=void 0;var ji=gu(),hp=qr(),NV;(function(r){r[r.Mainnet=1]="Mainnet",r[r.Ropsten=3]="Ropsten",r[r.Rinkeby=4]="Rinkeby",r[r.Kovan=42]="Kovan",r[r.Goerli=5]="Goerli",r[r.Sepolia=11155111]="Sepolia"})(NV=bp.Chain||(bp.Chain={}));var bN=class{constructor(e){this.activeCapabilities=[],this.DEFAULT_CHAIN=NV.Mainnet;let{nonce:t,gasLimit:n,to:s,value:i,data:a,v:o,r:c,s:u,type:f}=e;this._type=new hp.BN((0,ji.toBuffer)(f)).toNumber();let d=(0,ji.toBuffer)(s===""?"0x":s),g=(0,ji.toBuffer)(o===""?"0x":o),h=(0,ji.toBuffer)(c===""?"0x":c),m=(0,ji.toBuffer)(u===""?"0x":u);this.nonce=new hp.BN((0,ji.toBuffer)(t===""?"0x":t)),this.gasLimit=new hp.BN((0,ji.toBuffer)(n===""?"0x":n)),this.to=d.length>0?new ji.Address(d):void 0,this.value=new hp.BN((0,ji.toBuffer)(i===""?"0x":i)),this.data=(0,ji.toBuffer)(a===""?"0x":a),this.v=g.length>0?new hp.BN(g):void 0,this.r=h.length>0?new hp.BN(h):void 0,this.s=m.length>0?new hp.BN(m):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0)}get transactionType(){return this.type}get type(){return this._type}isSigned(){let{v:e,r:t,s:n}=this;return this.type===0?!(!e||!t||!n):!(e===void 0||!t||!n)}sign(e){if(e.length!==32){let a=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(a)}let t=this.getMessageToSign(!0),{v:n,r:s,s:i}=(0,ji.ecdsaSign)(t,e);return this._processSignature(n,s,i)}_validateCannotExceedMaxInteger(e,t=256,n=!1){for(let[s,i]of Object.entries(e))switch(t){case 64:if(n){if(i?.gte(ji.MAX_UINT64)){let a=this._errorMsg(`${s} cannot equal or exceed MAX_UINT64 (2^64-1), given ${i}`);throw new Error(a)}}else if(i?.gt(ji.MAX_UINT64)){let a=this._errorMsg(`${s} cannot exceed MAX_UINT64 (2^64-1), given ${i}`);throw new Error(a)}break;case 256:if(n){if(i?.gte(ji.MAX_INTEGER)){let a=this._errorMsg(`${s} cannot equal or exceed MAX_INTEGER (2^256-1), given ${i}`);throw new Error(a)}}else if(i?.gt(ji.MAX_INTEGER)){let a=this._errorMsg(`${s} cannot exceed MAX_INTEGER (2^256-1), given ${i}`);throw new Error(a)}break;default:{let a=this._errorMsg("unimplemented bits value");throw new Error(a)}}}_getSharedErrorPostfix(){let e="";try{e=this.isSigned()?(0,ji.bufferToHex)(this.hash()):"not available (unsigned)"}catch{e="error"}let t="";try{t=this.isSigned().toString()}catch{e="error"}let n=`tx type=${this.type} hash=${e} nonce=${this.nonce} value=${this.value} `;return n+=`signed=${t}`,n}processSignature(e,t,n){return this._processSignature(e,t,n)}processSignatureWithRawV(e,t,n){return this._processSignatureWithRawV(e,t,n)}};bp.BaseTransaction=bN});var IV=R(pN=>{"use strict";b();p();Object.defineProperty(pN,"__esModule",{value:!0});var _r=gu(),Lge=B9(),Rl=qr(),Uge=0,jl=class extends Lge.BaseTransaction{static fromTxData(e){return new jl(e)}static fromSerializedTx(e,t){let n=_r.rlp.decode(e);if(!Array.isArray(n))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(n,t)}static fromValuesArray(e,t){if(e.length!==6&&e.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");let[n,s,i,a,o,c,u,f,d]=e;return(0,_r.validateNoLeadingZeroes)({nonce:n,gasPrice:s,gasLimit:i,value:o,v:u,r:f,s:d}),new jl({nonce:n,gasPrice:s,gasLimit:i,to:a,value:o,data:c,v:u,r:f,s:d,chainId:t})}constructor(e){if(super({...e,type:Uge}),this.gasPrice=new Rl.BN((0,_r.toBuffer)(e.gasPrice===""?"0x":e.gasPrice)),this.chainId=new Rl.BN((0,_r.toBuffer)(e.chainId===""?"0x":e.chainId)),this.gasPrice.mul(this.gasLimit).gt(_r.MAX_INTEGER)){let t=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(t)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice})}raw(){return[(0,_r.bnToUnpaddedBuffer)(this.nonce),(0,_r.bnToUnpaddedBuffer)(this.gasPrice),(0,_r.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:v.Buffer.from([]),(0,_r.bnToUnpaddedBuffer)(this.value),this.data,this.v!==void 0?(0,_r.bnToUnpaddedBuffer)(this.v):v.Buffer.from([]),this.r!==void 0?(0,_r.bnToUnpaddedBuffer)(this.r):v.Buffer.from([]),this.s!==void 0?(0,_r.bnToUnpaddedBuffer)(this.s):v.Buffer.from([])]}serialize(){return _r.rlp.encode(this.raw())}_getMessageToSign(){return[(0,_r.bnToUnpaddedBuffer)(this.nonce),(0,_r.bnToUnpaddedBuffer)(this.gasPrice),(0,_r.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:v.Buffer.from([]),(0,_r.bnToUnpaddedBuffer)(this.value),this.data,(0,_r.toBuffer)(this.chainId),(0,_r.unpadBuffer)((0,_r.toBuffer)(0)),(0,_r.unpadBuffer)((0,_r.toBuffer)(0))]}getMessageToSign(e=!0){let t=this._getMessageToSign();return e?(0,_r.rlphash)(t):t}hash(){return(0,_r.rlphash)(this.raw())}_processSignature(e,t,n){let s=new Rl.BN(2*this.chainId.toNumber()+e+8);return jl.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,chainId:this.chainId,v:s,r:new Rl.BN(t),s:new Rl.BN(n)})}_processSignatureWithRawV(e,t,n){return jl.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,chainId:this.chainId,v:new Rl.BN(e),r:new Rl.BN(t),s:new Rl.BN(n)})}toJSON(){return{nonce:(0,_r.bnToHex)(this.nonce),gasPrice:(0,_r.bnToHex)(this.gasPrice),gasLimit:(0,_r.bnToHex)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,_r.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:this.v!==void 0?(0,_r.bnToHex)(this.v):void 0,r:this.r!==void 0?(0,_r.bnToHex)(this.r):void 0,s:this.s!==void 0?(0,_r.bnToHex)(this.s):void 0}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` gasPrice=${this.gasPrice}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}};pN.default=jl});var gN=R(dy=>{"use strict";b();p();Object.defineProperty(dy,"__esModule",{value:!0});dy.isAccessList=dy.isAccessListBuffer=void 0;function RV(r){if(r.length===0)return!0;let e=r[0];return!!Array.isArray(e)}dy.isAccessListBuffer=RV;function Fge(r){return!RV(r)}dy.isAccessList=Fge});var yN=R(k9=>{"use strict";b();p();Object.defineProperty(k9,"__esModule",{value:!0});k9.AccessLists=void 0;var ly=gu(),qge=gN(),xN=class{static getAccessListData(e){let t,n;if(e&&(0,qge.isAccessList)(e)){t=e;let s=[];for(let i=0;i<e.length;i++){let a=e[i],o=(0,ly.toBuffer)(a.address),c=[];for(let u=0;u<a.storageKeys.length;u++)c.push((0,ly.toBuffer)(a.storageKeys[u]));s.push([o,c])}n=s}else{n=e??[];let s=[];for(let i=0;i<n.length;i++){let a=n[i],o=(0,ly.bufferToHex)(a[0]),c=[];for(let f=0;f<a[1].length;f++)c.push((0,ly.bufferToHex)(a[1][f]));let u={address:o,storageKeys:c};s.push(u)}t=s}return{AccessListJSON:t,accessList:n}}static verifyAccessList(e){for(let t=0;t<e.length;t++){let n=e[t],s=n[0],i=n[1];if(n[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(s.length!=20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let a=0;a<i.length;a++)if(i[a].length!=32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}}static getAccessListJSON(e){let t=[];for(let n=0;n<e.length;n++){let s=e[n],i={address:"0x"+(0,ly.setLengthLeft)(s[0],20).toString("hex"),storageKeys:[]},a=s[1];for(let o=0;o<a.length;o++){let c=a[o];i.storageKeys.push("0x"+(0,ly.setLengthLeft)(c,32).toString("hex"))}t.push(i)}return t}};k9.AccessLists=xN});var jV=R(PN=>{"use strict";b();p();Object.defineProperty(PN,"__esModule",{value:!0});var Vr=gu(),W0=qr(),Dge=B9(),mN=yN(),vN=1,wN=v.Buffer.from(vN.toString(16).padStart(2,"0"),"hex"),$0=class extends Dge.BaseTransaction{static fromTxData(e){return new $0(e)}static fromSerializedTx(e){if(!e.slice(0,1).equals(wN))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${vN}, received: ${e.slice(0,1).toString("hex")}`);let t=Vr.rlp.decode(e.slice(1));if(!Array.isArray(t))throw new Error("Invalid serialized tx input: must be array");return $0.fromValuesArray(t)}static fromValuesArray(e){if(e.length!==8&&e.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");let[t,n,s,i,a,o,c,u,f,d,g]=e;(0,Vr.validateNoLeadingZeroes)({nonce:n,gasPrice:s,gasLimit:i,value:o,v:f,r:d,s:g});let h=[];return new $0({chainId:new W0.BN(t),nonce:n,gasPrice:s,gasLimit:i,to:a,value:o,data:c,accessList:u??h,v:f!==void 0?new W0.BN(f):void 0,r:d,s:g})}constructor(e){super({...e,type:vN});let{chainId:t,accessList:n,gasPrice:s}=e;this.chainId=(0,Vr.toType)(t,Vr.TypeOutput.BN),this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);let i=mN.AccessLists.getAccessListData(n??[]);if(this.accessList=i.accessList,this.AccessListJSON=i.AccessListJSON,mN.AccessLists.verifyAccessList(this.accessList),this.gasPrice=new W0.BN((0,Vr.toBuffer)(s===""?"0x":s)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),this.gasPrice.mul(this.gasLimit).gt(Vr.MAX_INTEGER)){let a=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(a)}if(this.v&&!this.v.eqn(0)&&!this.v.eqn(1)){let a=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(a)}}raw(){return[(0,Vr.bnToUnpaddedBuffer)(this.chainId),(0,Vr.bnToUnpaddedBuffer)(this.nonce),(0,Vr.bnToUnpaddedBuffer)(this.gasPrice),(0,Vr.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:v.Buffer.from([]),(0,Vr.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,this.v!==void 0?(0,Vr.bnToUnpaddedBuffer)(this.v):v.Buffer.from([]),this.r!==void 0?(0,Vr.bnToUnpaddedBuffer)(this.r):v.Buffer.from([]),this.s!==void 0?(0,Vr.bnToUnpaddedBuffer)(this.s):v.Buffer.from([])]}serialize(){let e=this.raw();return v.Buffer.concat([wN,Vr.rlp.encode(e)])}getMessageToSign(e=!0){let t=this.raw().slice(0,8),n=v.Buffer.concat([wN,Vr.rlp.encode(t)]);return e?(0,Vr.keccak256)(n):n}hash(){if(!this.isSigned()){let e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return(0,Vr.keccak256)(this.serialize())}_processSignature(e,t,n){return $0.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new W0.BN(e-27),r:new W0.BN(t),s:new W0.BN(n)})}_processSignatureWithRawV(e,t,n){return $0.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new W0.BN(e),r:new W0.BN(t),s:new W0.BN(n)})}toJSON(){let e=mN.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,Vr.bnToHex)(this.chainId),nonce:(0,Vr.bnToHex)(this.nonce),gasPrice:(0,Vr.bnToHex)(this.gasPrice),gasLimit:(0,Vr.bnToHex)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,Vr.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:this.v!==void 0?(0,Vr.bnToHex)(this.v):void 0,r:this.r!==void 0?(0,Vr.bnToHex)(this.r):void 0,s:this.s!==void 0?(0,Vr.bnToHex)(this.s):void 0}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` gasPrice=${this.gasPrice} accessListCount=${this.accessList?.length??0}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}};PN.default=$0});var MV=R(AN=>{"use strict";b();p();Object.defineProperty(AN,"__esModule",{value:!0});var Hge=gu(),Kge=qr(),pp=EN(),_N=class{static fromTxData(e){if(!("type"in e)||e.type===void 0)return pp.Transaction.fromTxData(e);{let t=new Kge.BN((0,Hge.toBuffer)(e.type)).toNumber();if(t===0)return pp.Transaction.fromTxData(e);if(t===1)return pp.AccessListEIP2930Transaction.fromTxData(e);if(t===2)return pp.FeeMarketEIP1559Transaction.fromTxData(e);throw new Error(`Tx instantiation with type ${t} not supported`)}}static fromSerializedData(e,t){if(e[0]<=127){let n;switch(e[0]){case 1:n=2930;break;case 2:n=1559;break;default:throw new Error(`TypedTransaction with ID ${e[0]} unknown`)}return n===1559?pp.FeeMarketEIP1559Transaction.fromSerializedTx(e):pp.AccessListEIP2930Transaction.fromSerializedTx(e)}else return pp.Transaction.fromSerializedTx(e,t)}};AN.default=_N});var CV=R(BN=>{"use strict";b();p();Object.defineProperty(BN,"__esModule",{value:!0});var Sr=gu(),Cf=qr(),Gge=B9(),SN=yN(),ON=2,TN=v.Buffer.from(ON.toString(16).padStart(2,"0"),"hex"),J0=class extends Gge.BaseTransaction{static fromTxData(e){return new J0(e)}static fromSerializedTx(e){if(!e.slice(0,1).equals(TN))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${ON}, received: ${e.slice(0,1).toString("hex")}`);let t=Sr.rlp.decode(e.slice(1));if(!Array.isArray(t))throw new Error("Invalid serialized tx input: must be array");return J0.fromValuesArray(t)}static fromValuesArray(e){if(e.length!==9&&e.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");let[t,n,s,i,a,o,c,u,f,d,g,h]=e;return(0,Sr.validateNoLeadingZeroes)({nonce:n,maxPriorityFeePerGas:s,maxFeePerGas:i,gasLimit:a,value:c,v:d,r:g,s:h}),new J0({chainId:new Cf.BN(t),nonce:n,maxPriorityFeePerGas:s,maxFeePerGas:i,gasLimit:a,to:o,value:c,data:u,accessList:f??[],v:d!==void 0?new Cf.BN(d):void 0,r:g,s:h})}constructor(e){super({...e,type:ON});let{chainId:t,accessList:n,maxFeePerGas:s,maxPriorityFeePerGas:i}=e;this.chainId=(0,Sr.toType)(t,Sr.TypeOutput.BN),this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);let a=SN.AccessLists.getAccessListData(n??[]);if(this.accessList=a.accessList,this.AccessListJSON=a.AccessListJSON,SN.AccessLists.verifyAccessList(this.accessList),this.maxFeePerGas=new Cf.BN((0,Sr.toBuffer)(s===""?"0x":s)),this.maxPriorityFeePerGas=new Cf.BN((0,Sr.toBuffer)(i===""?"0x":i)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),this.gasLimit.mul(this.maxFeePerGas).gt(Sr.MAX_INTEGER)){let o=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(o)}if(this.maxFeePerGas.lt(this.maxPriorityFeePerGas)){let o=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(o)}if(this.v&&!this.v.eqn(0)&&!this.v.eqn(1)){let o=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(o)}}raw(){return[(0,Sr.bnToUnpaddedBuffer)(this.chainId),(0,Sr.bnToUnpaddedBuffer)(this.nonce),(0,Sr.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,Sr.bnToUnpaddedBuffer)(this.maxFeePerGas),(0,Sr.bnToUnpaddedBuffer)(this.gasLimit),this.to!==void 0?this.to.buf:v.Buffer.from([]),(0,Sr.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,this.v!==void 0?(0,Sr.bnToUnpaddedBuffer)(this.v):v.Buffer.from([]),this.r!==void 0?(0,Sr.bnToUnpaddedBuffer)(this.r):v.Buffer.from([]),this.s!==void 0?(0,Sr.bnToUnpaddedBuffer)(this.s):v.Buffer.from([])]}serialize(){let e=this.raw();return v.Buffer.concat([TN,Sr.rlp.encode(e)])}getMessageToSign(e=!0){let t=this.raw().slice(0,9),n=v.Buffer.concat([TN,Sr.rlp.encode(t)]);return e?(0,Sr.keccak256)(n):n}hash(){if(!this.isSigned()){let e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return(0,Sr.keccak256)(this.serialize())}_processSignature(e,t,n){return J0.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new Cf.BN(e-27),r:new Cf.BN(t),s:new Cf.BN(n)})}_processSignatureWithRawV(e,t,n){return J0.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new Cf.BN(e),r:new Cf.BN(t),s:new Cf.BN(n)})}toJSON(){let e=SN.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,Sr.bnToHex)(this.chainId),nonce:(0,Sr.bnToHex)(this.nonce),maxPriorityFeePerGas:(0,Sr.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,Sr.bnToHex)(this.maxFeePerGas),gasLimit:(0,Sr.bnToHex)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,Sr.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:this.v!==void 0?(0,Sr.bnToHex)(this.v):void 0,r:this.r!==void 0?(0,Sr.bnToHex)(this.r):void 0,s:this.s!==void 0?(0,Sr.bnToHex)(this.s):void 0}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}};BN.default=J0});var EN=R(xi=>{"use strict";b();p();var Vge=xi&&xi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),zge=xi&&xi.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Vge(e,r,t)},N9=xi&&xi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xi,"__esModule",{value:!0});xi.FeeMarketEIP1559Transaction=xi.TransactionFactory=xi.AccessListEIP2930Transaction=xi.Transaction=void 0;var Wge=IV();Object.defineProperty(xi,"Transaction",{enumerable:!0,get:function(){return N9(Wge).default}});var $ge=jV();Object.defineProperty(xi,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return N9($ge).default}});var Jge=MV();Object.defineProperty(xi,"TransactionFactory",{enumerable:!0,get:function(){return N9(Jge).default}});var Zge=CV();Object.defineProperty(xi,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return N9(Zge).default}});zge(gN(),xi)});var kN=R(ka=>{"use strict";b();p();var LV=ka&&ka.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Qge=ka&&ka.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),UV=ka&&ka.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&LV(e,r,t)},Yge=ka&&ka.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&LV(e,r,t);return Qge(e,r),e};Object.defineProperty(ka,"__esModule",{value:!0});ka.sigUtil=void 0;UV(gu(),ka);UV(EN(),ka);ka.sigUtil=Yge(fp())});var NN=R(fo=>{"use strict";b();p();var Xge=fo&&fo.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),exe=fo&&fo.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),qV=fo&&fo.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Xge(e,r,t);return exe(e,r),e};Object.defineProperty(fo,"__esModule",{value:!0});fo.hashMessage=fo.MessageTypes=void 0;var Dw=qV(fp()),hy=qV(gu()),FV=qr(),by;(function(r){r[r.ETH_SIGN=0]="ETH_SIGN",r[r.PERSONAL_SIGN=1]="PERSONAL_SIGN",r[r.TYPE_DATA_V1=2]="TYPE_DATA_V1",r[r.TYPE_DATA_V3=3]="TYPE_DATA_V3",r[r.TYPE_DATA_V4=4]="TYPE_DATA_V4"})(by=fo.MessageTypes||(fo.MessageTypes={}));var txe=(r,e)=>{switch(r){case by.ETH_SIGN:return hy.addHexPrefix(e);case by.PERSONAL_SIGN:{let t=FV.base.isHexString(e)?FV.base.fromHex(e):v.Buffer.from(e);return hy.addHexPrefix(hy.hashPersonalMessage(t).toString("hex"))}case by.TYPE_DATA_V1:return hy.addHexPrefix(Dw.typedSignatureHash(JSON.parse(e)));case by.TYPE_DATA_V3:return hy.addHexPrefix(Dw.TypedDataUtils.eip712Hash(JSON.parse(e),Dw.SignTypedDataVersion.V3).toString("hex"));case by.TYPE_DATA_V4:return hy.addHexPrefix(Dw.TypedDataUtils.eip712Hash(JSON.parse(e),Dw.SignTypedDataVersion.V4).toString("hex"));default:throw new Error(`Invalid messageType: ${r}`)}};fo.hashMessage=txe});var GV=R(zr=>{"use strict";b();p();Object.defineProperty(zr,"__esModule",{value:!0});zr.validSignedTransaction=zr.getSignHash=zr.getSignedTransaction=zr.getMPCSignedMessage=zr.getMPCTransaction=zr.verifyMessage=zr.signMPCMessage=zr.signMessage=zr.signTransaction=zr.validAddress=zr.validPrivateKey=zr.getNewAddress=void 0;var Vt=qr(),lo=kN(),Z0=NN(),DV=fp(),py=Oce();function rxe(r){if(!HV(r))throw new Error("invalid key");let e=Vt.base.fromHex(r),t=(0,lo.privateToPublicRaw)(e),n=(0,lo.publicToAddress)(t.slice(1));return{address:Vt.base.toHex(n,!0),publicKey:Vt.base.toHex(t,!0)}}zr.getNewAddress=rxe;function HV(r){if(!Vt.base.validateHexString(r))return!1;let e=Vt.base.fromHex(r.toLowerCase());return!(e.length!=32||e.every(t=>t===0))}zr.validPrivateKey=HV;function nxe(r){let e="",t=(0,lo.isValidAddress)(r);return e=(0,lo.toChecksumAddress)(r),{isValid:t,address:e}}zr.validAddress=nxe;function sxe(r,e){let t=lo.TransactionFactory.fromTxData(e);if(!r)return{raw:Vt.base.toHex(v.Buffer.from(JSON.stringify(e))),hash:Vt.base.toHex(t.getMessageToSign(!0)),serializeRaw:Vt.base.toHex(t.serialize())};let n=Vt.base.fromHex(r),s=t.sign(n);return Vt.base.toHex(s.serialize(),!0)}zr.signTransaction=sxe;function ixe(r,e,t){if(!t)return KV(r,e);if(r==Z0.MessageTypes.TYPE_DATA_V1)return(0,py.signTypedMessage)(t,{data:JSON.parse(e)},"V1");if(r==Z0.MessageTypes.TYPE_DATA_V3)return(0,py.signTypedMessage)(t,{data:JSON.parse(e)},"V3");if(r==Z0.MessageTypes.TYPE_DATA_V4)return(0,py.signTypedMessage)(t,{data:JSON.parse(e)},"V4");let n=(0,Z0.hashMessage)(r,e),{v:s,r:i,s:a}=(0,lo.ecdsaSign)(Vt.base.fromHex(n),t);return(0,lo.makeSignature)(s,i,a)}zr.signMessage=ixe;function KV(r,e){return r==Z0.MessageTypes.TYPE_DATA_V1?(0,py.typedSignatureHash)(JSON.parse(e)):r==Z0.MessageTypes.TYPE_DATA_V3?Vt.base.toHex(py.TypedDataUtils.sign(JSON.parse(e),!1)):r==Z0.MessageTypes.TYPE_DATA_V4?Vt.base.toHex(py.TypedDataUtils.sign(JSON.parse(e))):(0,Z0.hashMessage)(r,e)}zr.signMPCMessage=KV;function axe(r,e,t){let n=(0,Z0.hashMessage)(r,e),[s,i,a]=[t.slice(0,32),t.slice(32,64),t[64]];return(0,lo.recoverFromSignature)(Vt.base.fromHex(n),a,s,i)}zr.verifyMessage=axe;function oxe(r,e,t){let n=lo.TransactionFactory.fromTxData(JSON.parse(Vt.base.fromHex(r).toString())),s=n.getMessageToSign(!0),i=Vt.base.fromHex(e),a=i.slice(0,32),o=i.slice(32,64),c=Vt.signUtil.secp256k1.getV(s,Vt.base.toHex(a),Vt.base.toHex(o),Vt.base.fromHex(t));return n=n.processSignature(c+27,a,o),Vt.base.toHex(n.serialize(),!0)}zr.getMPCTransaction=oxe;function cxe(r,e,t){let n=Vt.base.fromHex(e),s=n.slice(0,32),i=n.slice(32,64),a=Vt.signUtil.secp256k1.getV(Vt.base.fromHex(r),Vt.base.toHex(s),Vt.base.toHex(i),Vt.base.fromHex(t))+27;return(0,lo.makeSignature)(a,s,i)}zr.getMPCSignedMessage=cxe;function uxe(r,e,t,n){let s=lo.TransactionFactory.fromSerializedData(Vt.base.fromHex(r));return s=s.processSignatureWithRawV(parseInt(n,16),Vt.base.fromHex(e),Vt.base.fromHex(t)),Vt.base.toHex(s.serialize(),!0)}zr.getSignedTransaction=uxe;function fxe(r){let e=lo.TransactionFactory.fromSerializedData(Vt.base.fromHex(r));return Vt.base.toHex(e.getMessageToSign(!0))}zr.getSignHash=fxe;function dxe(r,e,t){let n=lo.TransactionFactory.fromSerializedData(Vt.base.fromHex(r),e),s=n.getMessageToSign(!0),i=(0,DV.padWithZeroes)(Vt.base.toHex(n.r.toArrayLike(v.Buffer)),64),a=(0,DV.padWithZeroes)(Vt.base.toHex(n.s.toArrayLike(v.Buffer)),64),o=Vt.base.fromHex(i.concat(a));return t&&!Vt.signUtil.secp256k1.verifyWithNoRecovery(s,o,Vt.base.fromHex(t))?new Error("signature error"):n}zr.validSignedTransaction=dxe});var IN=R(Hw=>{"use strict";b();p();Object.defineProperty(Hw,"__esModule",{value:!0});Hw.SignType=void 0;var lxe;(function(r){r[r.Secp256k1=1]="Secp256k1",r[r.ECDSA_P256=2]="ECDSA_P256",r[r.ED25519=3]="ED25519",r[r.StarknetSignType=4]="StarknetSignType",r[r.TezosSignType=5]="TezosSignType"})(lxe=Hw.SignType||(Hw.SignType={}))});var VV=R(Jo=>{"use strict";b();p();Object.defineProperty(Jo,"__esModule",{value:!0});Jo.CoinCurveMap=Jo.MultiAddressCoins=Jo.segwitType=Jo.Currency=void 0;var Zt;(function(r){r[r.NULL=-1]="NULL",r[r.BTC=0]="BTC",r[r.TBTC=1]="TBTC",r[r.ETH=60]="ETH",r[r.LTC=2]="LTC",r[r.DOGE=3]="DOGE",r[r.BCH=145]="BCH",r[r.BSV=236]="BSV",r[r.TRX=195]="TRX",r[r.SOL=501]="SOL",r[r.APTOS=637]="APTOS",r[r.OMNI_USDT=20001]="OMNI_USDT",r[r.OMNI_USDT_TEST=20002]="OMNI_USDT_TEST",r[r.SUI=784]="SUI",r[r.ATOM=118]="ATOM",r[r.OSMO=1e3]="OSMO",r[r.EVMOS=1001]="EVMOS",r[r.AXL=1002]="AXL",r[r.CRO=1003]="CRO",r[r.Iris=1004]="Iris",r[r.Juno=1005]="Juno",r[r.Kava=1006]="Kava",r[r.Kujira=1007]="Kujira",r[r.SCRT=1008]="SCRT",r[r.Stargaze=1009]="Stargaze",r[r.Terra=1010]="Terra",r[r.ZKSPACE=1011]="ZKSPACE",r[r.ZKSYNC=804]="ZKSYNC",r[r.Stx=5757]="Stx",r[r.SEI=2837]="SEI",r[r.WAX=14001]="WAX",r[r.Starknet=9004]="Starknet",r[r.ADA=1815]="ADA",r[r.INJ=2892]="INJ",r[r.Celestia=2854]="Celestia",r[r.DYDX=2897]="DYDX",r[r.Kaspa=111111]="Kaspa",r[r.TON=607]="TON",r[r.NostrAssets=1237]="NostrAssets",r[r.Near=397]="Near"})(Zt=Jo.Currency||(Jo.Currency={}));var hxe;(function(r){r[r.SEGWIT_NESTED=1]="SEGWIT_NESTED",r[r.SEGWIT_NESTED_49=2]="SEGWIT_NESTED_49",r[r.SEGWIT_NATIVE=3]="SEGWIT_NATIVE",r[r.SEGWIT_TAPROOT=4]="SEGWIT_TAPROOT"})(hxe=Jo.segwitType||(Jo.segwitType={}));Jo.MultiAddressCoins=[Zt.BTC,Zt.TBTC,Zt.LTC,Zt.DOGE,Zt.BSV,Zt.OMNI_USDT,Zt.OMNI_USDT_TEST];var fn="secp256k1",I9="ed25519";Jo.CoinCurveMap=new Map([[Zt.BTC,fn],[Zt.TBTC,fn],[Zt.ETH,fn],[Zt.LTC,fn],[Zt.DOGE,fn],[Zt.BCH,fn],[Zt.BSV,fn],[Zt.TRX,fn],[Zt.OMNI_USDT,fn],[Zt.OMNI_USDT_TEST,fn],[Zt.ATOM,fn],[Zt.OSMO,fn],[Zt.EVMOS,fn],[Zt.AXL,fn],[Zt.CRO,fn],[Zt.Iris,fn],[Zt.Juno,fn],[Zt.Kava,fn],[Zt.Kujira,fn],[Zt.SCRT,fn],[Zt.Stargaze,fn],[Zt.Terra,fn],[Zt.SEI,fn],[Zt.Celestia,fn],[Zt.DYDX,fn],[Zt.SOL,I9],[Zt.APTOS,I9],[Zt.SUI,I9],[Zt.TON,I9]])});var RN=R(je=>{"use strict";b();p();Object.defineProperty(je,"__esModule",{value:!0});je.SignCommonMsgError=je.EstimateFeeError=je.validSignedTransactionError=je.GetPayLoadError=je.HardwareDerivePubKeyError=je.CalcTxHashError=je.SignMsgStep3Error=je.SignMsgSetupError=je.Ed25519Step3Error=je.Ed25519Step2Error=je.Ed25519Step1Error=je.Ed25519SetupError=je.EcdsaStep3Error=je.EcdsaStep2Error=je.EcdsaStep1Error=je.EcdsaSetupError=je.MPCShakeHandsError=je.MPCStepError=je.MPCAesKeyMissError=je.GetHardWareMessageHashError=je.GetHardwareSignedTransactionError=je.GetHardwareRawTransactionError=je.GetMpcTransactionError=je.GetMpcRawTransactionError=je.DerivePathError=je.GenMnemonicError=je.GenPrivateKeyError=je.UnsupportedCoinError=je.SignMsgError=je.SignTxError=je.ValidAddressError=je.NewAddressError=je.NotImplementedError=void 0;je.NotImplementedError="no implementation method";je.NewAddressError="generate address error";je.ValidAddressError="valid address error";je.SignTxError="sign tx error";je.SignMsgError="sign message error";je.UnsupportedCoinError="unsupported currency";je.GenPrivateKeyError="generate private key error";je.GenMnemonicError="generate mnemonic error";je.DerivePathError="derive hdPath error";je.GetMpcRawTransactionError="get mpc raw transaction error";je.GetMpcTransactionError="get mpc transaction error";je.GetHardwareRawTransactionError="get hardware raw transaction error";je.GetHardwareSignedTransactionError="get hardware signed transaction error";je.GetHardWareMessageHashError="get hardware message hash error";je.MPCAesKeyMissError="mpc get aes key error";je.MPCStepError="mpc step error";je.MPCShakeHandsError="mpc shake hands error";je.EcdsaSetupError="ecdsa setup error";je.EcdsaStep1Error="ecdsa step1 error";je.EcdsaStep2Error="ecdsa step2 error";je.EcdsaStep3Error="ecdsa step3 error";je.Ed25519SetupError="ed25519 setup error";je.Ed25519Step1Error="ed25519 step1 error";je.Ed25519Step2Error="ed25519 step2 error";je.Ed25519Step3Error="ed25519 step3 error";je.SignMsgSetupError="sign message setup error";je.SignMsgStep3Error="sign message step3 error";je.CalcTxHashError="calculate tx hash error";je.HardwareDerivePubKeyError="derive sub pub key error";je.GetPayLoadError="get payload error";je.validSignedTransactionError="valid signed transaction error";je.EstimateFeeError="estimate fee error";je.SignCommonMsgError="sign common msg error"});var zV=R(Na=>{"use strict";b();p();Object.defineProperty(Na,"__esModule",{value:!0});Na.jsonStringifyUniform=Na.cloneObject=Na.assertBufferLength=Na.convert2BigNumber=Na.convert2Number=Na.buildCommonSignMsg=void 0;var R9=qr();function bxe(r,e){return`OKX Wallet Sign In
publicKey: ${r}
walletId: ${e}
host: api.wallet.okx
OKX Wallet Sign In`}Na.buildCommonSignMsg=bxe;function pxe(r){if(r!=null)return typeof r=="string"?parseInt(r):r}Na.convert2Number=pxe;function gxe(r){if(r!=null)return R9.BigNumber.isBigNumber(r)?r:new R9.BigNumber(r)}Na.convert2BigNumber=gxe;function xxe(r,e){if(r.length!=e)throw Error("buffer length is illegal")}Na.assertBufferLength=xxe;function yxe(r){return JSON.parse(JSON.stringify(r))}Na.cloneObject=yxe;function mxe(r){return JSON.stringify(r,(e,t)=>t&&(t.type==="Buffer"||t instanceof Uint8Array?R9.base.toHex(t):typeof t=="bigint"?t.toString():t))}Na.jsonStringifyUniform=mxe});var jN=R(gp=>{"use strict";b();p();var wxe=gp&&gp.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),vxe=gp&&gp.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&wxe(e,r,t)};Object.defineProperty(gp,"__esModule",{value:!0});vxe(zV(),gp)});var QV=R(Bn=>{"use strict";b();p();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.SimpleWallet=Bn.BaseWallet=Bn.ecdsaSign=Bn.fromSigned=Bn.padWithZeroes=Bn.toUnsigned=Bn.intToHex=Bn.makeSignature=Bn.secp256k1SignTest=void 0;var ms=RN(),gy=IN(),ws=qr(),Pxe=jN();function WV(r){let e=ws.base.sha256("secp256k1-test"),t=ws.signUtil.secp256k1.publicKeyCreate(r,!1),{signature:n,recovery:s}=ws.signUtil.secp256k1.sign(v.Buffer.from(e),r);return ws.signUtil.secp256k1.verify(e,n,s,t)}Bn.secp256k1SignTest=WV;function $V(r,e,t){let n=(0,Bn.fromSigned)(e),s=(0,Bn.fromSigned)(t),i=r,a=MN((0,Bn.toUnsigned)(n).toString("hex"),64),o=MN((0,Bn.toUnsigned)(s).toString("hex"),64);return ws.base.stripHexPrefix(JV(i)).concat(a,o)}Bn.makeSignature=$V;function JV(r){return`0x${r.toString(16)}`}Bn.intToHex=JV;var _xe=function(r){return v.Buffer.from(r.toTwos(256).toArray())};Bn.toUnsigned=_xe;function MN(r,e){if(r!==""&&!/^[a-f0-9]+$/iu.test(r))throw new Error(`Expected an unprefixed hex string. Received: ${r}`);if(e<0)throw new Error(`Expected a non-negative integer target length. Received: ${e}`);return String.prototype.padStart.call(r,e,"0")}Bn.padWithZeroes=MN;var Axe=function(r){return new ws.BN(r).fromTwos(256)};Bn.fromSigned=Axe;function ZV(r,e,t){let{signature:n,recovery:s}=ws.signUtil.secp256k1.sign(r,e),i=v.Buffer.from(n.slice(0,32)),a=v.Buffer.from(n.slice(32,64));if(t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{v:t?s+(t*2+35):s+27,r:i,s:a}}Bn.ecdsaSign=ZV;var j9=class{getRandomPrivateKey(){try{for(;;){let e=ws.base.randomBytes(32);if(WV(e))return Promise.resolve(ws.base.toHex(e,!0))}}catch{}return Promise.reject(ms.GenPrivateKeyError)}getDerivedPrivateKey(e){return ws.bip39.mnemonicToSeed(e.mnemonic).then(t=>{let n=ws.bip32.fromSeed(t).derivePath(e.hdPath);if(n.privateKey){let s=ws.base.toHex(n.privateKey);return Promise.resolve("0x"+s)}else return Promise.reject(ms.GenPrivateKeyError)}).catch(t=>Promise.reject(ms.GenPrivateKeyError))}getDerivedPath(e){return Promise.reject(ms.NotImplementedError)}validPrivateKey(e){return Promise.reject(ms.NotImplementedError)}signMessage(e){return Promise.reject(ms.NotImplementedError)}async signCommonMsg(e){e.signType||(e.signType=gy.SignType.Secp256k1);let t;if(e.message.text)t=e.message.text;else{let o;if(e.publicKey?o=e.publicKey:o=(await this.getNewAddress({privateKey:e.privateKey,addressType:e.addressType,hrp:e.hrp,version:e.version})).publicKey,o.startsWith("0x")&&(o=o.substring(2)),!e.message.walletId)return Promise.reject("invalid walletId");t=(0,Pxe.buildCommonSignMsg)(o,e.message.walletId)}let n=ws.base.magicHash(t),s=e.privateKeyHex?e.privateKeyHex:e.privateKey,i=ws.base.fromHex(s);var a;switch(e.signType){case gy.SignType.Secp256k1:let{v:o,r:c,s:u}=ZV(v.Buffer.from(n),i);return Promise.resolve($V(o,c,u));case gy.SignType.ECDSA_P256:return a=ws.signUtil.p256.sign(v.Buffer.from(n),i).signature,Promise.resolve(ws.base.toHex(a));case gy.SignType.ED25519:return a=ws.signUtil.ed25519.sign(n,i),Promise.resolve(ws.base.toHex(a));case gy.SignType.StarknetSignType:return a=ws.signUtil.schnorr.stark.sign(n,i).toCompactRawBytes(),Promise.resolve(ws.base.toHex(a));case gy.SignType.TezosSignType:return Promise.reject("not support")}}verifyMessage(e){return Promise.reject(ms.NotImplementedError)}ecRecover(e,t){return Promise.reject(ms.NotImplementedError)}getAddressByPublicKey(e){return Promise.reject(ms.NotImplementedError)}getMPCRawTransaction(e){return Promise.reject(ms.NotImplementedError)}getMPCTransaction(e){return Promise.reject(ms.NotImplementedError)}getMPCRawMessage(e){return Promise.reject(ms.NotImplementedError)}getMPCSignedMessage(e){return Promise.reject(ms.NotImplementedError)}getHardWareRawTransaction(e){return Promise.reject(ms.NotImplementedError)}getHardWareSignedTransaction(e){return Promise.reject(ms.NotImplementedError)}getHardWareMessageHash(e){return Promise.reject(ms.NotImplementedError)}calcTxHash(e){return Promise.reject(ms.NotImplementedError)}getRawTransaction(e){return Promise.reject(ms.NotImplementedError)}validSignedTransaction(e){return Promise.reject(ms.NotImplementedError)}estimateFee(e){return Promise.reject(ms.NotImplementedError)}};Bn.BaseWallet=j9;var CN=class extends j9{mockData(e,t){this.mockAddress=e,this.mockPublicKey=t}getNewAddress(e){return Promise.resolve({address:this.mockAddress,publicKey:this.mockPublicKey})}validAddress(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}};Bn.SimpleWallet=CN});var YV=R(yu=>{"use strict";b();p();var Exe=yu&&yu.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Kw=yu&&yu.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Exe(e,r,t)};Object.defineProperty(yu,"__esModule",{value:!0});Kw(IN(),yu);Kw(VV(),yu);Kw(RN(),yu);Kw(QV(),yu);Kw(jN(),yu)});var ez=R(Lf=>{"use strict";b();p();var Sxe=Lf&&Lf.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Txe=Lf&&Lf.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Oxe=Lf&&Lf.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Sxe(e,r,t);return Txe(e,r),e};Object.defineProperty(Lf,"__esModule",{value:!0});Lf.EthWallet=void 0;var ea=YV(),yi=qr(),ei=Oxe(UN()),XV="0xa9059cbb",LN=class extends ea.BaseWallet{async getDerivedPath(e){return`m/44'/60'/0'/0/${e.index}`}async getNewAddress(e){let t=e.privateKey;if(!ei.validPrivateKey(t))throw new Error("invalid key");try{let s=yi.base.fromHex(t.toLowerCase());return(0,ea.assertBufferLength)(s,32),Promise.resolve(ei.getNewAddress(t.toLowerCase()))}catch{}return Promise.reject(ea.NewAddressError)}async validPrivateKey(e){let n={isValid:ei.validPrivateKey(e.privateKey),privateKey:e.privateKey};return Promise.resolve(n)}async validAddress(e){return Promise.resolve(ei.validAddress(e.address))}convert2HexString(e){let t;return yi.BigNumber.isBigNumber(e)?t=e:t=new yi.BigNumber(e),yi.base.toBigIntHex(t)}convert2TxParam(e){return{to:e.to,value:this.convert2HexString(e.value||0),nonce:this.convert2HexString(e.nonce),contractAddress:e.contractAddress,gasPrice:this.convert2HexString(e.gasPrice||0),gasLimit:this.convert2HexString(e.gasLimit||0),data:e.data,chainId:this.convert2HexString(e.chainId||1),type:e.type||0,maxPriorityFeePerGas:this.convert2HexString(e.maxPriorityFeePerGas||0),maxFeePerGas:this.convert2HexString(e.maxFeePerGas||0),useValue:e.useValue||!1}}async signTransaction(e){try{let t=e.privateKey;t&&(0,ea.assertBufferLength)(yi.base.fromHex(t),32);let n=this.convert2TxParam(e.data),s=n.chainId,i=n.nonce,a=n.type;if(a===0||a===1){let o=n.gasPrice,c=n.contractAddress,u=n.to,f=n.value,d;c?(d=XV+Array.prototype.map.call(yi.abi.RawEncode(["address","uint256"],[u,f]),h=>`00${h.toString(16)}`.slice(-2)).join(""),n.useValue||(f="0x0"),u=c):d=n.data;let g={nonce:i,gasPrice:o,gasLimit:n.gasLimit,to:u,value:f,data:d,chainId:s,type:a};return Promise.resolve(ei.signTransaction(t,g))}else if(a===2){let o=n.contractAddress,c=n.to,u=n.value,f;o?(f=XV+Array.prototype.map.call(yi.abi.RawEncode(["address","uint256"],[c,u]),g=>`00${g.toString(16)}`.slice(-2)).join(""),u="0x0",c=o):f=n.data;let d={nonce:i,gasLimit:n.gasLimit,to:c,value:u,data:f,chainId:s,type:a,maxPriorityFeePerGas:n.maxPriorityFeePerGas,maxFeePerGas:n.maxFeePerGas};return Promise.resolve(ei.signTransaction(t,d))}return Promise.reject(ea.SignTxError)}catch{return Promise.reject(ea.SignTxError)}}async signMessage(e){let t;e.privateKey&&((0,ea.assertBufferLength)(yi.base.fromHex(e.privateKey),32),t=yi.base.fromHex(e.privateKey));let n=e.data,s=n.type,i=ei.signMessage(s,n.message,t);return Promise.resolve(i)}async verifyMessage(e){let t=e.data,n=await this.ecRecover(t,e.signature),s=e.address||"";return Promise.resolve(s.toLowerCase()===n.toLowerCase())}async ecRecover(e,t){let n=e.type,s=ei.verifyMessage(n,e.message,yi.base.fromHex(t)),i=yi.base.toHex(ei.publicToAddress(s),!0);return Promise.resolve(i)}async encrypt(e,t,n){return Promise.resolve(ei.sigUtil.encrypt({publicKey:e,data:t,version:n}))}async decrypt(e,t){return Promise.resolve(ei.sigUtil.decrypt({encryptedData:e,privateKey:yi.base.stripHexPrefix(t)}))}async getEncryptionPublicKey(e){return Promise.resolve(ei.sigUtil.getEncryptionPublicKey(yi.base.stripHexPrefix(e)))}getAddressByPublicKey(e){return Promise.resolve(yi.base.toHex(ei.publicToAddress(yi.base.fromHex(e.publicKey),!0),!0))}async getMPCRawTransaction(e){try{let t=await this.signTransaction(e);return Promise.resolve({raw:t.raw,hash:t.hash})}catch{return Promise.reject(ea.GetMpcRawTransactionError)}}async getMPCTransaction(e){try{let t=ei.getMPCTransaction(e.raw,e.sigs,e.publicKey);return Promise.resolve(t)}catch{return Promise.reject(ea.GetMpcTransactionError)}}async getMPCRawMessage(e){try{let t=await this.signMessage(e);return Promise.resolve({hash:t})}catch{return Promise.reject(ea.GetMpcRawTransactionError)}}async getMPCSignedMessage(e){try{return Promise.resolve(ei.getMPCSignedMessage(e.hash,e.sigs,e.publicKey))}catch{return Promise.reject(ea.GetMpcTransactionError)}}async getHardWareRawTransaction(e){try{let t=await this.signTransaction(e);return Promise.resolve(t.serializeRaw)}catch{return Promise.reject(ea.GetHardwareRawTransactionError)}}async getHardWareSignedTransaction(e){try{return ei.getSignedTransaction(e.raw,e.r,e.s,e.v)}catch{return Promise.reject(ea.GetHardwareSignedTransactionError)}}async calcTxHash(e){let t=yi.base.fromHex(e.data),n=ei.TransactionFactory.fromSerializedData(t);return Promise.resolve(yi.base.toHex(n.hash(),!0))}async validSignedTransaction(e){try{let t=e.data?e.data.chainId:void 0,n=e.data?e.data.publicKey:void 0,s=ei.validSignedTransaction(e.tx,t,n);return Promise.resolve((0,ea.jsonStringifyUniform)(s))}catch{return Promise.reject(ea.validSignedTransactionError)}}};Lf.EthWallet=LN});var UN=R(Uf=>{"use strict";b();p();var Bxe=Uf&&Uf.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),M9=Uf&&Uf.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Bxe(e,r,t)};Object.defineProperty(Uf,"__esModule",{value:!0});M9(GV(),Uf);M9(NN(),Uf);M9(kN(),Uf);M9(ez(),Uf)});var Gw=R(ta=>{"use strict";b();p();var kxe=ta&&ta.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Nxe=ta&&ta.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),nz=ta&&ta.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&kxe(t,e,n[s]);return Nxe(t,e),t}}();Object.defineProperty(ta,"__esModule",{value:!0});ta.HexStr=ta.RLP=void 0;ta.getTypePrefix=jxe;var Ixe=wB(),tz=mB(),xp=nz(c7()),Rxe=Ice(),rz=nz(Nce());ta.RLP={encode:rz.encode,decode:rz.decode};ta.HexStr={toNumber(r){return tz.BigNumber.from(r).toNumber()},fromNumber(r){return tz.BigNumber.from(r).toHexString()},from(r){return xp.hexlify(r)},concat(...r){return xp.hexlify(xp.concat(r))},isHex(r,e){return xp.isHexString(r,e)},stripZeros(r){return xp.hexlify(xp.stripZeros(r))},zeroPad(r,e){return xp.hexZeroPad(r,e)},withHexPrefix(r){return r.replace(/^(0x)?/,"0x")},stripHexPrefix(r){return r.replace(/^(0x)?/,"")},toAddress(r){return!r||r=="0x"?Rxe.AddressZero:(0,Ixe.getAddress)(r)},toBoolean(r){if(r=="0x")return!1;if(r=="0x01")return!0;throw new Error(`Invalid RLP boolean: '${r}'`)}};function jxe(r){if(!ta.HexStr.isHex(r))throw new Error("Not an RLP encoded string");if(r.length<4)throw new Error("RLP encoded string too short");return ta.HexStr.toNumber(r.substring(0,4))}});var FN=R(mi=>{"use strict";b();p();Object.defineProperty(mi,"__esModule",{value:!0});mi.CodeFormatEVM=mi.AccountKeyType=mi.TxType=void 0;mi.parseTxType=iz;mi.getKaikasTxType=Mxe;mi.isKlaytnTxType=az;mi.isBasicTxType=Cxe;mi.isFeeDelegationTxType=oz;mi.isPartialFeeDelegationTxType=cz;mi.isFeePayerSigTxType=Lxe;mi.isKlaytnAccountKeyType=Uxe;mi.isEmbeddableAccountKeyType=Fxe;var yp=(iu(),ao(su)),sz=Gw(),Q0;(function(r){r[r.ValueTransfer=8]="ValueTransfer",r[r.ValueTransferMemo=16]="ValueTransferMemo",r[r.AccountUpdate=32]="AccountUpdate",r[r.SmartContractDeploy=40]="SmartContractDeploy",r[r.SmartContractExecution=48]="SmartContractExecution",r[r.Cancel=56]="Cancel",r[r.FeeDelegatedValueTransfer=9]="FeeDelegatedValueTransfer",r[r.FeeDelegatedValueTransferMemo=17]="FeeDelegatedValueTransferMemo",r[r.FeeDelegatedAccountUpdate=33]="FeeDelegatedAccountUpdate",r[r.FeeDelegatedSmartContractDeploy=41]="FeeDelegatedSmartContractDeploy",r[r.FeeDelegatedSmartContractExecution=49]="FeeDelegatedSmartContractExecution",r[r.FeeDelegatedCancel=57]="FeeDelegatedCancel",r[r.FeeDelegatedValueTransferWithRatio=10]="FeeDelegatedValueTransferWithRatio",r[r.FeeDelegatedValueTransferMemoWithRatio=18]="FeeDelegatedValueTransferMemoWithRatio",r[r.FeeDelegatedAccountUpdateWithRatio=34]="FeeDelegatedAccountUpdateWithRatio",r[r.FeeDelegatedSmartContractDeployWithRatio=42]="FeeDelegatedSmartContractDeployWithRatio",r[r.FeeDelegatedSmartContractExecutionWithRatio=50]="FeeDelegatedSmartContractExecutionWithRatio",r[r.FeeDelegatedCancelWithRatio=58]="FeeDelegatedCancelWithRatio"})(Q0||(mi.TxType=Q0={}));function iz(r){if(r==null&&(r=0),typeof r=="bigint"&&(r=Number(r)),(0,yp.isNumber)(r))return r;if((0,yp.isString)(r)&&r.length>0){if(sz.HexStr.isHex(r))return sz.HexStr.toNumber(r);let e=r;if(e.startsWith("TxType")&&(e=e.substring(6)),e=(0,yp.upperFirst)((0,yp.camelCase)(e)),(0,yp.has)(Q0,e))return(0,yp.get)(Q0,e)}throw new Error(`Unrecognized tx type '${r}'. Expected a number.'`)}function Mxe(r){let e=iz(r);if(az(e)){let t=Q0[e];return(0,yp.snakeCase)(t).toUpperCase()}else return e}function az(r){return!!r&&r in Q0}function Cxe(r){return!!r&&r in Q0&&(r&3)==0}function oz(r){return!!r&&r in Q0&&(r&3)==1}function cz(r){return!!r&&r in Q0&&(r&3)==2}function Lxe(r){return oz(r)||cz(r)}var Vw;(function(r){r[r.Nil=0]="Nil",r[r.Legacy=1]="Legacy",r[r.Public=2]="Public",r[r.Fail=3]="Fail",r[r.WeightedMultiSig=4]="WeightedMultiSig",r[r.RoleBased=5]="RoleBased"})(Vw||(mi.AccountKeyType=Vw={}));function Uxe(r){return!!r&&r in Vw}function Fxe(r){return!!r&&r in Vw&&r!=Vw.RoleBased}mi.CodeFormatEVM=0});var DN=R(yy=>{"use strict";b();p();Object.defineProperty(yy,"__esModule",{value:!0});yy.getPublicKeyFromPrivate=Dxe;yy.getCompressedPublicKey=fz;yy.getSignatureTuple=Hxe;yy.getChainIdFromSignatureTuples=Kxe;var uz=c7(),qxe=mce(),ra=Gw(),xy=(iu(),ao(su)),qN=new qxe.ec("secp256k1");function Dxe(r){let e=qN.keyFromPrivate(ra.HexStr.stripHexPrefix(r),"hex");return fz(e.getPublic(!0,"hex"))}function fz(r){if(r instanceof Uint8Array&&(r=ra.HexStr.from(r)),(0,xy.isString)(r)){let e=ra.HexStr.from(ra.HexStr.withHexPrefix(r));if(ra.HexStr.isHex(e,33)||ra.HexStr.isHex(e,65)){let t=ra.HexStr.stripHexPrefix(e);return"0x"+qN.keyFromPublic(t,"hex").getPublic(!0,"hex")}}if((0,xy.isString)(r.x)&&(0,xy.isString)(r.y))return r.x=ra.HexStr.stripHexPrefix(r.x),r.y=ra.HexStr.stripHexPrefix(r.y),"0x"+qN.keyFromPublic(r).getPublic(!0,"hex");throw new Error("Public key must be a hex string of 33 or 65 bytes, or an { x, y } object")}function Hxe(r){let e;if((0,xy.isArray)(r)){if(r.length!=3)throw new Error("Signature tuple must have 3 elements [v,r,s]");let t=ra.HexStr.toNumber(r[0]);e=(0,uz.splitSignature)({v:t,r:r[1],s:r[2]})}else e=(0,uz.splitSignature)(r);return[ra.HexStr.fromNumber(e.v),ra.HexStr.stripZeros(e.r),ra.HexStr.stripZeros(e.s)]}function Kxe(r){if(!(0,xy.isArray)(r)||r.length==0)return;let e=r[0];if(!(0,xy.isArray)(e)||e.length!=3)return;let t=e[0];if(!ra.HexStr.isHex(t))return;let n=ra.HexStr.toNumber(t);if(n>=35)return(n+n%2-36)/2}});var dz=R(C9=>{"use strict";b();p();Object.defineProperty(C9,"__esModule",{value:!0});C9.splitKeystoreKIP3=Gxe;C9.isKIP3Json=Vxe;var mp=(iu(),ao(su));function Gxe(r,e=!0){let t=JSON.parse(r),n=t.keyring;if(!(0,mp.isArray)(n))throw new Error("Invalid KIP-3 JSON wallet");let s=[];return(0,mp.isArray)(n[0])?s=(0,mp.flattenDepth)(n,2):s=(0,mp.flattenDepth)(n,1),(0,mp.map)(s,i=>{let a={version:3,crypto:i,address:t.address,id:t.id};return e&&delete a.address,JSON.stringify(a)})}function Vxe(r){let e=null;try{e=JSON.parse(r)}catch{return!1}return(0,mp.isNumber)(e.version)&&e.version==4&&(0,mp.isArray)(e.keyring)}});var bz=R(wp=>{"use strict";b();p();Object.defineProperty(wp,"__esModule",{value:!0});wp.JsonRpcClient=void 0;wp.promisifyMethod=lz;wp.promisifyApi=hz;wp.asyncOpenApi=Wxe;var zxe=(iu(),ao(su)),L9=class{constructor(e){this.send=e}callApi(e,t,n,s,i,a,o,c,u,f,d,g,h){this.send(o.method,o.params).then(m=>h(null,m)).catch(m=>h(m,null))}};wp.JsonRpcClient=L9;function lz(r,e,t){return async function(...n){if(n.length<t)throw new Error(`API ${String(e)} expects ${t} or more arguments, got ${n.length}`);let s=n.slice(0,t),i=n.slice(t);return new Promise((a,o)=>{r[e](...s,i,(c,u)=>{c?o(c):a(u)})})}}function hz(r){let e={},t=Reflect.getPrototypeOf(r);if(!t)throw new Error("Cannot promisify OpenApi object");let n=Reflect.ownKeys(t);for(let s of n){if(s=="constructor")continue;let i=Reflect.get(t,s);if(!(0,zxe.isFunction)(i)||i.length<2)continue;let a=i.length-2;e[s]=lz(r,s,a)}return e}function Wxe(r,e){let t=new L9(r),n=new e(t);return hz(n)}});var Hz=R((KCe,q9)=>{b();p();var pz,gz,xz,yz,mz,wz,vz,Pz,_z,Az,Ez,Sz,Tz,U9,HN,Oz,Bz,kz,my,Nz,Iz,Rz,jz,Mz,Cz,Lz,Uz,Fz,F9,qz,Dz;(function(r){var e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof q9=="object"&&typeof q9.exports=="object"?r(t(e,t(q9.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=s?s(i,a):a}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(s[a]=i[a])};pz=function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(s,i);function a(){this.constructor=s}s.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)},gz=Object.assign||function(s){for(var i,a=1,o=arguments.length;a<o;a++){i=arguments[a];for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(s[c]=i[c])}return s},xz=function(s,i){var a={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.indexOf(o)<0&&(a[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(s);c<o.length;c++)i.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(s,o[c])&&(a[o[c]]=s[o[c]]);return a},yz=function(s,i,a,o){var c=arguments.length,u=c<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,a):o,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(s,i,a,o);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(u=(c<3?f(u):c>3?f(i,a,u):f(i,a))||u);return c>3&&u&&Object.defineProperty(i,a,u),u},mz=function(s,i){return function(a,o){i(a,o,s)}},wz=function(s,i,a,o,c,u){function f(z){if(z!==void 0&&typeof z!="function")throw new TypeError("Function expected");return z}for(var d=o.kind,g=d==="getter"?"get":d==="setter"?"set":"value",h=!i&&s?o.static?s:s.prototype:null,m=i||(h?Object.getOwnPropertyDescriptor(h,o.name):{}),y,S=!1,T=a.length-1;T>=0;T--){var H={};for(var C in o)H[C]=C==="access"?{}:o[C];for(var C in o.access)H.access[C]=o.access[C];H.addInitializer=function(z){if(S)throw new TypeError("Cannot add initializers after decoration has completed");u.push(f(z||null))};var J=(0,a[T])(d==="accessor"?{get:m.get,set:m.set}:m[g],H);if(d==="accessor"){if(J===void 0)continue;if(J===null||typeof J!="object")throw new TypeError("Object expected");(y=f(J.get))&&(m.get=y),(y=f(J.set))&&(m.set=y),(y=f(J.init))&&c.unshift(y)}else(y=f(J))&&(d==="field"?c.unshift(y):m[g]=y)}h&&Object.defineProperty(h,o.name,m),S=!0},vz=function(s,i,a){for(var o=arguments.length>2,c=0;c<i.length;c++)a=o?i[c].call(s,a):i[c].call(s);return o?a:void 0},Pz=function(s){return typeof s=="symbol"?s:"".concat(s)},_z=function(s,i,a){return typeof i=="symbol"&&(i=i.description?"[".concat(i.description,"]"):""),Object.defineProperty(s,"name",{configurable:!0,value:a?"".concat(a," ",i):i})},Az=function(s,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,i)},Ez=function(s,i,a,o){function c(u){return u instanceof a?u:new a(function(f){f(u)})}return new(a||(a=Promise))(function(u,f){function d(m){try{h(o.next(m))}catch(y){f(y)}}function g(m){try{h(o.throw(m))}catch(y){f(y)}}function h(m){m.done?u(m.value):c(m.value).then(d,g)}h((o=o.apply(s,i||[])).next())})},Sz=function(s,i){var a={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=d(0),f.throw=d(1),f.return=d(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function d(h){return function(m){return g([h,m])}}function g(h){if(o)throw new TypeError("Generator is already executing.");for(;f&&(f=0,h[0]&&(a=0)),a;)try{if(o=1,c&&(u=h[0]&2?c.return:h[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,h[1])).done)return u;switch(c=0,u&&(h=[h[0]&2,u.value]),h[0]){case 0:case 1:u=h;break;case 4:return a.label++,{value:h[1],done:!1};case 5:a.label++,c=h[1],h=[0];continue;case 7:h=a.ops.pop(),a.trys.pop();continue;default:if(u=a.trys,!(u=u.length>0&&u[u.length-1])&&(h[0]===6||h[0]===2)){a=0;continue}if(h[0]===3&&(!u||h[1]>u[0]&&h[1]<u[3])){a.label=h[1];break}if(h[0]===6&&a.label<u[1]){a.label=u[1],u=h;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(h);break}u[2]&&a.ops.pop(),a.trys.pop();continue}h=i.call(s,a)}catch(m){h=[6,m],c=0}finally{o=u=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},Tz=function(s,i){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&F9(i,s,a)},F9=Object.create?function(s,i,a,o){o===void 0&&(o=a);var c=Object.getOwnPropertyDescriptor(i,a);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(s,o,c)}:function(s,i,a,o){o===void 0&&(o=a),s[o]=i[a]},U9=function(s){var i=typeof Symbol=="function"&&Symbol.iterator,a=i&&s[i],o=0;if(a)return a.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&o>=s.length&&(s=void 0),{value:s&&s[o++],done:!s}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},HN=function(s,i){var a=typeof Symbol=="function"&&s[Symbol.iterator];if(!a)return s;var o=a.call(s),c,u=[],f;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(a=o.return)&&a.call(o)}finally{if(f)throw f.error}}return u},Oz=function(){for(var s=[],i=0;i<arguments.length;i++)s=s.concat(HN(arguments[i]));return s},Bz=function(){for(var s=0,i=0,a=arguments.length;i<a;i++)s+=arguments[i].length;for(var o=Array(s),c=0,i=0;i<a;i++)for(var u=arguments[i],f=0,d=u.length;f<d;f++,c++)o[c]=u[f];return o},kz=function(s,i,a){if(a||arguments.length===2)for(var o=0,c=i.length,u;o<c;o++)(u||!(o in i))&&(u||(u=Array.prototype.slice.call(i,0,o)),u[o]=i[o]);return s.concat(u||Array.prototype.slice.call(i))},my=function(s){return this instanceof my?(this.v=s,this):new my(s)},Nz=function(s,i,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a.apply(s,i||[]),c,u=[];return c=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),d("next"),d("throw"),d("return",f),c[Symbol.asyncIterator]=function(){return this},c;function f(T){return function(H){return Promise.resolve(H).then(T,y)}}function d(T,H){o[T]&&(c[T]=function(C){return new Promise(function(J,z){u.push([T,C,J,z])>1||g(T,C)})},H&&(c[T]=H(c[T])))}function g(T,H){try{h(o[T](H))}catch(C){S(u[0][3],C)}}function h(T){T.value instanceof my?Promise.resolve(T.value.v).then(m,y):S(u[0][2],T)}function m(T){g("next",T)}function y(T){g("throw",T)}function S(T,H){T(H),u.shift(),u.length&&g(u[0][0],u[0][1])}},Iz=function(s){var i,a;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=s[c]?function(f){return(a=!a)?{value:my(s[c](f)),done:!1}:u?u(f):f}:u}},Rz=function(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=s[Symbol.asyncIterator],a;return i?i.call(s):(s=typeof U9=="function"?U9(s):s[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(u){a[u]=s[u]&&function(f){return new Promise(function(d,g){f=s[u](f),c(d,g,f.done,f.value)})}}function c(u,f,d,g){Promise.resolve(g).then(function(h){u({value:h,done:d})},f)}},jz=function(s,i){return Object.defineProperty?Object.defineProperty(s,"raw",{value:i}):s.raw=i,s};var t=Object.create?function(s,i){Object.defineProperty(s,"default",{enumerable:!0,value:i})}:function(s,i){s.default=i};Mz=function(s){if(s&&s.__esModule)return s;var i={};if(s!=null)for(var a in s)a!=="default"&&Object.prototype.hasOwnProperty.call(s,a)&&F9(i,s,a);return t(i,s),i},Cz=function(s){return s&&s.__esModule?s:{default:s}},Lz=function(s,i,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?s!==i||!o:!i.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(s):o?o.value:i.get(s)},Uz=function(s,i,a,o,c){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?s!==i||!c:!i.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?c.call(s,a):c?c.value=a:i.set(s,a),a},Fz=function(s,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof s=="function"?i===s:s.has(i)},qz=function(s,i,a){if(i!=null){if(typeof i!="object"&&typeof i!="function")throw new TypeError("Object expected.");var o,c;if(a){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=i[Symbol.asyncDispose]}if(o===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=i[Symbol.dispose],a&&(c=o)}if(typeof o!="function")throw new TypeError("Object not disposable.");c&&(o=function(){try{c.call(this)}catch(u){return Promise.reject(u)}}),s.stack.push({value:i,dispose:o,async:a})}else a&&s.stack.push({async:!0});return i};var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,a){var o=new Error(a);return o.name="SuppressedError",o.error=s,o.suppressed=i,o};Dz=function(s){function i(u){s.error=s.hasError?new n(u,s.error,"An error was suppressed during disposal."):u,s.hasError=!0}var a,o=0;function c(){for(;a=s.stack.pop();)try{if(!a.async&&o===1)return o=0,s.stack.push(a),Promise.resolve().then(c);if(a.dispose){var u=a.dispose.call(a.value);if(a.async)return o|=2,Promise.resolve(u).then(c,function(f){return i(f),c()})}else o|=1}catch(f){i(f)}if(o===1)return s.hasError?Promise.reject(s.error):Promise.resolve();if(s.hasError)throw s.error}return c()},r("__extends",pz),r("__assign",gz),r("__rest",xz),r("__decorate",yz),r("__param",mz),r("__esDecorate",wz),r("__runInitializers",vz),r("__propKey",Pz),r("__setFunctionName",_z),r("__metadata",Az),r("__awaiter",Ez),r("__generator",Sz),r("__exportStar",Tz),r("__createBinding",F9),r("__values",U9),r("__read",HN),r("__spread",Oz),r("__spreadArrays",Bz),r("__spreadArray",kz),r("__await",my),r("__asyncGenerator",Nz),r("__asyncDelegator",Iz),r("__asyncValues",Rz),r("__makeTemplateObject",jz),r("__importStar",Mz),r("__importDefault",Cz),r("__classPrivateFieldGet",Lz),r("__classPrivateFieldSet",Uz),r("__classPrivateFieldIn",Fz),r("__addDisposableResource",qz),r("__disposeResources",Dz)})});var H9=R(D9=>{"use strict";b();p();Object.defineProperty(D9,"__esModule",{value:!0});D9.version=void 0;D9.version="6.13.5"});var Ml=R(wy=>{"use strict";b();p();Object.defineProperty(wy,"__esModule",{value:!0});wy.defineProperties=wy.resolveProperties=void 0;function $xe(r,e,t){let n=e.split("|").map(i=>i.trim());for(let i=0;i<n.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}let s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=r,s}async function Jxe(r){let e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,s,i)=>(n[e[i]]=s,n),{})}wy.resolveProperties=Jxe;function Zxe(r,e,t){for(let n in e){let s=e[n],i=t?t[n]:null;i&&$xe(s,i,n),Object.defineProperty(r,n,{enumerable:!0,value:s,writable:!1})}}wy.defineProperties=Zxe});var mu=R(ti=>{"use strict";b();p();Object.defineProperty(ti,"__esModule",{value:!0});ti.assertPrivate=ti.assertNormalize=ti.assertArgumentCount=ti.assertArgument=ti.assert=ti.makeError=ti.isCallException=ti.isError=void 0;var Qxe=H9(),Kz=Ml();function vy(r){if(r==null)return"null";if(Array.isArray(r))return"[ "+r.map(vy).join(", ")+" ]";if(r instanceof Uint8Array){let e="0123456789abcdef",t="0x";for(let n=0;n<r.length;n++)t+=e[r[n]>>4],t+=e[r[n]&15];return t}if(typeof r=="object"&&typeof r.toJSON=="function")return vy(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"number":return r.toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{ "+e.map(t=>`${vy(t)}: ${vy(r[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Gz(r,e){return r&&r.code===e}ti.isError=Gz;function Yxe(r){return Gz(r,"CALL_EXCEPTION")}ti.isCallException=Yxe;function Vz(r,e,t){let n=r;{let i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${vy(t)}`);for(let a in t){if(a==="shortMessage")continue;let o=t[a];i.push(a+"="+vy(o))}}i.push(`code=${e}`),i.push(`version=${Qxe.version}`),i.length&&(r+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(r);break;default:s=new Error(r)}return(0,Kz.defineProperties)(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&(0,Kz.defineProperties)(s,{shortMessage:n}),s}ti.makeError=Vz;function Py(r,e,t,n){if(!r)throw Vz(e,t,n)}ti.assert=Py;function Xxe(r,e,t,n){Py(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}ti.assertArgument=Xxe;function eye(r,e,t){t==null&&(t=""),t&&(t=": "+t),Py(r>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),Py(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}ti.assertArgumentCount=eye;var tye=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){let t=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(t!==n)throw new Error("broken")}r.push(e)}catch{}return r},[]);function rye(r){Py(tye.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}ti.assertNormalize=rye;function nye(r,e,t){if(t==null&&(t=""),r!==e){let n=t,s="new";t&&(n+=".",s+=" "+t),Py(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}ti.assertPrivate=nye});var Zo=R(kn=>{"use strict";b();p();Object.defineProperty(kn,"__esModule",{value:!0});kn.zeroPadBytes=kn.zeroPadValue=kn.stripZerosLeft=kn.dataSlice=kn.dataLength=kn.concat=kn.hexlify=kn.isBytesLike=kn.isHexString=kn.getBytesCopy=kn.getBytes=void 0;var KN=mu();function Wz(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let n=new Uint8Array((r.length-2)/2),s=2;for(let i=0;i<n.length;i++)n[i]=parseInt(r.substring(s,s+2),16),s+=2;return n}(0,KN.assertArgument)(!1,"invalid BytesLike value",e||"value",r)}function zw(r,e){return Wz(r,e,!1)}kn.getBytes=zw;function sye(r,e){return Wz(r,e,!0)}kn.getBytesCopy=sye;function GN(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}kn.isHexString=GN;function iye(r){return GN(r,!0)||r instanceof Uint8Array}kn.isBytesLike=iye;var zz="0123456789abcdef";function Ww(r){let e=zw(r),t="0x";for(let n=0;n<e.length;n++){let s=e[n];t+=zz[(s&240)>>4]+zz[s&15]}return t}kn.hexlify=Ww;function aye(r){return"0x"+r.map(e=>Ww(e).substring(2)).join("")}kn.concat=aye;function oye(r){return GN(r,!0)?(r.length-2)/2:zw(r).length}kn.dataLength=oye;function cye(r,e,t){let n=zw(r);return t!=null&&t>n.length&&(0,KN.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),Ww(n.slice(e??0,t??n.length))}kn.dataSlice=cye;function uye(r){let e=Ww(r).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}kn.stripZerosLeft=uye;function $z(r,e,t){let n=zw(r);(0,KN.assert)(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});let s=new Uint8Array(e);return s.fill(0),t?s.set(n,e-n.length):s.set(n,0),Ww(s)}function fye(r,e){return $z(r,e,!0)}kn.zeroPadValue=fye;function dye(r,e){return $z(r,e,!1)}kn.zeroPadBytes=dye});var Ay=R(Nn=>{"use strict";b();p();Object.defineProperty(Nn,"__esModule",{value:!0});Nn.toQuantity=Nn.toBeArray=Nn.toBeHex=Nn.toNumber=Nn.getNumber=Nn.toBigInt=Nn.getUint=Nn.getBigInt=Nn.mask=Nn.toTwos=Nn.fromTwos=void 0;var Jz=Zo(),Ia=mu(),K9=BigInt(0),wu=BigInt(1),_y=9007199254740991;function lye(r,e){let t=$w(r,"value"),n=BigInt(vp(e,"width"));if((0,Ia.assert)(t>>n===K9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-wu){let s=(wu<<n)-wu;return-((~t&s)+wu)}return t}Nn.fromTwos=lye;function hye(r,e){let t=G9(r,"value"),n=BigInt(vp(e,"width")),s=wu<<n-wu;if(t<K9){t=-t,(0,Ia.assert)(t<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});let i=(wu<<n)-wu;return(~t&i)+wu}else(0,Ia.assert)(t<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}Nn.toTwos=hye;function bye(r,e){let t=$w(r,"value"),n=BigInt(vp(e,"bits"));return t&(wu<<n)-wu}Nn.mask=bye;function G9(r,e){switch(typeof r){case"bigint":return r;case"number":return(0,Ia.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Ia.assertArgument)(r>=-_y&&r<=_y,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){(0,Ia.assertArgument)(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}(0,Ia.assertArgument)(!1,"invalid BigNumberish value",e||"value",r)}Nn.getBigInt=G9;function $w(r,e){let t=G9(r,e);return(0,Ia.assert)(t>=K9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}Nn.getUint=$w;var Zz="0123456789abcdef";function Qz(r){if(r instanceof Uint8Array){let e="0x0";for(let t of r)e+=Zz[t>>4],e+=Zz[t&15];return BigInt(e)}return G9(r)}Nn.toBigInt=Qz;function vp(r,e){switch(typeof r){case"bigint":return(0,Ia.assertArgument)(r>=-_y&&r<=_y,"overflow",e||"value",r),Number(r);case"number":return(0,Ia.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Ia.assertArgument)(r>=-_y&&r<=_y,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return vp(BigInt(r),e)}catch(t){(0,Ia.assertArgument)(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}(0,Ia.assertArgument)(!1,"invalid numeric value",e||"value",r)}Nn.getNumber=vp;function pye(r){return vp(Qz(r))}Nn.toNumber=pye;function gye(r,e){let n=$w(r,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{let s=vp(e,"width");for((0,Ia.assert)(s*2>=n.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<s*2;)n="0"+n}return"0x"+n}Nn.toBeHex=gye;function Yz(r){let e=$w(r,"value");if(e===K9)return new Uint8Array([]);let t=e.toString(16);t.length%2&&(t="0"+t);let n=new Uint8Array(t.length/2);for(let s=0;s<n.length;s++){let i=s*2;n[s]=parseInt(t.substring(i,i+2),16)}return n}Nn.toBeArray=Yz;function xye(r){let e=(0,Jz.hexlify)((0,Jz.isBytesLike)(r)?r:Yz(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}Nn.toQuantity=xye});var Xz=R(Ey=>{"use strict";b();p();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.decodeBase58=Ey.encodeBase58=void 0;var yye=Zo(),mye=mu(),wye=Ay(),z9="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",V9=null;function vye(r){if(V9==null){V9={};for(let t=0;t<z9.length;t++)V9[z9[t]]=BigInt(t)}let e=V9[r];return(0,mye.assertArgument)(e!=null,"invalid base58 value","letter",r),e}var Pye=BigInt(0),VN=BigInt(58);function _ye(r){let e=(0,yye.getBytes)(r),t=(0,wye.toBigInt)(e),n="";for(;t;)n=z9[Number(t%VN)]+n,t/=VN;for(let s=0;s<e.length&&!e[s];s++)n=z9[0]+n;return n}Ey.encodeBase58=_ye;function Aye(r){let e=Pye;for(let t=0;t<r.length;t++)e*=VN,e+=vye(r[t]);return e}Ey.decodeBase58=Aye});var zN=R(Sy=>{"use strict";b();p();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.encodeBase64=Sy.decodeBase64=void 0;var eW=Zo();function Eye(r){r=atob(r);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return(0,eW.getBytes)(e)}Sy.decodeBase64=Eye;function Sye(r){let e=(0,eW.getBytes)(r),t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}Sy.encodeBase64=Sye});var tW=R(W9=>{"use strict";b();p();Object.defineProperty(W9,"__esModule",{value:!0});W9.EventPayload=void 0;var Tye=Ml(),Ty,WN=class{constructor(e,t,n){N(this,"filter");N(this,"emitter");I(this,Ty,void 0);_(this,Ty,t),(0,Tye.defineProperties)(this,{emitter:e,filter:n})}async removeListener(){l(this,Ty)!=null&&await this.emitter.off(this.filter,l(this,Ty))}};Ty=new WeakMap;W9.EventPayload=WN});var $9=R(vu=>{"use strict";b();p();Object.defineProperty(vu,"__esModule",{value:!0});vu.toUtf8CodePoints=vu.toUtf8String=vu.toUtf8Bytes=vu.Utf8ErrorFuncs=void 0;var Oye=Zo(),Jw=mu();function Bye(r,e,t,n,s){(0,Jw.assertArgument)(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function rW(r,e,t,n,s){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let i=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)i++;return i}return r==="OVERRUN"?t.length-e-1:0}function kye(r,e,t,n,s){return r==="OVERLONG"?((0,Jw.assertArgument)(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),n.push(s),0):(n.push(65533),rW(r,e,t,n,s))}vu.Utf8ErrorFuncs=Object.freeze({error:Bye,ignore:rW,replace:kye});function nW(r,e){e==null&&(e=vu.Utf8ErrorFuncs.error);let t=(0,Oye.getBytes)(r,"bytes"),n=[],s=0;for(;s<t.length;){let i=t[s++];if(i>>7===0){n.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,n):s+=e("BAD_PREFIX",s-1,t,n);continue}if(s-1+a>=t.length){s+=e("OVERRUN",s-1,t,n);continue}let c=i&(1<<8-a-1)-1;for(let u=0;u<a;u++){let f=t[s];if((f&192)!=128){s+=e("MISSING_CONTINUE",s,t,n),c=null;break}c=c<<6|f&63,s++}if(c!==null){if(c>1114111){s+=e("OUT_OF_RANGE",s-1-a,t,n,c);continue}if(c>=55296&&c<=57343){s+=e("UTF16_SURROGATE",s-1-a,t,n,c);continue}if(c<=o){s+=e("OVERLONG",s-1-a,t,n,c);continue}n.push(c)}}return n}function sW(r,e){(0,Jw.assertArgument)(typeof r=="string","invalid string value","str",r),e!=null&&((0,Jw.assertNormalize)(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){n++;let i=r.charCodeAt(n);(0,Jw.assertArgument)(n<r.length&&(i&64512)===56320,"invalid surrogate pair","str",r);let a=65536+((s&1023)<<10)+(i&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}vu.toUtf8Bytes=sW;function Nye(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Iye(r,e){return Nye(nW(r,e))}vu.toUtf8String=Iye;function Rye(r,e){return nW(sW(r,e))}vu.toUtf8CodePoints=Rye});var aW=R(Oy=>{"use strict";b();p();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.getUrl=Oy.createGetUrl=void 0;var Zw=mu();function iW(r){async function e(t,n){(0,Zw.assert)(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");let s=t.url.split(":")[0].toLowerCase();(0,Zw.assert)(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),(0,Zw.assert)(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null,a=new AbortController,o=setTimeout(()=>{i=(0,Zw.makeError)("request timeout","TIMEOUT"),a.abort()},t.timeout);n&&n.addListener(()=>{i=(0,Zw.makeError)("request cancelled","CANCELLED"),a.abort()});let c=new Headers(Array.from(t));c.delete("content-length");let u={method:t.method,headers:c,body:t.body||void 0,signal:a.signal},f;try{f=await fetch(t.url,u)}catch(m){throw clearTimeout(o),i||m}clearTimeout(o);let d={};f.headers.forEach((m,y)=>{d[y.toLowerCase()]=m});let g=await f.arrayBuffer(),h=g==null?null:new Uint8Array(g);return{statusCode:f.status,statusMessage:f.statusText,headers:d,body:h}}return e}Oy.createGetUrl=iW;var jye=iW({});async function Mye(r,e){return jye(r,e)}Oy.getUrl=Mye});var pW=R(Ul=>{"use strict";b();p();Object.defineProperty(Ul,"__esModule",{value:!0});Ul.FetchResponse=Ul.FetchRequest=Ul.FetchCancelSignal=void 0;var uW=zN(),fW=Zo(),Qo=mu(),Cye=Ml(),By=$9(),dW=aW(),Lye=12,Uye=250,oW=(0,dW.createGetUrl)(),Fye=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),qye=new RegExp("^ipfs://(ipfs/)?(.*)$","i"),$N=!1;async function lW(r,e){try{let t=r.match(Fye);if(!t)throw new Error("invalid data");return new ed(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,uW.decodeBase64)(t[3]):Dye(t[3]))}catch{return new ed(599,"BAD REQUEST (invalid data: URI)",{},null,new My(r))}}function hW(r){async function e(t,n){try{let s=t.match(qye);if(!s)throw new Error("invalid link");return new My(`${r}${s[2]}`)}catch{return new ed(599,"BAD REQUEST (invalid IPFS URI)",{},null,new My(t))}}return e}var J9={data:lW,ipfs:hW("https://gateway.ipfs.io/ipfs/")},bW=new WeakMap,Pp,Cl,Q9=class{constructor(e){I(this,Pp,void 0);I(this,Cl,void 0);_(this,Pp,[]),_(this,Cl,!1),bW.set(e,()=>{if(!l(this,Cl)){_(this,Cl,!0);for(let t of l(this,Pp))setTimeout(()=>{t()},0);_(this,Pp,[])}})}addListener(e){(0,Qo.assert)(!l(this,Cl),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),l(this,Pp).push(e)}get cancelled(){return l(this,Cl)}checkSignal(){(0,Qo.assert)(!this.cancelled,"cancelled","CANCELLED",{})}};Pp=new WeakMap,Cl=new WeakMap;Ul.FetchCancelSignal=Q9;function Z9(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}var ky,Ny,Pu,Y0,Iy,Ry,ri,ho,X0,_p,Ap,Ep,Ff,_u,Ll,Sp,Qw,Y9=class{constructor(e){I(this,Sp);I(this,ky,void 0);I(this,Ny,void 0);I(this,Pu,void 0);I(this,Y0,void 0);I(this,Iy,void 0);I(this,Ry,void 0);I(this,ri,void 0);I(this,ho,void 0);I(this,X0,void 0);I(this,_p,void 0);I(this,Ap,void 0);I(this,Ep,void 0);I(this,Ff,void 0);I(this,_u,void 0);I(this,Ll,void 0);_(this,Ry,String(e)),_(this,ky,!1),_(this,Ny,!0),_(this,Pu,{}),_(this,Y0,""),_(this,Iy,3e5),_(this,_u,{slotInterval:Uye,maxAttempts:Lye}),_(this,Ll,null)}get url(){return l(this,Ry)}set url(e){_(this,Ry,String(e))}get body(){return l(this,ri)==null?null:new Uint8Array(l(this,ri))}set body(e){if(e==null)_(this,ri,void 0),_(this,ho,void 0);else if(typeof e=="string")_(this,ri,(0,By.toUtf8Bytes)(e)),_(this,ho,"text/plain");else if(e instanceof Uint8Array)_(this,ri,e),_(this,ho,"application/octet-stream");else if(typeof e=="object")_(this,ri,(0,By.toUtf8Bytes)(JSON.stringify(e))),_(this,ho,"application/json");else throw new Error("invalid body")}hasBody(){return l(this,ri)!=null}get method(){return l(this,Y0)?l(this,Y0):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),_(this,Y0,String(e).toUpperCase())}get headers(){let e=Object.assign({},l(this,Pu));return l(this,X0)&&(e.authorization=`Basic ${(0,uW.encodeBase64)((0,By.toUtf8Bytes)(l(this,X0)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&l(this,ho)&&(e["content-type"]=l(this,ho)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){l(this,Pu)[String(e).toLowerCase()]=String(t)}clearHeaders(){_(this,Pu,{})}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return l(this,X0)||null}setCredentials(e,t){(0,Qo.assertArgument)(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),_(this,X0,`${e}:${t}`)}get allowGzip(){return l(this,Ny)}set allowGzip(e){_(this,Ny,!!e)}get allowInsecureAuthentication(){return!!l(this,ky)}set allowInsecureAuthentication(e){_(this,ky,!!e)}get timeout(){return l(this,Iy)}set timeout(e){(0,Qo.assertArgument)(e>=0,"timeout must be non-zero","timeout",e),_(this,Iy,e)}get preflightFunc(){return l(this,_p)||null}set preflightFunc(e){_(this,_p,e)}get processFunc(){return l(this,Ap)||null}set processFunc(e){_(this,Ap,e)}get retryFunc(){return l(this,Ep)||null}set retryFunc(e){_(this,Ep,e)}get getUrlFunc(){return l(this,Ll)||oW}set getUrlFunc(e){_(this,Ll,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${l(this,ri)?(0,fW.hexlify)(l(this,ri)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(l(this,_u).slotInterval=e.slotInterval),e.maxAttempts!=null&&(l(this,_u).maxAttempts=e.maxAttempts)}send(){return(0,Qo.assert)(l(this,Ff)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),_(this,Ff,new Q9(this)),$(this,Sp,Qw).call(this,0,cW()+this.timeout,0,this,new ed(0,"",{},null,this))}cancel(){(0,Qo.assert)(l(this,Ff)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});let e=bW.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){let t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();(0,Qo.assert)(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});let s=new Y9(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,_(s,Pu,Object.assign({},l(this,Pu))),l(this,ri)&&_(s,ri,new Uint8Array(l(this,ri))),_(s,ho,l(this,ho)),s}clone(){let e=new Y9(this.url);return _(e,Y0,l(this,Y0)),l(this,ri)&&_(e,ri,l(this,ri)),_(e,ho,l(this,ho)),_(e,Pu,Object.assign({},l(this,Pu))),_(e,X0,l(this,X0)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),_(e,_p,l(this,_p)),_(e,Ap,l(this,Ap)),_(e,Ep,l(this,Ep)),_(e,_u,Object.assign({},l(this,_u))),_(e,Ll,l(this,Ll)),e}static lockConfig(){$N=!0}static getGateway(e){return J9[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if($N)throw new Error("gateways locked");J9[e]=t}static registerGetUrl(e){if($N)throw new Error("gateways locked");oW=e}static createGetUrlFunc(e){return(0,dW.createGetUrl)(e)}static createDataGateway(){return lW}static createIpfsGatewayFunc(e){return hW(e)}},My=Y9;ky=new WeakMap,Ny=new WeakMap,Pu=new WeakMap,Y0=new WeakMap,Iy=new WeakMap,Ry=new WeakMap,ri=new WeakMap,ho=new WeakMap,X0=new WeakMap,_p=new WeakMap,Ap=new WeakMap,Ep=new WeakMap,Ff=new WeakMap,_u=new WeakMap,Ll=new WeakMap,Sp=new WeakSet,Qw=async function(e,t,n,s,i){var f,d,g;if(e>=l(this,_u).maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,Qo.assert)(cW()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),n>0&&await Hye(n);let a=this.clone(),o=(a.url.split(":")[0]||"").toLowerCase();if(o in J9){let h=await J9[o](a.url,Z9(l(s,Ff)));if(h instanceof ed){let m=h;if(this.processFunc){Z9(l(s,Ff));try{m=await this.processFunc(a,m)}catch(y){(y.throttle==null||typeof y.stall!="number")&&m.makeServerError("error in post-processing function",y).assertOk()}}return m}a=h}this.preflightFunc&&(a=await this.preflightFunc(a));let c=await this.getUrlFunc(a,Z9(l(s,Ff))),u=new ed(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{let h=u.headers.location||"";return $(f=a.redirect(h),Sp,Qw).call(f,e+1,t,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,u,e))){let h=u.headers["retry-after"],m=l(this,_u).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(m=parseInt(h)),$(d=a.clone(),Sp,Qw).call(d,e+1,t,m,s,u)}if(this.processFunc){Z9(l(s,Ff));try{u=await this.processFunc(a,u)}catch(h){(h.throttle==null||typeof h.stall!="number")&&u.makeServerError("error in post-processing function",h).assertOk();let m=l(this,_u).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(m=h.stall),$(g=a.clone(),Sp,Qw).call(g,e+1,t,m,s,u)}}return u};Ul.FetchRequest=My;var Yw,Xw,e8,bo,jy,Tp,JN=class{constructor(e,t,n,s,i){I(this,Yw,void 0);I(this,Xw,void 0);I(this,e8,void 0);I(this,bo,void 0);I(this,jy,void 0);I(this,Tp,void 0);_(this,Yw,e),_(this,Xw,t),_(this,e8,Object.keys(n).reduce((a,o)=>(a[o.toLowerCase()]=String(n[o]),a),{})),_(this,bo,s==null?null:new Uint8Array(s)),_(this,jy,i||null),_(this,Tp,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${l(this,bo)?(0,fW.hexlify)(l(this,bo)):"null"}>`}get statusCode(){return l(this,Yw)}get statusMessage(){return l(this,Xw)}get headers(){return Object.assign({},l(this,e8))}get body(){return l(this,bo)==null?null:new Uint8Array(l(this,bo))}get bodyText(){try{return l(this,bo)==null?"":(0,By.toUtf8String)(l(this,bo))}catch{(0,Qo.assert)(!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{(0,Qo.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);let s=new JN(599,n,this.headers,this.body,l(this,jy)||void 0);return _(s,Tp,{message:e,error:t}),s}throwThrottleError(e,t){t==null?t=-1:(0,Qo.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);let n=new Error(e||"throttling requests");throw(0,Cye.defineProperties)(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return l(this,bo)!=null}get request(){return l(this,jy)}ok(){return l(this,Tp).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=l(this,Tp);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let s=null;try{l(this,bo)&&(s=(0,By.toUtf8String)(l(this,bo)))}catch{}(0,Qo.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}},ed=JN;Yw=new WeakMap,Xw=new WeakMap,e8=new WeakMap,bo=new WeakMap,jy=new WeakMap,Tp=new WeakMap;Ul.FetchResponse=ed;function cW(){return new Date().getTime()}function Dye(r){return(0,By.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function Hye(r){return new Promise(e=>setTimeout(e,r))}});var rI=R(X9=>{"use strict";b();p();Object.defineProperty(X9,"__esModule",{value:!0});X9.FixedNumber=void 0;var Kye=Zo(),sa=mu(),ql=Ay(),Gye=Ml(),Vye=BigInt(-1),Au=BigInt(0),Ly=BigInt(1),zye=BigInt(5),Cy={},Uy="0000";for(;Uy.length<80;)Uy+=Uy;function Op(r){let e=Uy;for(;e.length<r;)e+=e;return BigInt("1"+e.substring(0,r))}function t8(r,e,t){let n=BigInt(e.width);if(e.signed){let s=Ly<<n-Ly;(0,sa.assert)(t==null||r>=-s&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r>Au?r=(0,ql.fromTwos)((0,ql.mask)(r,n),n):r=-(0,ql.fromTwos)((0,ql.mask)(-r,n),n)}else{let s=Ly<<n;(0,sa.assert)(t==null||r>=0&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r=(r%s+s)%s&s-Ly}return r}function ZN(r){typeof r=="number"&&(r=`fixed128x${r}`);let e=!0,t=128,n=18;if(typeof r=="string"){if(r!=="fixed")if(r==="ufixed")e=!1;else{let i=r.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,sa.assertArgument)(i,"invalid fixed format","format",r),e=i[1]!=="u",t=parseInt(i[2]),n=parseInt(i[3])}}else if(r){let i=r,a=(o,c,u)=>i[o]==null?u:((0,sa.assertArgument)(typeof i[o]===c,"invalid fixed format ("+o+" not "+c+")","format."+o,i[o]),i[o]);e=a("signed","boolean",e),t=a("width","number",t),n=a("decimals","number",n)}(0,sa.assertArgument)(t%8===0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,sa.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);let s=(e?"":"u")+"fixed"+String(t)+"x"+String(n);return{signed:e,width:t,decimals:n,name:s}}function Wye(r,e){let t="";r<Au&&(t="-",r*=Vye);let n=r.toString();if(e===0)return t+n;for(;n.length<=e;)n=Uy+n;let s=n.length-e;for(n=n.substring(0,s)+"."+n.substring(s);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 t+n}var Eu,Br,na,rd,Bp,Su,td,r8,YN,n8,XN,s8,eI,i8,tI,Fl=class{constructor(e,t,n){I(this,rd);I(this,Su);I(this,r8);I(this,n8);I(this,s8);I(this,i8);N(this,"format");I(this,Eu,void 0);I(this,Br,void 0);I(this,na,void 0);N(this,"_value");(0,sa.assertPrivate)(e,Cy,"FixedNumber"),_(this,Br,t),_(this,Eu,n);let s=Wye(t,n.decimals);(0,Gye.defineProperties)(this,{format:n.name,_value:s}),_(this,na,Op(n.decimals))}get signed(){return l(this,Eu).signed}get width(){return l(this,Eu).width}get decimals(){return l(this,Eu).decimals}get value(){return l(this,Br)}addUnsafe(e){return $(this,r8,YN).call(this,e)}add(e){return $(this,r8,YN).call(this,e,"add")}subUnsafe(e){return $(this,n8,XN).call(this,e)}sub(e){return $(this,n8,XN).call(this,e,"sub")}mulUnsafe(e){return $(this,s8,eI).call(this,e)}mul(e){return $(this,s8,eI).call(this,e,"mul")}mulSignal(e){$(this,rd,Bp).call(this,e);let t=l(this,Br)*l(e,Br);return(0,sa.assert)(t%l(this,na)===Au,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),$(this,Su,td).call(this,t/l(this,na),"mulSignal")}divUnsafe(e){return $(this,i8,tI).call(this,e)}div(e){return $(this,i8,tI).call(this,e,"div")}divSignal(e){(0,sa.assert)(l(e,Br)!==Au,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),$(this,rd,Bp).call(this,e);let t=l(this,Br)*l(this,na);return(0,sa.assert)(t%l(e,Br)===Au,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),$(this,Su,td).call(this,t/l(e,Br),"divSignal")}cmp(e){let t=this.value,n=e.value,s=this.decimals-e.decimals;return s>0?n*=Op(s):s<0&&(t*=Op(-s)),t<n?-1:t>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=l(this,Br);return l(this,Br)<Au&&(e-=l(this,na)-Ly),e=l(this,Br)/l(this,na)*l(this,na),$(this,Su,td).call(this,e,"floor")}ceiling(){let e=l(this,Br);return l(this,Br)>Au&&(e+=l(this,na)-Ly),e=l(this,Br)/l(this,na)*l(this,na),$(this,Su,td).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;let t=this.decimals-e,n=zye*Op(t-1),s=this.value+n,i=Op(t);return s=s/i*i,t8(s,l(this,Eu),"round"),new Fl(Cy,s,l(this,Eu))}isZero(){return l(this,Br)===Au}isNegative(){return l(this,Br)<Au}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Fl.fromString(this.toString(),e)}static fromValue(e,t,n){let s=t==null?0:(0,ql.getNumber)(t),i=ZN(n),a=(0,ql.getBigInt)(e,"value"),o=s-i.decimals;if(o>0){let c=Op(o);(0,sa.assert)(a%c===Au,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),a/=c}else o<0&&(a*=Op(-o));return t8(a,i,"fromValue"),new Fl(Cy,a,i)}static fromString(e,t){let n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,sa.assertArgument)(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);let s=ZN(t),i=n[2]||"0",a=n[3]||"";for(;a.length<s.decimals;)a+=Uy;(0,sa.assert)(a.substring(s.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),a=a.substring(0,s.decimals);let o=BigInt(n[1]+i+a);return t8(o,s,"fromString"),new Fl(Cy,o,s)}static fromBytes(e,t){let n=(0,ql.toBigInt)((0,Kye.getBytes)(e,"value")),s=ZN(t);return s.signed&&(n=(0,ql.fromTwos)(n,s.width)),t8(n,s,"fromBytes"),new Fl(Cy,n,s)}},QN=Fl;Eu=new WeakMap,Br=new WeakMap,na=new WeakMap,rd=new WeakSet,Bp=function(e){(0,sa.assertArgument)(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)},Su=new WeakSet,td=function(e,t){return e=t8(e,l(this,Eu),t),new Fl(Cy,e,l(this,Eu))},r8=new WeakSet,YN=function(e,t){return $(this,rd,Bp).call(this,e),$(this,Su,td).call(this,l(this,Br)+l(e,Br),t)},n8=new WeakSet,XN=function(e,t){return $(this,rd,Bp).call(this,e),$(this,Su,td).call(this,l(this,Br)-l(e,Br),t)},s8=new WeakSet,eI=function(e,t){return $(this,rd,Bp).call(this,e),$(this,Su,td).call(this,l(this,Br)*l(e,Br)/l(this,na),t)},i8=new WeakSet,tI=function(e,t){return(0,sa.assert)(l(e,Br)!==Au,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),$(this,rd,Bp).call(this,e),$(this,Su,td).call(this,l(this,Br)*l(this,na)/l(e,Br),t)};X9.FixedNumber=QN});var wW=R(tP=>{"use strict";b();p();Object.defineProperty(tP,"__esModule",{value:!0});tP.decodeRlp=void 0;var gW=Zo(),eP=mu(),$ye=Zo();function Jye(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function xW(r,e,t){let n=0;for(let s=0;s<t;s++)n=n*256+r[e+s];return n}function yW(r,e,t,n){let s=[];for(;t<e+1+n;){let i=mW(r,t);s.push(i.result),t+=i.consumed,(0,eP.assert)(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:s}}function mW(r,e){(0,eP.assert)(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});let t=n=>{(0,eP.assert)(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){let n=r[e]-247;t(e+1+n);let s=xW(r,e+1,n);return t(e+1+n+s),yW(r,e,e+1+n,n+s)}else if(r[e]>=192){let n=r[e]-192;return t(e+1+n),yW(r,e,e+1,n)}else if(r[e]>=184){let n=r[e]-183;t(e+1+n);let s=xW(r,e+1,n);t(e+1+n+s);let i=(0,gW.hexlify)(r.slice(e+1+n,e+1+n+s));return{consumed:1+n+s,result:i}}else if(r[e]>=128){let n=r[e]-128;t(e+1+n);let s=(0,gW.hexlify)(r.slice(e+1,e+1+n));return{consumed:1+n,result:s}}return{consumed:1,result:Jye(r[e])}}function Zye(r){let e=(0,$ye.getBytes)(r,"data"),t=mW(e,0);return(0,eP.assertArgument)(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}tP.decodeRlp=Zye});var AW=R(rP=>{"use strict";b();p();Object.defineProperty(rP,"__esModule",{value:!0});rP.encodeRlp=void 0;var Qye=Zo();function vW(r){let e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function _W(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(i){n=n.concat(_W(i))}),n.length<=55)return n.unshift(192+n.length),n;let s=vW(n.length);return s.unshift(247+s.length),s.concat(n)}let e=Array.prototype.slice.call((0,Qye.getBytes)(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let t=vW(e.length);return t.unshift(183+t.length),t.concat(e)}var PW="0123456789abcdef";function Yye(r){let e="0x";for(let t of _W(r))e+=PW[t>>4],e+=PW[t&15];return e}rP.encodeRlp=Yye});var kW=R(qf=>{"use strict";b();p();Object.defineProperty(qf,"__esModule",{value:!0});qf.parseEther=qf.formatEther=qf.parseUnits=qf.formatUnits=void 0;var nI=mu(),EW=rI(),SW=Ay(),TW=["wei","kwei","mwei","gwei","szabo","finney","ether"];function OW(r,e){let t=18;if(typeof e=="string"){let n=TW.indexOf(e);(0,nI.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,SW.getNumber)(e,"unit"));return EW.FixedNumber.fromValue(r,t,{decimals:t,width:512}).toString()}qf.formatUnits=OW;function BW(r,e){(0,nI.assertArgument)(typeof r=="string","value must be a string","value",r);let t=18;if(typeof e=="string"){let n=TW.indexOf(e);(0,nI.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,SW.getNumber)(e,"unit"));return EW.FixedNumber.fromString(r,{decimals:t,width:512}).value}qf.parseUnits=BW;function Xye(r){return OW(r,18)}qf.formatEther=Xye;function e1e(r){return BW(r,18)}qf.parseEther=e1e});var IW=R(nP=>{"use strict";b();p();Object.defineProperty(nP,"__esModule",{value:!0});nP.uuidV4=void 0;var NW=Zo();function t1e(r){let e=(0,NW.getBytes)(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=(0,NW.hexlify)(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}nP.uuidV4=t1e});var ke=R(le=>{"use strict";b();p();Object.defineProperty(le,"__esModule",{value:!0});le.toUtf8String=le.toUtf8CodePoints=le.toUtf8Bytes=le.parseUnits=le.formatUnits=le.parseEther=le.formatEther=le.encodeRlp=le.decodeRlp=le.defineProperties=le.resolveProperties=le.toQuantity=le.toBeArray=le.toBeHex=le.toNumber=le.toBigInt=le.getUint=le.getNumber=le.getBigInt=le.mask=le.toTwos=le.fromTwos=le.FixedNumber=le.FetchCancelSignal=le.FetchResponse=le.FetchRequest=le.EventPayload=le.makeError=le.assertNormalize=le.assertPrivate=le.assertArgumentCount=le.assertArgument=le.assert=le.isError=le.isCallException=le.zeroPadBytes=le.zeroPadValue=le.stripZerosLeft=le.dataSlice=le.dataLength=le.concat=le.hexlify=le.isBytesLike=le.isHexString=le.getBytesCopy=le.getBytes=le.encodeBase64=le.decodeBase64=le.encodeBase58=le.decodeBase58=void 0;le.uuidV4=le.Utf8ErrorFuncs=void 0;var RW=Xz();Object.defineProperty(le,"decodeBase58",{enumerable:!0,get:function(){return RW.decodeBase58}});Object.defineProperty(le,"encodeBase58",{enumerable:!0,get:function(){return RW.encodeBase58}});var jW=zN();Object.defineProperty(le,"decodeBase64",{enumerable:!0,get:function(){return jW.decodeBase64}});Object.defineProperty(le,"encodeBase64",{enumerable:!0,get:function(){return jW.encodeBase64}});var Tu=Zo();Object.defineProperty(le,"getBytes",{enumerable:!0,get:function(){return Tu.getBytes}});Object.defineProperty(le,"getBytesCopy",{enumerable:!0,get:function(){return Tu.getBytesCopy}});Object.defineProperty(le,"isHexString",{enumerable:!0,get:function(){return Tu.isHexString}});Object.defineProperty(le,"isBytesLike",{enumerable:!0,get:function(){return Tu.isBytesLike}});Object.defineProperty(le,"hexlify",{enumerable:!0,get:function(){return Tu.hexlify}});Object.defineProperty(le,"concat",{enumerable:!0,get:function(){return Tu.concat}});Object.defineProperty(le,"dataLength",{enumerable:!0,get:function(){return Tu.dataLength}});Object.defineProperty(le,"dataSlice",{enumerable:!0,get:function(){return Tu.dataSlice}});Object.defineProperty(le,"stripZerosLeft",{enumerable:!0,get:function(){return Tu.stripZerosLeft}});Object.defineProperty(le,"zeroPadValue",{enumerable:!0,get:function(){return Tu.zeroPadValue}});Object.defineProperty(le,"zeroPadBytes",{enumerable:!0,get:function(){return Tu.zeroPadBytes}});var Dl=mu();Object.defineProperty(le,"isCallException",{enumerable:!0,get:function(){return Dl.isCallException}});Object.defineProperty(le,"isError",{enumerable:!0,get:function(){return Dl.isError}});Object.defineProperty(le,"assert",{enumerable:!0,get:function(){return Dl.assert}});Object.defineProperty(le,"assertArgument",{enumerable:!0,get:function(){return Dl.assertArgument}});Object.defineProperty(le,"assertArgumentCount",{enumerable:!0,get:function(){return Dl.assertArgumentCount}});Object.defineProperty(le,"assertPrivate",{enumerable:!0,get:function(){return Dl.assertPrivate}});Object.defineProperty(le,"assertNormalize",{enumerable:!0,get:function(){return Dl.assertNormalize}});Object.defineProperty(le,"makeError",{enumerable:!0,get:function(){return Dl.makeError}});var r1e=tW();Object.defineProperty(le,"EventPayload",{enumerable:!0,get:function(){return r1e.EventPayload}});var sI=pW();Object.defineProperty(le,"FetchRequest",{enumerable:!0,get:function(){return sI.FetchRequest}});Object.defineProperty(le,"FetchResponse",{enumerable:!0,get:function(){return sI.FetchResponse}});Object.defineProperty(le,"FetchCancelSignal",{enumerable:!0,get:function(){return sI.FetchCancelSignal}});var n1e=rI();Object.defineProperty(le,"FixedNumber",{enumerable:!0,get:function(){return n1e.FixedNumber}});var Ou=Ay();Object.defineProperty(le,"fromTwos",{enumerable:!0,get:function(){return Ou.fromTwos}});Object.defineProperty(le,"toTwos",{enumerable:!0,get:function(){return Ou.toTwos}});Object.defineProperty(le,"mask",{enumerable:!0,get:function(){return Ou.mask}});Object.defineProperty(le,"getBigInt",{enumerable:!0,get:function(){return Ou.getBigInt}});Object.defineProperty(le,"getNumber",{enumerable:!0,get:function(){return Ou.getNumber}});Object.defineProperty(le,"getUint",{enumerable:!0,get:function(){return Ou.getUint}});Object.defineProperty(le,"toBigInt",{enumerable:!0,get:function(){return Ou.toBigInt}});Object.defineProperty(le,"toNumber",{enumerable:!0,get:function(){return Ou.toNumber}});Object.defineProperty(le,"toBeHex",{enumerable:!0,get:function(){return Ou.toBeHex}});Object.defineProperty(le,"toBeArray",{enumerable:!0,get:function(){return Ou.toBeArray}});Object.defineProperty(le,"toQuantity",{enumerable:!0,get:function(){return Ou.toQuantity}});var MW=Ml();Object.defineProperty(le,"resolveProperties",{enumerable:!0,get:function(){return MW.resolveProperties}});Object.defineProperty(le,"defineProperties",{enumerable:!0,get:function(){return MW.defineProperties}});var s1e=wW();Object.defineProperty(le,"decodeRlp",{enumerable:!0,get:function(){return s1e.decodeRlp}});var i1e=AW();Object.defineProperty(le,"encodeRlp",{enumerable:!0,get:function(){return i1e.encodeRlp}});var sP=kW();Object.defineProperty(le,"formatEther",{enumerable:!0,get:function(){return sP.formatEther}});Object.defineProperty(le,"parseEther",{enumerable:!0,get:function(){return sP.parseEther}});Object.defineProperty(le,"formatUnits",{enumerable:!0,get:function(){return sP.formatUnits}});Object.defineProperty(le,"parseUnits",{enumerable:!0,get:function(){return sP.parseUnits}});var iP=$9();Object.defineProperty(le,"toUtf8Bytes",{enumerable:!0,get:function(){return iP.toUtf8Bytes}});Object.defineProperty(le,"toUtf8CodePoints",{enumerable:!0,get:function(){return iP.toUtf8CodePoints}});Object.defineProperty(le,"toUtf8String",{enumerable:!0,get:function(){return iP.toUtf8String}});Object.defineProperty(le,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return iP.Utf8ErrorFuncs}});var a1e=IW();Object.defineProperty(le,"uuidV4",{enumerable:!0,get:function(){return a1e.uuidV4}})});var Yo=R(dn=>{"use strict";b();p();Object.defineProperty(dn,"__esModule",{value:!0});dn.Reader=dn.Writer=dn.Coder=dn.checkResultErrors=dn.Result=dn.WordSize=void 0;var Qn=ke();dn.WordSize=32;var iI=new Uint8Array(dn.WordSize),o1e=["then"],aP={},UW=new WeakMap;function kp(r){return UW.get(r)}function CW(r,e){UW.set(r,e)}function a8(r,e){let t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function aI(r,e,t){return r.indexOf(null)>=0?e.map((n,s)=>n instanceof o8?aI(kp(n),n,t):n):r.reduce((n,s,i)=>{let a=e.getValue(s);return s in n||(t&&a instanceof o8&&(a=aI(kp(a),a,t)),n[s]=a),n},{})}var qy,Fy=class extends Array{constructor(...t){let n=t[0],s=t[1],i=(t[2]||[]).slice(),a=!0;n!==aP&&(s=t,i=[],a=!1);super(s.length);I(this,qy,void 0);s.forEach((u,f)=>{this[f]=u});let o=i.reduce((u,f)=>(typeof f=="string"&&u.set(f,(u.get(f)||0)+1),u),new Map);if(CW(this,Object.freeze(s.map((u,f)=>{let d=i[f];return d!=null&&o.get(d)===1?d:null}))),_(this,qy,[]),l(this,qy)==null&&l(this,qy),!a)return;Object.freeze(this);let c=new Proxy(this,{get:(u,f,d)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){let h=(0,Qn.getNumber)(f,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");let m=u[h];return m instanceof Error&&a8(`index ${h}`,m),m}if(o1e.indexOf(f)>=0)return Reflect.get(u,f,d);let g=u[f];if(g instanceof Function)return function(...h){return g.apply(this===d?u:this,h)};if(!(f in u))return u.getValue.apply(this===d?u:this,[f])}return Reflect.get(u,f,d)}});return CW(c,kp(this)),c}toArray(t){let n=[];return this.forEach((s,i)=>{s instanceof Error&&a8(`index ${i}`,s),t&&s instanceof Fy&&(s=s.toArray(t)),n.push(s)}),n}toObject(t){let n=kp(this);return n.reduce((s,i,a)=>((0,Qn.assert)(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),aI(n,this,t)),{})}slice(t,n){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);let s=kp(this),i=[],a=[];for(let o=t;o<n;o++)i.push(this[o]),a.push(s[o]);return new Fy(aP,i,a)}filter(t,n){let s=kp(this),i=[],a=[];for(let o=0;o<this.length;o++){let c=this[o];c instanceof Error&&a8(`index ${o}`,c),t.call(n,c,o,this)&&(i.push(c),a.push(s[o]))}return new Fy(aP,i,a)}map(t,n){let s=[];for(let i=0;i<this.length;i++){let a=this[i];a instanceof Error&&a8(`index ${i}`,a),s.push(t.call(n,a,i,this))}return s}getValue(t){let n=kp(this).indexOf(t);if(n===-1)return;let s=this[n];return s instanceof Error&&a8(`property ${JSON.stringify(t)}`,s.error),s}static fromItems(t,n){return new Fy(aP,t,n)}},o8=Fy;qy=new WeakMap;dn.Result=o8;function c1e(r){let e=[],t=function(n,s){if(!!Array.isArray(s))for(let i in s){let a=n.slice();a.push(i);try{t(a,s[i])}catch(o){e.push({path:a,error:o})}}};return t([],r),e}dn.checkResultErrors=c1e;function LW(r){let e=(0,Qn.toBeArray)(r);return(0,Qn.assert)(e.length<=dn.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:dn.WordSize,offset:e.length}),e.length!==dn.WordSize&&(e=(0,Qn.getBytesCopy)((0,Qn.concat)([iI.slice(e.length%dn.WordSize),e]))),e}var oI=class{constructor(e,t,n,s){N(this,"name");N(this,"type");N(this,"localName");N(this,"dynamic");(0,Qn.defineProperties)(this,{name:e,type:t,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){(0,Qn.assertArgument)(!1,e,this.localName,t)}};dn.Coder=oI;var nd,Np,Dy,oP,cI=class{constructor(){I(this,Dy);I(this,nd,void 0);I(this,Np,void 0);_(this,nd,[]),_(this,Np,0)}get data(){return(0,Qn.concat)(l(this,nd))}get length(){return l(this,Np)}appendWriter(e){return $(this,Dy,oP).call(this,(0,Qn.getBytesCopy)(e.data))}writeBytes(e){let t=(0,Qn.getBytesCopy)(e),n=t.length%dn.WordSize;return n&&(t=(0,Qn.getBytesCopy)((0,Qn.concat)([t,iI.slice(n)]))),$(this,Dy,oP).call(this,t)}writeValue(e){return $(this,Dy,oP).call(this,LW(e))}writeUpdatableValue(){let e=l(this,nd).length;return l(this,nd).push(iI),_(this,Np,l(this,Np)+dn.WordSize),t=>{l(this,nd)[e]=LW(t)}}};nd=new WeakMap,Np=new WeakMap,Dy=new WeakSet,oP=function(e){return l(this,nd).push(e),_(this,Np,l(this,Np)+e.length),e.length};dn.Writer=cI;var Ra,po,Ip,Rp,Hl,c8,fI,cP,FW,dI=class{constructor(e,t,n){I(this,c8);I(this,cP);N(this,"allowLoose");I(this,Ra,void 0);I(this,po,void 0);I(this,Ip,void 0);I(this,Rp,void 0);I(this,Hl,void 0);(0,Qn.defineProperties)(this,{allowLoose:!!t}),_(this,Ra,(0,Qn.getBytesCopy)(e)),_(this,Ip,0),_(this,Rp,null),_(this,Hl,n??1024),_(this,po,0)}get data(){return(0,Qn.hexlify)(l(this,Ra))}get dataLength(){return l(this,Ra).length}get consumed(){return l(this,po)}get bytes(){return new Uint8Array(l(this,Ra))}subReader(e){let t=new dI(l(this,Ra).slice(l(this,po)+e),this.allowLoose,l(this,Hl));return _(t,Rp,this),t}readBytes(e,t){let n=$(this,cP,FW).call(this,0,e,!!t);return $(this,c8,fI).call(this,e),_(this,po,l(this,po)+n.length),n.slice(0,e)}readValue(){return(0,Qn.toBigInt)(this.readBytes(dn.WordSize))}readIndex(){return(0,Qn.toNumber)(this.readBytes(dn.WordSize))}},uI=dI;Ra=new WeakMap,po=new WeakMap,Ip=new WeakMap,Rp=new WeakMap,Hl=new WeakMap,c8=new WeakSet,fI=function(e){var t;if(l(this,Rp))return $(t=l(this,Rp),c8,fI).call(t,e);_(this,Ip,l(this,Ip)+e),(0,Qn.assert)(l(this,Hl)<1||l(this,Ip)<=l(this,Hl)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${l(this,Hl)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,Qn.getBytesCopy)(l(this,Ra)),offset:l(this,po),length:e,info:{bytesRead:l(this,Ip),dataLength:this.dataLength}})},cP=new WeakSet,FW=function(e,t,n){let s=Math.ceil(t/dn.WordSize)*dn.WordSize;return l(this,po)+s>l(this,Ra).length&&(this.allowLoose&&n&&l(this,po)+t<=l(this,Ra).length?s=t:(0,Qn.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,Qn.getBytesCopy)(l(this,Ra)),length:l(this,Ra).length,offset:l(this,po)+s})),l(this,Ra).slice(l(this,po),l(this,po)+s)};dn.Reader=uI});var Hy=R(ia=>{"use strict";b();p();Object.defineProperty(ia,"__esModule",{value:!0});ia.output=ia.exists=ia.hash=ia.bytes=ia.bool=ia.number=void 0;function uP(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}ia.number=uP;function qW(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}ia.bool=qW;function lI(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}ia.bytes=lI;function DW(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");uP(r.outputLen),uP(r.blockLen)}ia.hash=DW;function HW(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}ia.exists=HW;function KW(r,e){lI(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}ia.output=KW;var u1e={number:uP,bool:qW,bytes:lI,hash:DW,exists:HW,output:KW};ia.default=u1e});var GW=R(fP=>{"use strict";b();p();Object.defineProperty(fP,"__esModule",{value:!0});fP.crypto=void 0;fP.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var Bu=R(Mt=>{"use strict";b();p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.randomBytes=Mt.wrapXOFConstructorWithOpts=Mt.wrapConstructorWithOpts=Mt.wrapConstructor=Mt.checkOpts=Mt.Hash=Mt.concatBytes=Mt.toBytes=Mt.utf8ToBytes=Mt.asyncLoop=Mt.nextTick=Mt.hexToBytes=Mt.bytesToHex=Mt.isLE=Mt.rotr=Mt.createView=Mt.u32=Mt.u8=void 0;var hI=GW(),pI=r=>r instanceof Uint8Array,f1e=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Mt.u8=f1e;var d1e=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Mt.u32=d1e;var l1e=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Mt.createView=l1e;var h1e=(r,e)=>r<<32-e|r>>>e;Mt.rotr=h1e;Mt.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Mt.isLE)throw new Error("Non little-endian hardware is not supported");var b1e=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function p1e(r){if(!pI(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=b1e[r[t]];return e}Mt.bytesToHex=p1e;function g1e(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");t[n]=a}return t}Mt.hexToBytes=g1e;var x1e=async()=>{};Mt.nextTick=x1e;async function y1e(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,Mt.nextTick)(),n+=i)}}Mt.asyncLoop=y1e;function VW(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Mt.utf8ToBytes=VW;function dP(r){if(typeof r=="string"&&(r=VW(r)),!pI(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}Mt.toBytes=dP;function m1e(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!pI(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}Mt.concatBytes=m1e;var bI=class{clone(){return this._cloneInto()}};Mt.Hash=bI;var w1e={}.toString;function v1e(r,e){if(e!==void 0&&w1e.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}Mt.checkOpts=v1e;function P1e(r){let e=n=>r().update(dP(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}Mt.wrapConstructor=P1e;function _1e(r){let e=(n,s)=>r(s).update(dP(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Mt.wrapConstructorWithOpts=_1e;function A1e(r){let e=(n,s)=>r(s).update(dP(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Mt.wrapXOFConstructorWithOpts=A1e;function E1e(r=32){if(hI.crypto&&typeof hI.crypto.getRandomValues=="function")return hI.crypto.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}Mt.randomBytes=E1e});var hP=R(jp=>{"use strict";b();p();Object.defineProperty(jp,"__esModule",{value:!0});jp.hmac=jp.HMAC=void 0;var lP=Hy(),zW=Bu(),u8=class extends zW.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,lP.hash)(e);let n=(0,zW.toBytes)(t);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;let s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let a=0;a<i.length;a++)i[a]^=54;this.iHash.update(i),this.oHash=e.create();for(let a=0;a<i.length;a++)i[a]^=106;this.oHash.update(i),i.fill(0)}update(e){return(0,lP.exists)(this),this.iHash.update(e),this}digestInto(e){(0,lP.exists)(this),(0,lP.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:n,finished:s,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};jp.HMAC=u8;var S1e=(r,e,t)=>new u8(r,e).update(t).digest();jp.hmac=S1e;jp.hmac.create=(r,e)=>new u8(r,e)});var gI=R(Gy=>{"use strict";b();p();Object.defineProperty(Gy,"__esModule",{value:!0});Gy.pbkdf2Async=Gy.pbkdf2=void 0;var bP=Hy(),T1e=hP(),Ky=Bu();function WW(r,e,t,n){(0,bP.hash)(r);let s=(0,Ky.checkOpts)({dkLen:32,asyncTick:10},n),{c:i,dkLen:a,asyncTick:o}=s;if((0,bP.number)(i),(0,bP.number)(a),(0,bP.number)(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=(0,Ky.toBytes)(e),u=(0,Ky.toBytes)(t),f=new Uint8Array(a),d=T1e.hmac.create(r,c),g=d._cloneInto().update(u);return{c:i,dkLen:a,asyncTick:o,DK:f,PRF:d,PRFSalt:g}}function $W(r,e,t,n,s){return r.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),t}function O1e(r,e,t,n){let{c:s,dkLen:i,DK:a,PRF:o,PRFSalt:c}=WW(r,e,t,n),u,f=new Uint8Array(4),d=(0,Ky.createView)(f),g=new Uint8Array(o.outputLen);for(let h=1,m=0;m<i;h++,m+=o.outputLen){let y=a.subarray(m,m+o.outputLen);d.setInt32(0,h,!1),(u=c._cloneInto(u)).update(f).digestInto(g),y.set(g.subarray(0,y.length));for(let S=1;S<s;S++){o._cloneInto(u).update(g).digestInto(g);for(let T=0;T<y.length;T++)y[T]^=g[T]}}return $W(o,c,a,u,g)}Gy.pbkdf2=O1e;async function B1e(r,e,t,n){let{c:s,dkLen:i,asyncTick:a,DK:o,PRF:c,PRFSalt:u}=WW(r,e,t,n),f,d=new Uint8Array(4),g=(0,Ky.createView)(d),h=new Uint8Array(c.outputLen);for(let m=1,y=0;y<i;m++,y+=c.outputLen){let S=o.subarray(y,y+c.outputLen);g.setInt32(0,m,!1),(f=u._cloneInto(f)).update(d).digestInto(h),S.set(h.subarray(0,S.length)),await(0,Ky.asyncLoop)(s-1,a,()=>{c._cloneInto(f).update(h).digestInto(h);for(let T=0;T<S.length;T++)S[T]^=h[T]})}return $W(c,u,o,f,h)}Gy.pbkdf2Async=B1e});var gP=R(pP=>{"use strict";b();p();Object.defineProperty(pP,"__esModule",{value:!0});pP.SHA2=void 0;var xI=Hy(),f8=Bu();function k1e(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),a=Number(t>>s&i),o=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,a,n),r.setUint32(e+u,o,n)}var yI=class extends f8.Hash{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,f8.createView)(this.buffer)}update(e){(0,xI.exists)(this);let{view:t,buffer:n,blockLen:s}=this;e=(0,f8.toBytes)(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(s-this.pos,i-a);if(o===s){let c=(0,f8.createView)(e);for(;s<=i-a;a+=s)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,xI.exists)(this),(0,xI.output)(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let d=a;d<s;d++)t[d]=0;k1e(n,s-8,BigInt(this.length*8),i),this.process(n,0);let o=(0,f8.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)o.setUint32(4*d,f[d],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:a,pos:o}=this;return e.length=s,e.pos=o,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(n),e}};pP.SHA2=yI});var yP=R(Vy=>{"use strict";b();p();Object.defineProperty(Vy,"__esModule",{value:!0});Vy.sha224=Vy.sha256=void 0;var N1e=gP(),Xo=Bu(),I1e=(r,e,t)=>r&e^~r&t,R1e=(r,e,t)=>r&e^r&t^e&t,j1e=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]),Kl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Gl=new Uint32Array(64),xP=class extends N1e.SHA2{constructor(){super(64,32,8,!1),this.A=Kl[0]|0,this.B=Kl[1]|0,this.C=Kl[2]|0,this.D=Kl[3]|0,this.E=Kl[4]|0,this.F=Kl[5]|0,this.G=Kl[6]|0,this.H=Kl[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:a,G:o,H:c}=this;return[e,t,n,s,i,a,o,c]}set(e,t,n,s,i,a,o,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,t){for(let d=0;d<16;d++,t+=4)Gl[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=Gl[d-15],h=Gl[d-2],m=(0,Xo.rotr)(g,7)^(0,Xo.rotr)(g,18)^g>>>3,y=(0,Xo.rotr)(h,17)^(0,Xo.rotr)(h,19)^h>>>10;Gl[d]=y+Gl[d-7]+m+Gl[d-16]|0}let{A:n,B:s,C:i,D:a,E:o,F:c,G:u,H:f}=this;for(let d=0;d<64;d++){let g=(0,Xo.rotr)(o,6)^(0,Xo.rotr)(o,11)^(0,Xo.rotr)(o,25),h=f+g+I1e(o,c,u)+j1e[d]+Gl[d]|0,y=((0,Xo.rotr)(n,2)^(0,Xo.rotr)(n,13)^(0,Xo.rotr)(n,22))+R1e(n,s,i)|0;f=u,u=c,c=o,o=a+h|0,a=i,i=s,s=n,n=h+y|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+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,s,i,a,o,c,u,f)}roundClean(){Gl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},mI=class extends xP{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};Vy.sha256=(0,Xo.wrapConstructor)(()=>new xP);Vy.sha224=(0,Xo.wrapConstructor)(()=>new mI)});var PI=R(ot=>{"use strict";b();p();Object.defineProperty(ot,"__esModule",{value:!0});ot.add5L=ot.add5H=ot.add4H=ot.add4L=ot.add3H=ot.add3L=ot.add=ot.rotlBL=ot.rotlBH=ot.rotlSL=ot.rotlSH=ot.rotr32L=ot.rotr32H=ot.rotrBL=ot.rotrBH=ot.rotrSL=ot.rotrSH=ot.shrSL=ot.shrSH=ot.toBig=ot.split=ot.fromBig=void 0;var mP=BigInt(2**32-1),wI=BigInt(32);function vI(r,e=!1){return e?{h:Number(r&mP),l:Number(r>>wI&mP)}:{h:Number(r>>wI&mP)|0,l:Number(r&mP)|0}}ot.fromBig=vI;function JW(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:a}=vI(r[s],e);[t[s],n[s]]=[i,a]}return[t,n]}ot.split=JW;var ZW=(r,e)=>BigInt(r>>>0)<<wI|BigInt(e>>>0);ot.toBig=ZW;var QW=(r,e,t)=>r>>>t;ot.shrSH=QW;var YW=(r,e,t)=>r<<32-t|e>>>t;ot.shrSL=YW;var XW=(r,e,t)=>r>>>t|e<<32-t;ot.rotrSH=XW;var e$=(r,e,t)=>r<<32-t|e>>>t;ot.rotrSL=e$;var t$=(r,e,t)=>r<<64-t|e>>>t-32;ot.rotrBH=t$;var r$=(r,e,t)=>r>>>t-32|e<<64-t;ot.rotrBL=r$;var n$=(r,e)=>e;ot.rotr32H=n$;var s$=(r,e)=>r;ot.rotr32L=s$;var i$=(r,e,t)=>r<<t|e>>>32-t;ot.rotlSH=i$;var a$=(r,e,t)=>e<<t|r>>>32-t;ot.rotlSL=a$;var o$=(r,e,t)=>e<<t-32|r>>>64-t;ot.rotlBH=o$;var c$=(r,e,t)=>r<<t-32|e>>>64-t;ot.rotlBL=c$;function u$(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}ot.add=u$;var f$=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);ot.add3L=f$;var d$=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;ot.add3H=d$;var l$=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);ot.add4L=l$;var h$=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;ot.add4H=h$;var b$=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);ot.add5L=b$;var p$=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;ot.add5H=p$;var M1e={fromBig:vI,split:JW,toBig:ZW,shrSH:QW,shrSL:YW,rotrSH:XW,rotrSL:e$,rotrBH:t$,rotrBL:r$,rotr32H:n$,rotr32L:s$,rotlSH:i$,rotlSL:a$,rotlBH:o$,rotlBL:c$,add:u$,add3L:f$,add3H:d$,add4L:l$,add4H:h$,add5H:p$,add5L:b$};ot.default=M1e});var g$=R(ec=>{"use strict";b();p();Object.defineProperty(ec,"__esModule",{value:!0});ec.sha384=ec.sha512_256=ec.sha512_224=ec.sha512=ec.SHA512=void 0;var C1e=gP(),Ct=PI(),wP=Bu(),[L1e,U1e]=(()=>Ct.default.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(r=>BigInt(r))))(),Vl=new Uint32Array(80),zl=new Uint32Array(80),Mp=class extends C1e.SHA2{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(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:a,Dh:o,Dl:c,Eh:u,El:f,Fh:d,Fl:g,Gh:h,Gl:m,Hh:y,Hl:S}=this;return[e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S]}set(e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=d|0,this.Fl=g|0,this.Gh=h|0,this.Gl=m|0,this.Hh=y|0,this.Hl=S|0}process(e,t){for(let C=0;C<16;C++,t+=4)Vl[C]=e.getUint32(t),zl[C]=e.getUint32(t+=4);for(let C=16;C<80;C++){let J=Vl[C-15]|0,z=zl[C-15]|0,W=Ct.default.rotrSH(J,z,1)^Ct.default.rotrSH(J,z,8)^Ct.default.shrSH(J,z,7),Y=Ct.default.rotrSL(J,z,1)^Ct.default.rotrSL(J,z,8)^Ct.default.shrSL(J,z,7),Z=Vl[C-2]|0,se=zl[C-2]|0,q=Ct.default.rotrSH(Z,se,19)^Ct.default.rotrBH(Z,se,61)^Ct.default.shrSH(Z,se,6),x=Ct.default.rotrSL(Z,se,19)^Ct.default.rotrBL(Z,se,61)^Ct.default.shrSL(Z,se,6),O=Ct.default.add4L(Y,x,zl[C-7],zl[C-16]),B=Ct.default.add4H(O,W,q,Vl[C-7],Vl[C-16]);Vl[C]=B|0,zl[C]=O|0}let{Ah:n,Al:s,Bh:i,Bl:a,Ch:o,Cl:c,Dh:u,Dl:f,Eh:d,El:g,Fh:h,Fl:m,Gh:y,Gl:S,Hh:T,Hl:H}=this;for(let C=0;C<80;C++){let J=Ct.default.rotrSH(d,g,14)^Ct.default.rotrSH(d,g,18)^Ct.default.rotrBH(d,g,41),z=Ct.default.rotrSL(d,g,14)^Ct.default.rotrSL(d,g,18)^Ct.default.rotrBL(d,g,41),W=d&h^~d&y,Y=g&m^~g&S,Z=Ct.default.add5L(H,z,Y,U1e[C],zl[C]),se=Ct.default.add5H(Z,T,J,W,L1e[C],Vl[C]),q=Z|0,x=Ct.default.rotrSH(n,s,28)^Ct.default.rotrBH(n,s,34)^Ct.default.rotrBH(n,s,39),O=Ct.default.rotrSL(n,s,28)^Ct.default.rotrBL(n,s,34)^Ct.default.rotrBL(n,s,39),B=n&i^n&o^i&o,A=s&a^s&c^a&c;T=y|0,H=S|0,y=h|0,S=m|0,h=d|0,m=g|0,{h:d,l:g}=Ct.default.add(u|0,f|0,se|0,q|0),u=o|0,f=c|0,o=i|0,c=a|0,i=n|0,a=s|0;let E=Ct.default.add3L(q,O,A);n=Ct.default.add3H(E,se,x,B),s=E|0}({h:n,l:s}=Ct.default.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:a}=Ct.default.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:c}=Ct.default.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:u,l:f}=Ct.default.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:d,l:g}=Ct.default.add(this.Eh|0,this.El|0,d|0,g|0),{h,l:m}=Ct.default.add(this.Fh|0,this.Fl|0,h|0,m|0),{h:y,l:S}=Ct.default.add(this.Gh|0,this.Gl|0,y|0,S|0),{h:T,l:H}=Ct.default.add(this.Hh|0,this.Hl|0,T|0,H|0),this.set(n,s,i,a,o,c,u,f,d,g,h,m,y,S,T,H)}roundClean(){Vl.fill(0),zl.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)}};ec.SHA512=Mp;var _I=class extends Mp{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},AI=class extends Mp{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},EI=class extends Mp{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};ec.sha512=(0,wP.wrapConstructor)(()=>new Mp);ec.sha512_224=(0,wP.wrapConstructor)(()=>new _I);ec.sha512_256=(0,wP.wrapConstructor)(()=>new AI);ec.sha384=(0,wP.wrapConstructor)(()=>new EI)});var l8=R(Df=>{"use strict";b();p();Object.defineProperty(Df,"__esModule",{value:!0});Df.randomBytes=Df.pbkdf2Sync=Df.createHmac=Df.createHash=void 0;var F1e=hP(),q1e=gI(),SI=yP(),TI=g$(),d8=ke();function D1e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}var x$=D1e(),y$=x$.crypto||x$.msCrypto;function H1e(r){switch(r){case"sha256":return SI.sha256.create();case"sha512":return TI.sha512.create()}(0,d8.assertArgument)(!1,"invalid hashing algorithm name","algorithm",r)}Df.createHash=H1e;function K1e(r,e){let t={sha256:SI.sha256,sha512:TI.sha512}[r];return(0,d8.assertArgument)(t!=null,"invalid hmac algorithm","algorithm",r),F1e.hmac.create(t,e)}Df.createHmac=K1e;function G1e(r,e,t,n,s){let i={sha256:SI.sha256,sha512:TI.sha512}[s];return(0,d8.assertArgument)(i!=null,"invalid pbkdf2 algorithm","algorithm",s),(0,q1e.pbkdf2)(i,r,e,{c:t,dkLen:n})}Df.pbkdf2Sync=G1e;function V1e(r){(0,d8.assert)(y$!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,d8.assertArgument)(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);let e=new Uint8Array(r);return y$.getRandomValues(e),e}Df.randomBytes=V1e});var P$=R(vP=>{"use strict";b();p();Object.defineProperty(vP,"__esModule",{value:!0});vP.computeHmac=void 0;var z1e=l8(),OI=ke(),m$=!1,w$=function(r,e,t){return(0,z1e.createHmac)(r,e).update(t).digest()},v$=w$;function h8(r,e,t){let n=(0,OI.getBytes)(e,"key"),s=(0,OI.getBytes)(t,"data");return(0,OI.hexlify)(v$(r,n,s))}vP.computeHmac=h8;h8._=w$;h8.lock=function(){m$=!0};h8.register=function(r){if(m$)throw new Error("computeHmac is locked");v$=r};Object.freeze(h8)});var k$=R(Wr=>{"use strict";b();p();Object.defineProperty(Wr,"__esModule",{value:!0});Wr.shake256=Wr.shake128=Wr.keccak_512=Wr.keccak_384=Wr.keccak_256=Wr.keccak_224=Wr.sha3_512=Wr.sha3_384=Wr.sha3_256=Wr.sha3_224=Wr.Keccak=Wr.keccakP=void 0;var zy=Hy(),g8=PI(),p8=Bu(),[E$,S$,T$]=[[],[],[]],W1e=BigInt(0),b8=BigInt(1),$1e=BigInt(2),J1e=BigInt(7),Z1e=BigInt(256),Q1e=BigInt(113);for(let r=0,e=b8,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],E$.push(2*(5*n+t)),S$.push((r+1)*(r+2)/2%64);let s=W1e;for(let i=0;i<7;i++)e=(e<<b8^(e>>J1e)*Q1e)%Z1e,e&$1e&&(s^=b8<<(b8<<BigInt(i))-b8);T$.push(s)}var[Y1e,X1e]=(0,g8.split)(T$,!0),_$=(r,e,t)=>t>32?(0,g8.rotlBH)(r,e,t):(0,g8.rotlSH)(r,e,t),A$=(r,e,t)=>t>32?(0,g8.rotlBL)(r,e,t):(0,g8.rotlSL)(r,e,t);function O$(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)t[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){let o=(a+8)%10,c=(a+2)%10,u=t[c],f=t[c+1],d=_$(u,f,1)^t[o],g=A$(u,f,1)^t[o+1];for(let h=0;h<50;h+=10)r[a+h]^=d,r[a+h+1]^=g}let s=r[2],i=r[3];for(let a=0;a<24;a++){let o=S$[a],c=_$(s,i,o),u=A$(s,i,o),f=E$[a];s=r[f],i=r[f+1],r[f]=c,r[f+1]=u}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=r[a+o];for(let o=0;o<10;o++)r[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}r[0]^=Y1e[n],r[1]^=X1e[n]}t.fill(0)}Wr.keccakP=O$;var Cp=class extends p8.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,zy.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,p8.u32)(this.state)}keccak(){O$(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,zy.exists)(this);let{blockLen:t,state:n}=this;e=(0,p8.toBytes)(e);let s=e.length;for(let i=0;i<s;){let a=Math.min(t-this.pos,s-i);for(let o=0;o<a;o++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,zy.exists)(this,!1),(0,zy.bytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,zy.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,zy.output)(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){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:a}=this;return e||(e=new Cp(t,n,s,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}};Wr.Keccak=Cp;var Wl=(r,e,t)=>(0,p8.wrapConstructor)(()=>new Cp(e,r,t));Wr.sha3_224=Wl(6,144,224/8);Wr.sha3_256=Wl(6,136,256/8);Wr.sha3_384=Wl(6,104,384/8);Wr.sha3_512=Wl(6,72,512/8);Wr.keccak_224=Wl(1,144,224/8);Wr.keccak_256=Wl(1,136,256/8);Wr.keccak_384=Wl(1,104,384/8);Wr.keccak_512=Wl(1,72,512/8);var B$=(r,e,t)=>(0,p8.wrapXOFConstructorWithOpts)((n={})=>new Cp(e,r,n.dkLen===void 0?t:n.dkLen,!0));Wr.shake128=B$(31,168,128/8);Wr.shake256=B$(31,136,256/8)});var M$=R(PP=>{"use strict";b();p();Object.defineProperty(PP,"__esModule",{value:!0});PP.keccak256=void 0;var eme=k$(),N$=ke(),I$=!1,R$=function(r){return(0,eme.keccak_256)(r)},j$=R$;function x8(r){let e=(0,N$.getBytes)(r,"data");return(0,N$.hexlify)(j$(e))}PP.keccak256=x8;x8._=R$;x8.lock=function(){I$=!0};x8.register=function(r){if(I$)throw new TypeError("keccak256 is locked");j$=r};Object.freeze(x8)});var F$=R(Wy=>{"use strict";b();p();Object.defineProperty(Wy,"__esModule",{value:!0});Wy.ripemd160=Wy.RIPEMD160=void 0;var tme=gP(),rme=Bu(),nme=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),L$=Uint8Array.from({length:16},(r,e)=>e),sme=L$.map(r=>(9*r+5)%16),BI=[L$],kI=[sme];for(let r=0;r<4;r++)for(let e of[BI,kI])e.push(e[r].map(t=>nme[t]));var U$=[[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(r=>new Uint8Array(r)),ime=BI.map((r,e)=>r.map(t=>U$[e][t])),ame=kI.map((r,e)=>r.map(t=>U$[e][t])),ome=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),cme=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),_P=(r,e)=>r<<e|r>>>32-e;function C$(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}var AP=new Uint32Array(16),EP=class extends tme.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:s,h4:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=s|0,this.h4=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)AP[h]=e.getUint32(t,!0);let n=this.h0|0,s=n,i=this.h1|0,a=i,o=this.h2|0,c=o,u=this.h3|0,f=u,d=this.h4|0,g=d;for(let h=0;h<5;h++){let m=4-h,y=ome[h],S=cme[h],T=BI[h],H=kI[h],C=ime[h],J=ame[h];for(let z=0;z<16;z++){let W=_P(n+C$(h,i,o,u)+AP[T[z]]+y,C[z])+d|0;n=d,d=u,u=_P(o,10)|0,o=i,i=W}for(let z=0;z<16;z++){let W=_P(s+C$(m,a,c,f)+AP[H[z]]+S,J[z])+g|0;s=g,g=f,f=_P(c,10)|0,c=a,a=W}}this.set(this.h1+o+f|0,this.h2+u+g|0,this.h3+d+s|0,this.h4+n+a|0,this.h0+i+c|0)}roundClean(){AP.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};Wy.RIPEMD160=EP;Wy.ripemd160=(0,rme.wrapConstructor)(()=>new EP)});var G$=R(SP=>{"use strict";b();p();Object.defineProperty(SP,"__esModule",{value:!0});SP.ripemd160=void 0;var ume=F$(),q$=ke(),D$=!1,H$=function(r){return(0,ume.ripemd160)(r)},K$=H$;function y8(r){let e=(0,q$.getBytes)(r,"data");return(0,q$.hexlify)(K$(e))}SP.ripemd160=y8;y8._=H$;y8.lock=function(){D$=!0};y8.register=function(r){if(D$)throw new TypeError("ripemd160 is locked");K$=r};Object.freeze(y8)});var $$=R(TP=>{"use strict";b();p();Object.defineProperty(TP,"__esModule",{value:!0});TP.pbkdf2=void 0;var fme=l8(),NI=ke(),V$=!1,z$=function(r,e,t,n,s){return(0,fme.pbkdf2Sync)(r,e,t,n,s)},W$=z$;function m8(r,e,t,n,s){let i=(0,NI.getBytes)(r,"password"),a=(0,NI.getBytes)(e,"salt");return(0,NI.hexlify)(W$(i,a,t,n,s))}TP.pbkdf2=m8;m8._=z$;m8.lock=function(){V$=!0};m8.register=function(r){if(V$)throw new Error("pbkdf2 is locked");W$=r};Object.freeze(m8)});var Y$=R(OP=>{"use strict";b();p();Object.defineProperty(OP,"__esModule",{value:!0});OP.randomBytes=void 0;var dme=l8(),J$=!1,Z$=function(r){return new Uint8Array((0,dme.randomBytes)(r))},Q$=Z$;function w8(r){return Q$(r)}OP.randomBytes=w8;w8._=Z$;w8.lock=function(){J$=!0};w8.register=function(r){if(J$)throw new Error("randomBytes is locked");Q$=r};Object.freeze(w8)});var sJ=R(Qy=>{"use strict";b();p();Object.defineProperty(Qy,"__esModule",{value:!0});Qy.scryptAsync=Qy.scrypt=void 0;var $y=Hy(),eJ=yP(),tJ=gI(),Jy=Bu(),hr=(r,e)=>r<<e|r>>>32-e;function X$(r,e,t,n,s,i){let a=r[e++]^t[n++],o=r[e++]^t[n++],c=r[e++]^t[n++],u=r[e++]^t[n++],f=r[e++]^t[n++],d=r[e++]^t[n++],g=r[e++]^t[n++],h=r[e++]^t[n++],m=r[e++]^t[n++],y=r[e++]^t[n++],S=r[e++]^t[n++],T=r[e++]^t[n++],H=r[e++]^t[n++],C=r[e++]^t[n++],J=r[e++]^t[n++],z=r[e++]^t[n++],W=a,Y=o,Z=c,se=u,q=f,x=d,O=g,B=h,A=m,E=y,j=S,G=T,M=H,P=C,K=J,re=z;for(let ie=0;ie<8;ie+=2)q^=hr(W+M|0,7),A^=hr(q+W|0,9),M^=hr(A+q|0,13),W^=hr(M+A|0,18),E^=hr(x+Y|0,7),P^=hr(E+x|0,9),Y^=hr(P+E|0,13),x^=hr(Y+P|0,18),K^=hr(j+O|0,7),Z^=hr(K+j|0,9),O^=hr(Z+K|0,13),j^=hr(O+Z|0,18),se^=hr(re+G|0,7),B^=hr(se+re|0,9),G^=hr(B+se|0,13),re^=hr(G+B|0,18),Y^=hr(W+se|0,7),Z^=hr(Y+W|0,9),se^=hr(Z+Y|0,13),W^=hr(se+Z|0,18),O^=hr(x+q|0,7),B^=hr(O+x|0,9),q^=hr(B+O|0,13),x^=hr(q+B|0,18),G^=hr(j+E|0,7),A^=hr(G+j|0,9),E^=hr(A+G|0,13),j^=hr(E+A|0,18),M^=hr(re+K|0,7),P^=hr(M+re|0,9),K^=hr(P+M|0,13),re^=hr(K+P|0,18);s[i++]=a+W|0,s[i++]=o+Y|0,s[i++]=c+Z|0,s[i++]=u+se|0,s[i++]=f+q|0,s[i++]=d+x|0,s[i++]=g+O|0,s[i++]=h+B|0,s[i++]=m+A|0,s[i++]=y+E|0,s[i++]=S+j|0,s[i++]=T+G|0,s[i++]=H+M|0,s[i++]=C+P|0,s[i++]=J+K|0,s[i++]=z+re|0}function Zy(r,e,t,n,s){let i=n+0,a=n+16*s;for(let o=0;o<16;o++)t[a+o]=r[e+(2*s-1)*16+o];for(let o=0;o<s;o++,i+=16,e+=16)X$(t,a,r,e,t,i),o>0&&(a+=16),X$(t,i,r,e+=16,t,a)}function rJ(r,e,t){let n=(0,Jy.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:s,r:i,p:a,dkLen:o,asyncTick:c,maxmem:u,onProgress:f}=n;if((0,$y.number)(s),(0,$y.number)(i),(0,$y.number)(a),(0,$y.number)(o),(0,$y.number)(c),(0,$y.number)(u),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");let d=128*i,g=d/4;if(s<=1||(s&s-1)!==0||s>=2**(d/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/d)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");let h=d*(s+a);if(h>u)throw new Error(`Scrypt: parameters too large, ${h} (128 * r * (N + p)) > ${u} (maxmem)`);let m=(0,tJ.pbkdf2)(eJ.sha256,r,e,{c:1,dkLen:d*a}),y=(0,Jy.u32)(m),S=(0,Jy.u32)(new Uint8Array(d*s)),T=(0,Jy.u32)(new Uint8Array(d)),H=()=>{};if(f){let C=2*s*a,J=Math.max(Math.floor(C/1e4),1),z=0;H=()=>{z++,f&&(!(z%J)||z===C)&&f(z/C)}}return{N:s,r:i,p:a,dkLen:o,blockSize32:g,V:S,B32:y,B:m,tmp:T,blockMixCb:H,asyncTick:c}}function nJ(r,e,t,n,s){let i=(0,tJ.pbkdf2)(eJ.sha256,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),s.fill(0),i}function lme(r,e,t){let{N:n,r:s,p:i,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:d,blockMixCb:g}=rJ(r,e,t);for(let h=0;h<i;h++){let m=o*h;for(let y=0;y<o;y++)c[y]=u[m+y];for(let y=0,S=0;y<n-1;y++)Zy(c,S,c,S+=o,s),g();Zy(c,(n-1)*o,u,m,s),g();for(let y=0;y<n;y++){let S=u[m+o-16]%n;for(let T=0;T<o;T++)d[T]=u[m+T]^c[S*o+T];Zy(d,0,u,m,s),g()}}return nJ(r,a,f,c,d)}Qy.scrypt=lme;async function hme(r,e,t){let{N:n,r:s,p:i,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:d,blockMixCb:g,asyncTick:h}=rJ(r,e,t);for(let m=0;m<i;m++){let y=o*m;for(let T=0;T<o;T++)c[T]=u[y+T];let S=0;await(0,Jy.asyncLoop)(n-1,h,()=>{Zy(c,S,c,S+=o,s),g()}),Zy(c,(n-1)*o,u,y,s),g(),await(0,Jy.asyncLoop)(n,h,()=>{let T=u[y+o-16]%n;for(let H=0;H<o;H++)d[H]=u[y+H]^c[T*o+H];Zy(d,0,u,y,s),g()})}return nJ(r,a,f,c,d)}Qy.scryptAsync=hme});var lJ=R(Xy=>{"use strict";b();p();Object.defineProperty(Xy,"__esModule",{value:!0});Xy.scryptSync=Xy.scrypt=void 0;var iJ=sJ(),Yy=ke(),aJ=!1,oJ=!1,cJ=async function(r,e,t,n,s,i,a){return await(0,iJ.scryptAsync)(r,e,{N:t,r:n,p:s,dkLen:i,onProgress:a})},uJ=function(r,e,t,n,s,i){return(0,iJ.scrypt)(r,e,{N:t,r:n,p:s,dkLen:i})},fJ=cJ,dJ=uJ;async function v8(r,e,t,n,s,i,a){let o=(0,Yy.getBytes)(r,"passwd"),c=(0,Yy.getBytes)(e,"salt");return(0,Yy.hexlify)(await fJ(o,c,t,n,s,i,a))}Xy.scrypt=v8;v8._=cJ;v8.lock=function(){oJ=!0};v8.register=function(r){if(oJ)throw new Error("scrypt is locked");fJ=r};Object.freeze(v8);function P8(r,e,t,n,s,i){let a=(0,Yy.getBytes)(r,"passwd"),o=(0,Yy.getBytes)(e,"salt");return(0,Yy.hexlify)(dJ(a,o,t,n,s,i))}Xy.scryptSync=P8;P8._=uJ;P8.lock=function(){aJ=!0};P8.register=function(r){if(aJ)throw new Error("scryptSync is locked");dJ=r};Object.freeze(P8)});var wJ=R(e1=>{"use strict";b();p();Object.defineProperty(e1,"__esModule",{value:!0});e1.sha512=e1.sha256=void 0;var hJ=l8(),BP=ke(),bJ=function(r){return(0,hJ.createHash)("sha256").update(r).digest()},pJ=function(r){return(0,hJ.createHash)("sha512").update(r).digest()},gJ=bJ,xJ=pJ,yJ=!1,mJ=!1;function t1(r){let e=(0,BP.getBytes)(r,"data");return(0,BP.hexlify)(gJ(e))}e1.sha256=t1;t1._=bJ;t1.lock=function(){yJ=!0};t1.register=function(r){if(yJ)throw new Error("sha256 is locked");gJ=r};Object.freeze(t1);function kP(r){let e=(0,BP.getBytes)(r,"data");return(0,BP.hexlify)(xJ(e))}e1.sha512=kP;kP._=pJ;kP.lock=function(){mJ=!0};kP.register=function(r){if(mJ)throw new Error("sha512 is locked");xJ=r};Object.freeze(t1)});var Lp=R(Lt=>{"use strict";b();p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.validateObject=Lt.createHmacDrbg=Lt.bitMask=Lt.bitSet=Lt.bitGet=Lt.bitLen=Lt.utf8ToBytes=Lt.equalBytes=Lt.concatBytes=Lt.ensureBytes=Lt.numberToVarBytesBE=Lt.numberToBytesLE=Lt.numberToBytesBE=Lt.bytesToNumberLE=Lt.bytesToNumberBE=Lt.hexToBytes=Lt.hexToNumber=Lt.numberToHexUnpadded=Lt.bytesToHex=void 0;var PJ=BigInt(0),NP=BigInt(1),bme=BigInt(2),IP=r=>r instanceof Uint8Array,pme=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function RI(r){if(!IP(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=pme[r[t]];return e}Lt.bytesToHex=RI;function _J(r){let e=r.toString(16);return e.length&1?`0${e}`:e}Lt.numberToHexUnpadded=_J;function jI(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}Lt.hexToNumber=jI;function RP(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");t[n]=a}return t}Lt.hexToBytes=RP;function gme(r){return jI(RI(r))}Lt.bytesToNumberBE=gme;function xme(r){if(!IP(r))throw new Error("Uint8Array expected");return jI(RI(Uint8Array.from(r).reverse()))}Lt.bytesToNumberLE=xme;function AJ(r,e){return RP(r.toString(16).padStart(e*2,"0"))}Lt.numberToBytesBE=AJ;function yme(r,e){return AJ(r,e).reverse()}Lt.numberToBytesLE=yme;function mme(r){return RP(_J(r))}Lt.numberToVarBytesBE=mme;function wme(r,e,t){let n;if(typeof e=="string")try{n=RP(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(IP(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}Lt.ensureBytes=wme;function EJ(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!IP(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}Lt.concatBytes=EJ;function vme(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}Lt.equalBytes=vme;function Pme(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Lt.utf8ToBytes=Pme;function _me(r){let e;for(e=0;r>PJ;r>>=NP,e+=1);return e}Lt.bitLen=_me;function Ame(r,e){return r>>BigInt(e)&NP}Lt.bitGet=Ame;var Eme=(r,e,t)=>r|(t?NP:PJ)<<BigInt(e);Lt.bitSet=Eme;var Sme=r=>(bme<<BigInt(r-1))-NP;Lt.bitMask=Sme;var II=r=>new Uint8Array(r),vJ=r=>Uint8Array.from(r);function Tme(r,e,t){if(typeof r!="number"||r<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 t!="function")throw new Error("hmacFn must be a function");let n=II(r),s=II(r),i=0,a=()=>{n.fill(1),s.fill(0),i=0},o=(...d)=>t(s,n,...d),c=(d=II())=>{s=o(vJ([0]),d),n=o(),d.length!==0&&(s=o(vJ([1]),d),n=o())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,g=[];for(;d<e;){n=o();let h=n.slice();g.push(h),d+=n.length}return EJ(...g)};return(d,g)=>{a(),c(d);let h;for(;!(h=g(u()));)c();return a(),h}}Lt.createHmacDrbg=Tme;var Ome={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Bme(r,e,t={}){let n=(s,i,a)=>{let o=Ome[i];if(typeof o!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(a&&c===void 0)&&!o(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}Lt.validateObject=Bme});var _8=R(Tt=>{"use strict";b();p();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.mapHashToField=Tt.getMinHashLength=Tt.getFieldBytesLength=Tt.hashToPrivateScalar=Tt.FpSqrtEven=Tt.FpSqrtOdd=Tt.Field=Tt.nLength=Tt.FpIsSquare=Tt.FpDiv=Tt.FpInvertBatch=Tt.FpPow=Tt.validateField=Tt.isNegativeLE=Tt.FpSqrt=Tt.tonelliShanks=Tt.invert=Tt.pow2=Tt.pow=Tt.mod=void 0;var xo=Lp(),qs=BigInt(0),jr=BigInt(1),$l=BigInt(2),kme=BigInt(3),MI=BigInt(4),SJ=BigInt(5),TJ=BigInt(8),Nme=BigInt(9),Ime=BigInt(16);function go(r,e){let t=r%e;return t>=qs?t:e+t}Tt.mod=go;function OJ(r,e,t){if(t<=qs||e<qs)throw new Error("Expected power/modulo > 0");if(t===jr)return qs;let n=jr;for(;e>qs;)e&jr&&(n=n*r%t),r=r*r%t,e>>=jr;return n}Tt.pow=OJ;function Rme(r,e,t){let n=r;for(;e-- >qs;)n*=n,n%=t;return n}Tt.pow2=Rme;function jP(r,e){if(r===qs||e<=qs)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=go(r,e),n=e,s=qs,i=jr,a=jr,o=qs;for(;t!==qs;){let u=n/t,f=n%t,d=s-a*u,g=i-o*u;n=t,t=f,s=a,i=o,a=d,o=g}if(n!==jr)throw new Error("invert: does not exist");return go(s,e)}Tt.invert=jP;function BJ(r){let e=(r-jr)/$l,t,n,s;for(t=r-jr,n=0;t%$l===qs;t/=$l,n++);for(s=$l;s<r&&OJ(s,e,r)!==r-jr;s++);if(n===1){let a=(r+jr)/MI;return function(c,u){let f=c.pow(u,a);if(!c.eql(c.sqr(f),u))throw new Error("Cannot find square root");return f}}let i=(t+jr)/$l;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,s),t),d=o.pow(c,i),g=o.pow(c,t);for(;!o.eql(g,o.ONE);){if(o.eql(g,o.ZERO))return o.ZERO;let h=1;for(let y=o.sqr(g);h<u&&!o.eql(y,o.ONE);h++)y=o.sqr(y);let m=o.pow(f,jr<<BigInt(u-h-1));f=o.sqr(m),d=o.mul(d,m),g=o.mul(g,f),u=h}return d}}Tt.tonelliShanks=BJ;function kJ(r){if(r%MI===kme){let e=(r+jr)/MI;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%TJ===SJ){let e=(r-SJ)/TJ;return function(n,s){let i=n.mul(s,$l),a=n.pow(i,e),o=n.mul(s,a),c=n.mul(n.mul(o,$l),a),u=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%Ime,BJ(r)}Tt.FpSqrt=kJ;var jme=(r,e)=>(go(r,e)&jr)===jr;Tt.isNegativeLE=jme;var Mme=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Cme(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=Mme.reduce((n,s)=>(n[s]="function",n),e);return(0,xo.validateObject)(r,t)}Tt.validateField=Cme;function NJ(r,e,t){if(t<qs)throw new Error("Expected power > 0");if(t===qs)return r.ONE;if(t===jr)return e;let n=r.ONE,s=e;for(;t>qs;)t&jr&&(n=r.mul(n,s)),s=r.sqr(s),t>>=jr;return n}Tt.FpPow=NJ;function IJ(r,e){let t=new Array(e.length),n=e.reduce((i,a,o)=>r.is0(a)?i:(t[o]=i,r.mul(i,a)),r.ONE),s=r.inv(n);return e.reduceRight((i,a,o)=>r.is0(a)?i:(t[o]=r.mul(i,t[o]),r.mul(i,a)),s),t}Tt.FpInvertBatch=IJ;function Lme(r,e,t){return r.mul(e,typeof t=="bigint"?jP(t,r.ORDER):r.inv(t))}Tt.FpDiv=Lme;function Ume(r){let e=(r.ORDER-jr)/$l;return t=>{let n=r.pow(t,e);return r.eql(n,r.ZERO)||r.eql(n,r.ONE)}}Tt.FpIsSquare=Ume;function CI(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}Tt.nLength=CI;function Fme(r,e,t=!1,n={}){if(r<=qs)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=CI(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=kJ(r),o=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:(0,xo.bitMask)(s),ZERO:qs,ONE:jr,create:c=>go(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return qs<=c&&c<r},is0:c=>c===qs,isOdd:c=>(c&jr)===jr,neg:c=>go(-c,r),eql:(c,u)=>c===u,sqr:c=>go(c*c,r),add:(c,u)=>go(c+u,r),sub:(c,u)=>go(c-u,r),mul:(c,u)=>go(c*u,r),pow:(c,u)=>NJ(o,c,u),div:(c,u)=>go(c*jP(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>jP(c,r),sqrt:n.sqrt||(c=>a(o,c)),invertBatch:c=>IJ(o,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>t?(0,xo.numberToBytesLE)(c,i):(0,xo.numberToBytesBE)(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?(0,xo.bytesToNumberLE)(c):(0,xo.bytesToNumberBE)(c)}});return Object.freeze(o)}Tt.Field=Fme;function qme(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?t:r.neg(t)}Tt.FpSqrtOdd=qme;function Dme(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}Tt.FpSqrtEven=Dme;function Hme(r,e,t=!1){r=(0,xo.ensureBytes)("privateHash",r);let n=r.length,s=CI(e).nByteLength+8;if(s<24||n<s||n>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${n}`);let i=t?(0,xo.bytesToNumberLE)(r):(0,xo.bytesToNumberBE)(r);return go(i,e-jr)+jr}Tt.hashToPrivateScalar=Hme;function LI(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}Tt.getFieldBytesLength=LI;function RJ(r){let e=LI(r);return e+Math.ceil(e/2)}Tt.getMinHashLength=RJ;function Kme(r,e,t=!1){let n=r.length,s=LI(e),i=RJ(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let a=t?(0,xo.bytesToNumberBE)(r):(0,xo.bytesToNumberLE)(r),o=go(a,e-jr)+jr;return t?(0,xo.numberToBytesLE)(o,s):(0,xo.numberToBytesBE)(o,s)}Tt.mapHashToField=Kme});var MJ=R(r1=>{"use strict";b();p();Object.defineProperty(r1,"__esModule",{value:!0});r1.validateBasic=r1.wNAF=void 0;var jJ=_8(),Gme=Lp(),Vme=BigInt(0),UI=BigInt(1);function zme(r,e){let t=(s,i)=>{let a=i.negate();return s?a:i},n=s=>{let i=Math.ceil(e/s)+1,a=2**(s-1);return{windows:i,windowSize:a}};return{constTimeNegate:t,unsafeLadder(s,i){let a=r.ZERO,o=s;for(;i>Vme;)i&UI&&(a=a.add(o)),o=o.double(),i>>=UI;return a},precomputeWindow(s,i){let{windows:a,windowSize:o}=n(i),c=[],u=s,f=u;for(let d=0;d<a;d++){f=u,c.push(f);for(let g=1;g<o;g++)f=f.add(u),c.push(f);u=f.double()}return c},wNAF(s,i,a){let{windows:o,windowSize:c}=n(s),u=r.ZERO,f=r.BASE,d=BigInt(2**s-1),g=2**s,h=BigInt(s);for(let m=0;m<o;m++){let y=m*c,S=Number(a&d);a>>=h,S>c&&(S-=g,a+=UI);let T=y,H=y+Math.abs(S)-1,C=m%2!==0,J=S<0;S===0?f=f.add(t(C,i[T])):u=u.add(t(J,i[H]))}return{p:u,f}},wNAFCached(s,i,a,o){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,o(u))),this.wNAF(c,u,a)}}}r1.wNAF=zme;function Wme(r){return(0,jJ.validateField)(r.Fp),(0,Gme.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,jJ.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}r1.validateBasic=Wme});var qI=R(Hs=>{"use strict";b();p();Object.defineProperty(Hs,"__esModule",{value:!0});Hs.mapToCurveSimpleSWU=Hs.SWUFpSqrtRatio=Hs.weierstrass=Hs.weierstrassPoints=Hs.DER=void 0;var n1=_8(),Ds=Lp(),Hf=Lp(),FI=MJ();function $me(r){let e=(0,FI.validateBasic)(r);Ds.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:Jme,hexToBytes:Zme}=Ds;Hs.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=Hs.DER;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)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:Jme(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=Hs.DER,t=typeof r=="string"?Zme(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=Hs.DER._parseInt(t.subarray(2)),{d:a,l:o}=Hs.DER._parseInt(i);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let f=u.toString(16);return f.length&1?`0${f}`:f},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,a=s.length/2,o=t(i),c=t(a);return`30${t(a+i+4)}02${c}${s}02${o}${n}`}};var ku=BigInt(0),Yn=BigInt(1),Jl=BigInt(2),MP=BigInt(3),CJ=BigInt(4);function LJ(r){let e=$me(r),{Fp:t}=e,n=e.toBytes||((m,y,S)=>{let T=y.toAffine();return Ds.concatBytes(Uint8Array.from([4]),t.toBytes(T.x),t.toBytes(T.y))}),s=e.fromBytes||(m=>{let y=m.subarray(1),S=t.fromBytes(y.subarray(0,t.BYTES)),T=t.fromBytes(y.subarray(t.BYTES,2*t.BYTES));return{x:S,y:T}});function i(m){let{a:y,b:S}=e,T=t.sqr(m),H=t.mul(T,m);return t.add(t.add(H,t.mul(m,y)),S)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function a(m){return typeof m=="bigint"&&ku<m&&m<e.n}function o(m){if(!a(m))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(m){let{allowedPrivateKeyLengths:y,nByteLength:S,wrapPrivateKey:T,n:H}=e;if(y&&typeof m!="bigint"){if(m instanceof Uint8Array&&(m=Ds.bytesToHex(m)),typeof m!="string"||!y.includes(m.length))throw new Error("Invalid key");m=m.padStart(S*2,"0")}let C;try{C=typeof m=="bigint"?m:Ds.bytesToNumberBE((0,Hf.ensureBytes)("private key",m,S))}catch{throw new Error(`private key must be ${S} bytes, hex or bigint, not ${typeof m}`)}return T&&(C=n1.mod(C,H)),o(C),C}let u=new Map;function f(m){if(!(m instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(y,S,T){if(this.px=y,this.py=S,this.pz=T,y==null||!t.isValid(y))throw new Error("x required");if(S==null||!t.isValid(S))throw new Error("y required");if(T==null||!t.isValid(T))throw new Error("z required")}static fromAffine(y){let{x:S,y:T}=y||{};if(!y||!t.isValid(S)||!t.isValid(T))throw new Error("invalid affine point");if(y instanceof d)throw new Error("projective point not allowed");let H=C=>t.eql(C,t.ZERO);return H(S)&&H(T)?d.ZERO:new d(S,T,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){let S=t.invertBatch(y.map(T=>T.pz));return y.map((T,H)=>T.toAffine(S[H])).map(d.fromAffine)}static fromHex(y){let S=d.fromAffine(s((0,Hf.ensureBytes)("pointHex",y)));return S.assertValidity(),S}static fromPrivateKey(y){return d.BASE.multiply(c(y))}_setWindowSize(y){this._WINDOW_SIZE=y,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:y,y:S}=this.toAffine();if(!t.isValid(y)||!t.isValid(S))throw new Error("bad point: x or y not FE");let T=t.sqr(S),H=i(y);if(!t.eql(T,H))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y}=this.toAffine();if(t.isOdd)return!t.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(y){f(y);let{px:S,py:T,pz:H}=this,{px:C,py:J,pz:z}=y,W=t.eql(t.mul(S,z),t.mul(C,H)),Y=t.eql(t.mul(T,z),t.mul(J,H));return W&&Y}negate(){return new d(this.px,t.neg(this.py),this.pz)}double(){let{a:y,b:S}=e,T=t.mul(S,MP),{px:H,py:C,pz:J}=this,z=t.ZERO,W=t.ZERO,Y=t.ZERO,Z=t.mul(H,H),se=t.mul(C,C),q=t.mul(J,J),x=t.mul(H,C);return x=t.add(x,x),Y=t.mul(H,J),Y=t.add(Y,Y),z=t.mul(y,Y),W=t.mul(T,q),W=t.add(z,W),z=t.sub(se,W),W=t.add(se,W),W=t.mul(z,W),z=t.mul(x,z),Y=t.mul(T,Y),q=t.mul(y,q),x=t.sub(Z,q),x=t.mul(y,x),x=t.add(x,Y),Y=t.add(Z,Z),Z=t.add(Y,Z),Z=t.add(Z,q),Z=t.mul(Z,x),W=t.add(W,Z),q=t.mul(C,J),q=t.add(q,q),Z=t.mul(q,x),z=t.sub(z,Z),Y=t.mul(q,se),Y=t.add(Y,Y),Y=t.add(Y,Y),new d(z,W,Y)}add(y){f(y);let{px:S,py:T,pz:H}=this,{px:C,py:J,pz:z}=y,W=t.ZERO,Y=t.ZERO,Z=t.ZERO,se=e.a,q=t.mul(e.b,MP),x=t.mul(S,C),O=t.mul(T,J),B=t.mul(H,z),A=t.add(S,T),E=t.add(C,J);A=t.mul(A,E),E=t.add(x,O),A=t.sub(A,E),E=t.add(S,H);let j=t.add(C,z);return E=t.mul(E,j),j=t.add(x,B),E=t.sub(E,j),j=t.add(T,H),W=t.add(J,z),j=t.mul(j,W),W=t.add(O,B),j=t.sub(j,W),Z=t.mul(se,E),W=t.mul(q,B),Z=t.add(W,Z),W=t.sub(O,Z),Z=t.add(O,Z),Y=t.mul(W,Z),O=t.add(x,x),O=t.add(O,x),B=t.mul(se,B),E=t.mul(q,E),O=t.add(O,B),B=t.sub(x,B),B=t.mul(se,B),E=t.add(E,B),x=t.mul(O,E),Y=t.add(Y,x),x=t.mul(j,E),W=t.mul(A,W),W=t.sub(W,x),x=t.mul(A,O),Z=t.mul(j,Z),Z=t.add(Z,x),new d(W,Y,Z)}subtract(y){return this.add(y.negate())}is0(){return this.equals(d.ZERO)}wNAF(y){return h.wNAFCached(this,u,y,S=>{let T=t.invertBatch(S.map(H=>H.pz));return S.map((H,C)=>H.toAffine(T[C])).map(d.fromAffine)})}multiplyUnsafe(y){let S=d.ZERO;if(y===ku)return S;if(o(y),y===Yn)return this;let{endo:T}=e;if(!T)return h.unsafeLadder(this,y);let{k1neg:H,k1:C,k2neg:J,k2:z}=T.splitScalar(y),W=S,Y=S,Z=this;for(;C>ku||z>ku;)C&Yn&&(W=W.add(Z)),z&Yn&&(Y=Y.add(Z)),Z=Z.double(),C>>=Yn,z>>=Yn;return H&&(W=W.negate()),J&&(Y=Y.negate()),Y=new d(t.mul(Y.px,T.beta),Y.py,Y.pz),W.add(Y)}multiply(y){o(y);let S=y,T,H,{endo:C}=e;if(C){let{k1neg:J,k1:z,k2neg:W,k2:Y}=C.splitScalar(S),{p:Z,f:se}=this.wNAF(z),{p:q,f:x}=this.wNAF(Y);Z=h.constTimeNegate(J,Z),q=h.constTimeNegate(W,q),q=new d(t.mul(q.px,C.beta),q.py,q.pz),T=Z.add(q),H=se.add(x)}else{let{p:J,f:z}=this.wNAF(S);T=J,H=z}return d.normalizeZ([T,H])[0]}multiplyAndAddUnsafe(y,S,T){let H=d.BASE,C=(z,W)=>W===ku||W===Yn||!z.equals(H)?z.multiplyUnsafe(W):z.multiply(W),J=C(this,S).add(C(y,T));return J.is0()?void 0:J}toAffine(y){let{px:S,py:T,pz:H}=this,C=this.is0();y==null&&(y=C?t.ONE:t.inv(H));let J=t.mul(S,y),z=t.mul(T,y),W=t.mul(H,y);if(C)return{x:t.ZERO,y:t.ZERO};if(!t.eql(W,t.ONE))throw new Error("invZ was invalid");return{x:J,y:z}}isTorsionFree(){let{h:y,isTorsionFree:S}=e;if(y===Yn)return!0;if(S)return S(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:y,clearCofactor:S}=e;return y===Yn?this:S?S(d,this):this.multiplyUnsafe(e.h)}toRawBytes(y=!0){return this.assertValidity(),n(d,this,y)}toHex(y=!0){return Ds.bytesToHex(this.toRawBytes(y))}}d.BASE=new d(e.Gx,e.Gy,t.ONE),d.ZERO=new d(t.ZERO,t.ONE,t.ZERO);let g=e.nBitLength,h=(0,FI.wNAF)(d,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:a}}Hs.weierstrassPoints=LJ;function Qme(r){let e=(0,FI.validateBasic)(r);return Ds.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Yme(r){let e=Qme(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function a(E){return ku<E&&E<t.ORDER}function o(E){return n1.mod(E,n)}function c(E){return n1.invert(E,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:d,isWithinCurveOrder:g}=LJ({...e,toBytes(E,j,G){let M=j.toAffine(),P=t.toBytes(M.x),K=Ds.concatBytes;return G?K(Uint8Array.from([j.hasEvenY()?2:3]),P):K(Uint8Array.from([4]),P,t.toBytes(M.y))},fromBytes(E){let j=E.length,G=E[0],M=E.subarray(1);if(j===s&&(G===2||G===3)){let P=Ds.bytesToNumberBE(M);if(!a(P))throw new Error("Point is not on curve");let K=d(P),re=t.sqrt(K),ie=(re&Yn)===Yn;return(G&1)===1!==ie&&(re=t.neg(re)),{x:P,y:re}}else if(j===i&&G===4){let P=t.fromBytes(M.subarray(0,t.BYTES)),K=t.fromBytes(M.subarray(t.BYTES,2*t.BYTES));return{x:P,y:K}}else throw new Error(`Point of length ${j} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=E=>Ds.bytesToHex(Ds.numberToBytesBE(E,e.nByteLength));function m(E){let j=n>>Yn;return E>j}function y(E){return m(E)?o(-E):E}let S=(E,j,G)=>Ds.bytesToNumberBE(E.slice(j,G));class T{constructor(j,G,M){this.r=j,this.s=G,this.recovery=M,this.assertValidity()}static fromCompact(j){let G=e.nByteLength;return j=(0,Hf.ensureBytes)("compactSignature",j,G*2),new T(S(j,0,G),S(j,G,2*G))}static fromDER(j){let{r:G,s:M}=Hs.DER.toSig((0,Hf.ensureBytes)("DER",j));return new T(G,M)}assertValidity(){if(!g(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!g(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(j){return new T(this.r,this.s,j)}recoverPublicKey(j){let{r:G,s:M,recovery:P}=this,K=Y((0,Hf.ensureBytes)("msgHash",j));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");let re=P===2||P===3?G+e.n:G;if(re>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let ie=(P&1)===0?"02":"03",ce=u.fromHex(ie+h(re)),oe=c(re),we=o(-K*oe),He=o(M*oe),yt=u.BASE.multiplyAndAddUnsafe(ce,we,He);if(!yt)throw new Error("point at infinify");return yt.assertValidity(),yt}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Ds.hexToBytes(this.toDERHex())}toDERHex(){return Hs.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ds.hexToBytes(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let H={isValidPrivateKey(E){try{return f(E),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let E=n1.getMinHashLength(e.n);return n1.mapHashToField(e.randomBytes(E),e.n)},precompute(E=8,j=u.BASE){return j._setWindowSize(E),j.multiply(BigInt(3)),j}};function C(E,j=!0){return u.fromPrivateKey(E).toRawBytes(j)}function J(E){let j=E instanceof Uint8Array,G=typeof E=="string",M=(j||G)&&E.length;return j?M===s||M===i:G?M===2*s||M===2*i:E instanceof u}function z(E,j,G=!0){if(J(E))throw new Error("first arg must be private key");if(!J(j))throw new Error("second arg must be public key");return u.fromHex(j).multiply(f(E)).toRawBytes(G)}let W=e.bits2int||function(E){let j=Ds.bytesToNumberBE(E),G=E.length*8-e.nBitLength;return G>0?j>>BigInt(G):j},Y=e.bits2int_modN||function(E){return o(W(E))},Z=Ds.bitMask(e.nBitLength);function se(E){if(typeof E!="bigint")throw new Error("bigint expected");if(!(ku<=E&&E<Z))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Ds.numberToBytesBE(E,e.nByteLength)}function q(E,j,G=x){if(["recovered","canonical"].some(Qe=>Qe in G))throw new Error("sign() legacy options not supported");let{hash:M,randomBytes:P}=e,{lowS:K,prehash:re,extraEntropy:ie}=G;K==null&&(K=!0),E=(0,Hf.ensureBytes)("msgHash",E),re&&(E=(0,Hf.ensureBytes)("prehashed msgHash",M(E)));let ce=Y(E),oe=f(j),we=[se(oe),se(ce)];if(ie!=null){let Qe=ie===!0?P(t.BYTES):ie;we.push((0,Hf.ensureBytes)("extraEntropy",Qe))}let He=Ds.concatBytes(...we),yt=ce;function mt(Qe){let Cr=W(Qe);if(!g(Cr))return;let sr=c(Cr),We=u.BASE.multiply(Cr).toAffine(),rn=o(We.x);if(rn===ku)return;let $t=o(sr*o(yt+rn*oe));if($t===ku)return;let vr=(We.x===rn?0:2)|Number(We.y&Yn),_a=$t;return K&&m($t)&&(_a=y($t),vr^=1),new T(rn,_a,vr)}return{seed:He,k2sig:mt}}let x={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};function B(E,j,G=x){let{seed:M,k2sig:P}=q(E,j,G),K=e;return Ds.createHmacDrbg(K.hash.outputLen,K.nByteLength,K.hmac)(M,P)}u.BASE._setWindowSize(8);function A(E,j,G,M=O){let P=E;if(j=(0,Hf.ensureBytes)("msgHash",j),G=(0,Hf.ensureBytes)("publicKey",G),"strict"in M)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:re}=M,ie,ce;try{if(typeof P=="string"||P instanceof Uint8Array)try{ie=T.fromDER(P)}catch(We){if(!(We instanceof Hs.DER.Err))throw We;ie=T.fromCompact(P)}else if(typeof P=="object"&&typeof P.r=="bigint"&&typeof P.s=="bigint"){let{r:We,s:rn}=P;ie=new T(We,rn)}else throw new Error("PARSE");ce=u.fromHex(G)}catch(We){if(We.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&ie.hasHighS())return!1;re&&(j=e.hash(j));let{r:oe,s:we}=ie,He=Y(j),yt=c(we),mt=o(He*yt),Qe=o(oe*yt),Cr=u.BASE.multiplyAndAddUnsafe(ce,mt,Qe)?.toAffine();return Cr?o(Cr.x)===oe:!1}return{CURVE:e,getPublicKey:C,getSharedSecret:z,sign:B,verify:A,ProjectivePoint:u,Signature:T,utils:H}}Hs.weierstrass=Yme;function UJ(r,e){let t=r.ORDER,n=ku;for(let m=t-Yn;m%Jl===ku;m/=Jl)n+=Yn;let s=n,i=Jl<<s-Yn-Yn,a=i*Jl,o=(t-Yn)/a,c=(o-Yn)/Jl,u=a-Yn,f=i,d=r.pow(e,o),g=r.pow(e,(o+Yn)/Jl),h=(m,y)=>{let S=d,T=r.pow(y,u),H=r.sqr(T);H=r.mul(H,y);let C=r.mul(m,H);C=r.pow(C,c),C=r.mul(C,T),T=r.mul(C,y),H=r.mul(C,m);let J=r.mul(H,T);C=r.pow(J,f);let z=r.eql(C,r.ONE);T=r.mul(H,g),C=r.mul(J,S),H=r.cmov(T,H,z),J=r.cmov(C,J,z);for(let W=s;W>Yn;W--){let Y=W-Jl;Y=Jl<<Y-Yn;let Z=r.pow(J,Y),se=r.eql(Z,r.ONE);T=r.mul(H,S),S=r.mul(S,S),Z=r.mul(J,S),H=r.cmov(T,H,se),J=r.cmov(Z,J,se)}return{isValid:z,value:H}};if(r.ORDER%CJ===MP){let m=(r.ORDER-MP)/CJ,y=r.sqrt(r.neg(e));h=(S,T)=>{let H=r.sqr(T),C=r.mul(S,T);H=r.mul(H,C);let J=r.pow(H,m);J=r.mul(J,C);let z=r.mul(J,y),W=r.mul(r.sqr(J),T),Y=r.eql(W,S),Z=r.cmov(z,J,Y);return{isValid:Y,value:Z}}}return h}Hs.SWUFpSqrtRatio=UJ;function Xme(r,e){if(n1.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let t=UJ(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,i,a,o,c,u,f,d;s=r.sqr(n),s=r.mul(s,e.Z),i=r.sqr(s),i=r.add(i,s),a=r.add(i,r.ONE),a=r.mul(a,e.B),o=r.cmov(e.Z,r.neg(i),!r.eql(i,r.ZERO)),o=r.mul(o,e.A),i=r.sqr(a),u=r.sqr(o),c=r.mul(u,e.A),i=r.add(i,c),i=r.mul(i,a),u=r.mul(u,o),c=r.mul(u,e.B),i=r.add(i,c),f=r.mul(s,a);let{isValid:g,value:h}=t(i,u);d=r.mul(s,n),d=r.mul(d,h),f=r.cmov(f,a,g),d=r.cmov(d,h,g);let m=r.isOdd(n)===r.isOdd(d);return d=r.cmov(r.neg(d),d,m),f=r.div(f,o),{x:f,y:d}}}Hs.mapToCurveSimpleSWU=Xme});var DJ=R(tc=>{"use strict";b();p();Object.defineProperty(tc,"__esModule",{value:!0});tc.createHasher=tc.isogenyMap=tc.hash_to_field=tc.expand_message_xof=tc.expand_message_xmd=void 0;var e2e=_8(),Nu=Lp();function t2e(r){if(r instanceof Uint8Array)return r;if(typeof r=="string")return(0,Nu.utf8ToBytes)(r);throw new Error("DST must be Uint8Array or string")}var r2e=Nu.bytesToNumberBE;function Zl(r,e){if(r<0||r>=1<<8*e)throw new Error(`bad I2OSP call: value=${r} length=${e}`);let t=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)t[n]=r&255,r>>>=8;return new Uint8Array(t)}function n2e(r,e){let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}function A8(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected")}function HI(r){if(!Number.isSafeInteger(r))throw new Error("number expected")}function FJ(r,e,t,n){A8(r),A8(e),HI(t),e.length>255&&(e=n((0,Nu.concatBytes)((0,Nu.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:s,blockLen:i}=n,a=Math.ceil(t/s);if(a>255)throw new Error("Invalid xmd length");let o=(0,Nu.concatBytes)(e,Zl(e.length,1)),c=Zl(0,i),u=Zl(t,2),f=new Array(a),d=n((0,Nu.concatBytes)(c,r,u,Zl(0,1),o));f[0]=n((0,Nu.concatBytes)(d,Zl(1,1),o));for(let h=1;h<=a;h++){let m=[n2e(d,f[h-1]),Zl(h+1,1),o];f[h]=n((0,Nu.concatBytes)(...m))}return(0,Nu.concatBytes)(...f).slice(0,t)}tc.expand_message_xmd=FJ;function qJ(r,e,t,n,s){if(A8(r),A8(e),HI(t),e.length>255){let i=Math.ceil(2*n/8);e=s.create({dkLen:i}).update((0,Nu.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(t>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:t}).update(r).update(Zl(t,2)).update(e).update(Zl(e.length,1)).digest()}tc.expand_message_xof=qJ;function DI(r,e,t){(0,Nu.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:s,m:i,hash:a,expand:o,DST:c}=t;A8(r),HI(e);let u=t2e(c),f=n.toString(2).length,d=Math.ceil((f+s)/8),g=e*i*d,h;if(o==="xmd")h=FJ(r,u,g,a);else if(o==="xof")h=qJ(r,u,g,s,a);else if(o==="_internal_pass")h=r;else throw new Error('expand must be "xmd" or "xof"');let m=new Array(e);for(let y=0;y<e;y++){let S=new Array(i);for(let T=0;T<i;T++){let H=d*(T+y*i),C=h.subarray(H,H+d);S[T]=(0,e2e.mod)(r2e(C),n)}m[y]=S}return m}tc.hash_to_field=DI;function s2e(r,e){let t=e.map(n=>Array.from(n).reverse());return(n,s)=>{let[i,a,o,c]=t.map(u=>u.reduce((f,d)=>r.add(r.mul(f,n),d)));return n=r.div(i,a),s=r.mul(s,r.div(o,c)),{x:n,y:s}}}tc.isogenyMap=s2e;function i2e(r,e,t){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,s){let i=DI(n,2,{...t,DST:t.DST,...s}),a=r.fromAffine(e(i[0])),o=r.fromAffine(e(i[1])),c=a.add(o).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,s){let i=DI(n,1,{...t,DST:t.encodeDST,...s}),a=r.fromAffine(e(i[0])).clearCofactor();return a.assertValidity(),a}}}tc.createHasher=i2e});var GJ=R(s1=>{"use strict";b();p();Object.defineProperty(s1,"__esModule",{value:!0});s1.createCurve=s1.getHash=void 0;var a2e=hP(),HJ=Bu(),o2e=qI();function KJ(r){return{hash:r,hmac:(e,...t)=>(0,a2e.hmac)(r,e,(0,HJ.concatBytes)(...t)),randomBytes:HJ.randomBytes}}s1.getHash=KJ;function c2e(r,e){let t=n=>(0,o2e.weierstrass)({...r,...KJ(n)});return Object.freeze({...t(e),create:t})}s1.createCurve=c2e});var tZ=R(ja=>{"use strict";b();p();Object.defineProperty(ja,"__esModule",{value:!0});ja.encodeToCurve=ja.hashToCurve=ja.schnorr=ja.secp256k1=void 0;var CP=yP(),u2e=Bu(),ni=_8(),f2e=qI(),Mi=Lp(),WJ=DJ(),d2e=GJ(),qP=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),LP=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),$J=BigInt(1),UP=BigInt(2),VJ=(r,e)=>(r+e/UP)/e;function JJ(r){let e=qP,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),u=r*r*r%e,f=u*u*r%e,d=(0,ni.pow2)(f,t,e)*f%e,g=(0,ni.pow2)(d,t,e)*f%e,h=(0,ni.pow2)(g,UP,e)*u%e,m=(0,ni.pow2)(h,s,e)*h%e,y=(0,ni.pow2)(m,i,e)*m%e,S=(0,ni.pow2)(y,o,e)*y%e,T=(0,ni.pow2)(S,c,e)*S%e,H=(0,ni.pow2)(T,o,e)*y%e,C=(0,ni.pow2)(H,t,e)*f%e,J=(0,ni.pow2)(C,a,e)*m%e,z=(0,ni.pow2)(J,n,e)*u%e,W=(0,ni.pow2)(z,UP,e);if(!Ql.eql(Ql.sqr(W),r))throw new Error("Cannot find square root");return W}var Ql=(0,ni.Field)(qP,void 0,void 0,{sqrt:JJ});ja.secp256k1=(0,d2e.createCurve)({a:BigInt(0),b:BigInt(7),Fp:Ql,n:LP,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=LP,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-$J*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,a=BigInt("0x100000000000000000000000000000000"),o=VJ(i*r,e),c=VJ(-n*r,e),u=(0,ni.mod)(r-o*t-c*s,e),f=(0,ni.mod)(-o*n-c*i,e),d=u>a,g=f>a;if(d&&(u=e-u),g&&(f=e-f),u>a||f>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:d,k1:u,k2neg:g,k2:f}}}},CP.sha256);var DP=BigInt(0),ZJ=r=>typeof r=="bigint"&&DP<r&&r<qP,l2e=r=>typeof r=="bigint"&&DP<r&&r<LP,zJ={};function FP(r,...e){let t=zJ[r];if(t===void 0){let n=(0,CP.sha256)(Uint8Array.from(r,s=>s.charCodeAt(0)));t=(0,Mi.concatBytes)(n,n),zJ[r]=t}return(0,CP.sha256)((0,Mi.concatBytes)(t,...e))}var zI=r=>r.toRawBytes(!0).slice(1),GI=r=>(0,Mi.numberToBytesBE)(r,32),KI=r=>(0,ni.mod)(r,qP),E8=r=>(0,ni.mod)(r,LP),WI=ja.secp256k1.ProjectivePoint,h2e=(r,e,t)=>WI.BASE.multiplyAndAddUnsafe(r,e,t);function VI(r){let e=ja.secp256k1.utils.normPrivateKeyToScalar(r),t=WI.fromPrivateKey(e);return{scalar:t.hasEvenY()?e:E8(-e),bytes:zI(t)}}function QJ(r){if(!ZJ(r))throw new Error("bad x: need 0 < x < p");let e=KI(r*r),t=KI(e*r+BigInt(7)),n=JJ(t);n%UP!==DP&&(n=KI(-n));let s=new WI(r,n,$J);return s.assertValidity(),s}function YJ(...r){return E8((0,Mi.bytesToNumberBE)(FP("BIP0340/challenge",...r)))}function b2e(r){return VI(r).bytes}function p2e(r,e,t=(0,u2e.randomBytes)(32)){let n=(0,Mi.ensureBytes)("message",r),{bytes:s,scalar:i}=VI(e),a=(0,Mi.ensureBytes)("auxRand",t,32),o=GI(i^(0,Mi.bytesToNumberBE)(FP("BIP0340/aux",a))),c=FP("BIP0340/nonce",o,s,n),u=E8((0,Mi.bytesToNumberBE)(c));if(u===DP)throw new Error("sign failed: k is zero");let{bytes:f,scalar:d}=VI(u),g=YJ(f,s,n),h=new Uint8Array(64);if(h.set(f,0),h.set(GI(E8(d+g*i)),32),!XJ(h,n,s))throw new Error("sign: Invalid signature produced");return h}function XJ(r,e,t){let n=(0,Mi.ensureBytes)("signature",r,64),s=(0,Mi.ensureBytes)("message",e),i=(0,Mi.ensureBytes)("publicKey",t,32);try{let a=QJ((0,Mi.bytesToNumberBE)(i)),o=(0,Mi.bytesToNumberBE)(n.subarray(0,32));if(!ZJ(o))return!1;let c=(0,Mi.bytesToNumberBE)(n.subarray(32,64));if(!l2e(c))return!1;let u=YJ(GI(o),zI(a),s),f=h2e(a,c,E8(-u));return!(!f||!f.hasEvenY()||f.toAffine().x!==o)}catch{return!1}}ja.schnorr=(()=>({getPublicKey:b2e,sign:p2e,verify:XJ,utils:{randomPrivateKey:ja.secp256k1.utils.randomPrivateKey,lift_x:QJ,pointToBytes:zI,numberToBytesBE:Mi.numberToBytesBE,bytesToNumberBE:Mi.bytesToNumberBE,taggedHash:FP,mod:ni.mod}}))();var g2e=(()=>(0,WJ.isogenyMap)(Ql,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(r=>r.map(e=>BigInt(e)))))(),x2e=(()=>(0,f2e.mapToCurveSimpleSWU)(Ql,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Ql.create(BigInt("-11"))}))(),eZ=(()=>(0,WJ.createHasher)(ja.secp256k1.ProjectivePoint,r=>{let{x:e,y:t}=x2e(Ql.create(r[0]));return g2e(e,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Ql.ORDER,m:1,k:128,expand:"xmd",hash:CP.sha256}))();ja.hashToCurve=(()=>eZ.hashToCurve)();ja.encodeToCurve=(()=>eZ.encodeToCurve)()});var $I=R(HP=>{"use strict";b();p();Object.defineProperty(HP,"__esModule",{value:!0});HP.ZeroAddress=void 0;HP.ZeroAddress="0x0000000000000000000000000000000000000000"});var rZ=R(KP=>{"use strict";b();p();Object.defineProperty(KP,"__esModule",{value:!0});KP.ZeroHash=void 0;KP.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"});var nZ=R(rc=>{"use strict";b();p();Object.defineProperty(rc,"__esModule",{value:!0});rc.MaxInt256=rc.MinInt256=rc.MaxUint256=rc.WeiPerEther=rc.N=void 0;rc.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");rc.WeiPerEther=BigInt("1000000000000000000");rc.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");rc.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);rc.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")});var sZ=R(i1=>{"use strict";b();p();Object.defineProperty(i1,"__esModule",{value:!0});i1.MessagePrefix=i1.EtherSymbol=void 0;i1.EtherSymbol="\u039E";i1.MessagePrefix=`Ethereum Signed Message:
`});var a1=R(vs=>{"use strict";b();p();Object.defineProperty(vs,"__esModule",{value:!0});vs.MessagePrefix=vs.EtherSymbol=vs.MaxInt256=vs.MinInt256=vs.MaxUint256=vs.WeiPerEther=vs.N=vs.ZeroHash=vs.ZeroAddress=void 0;var y2e=$I();Object.defineProperty(vs,"ZeroAddress",{enumerable:!0,get:function(){return y2e.ZeroAddress}});var m2e=rZ();Object.defineProperty(vs,"ZeroHash",{enumerable:!0,get:function(){return m2e.ZeroHash}});var S8=nZ();Object.defineProperty(vs,"N",{enumerable:!0,get:function(){return S8.N}});Object.defineProperty(vs,"WeiPerEther",{enumerable:!0,get:function(){return S8.WeiPerEther}});Object.defineProperty(vs,"MaxUint256",{enumerable:!0,get:function(){return S8.MaxUint256}});Object.defineProperty(vs,"MinInt256",{enumerable:!0,get:function(){return S8.MinInt256}});Object.defineProperty(vs,"MaxInt256",{enumerable:!0,get:function(){return S8.MaxInt256}});var iZ=sZ();Object.defineProperty(vs,"EtherSymbol",{enumerable:!0,get:function(){return iZ.EtherSymbol}});Object.defineProperty(vs,"MessagePrefix",{enumerable:!0,get:function(){return iZ.MessagePrefix}})});var ZI=R(VP=>{"use strict";b();p();Object.defineProperty(VP,"__esModule",{value:!0});VP.Signature=void 0;var aZ=a1(),Yt=ke(),oZ=BigInt(0),cZ=BigInt(1),uZ=BigInt(2),fZ=BigInt(27),dZ=BigInt(28),GP=BigInt(35),o1={};function lZ(r){return(0,Yt.zeroPadValue)((0,Yt.toBeArray)(r),32)}var c1,u1,f1,Up,Iu=class{constructor(e,t,n,s){I(this,c1,void 0);I(this,u1,void 0);I(this,f1,void 0);I(this,Up,void 0);(0,Yt.assertPrivate)(e,o1,"Signature"),_(this,c1,t),_(this,u1,n),_(this,f1,s),_(this,Up,null)}get r(){return l(this,c1)}set r(e){(0,Yt.assertArgument)((0,Yt.dataLength)(e)===32,"invalid r","value",e),_(this,c1,(0,Yt.hexlify)(e))}get s(){return l(this,u1)}set s(e){(0,Yt.assertArgument)((0,Yt.dataLength)(e)===32,"invalid s","value",e);let t=(0,Yt.hexlify)(e);(0,Yt.assertArgument)(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),_(this,u1,t)}get v(){return l(this,f1)}set v(e){let t=(0,Yt.getNumber)(e,"value");(0,Yt.assertArgument)(t===27||t===28,"invalid v","v",e),_(this,f1,t)}get networkV(){return l(this,Up)}get legacyChainId(){let e=this.networkV;return e==null?null:Iu.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=(0,Yt.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,Yt.hexlify)(e)}get compactSerialized(){return(0,Yt.concat)([this.r,this.yParityAndS])}get serialized(){return(0,Yt.concat)([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(){let e=new Iu(o1,this.r,this.s,this.v);return this.networkV&&_(e,Up,this.networkV),e}toJSON(){let e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){let t=(0,Yt.getBigInt)(e,"v");return t==fZ||t==dZ?oZ:((0,Yt.assertArgument)(t>=GP,"invalid EIP-155 v","v",e),(t-GP)/uZ)}static getChainIdV(e,t){return(0,Yt.getBigInt)(e)*uZ+BigInt(35+t-27)}static getNormalizedV(e){let t=(0,Yt.getBigInt)(e);return t===oZ||t===fZ?27:t===cZ||t===dZ?28:((0,Yt.assertArgument)(t>=GP,"invalid v","v",e),t&cZ?27:28)}static from(e){function t(u,f){(0,Yt.assertArgument)(u,f,"signature",e)}if(e==null)return new Iu(o1,aZ.ZeroHash,aZ.ZeroHash,27);if(typeof e=="string"){let u=(0,Yt.getBytes)(e,"signature");if(u.length===64){let f=(0,Yt.hexlify)(u.slice(0,32)),d=u.slice(32,64),g=d[0]&128?28:27;return d[0]&=127,new Iu(o1,f,(0,Yt.hexlify)(d),g)}if(u.length===65){let f=(0,Yt.hexlify)(u.slice(0,32)),d=u.slice(32,64);t((d[0]&128)===0,"non-canonical s");let g=Iu.getNormalizedV(u[64]);return new Iu(o1,f,(0,Yt.hexlify)(d),g)}t(!1,"invalid raw signature length")}if(e instanceof Iu)return e.clone();let n=e.r;t(n!=null,"missing r");let s=lZ(n),i=function(u,f){if(u!=null)return lZ(u);if(f!=null){t((0,Yt.isHexString)(f,32),"invalid yParityAndS");let d=(0,Yt.getBytes)(f);return d[0]&=127,(0,Yt.hexlify)(d)}t(!1,"missing s")}(e.s,e.yParityAndS);t(((0,Yt.getBytes)(i)[0]&128)==0,"non-canonical s");let{networkV:a,v:o}=function(u,f,d){if(u!=null){let g=(0,Yt.getBigInt)(u);return{networkV:g>=GP?g:void 0,v:Iu.getNormalizedV(g)}}if(f!=null)return t((0,Yt.isHexString)(f,32),"invalid yParityAndS"),{v:(0,Yt.getBytes)(f)[0]&128?28:27};if(d!=null){switch((0,Yt.getNumber)(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Iu(o1,s,i,o);return a&&_(c,Up,a),t(e.yParity==null||(0,Yt.getNumber)(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}},JI=Iu;c1=new WeakMap,u1=new WeakMap,f1=new WeakMap,Up=new WeakMap;VP.Signature=JI});var bZ=R(zP=>{"use strict";b();p();Object.defineProperty(zP,"__esModule",{value:!0});zP.SigningKey=void 0;var Fp=tZ(),as=ke(),hZ=ZI(),sd,qp=class{constructor(e){I(this,sd,void 0);(0,as.assertArgument)((0,as.dataLength)(e)===32,"invalid private key","privateKey","[REDACTED]"),_(this,sd,(0,as.hexlify)(e))}get privateKey(){return l(this,sd)}get publicKey(){return qp.computePublicKey(l(this,sd))}get compressedPublicKey(){return qp.computePublicKey(l(this,sd),!0)}sign(e){(0,as.assertArgument)((0,as.dataLength)(e)===32,"invalid digest length","digest",e);let t=Fp.secp256k1.sign((0,as.getBytesCopy)(e),(0,as.getBytesCopy)(l(this,sd)),{lowS:!0});return hZ.Signature.from({r:(0,as.toBeHex)(t.r,32),s:(0,as.toBeHex)(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){let t=qp.computePublicKey(e);return(0,as.hexlify)(Fp.secp256k1.getSharedSecret((0,as.getBytesCopy)(l(this,sd)),(0,as.getBytes)(t),!1))}static computePublicKey(e,t){let n=(0,as.getBytes)(e,"key");if(n.length===32){let i=Fp.secp256k1.getPublicKey(n,!!t);return(0,as.hexlify)(i)}if(n.length===64){let i=new Uint8Array(65);i[0]=4,i.set(n,1),n=i}let s=Fp.secp256k1.ProjectivePoint.fromHex(n);return(0,as.hexlify)(s.toRawBytes(t))}static recoverPublicKey(e,t){(0,as.assertArgument)((0,as.dataLength)(e)===32,"invalid digest length","digest",e);let n=hZ.Signature.from(t),s=Fp.secp256k1.Signature.fromCompact((0,as.getBytesCopy)((0,as.concat)([n.r,n.s])));s=s.addRecoveryBit(n.yParity);let i=s.recoverPublicKey((0,as.getBytesCopy)(e));return(0,as.assertArgument)(i!=null,"invalid signautre for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){let s=Fp.secp256k1.ProjectivePoint.fromHex(qp.computePublicKey(e).substring(2)),i=Fp.secp256k1.ProjectivePoint.fromHex(qp.computePublicKey(t).substring(2));return"0x"+s.add(i).toHex(!!n)}},QI=qp;sd=new WeakMap;zP.SigningKey=QI});var si=R($r=>{"use strict";b();p();Object.defineProperty($r,"__esModule",{value:!0});$r.lock=$r.Signature=$r.SigningKey=$r.scryptSync=$r.scrypt=$r.pbkdf2=$r.sha512=$r.sha256=$r.ripemd160=$r.keccak256=$r.randomBytes=$r.computeHmac=void 0;var pZ=P$();Object.defineProperty($r,"computeHmac",{enumerable:!0,get:function(){return pZ.computeHmac}});var gZ=M$();Object.defineProperty($r,"keccak256",{enumerable:!0,get:function(){return gZ.keccak256}});var xZ=G$();Object.defineProperty($r,"ripemd160",{enumerable:!0,get:function(){return xZ.ripemd160}});var yZ=$$();Object.defineProperty($r,"pbkdf2",{enumerable:!0,get:function(){return yZ.pbkdf2}});var YI=Y$();Object.defineProperty($r,"randomBytes",{enumerable:!0,get:function(){return YI.randomBytes}});var WP=lJ();Object.defineProperty($r,"scrypt",{enumerable:!0,get:function(){return WP.scrypt}});Object.defineProperty($r,"scryptSync",{enumerable:!0,get:function(){return WP.scryptSync}});var $P=wJ();Object.defineProperty($r,"sha256",{enumerable:!0,get:function(){return $P.sha256}});Object.defineProperty($r,"sha512",{enumerable:!0,get:function(){return $P.sha512}});var w2e=bZ();Object.defineProperty($r,"SigningKey",{enumerable:!0,get:function(){return w2e.SigningKey}});var v2e=ZI();Object.defineProperty($r,"Signature",{enumerable:!0,get:function(){return v2e.Signature}});function P2e(){pZ.computeHmac.lock(),gZ.keccak256.lock(),yZ.pbkdf2.lock(),YI.randomBytes.lock(),xZ.ripemd160.lock(),WP.scrypt.lock(),WP.scryptSync.lock(),$P.sha256.lock(),$P.sha512.lock(),YI.randomBytes.lock()}$r.lock=P2e});var JP=R(d1=>{"use strict";b();p();Object.defineProperty(d1,"__esModule",{value:!0});d1.getIcapAddress=d1.getAddress=void 0;var _2e=si(),T8=ke(),A2e=BigInt(0),E2e=BigInt(36);function mZ(r){r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);let n=(0,T8.getBytes)((0,_2e.keccak256)(t));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(n[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}var XI={};for(let r=0;r<10;r++)XI[String(r)]=String(r);for(let r=0;r<26;r++)XI[String.fromCharCode(65+r)]=String(10+r);var wZ=15;function vZ(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>XI[n]).join("");for(;e.length>=wZ;){let n=e.substring(0,wZ);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}var S2e=function(){let r={};for(let e=0;e<36;e++){let t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r}();function T2e(r){r=r.toLowerCase();let e=A2e;for(let t=0;t<r.length;t++)e=e*E2e+S2e[r[t]];return e}function PZ(r){if((0,T8.assertArgument)(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);let e=mZ(r);return(0,T8.assertArgument)(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,T8.assertArgument)(r.substring(2,4)===vZ(r),"bad icap checksum","address",r);let e=T2e(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return mZ("0x"+e)}(0,T8.assertArgument)(!1,"invalid address","address",r)}d1.getAddress=PZ;function O2e(r){let e=BigInt(PZ(r)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+vZ("XE00"+e)+e}d1.getIcapAddress=O2e});var AZ=R(l1=>{"use strict";b();p();Object.defineProperty(l1,"__esModule",{value:!0});l1.getCreate2Address=l1.getCreateAddress=void 0;var _Z=si(),id=ke(),ZP=JP();function B2e(r){let e=(0,ZP.getAddress)(r.from),n=(0,id.getBigInt)(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,(0,ZP.getAddress)((0,id.dataSlice)((0,_Z.keccak256)((0,id.encodeRlp)([e,n])),12))}l1.getCreateAddress=B2e;function k2e(r,e,t){let n=(0,ZP.getAddress)(r),s=(0,id.getBytes)(e,"salt"),i=(0,id.getBytes)(t,"initCodeHash");return(0,id.assertArgument)(s.length===32,"salt must be 32 bytes","salt",e),(0,id.assertArgument)(i.length===32,"initCodeHash must be 32 bytes","initCodeHash",t),(0,ZP.getAddress)((0,id.dataSlice)((0,_Z.keccak256)((0,id.concat)(["0xff",n,s,i])),12))}l1.getCreate2Address=k2e});var SZ=R(Yl=>{"use strict";b();p();Object.defineProperty(Yl,"__esModule",{value:!0});Yl.resolveAddress=Yl.isAddress=Yl.isAddressable=void 0;var QP=ke(),tR=JP();function EZ(r){return r&&typeof r.getAddress=="function"}Yl.isAddressable=EZ;function N2e(r){try{return(0,tR.getAddress)(r),!0}catch{}return!1}Yl.isAddress=N2e;async function eR(r,e){let t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&((0,QP.assert)(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),(0,QP.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),(0,tR.getAddress)(t)}function I2e(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?(0,tR.getAddress)(r):((0,QP.assert)(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),eR(r,e.resolveName(r)));if(EZ(r))return eR(r,r.getAddress());if(r&&typeof r.then=="function")return eR(r,r);(0,QP.assertArgument)(!1,"unsupported addressable value","target",r)}Yl.resolveAddress=I2e});var Ks=R(Ci=>{"use strict";b();p();Object.defineProperty(Ci,"__esModule",{value:!0});Ci.resolveAddress=Ci.isAddress=Ci.isAddressable=Ci.getCreate2Address=Ci.getCreateAddress=Ci.getIcapAddress=Ci.getAddress=void 0;var TZ=JP();Object.defineProperty(Ci,"getAddress",{enumerable:!0,get:function(){return TZ.getAddress}});Object.defineProperty(Ci,"getIcapAddress",{enumerable:!0,get:function(){return TZ.getIcapAddress}});var OZ=AZ();Object.defineProperty(Ci,"getCreateAddress",{enumerable:!0,get:function(){return OZ.getCreateAddress}});Object.defineProperty(Ci,"getCreate2Address",{enumerable:!0,get:function(){return OZ.getCreate2Address}});var rR=SZ();Object.defineProperty(Ci,"isAddressable",{enumerable:!0,get:function(){return rR.isAddressable}});Object.defineProperty(Ci,"isAddress",{enumerable:!0,get:function(){return rR.isAddress}});Object.defineProperty(Ci,"resolveAddress",{enumerable:!0,get:function(){return rR.resolveAddress}})});var Kf=R(YP=>{"use strict";b();p();Object.defineProperty(YP,"__esModule",{value:!0});YP.Typed=void 0;var BZ=ke(),Ru={};function Ue(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new O8(Ru,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function br(r,e){return new O8(Ru,`bytes${e||""}`,r,{size:e})}var kZ=Symbol.for("_ethers_typed"),Dp,ju=class{constructor(e,t,n,s){N(this,"type");N(this,"value");I(this,Dp,void 0);N(this,"_typedSymbol");s==null&&(s=null),(0,BZ.assertPrivate)(Ru,e,"Typed"),(0,BZ.defineProperties)(this,{_typedSymbol:kZ,type:t,value:n}),_(this,Dp,s),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 l(this,Dp)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return l(this,Dp)===!0?-1:l(this,Dp)===!1?this.value.length:null}static from(e,t){return new ju(Ru,e,t)}static uint8(e){return Ue(e,8)}static uint16(e){return Ue(e,16)}static uint24(e){return Ue(e,24)}static uint32(e){return Ue(e,32)}static uint40(e){return Ue(e,40)}static uint48(e){return Ue(e,48)}static uint56(e){return Ue(e,56)}static uint64(e){return Ue(e,64)}static uint72(e){return Ue(e,72)}static uint80(e){return Ue(e,80)}static uint88(e){return Ue(e,88)}static uint96(e){return Ue(e,96)}static uint104(e){return Ue(e,104)}static uint112(e){return Ue(e,112)}static uint120(e){return Ue(e,120)}static uint128(e){return Ue(e,128)}static uint136(e){return Ue(e,136)}static uint144(e){return Ue(e,144)}static uint152(e){return Ue(e,152)}static uint160(e){return Ue(e,160)}static uint168(e){return Ue(e,168)}static uint176(e){return Ue(e,176)}static uint184(e){return Ue(e,184)}static uint192(e){return Ue(e,192)}static uint200(e){return Ue(e,200)}static uint208(e){return Ue(e,208)}static uint216(e){return Ue(e,216)}static uint224(e){return Ue(e,224)}static uint232(e){return Ue(e,232)}static uint240(e){return Ue(e,240)}static uint248(e){return Ue(e,248)}static uint256(e){return Ue(e,256)}static uint(e){return Ue(e,256)}static int8(e){return Ue(e,-8)}static int16(e){return Ue(e,-16)}static int24(e){return Ue(e,-24)}static int32(e){return Ue(e,-32)}static int40(e){return Ue(e,-40)}static int48(e){return Ue(e,-48)}static int56(e){return Ue(e,-56)}static int64(e){return Ue(e,-64)}static int72(e){return Ue(e,-72)}static int80(e){return Ue(e,-80)}static int88(e){return Ue(e,-88)}static int96(e){return Ue(e,-96)}static int104(e){return Ue(e,-104)}static int112(e){return Ue(e,-112)}static int120(e){return Ue(e,-120)}static int128(e){return Ue(e,-128)}static int136(e){return Ue(e,-136)}static int144(e){return Ue(e,-144)}static int152(e){return Ue(e,-152)}static int160(e){return Ue(e,-160)}static int168(e){return Ue(e,-168)}static int176(e){return Ue(e,-176)}static int184(e){return Ue(e,-184)}static int192(e){return Ue(e,-192)}static int200(e){return Ue(e,-200)}static int208(e){return Ue(e,-208)}static int216(e){return Ue(e,-216)}static int224(e){return Ue(e,-224)}static int232(e){return Ue(e,-232)}static int240(e){return Ue(e,-240)}static int248(e){return Ue(e,-248)}static int256(e){return Ue(e,-256)}static int(e){return Ue(e,-256)}static bytes1(e){return br(e,1)}static bytes2(e){return br(e,2)}static bytes3(e){return br(e,3)}static bytes4(e){return br(e,4)}static bytes5(e){return br(e,5)}static bytes6(e){return br(e,6)}static bytes7(e){return br(e,7)}static bytes8(e){return br(e,8)}static bytes9(e){return br(e,9)}static bytes10(e){return br(e,10)}static bytes11(e){return br(e,11)}static bytes12(e){return br(e,12)}static bytes13(e){return br(e,13)}static bytes14(e){return br(e,14)}static bytes15(e){return br(e,15)}static bytes16(e){return br(e,16)}static bytes17(e){return br(e,17)}static bytes18(e){return br(e,18)}static bytes19(e){return br(e,19)}static bytes20(e){return br(e,20)}static bytes21(e){return br(e,21)}static bytes22(e){return br(e,22)}static bytes23(e){return br(e,23)}static bytes24(e){return br(e,24)}static bytes25(e){return br(e,25)}static bytes26(e){return br(e,26)}static bytes27(e){return br(e,27)}static bytes28(e){return br(e,28)}static bytes29(e){return br(e,29)}static bytes30(e){return br(e,30)}static bytes31(e){return br(e,31)}static bytes32(e){return br(e,32)}static address(e){return new ju(Ru,"address",e)}static bool(e){return new ju(Ru,"bool",!!e)}static bytes(e){return new ju(Ru,"bytes",e)}static string(e){return new ju(Ru,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new ju(Ru,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===kZ}static dereference(e,t){if(ju.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}},O8=ju;Dp=new WeakMap;YP.Typed=O8});var IZ=R(XP=>{"use strict";b();p();Object.defineProperty(XP,"__esModule",{value:!0});XP.AddressCoder=void 0;var NZ=Ks(),R2e=Ay(),j2e=Kf(),M2e=Yo(),nR=class extends M2e.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=j2e.Typed.dereference(t,"string");try{n=(0,NZ.getAddress)(n)}catch(s){return this._throwError(s.message,t)}return e.writeValue(n)}decode(e){return(0,NZ.getAddress)((0,R2e.toBeHex)(e.readValue(),20))}};XP.AddressCoder=nR});var RZ=R(e_=>{"use strict";b();p();Object.defineProperty(e_,"__esModule",{value:!0});e_.AnonymousCoder=void 0;var C2e=Yo(),sR=class extends C2e.Coder{constructor(t){super(t.name,t.type,"_",t.dynamic);N(this,"coder");this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,n){return this.coder.encode(t,n)}decode(t){return this.coder.decode(t)}};e_.AnonymousCoder=sR});var aR=R(Xl=>{"use strict";b();p();Object.defineProperty(Xl,"__esModule",{value:!0});Xl.ArrayCoder=Xl.unpack=Xl.pack=void 0;var ad=ke(),L2e=Kf(),h1=Yo(),U2e=RZ();function jZ(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(u=>{let f=u.localName;return(0,ad.assert)(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),(0,ad.assert)(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),c[f]=!0,t[f]})}else(0,ad.assertArgument)(!1,"invalid tuple value","tuple",t);(0,ad.assertArgument)(e.length===n.length,"types/value length mismatch","tuple",t);let s=new h1.Writer,i=new h1.Writer,a=[];e.forEach((c,u)=>{let f=n[u];if(c.dynamic){let d=i.length;c.encode(i,f);let g=s.writeUpdatableValue();a.push(h=>{g(h+d)})}else c.encode(s,f)}),a.forEach(c=>{c(s.length)});let o=r.appendWriter(s);return o+=r.appendWriter(i),o}Xl.pack=jZ;function MZ(r,e){let t=[],n=[],s=r.subReader(0);return e.forEach(i=>{let a=null;if(i.dynamic){let o=r.readIndex(),c=s.subReader(o);try{a=i.decode(c)}catch(u){if((0,ad.isError)(u,"BUFFER_OVERRUN"))throw u;a=u,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(r)}catch(o){if((0,ad.isError)(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");t.push(a),n.push(i.localName||null)}),h1.Result.fromItems(t,n)}Xl.unpack=MZ;var iR=class extends h1.Coder{constructor(t,n,s){let i=t.type+"["+(n>=0?n:"")+"]",a=n===-1||t.dynamic;super("array",i,s,a);N(this,"coder");N(this,"length");(0,ad.defineProperties)(this,{coder:t,length:n})}defaultValue(){let t=this.coder.defaultValue(),n=[];for(let s=0;s<this.length;s++)n.push(t);return n}encode(t,n){let s=L2e.Typed.dereference(n,"array");Array.isArray(s)||this._throwError("expected array value",s);let i=this.length;i===-1&&(i=s.length,t.writeValue(s.length)),(0,ad.assertArgumentCount)(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<s.length;o++)a.push(this.coder);return jZ(t,a,s)}decode(t){let n=this.length;n===-1&&(n=t.readIndex(),(0,ad.assert)(n*h1.WordSize<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:n*h1.WordSize,length:t.dataLength}));let s=[];for(let i=0;i<n;i++)s.push(new U2e.AnonymousCoder(this.coder));return MZ(t,s)}};Xl.ArrayCoder=iR});var CZ=R(t_=>{"use strict";b();p();Object.defineProperty(t_,"__esModule",{value:!0});t_.BooleanCoder=void 0;var F2e=Kf(),q2e=Yo(),oR=class extends q2e.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){let n=F2e.Typed.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}};t_.BooleanCoder=oR});var uR=R(b1=>{"use strict";b();p();Object.defineProperty(b1,"__esModule",{value:!0});b1.BytesCoder=b1.DynamicBytesCoder=void 0;var LZ=ke(),D2e=Yo(),r_=class extends D2e.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,LZ.getBytesCopy)(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}};b1.DynamicBytesCoder=r_;var cR=class extends r_{constructor(e){super("bytes",e)}decode(e){return(0,LZ.hexlify)(super.decode(e))}};b1.BytesCoder=cR});var UZ=R(n_=>{"use strict";b();p();Object.defineProperty(n_,"__esModule",{value:!0});n_.FixedBytesCoder=void 0;var fR=ke(),H2e=Kf(),K2e=Yo(),dR=class extends K2e.Coder{constructor(t,n){let s="bytes"+String(t);super(s,s,n,!1);N(this,"size");(0,fR.defineProperties)(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,n){let s=(0,fR.getBytesCopy)(H2e.Typed.dereference(n,this.type));return s.length!==this.size&&this._throwError("incorrect data length",n),t.writeBytes(s)}decode(t){return(0,fR.hexlify)(t.readBytes(this.size))}};n_.FixedBytesCoder=dR});var FZ=R(s_=>{"use strict";b();p();Object.defineProperty(s_,"__esModule",{value:!0});s_.NullCoder=void 0;var G2e=Yo(),V2e=new Uint8Array([]),lR=class extends G2e.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(V2e)}decode(e){return e.readBytes(0),null}};s_.NullCoder=lR});var qZ=R(i_=>{"use strict";b();p();Object.defineProperty(i_,"__esModule",{value:!0});i_.NumberCoder=void 0;var eh=ke(),z2e=Kf(),hR=Yo(),W2e=BigInt(0),$2e=BigInt(1),J2e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),bR=class extends hR.Coder{constructor(t,n,s){let i=(n?"int":"uint")+t*8;super(i,i,s,!1);N(this,"size");N(this,"signed");(0,eh.defineProperties)(this,{size:t,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,n){let s=(0,eh.getBigInt)(z2e.Typed.dereference(n,this.type)),i=(0,eh.mask)(J2e,hR.WordSize*8);if(this.signed){let a=(0,eh.mask)(i,this.size*8-1);(s>a||s<-(a+$2e))&&this._throwError("value out-of-bounds",n),s=(0,eh.toTwos)(s,8*hR.WordSize)}else(s<W2e||s>(0,eh.mask)(i,this.size*8))&&this._throwError("value out-of-bounds",n);return t.writeValue(s)}decode(t){let n=(0,eh.mask)(t.readValue(),this.size*8);return this.signed&&(n=(0,eh.fromTwos)(n,this.size*8)),n}};i_.NumberCoder=bR});var HZ=R(a_=>{"use strict";b();p();Object.defineProperty(a_,"__esModule",{value:!0});a_.StringCoder=void 0;var DZ=$9(),Z2e=Kf(),Q2e=uR(),pR=class extends Q2e.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,DZ.toUtf8Bytes)(Z2e.Typed.dereference(t,"string")))}decode(e){return(0,DZ.toUtf8String)(super.decode(e))}};a_.StringCoder=pR});var GZ=R(o_=>{"use strict";b();p();Object.defineProperty(o_,"__esModule",{value:!0});o_.TupleCoder=void 0;var Y2e=Ml(),X2e=Kf(),e3e=Yo(),KZ=aR(),gR=class extends e3e.Coder{constructor(t,n){let s=!1,i=[];t.forEach(o=>{o.dynamic&&(s=!0),i.push(o.type)});let a="tuple("+i.join(",")+")";super("tuple",a,n,s);N(this,"coders");(0,Y2e.defineProperties)(this,{coders:Object.freeze(t.slice())})}defaultValue(){let t=[];this.coders.forEach(s=>{t.push(s.defaultValue())});let n=this.coders.reduce((s,i)=>{let a=i.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});return this.coders.forEach((s,i)=>{let a=s.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,n){let s=X2e.Typed.dereference(n,"tuple");return(0,KZ.pack)(t,this.coders,s)}decode(t){return(0,KZ.unpack)(t,this.coders)}};o_.TupleCoder=gR});var xR=R(c_=>{"use strict";b();p();Object.defineProperty(c_,"__esModule",{value:!0});c_.id=void 0;var t3e=si(),r3e=ke();function n3e(r){return(0,t3e.keccak256)((0,r3e.toUtf8Bytes)(r))}c_.id=n3e});var RR=R(nc=>{"use strict";b();p();var s3e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/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",VZ=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),zZ=4;function i3e(r){let e=0;function t(){return r[e++]<<8|r[e++]}let n=t(),s=1,i=[0,1];for(let z=1;z<n;z++)i.push(s+=t());let a=t(),o=e;e+=a;let c=0,u=0;function f(){return c==0&&(u=u<<8|r[e++],c=8),u>>--c&1}let d=31,g=2**d,h=g>>>1,m=h>>1,y=g-1,S=0;for(let z=0;z<d;z++)S=S<<1|f();let T=[],H=0,C=g;for(;;){let z=Math.floor(((S-H+1)*s-1)/C),W=0,Y=n;for(;Y-W>1;){let q=W+Y>>>1;z<i[q]?Y=q:W=q}if(W==0)break;T.push(W);let Z=H+Math.floor(C*i[W]/s),se=H+Math.floor(C*i[W+1]/s)-1;for(;((Z^se)&h)==0;)S=S<<1&y|f(),Z=Z<<1&y,se=se<<1&y|1;for(;Z&~se&m;)S=S&h|S<<1&y>>>1|f(),Z=Z<<1^h,se=(se^h)<<1|h|1;H=Z,C=1+se-Z}let J=n-4;return T.map(z=>{switch(z-J){case 3:return J+65792+(r[o++]<<16|r[o++]<<8|r[o++]);case 2:return J+256+(r[o++]<<8|r[o++]);case 1:return J+r[o++];default:return z-1}})}function a3e(r){let e=0;return()=>r[e++]}function QZ(r){return a3e(i3e(o3e(r)))}function o3e(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let t=r.length,n=new Uint8Array(6*t>>3);for(let s=0,i=0,a=0,o=0;s<t;s++)o=o<<6|e[r.charCodeAt(s)],a+=6,a>=8&&(n[i++]=o>>(a-=8));return n}function c3e(r){return r&1?~r>>1:r>>1}function u3e(r,e){let t=Array(r);for(let n=0,s=0;n<r;n++)t[n]=s+=c3e(e());return t}function I8(r,e=0){let t=[];for(;;){let n=r(),s=r();if(!s)break;e+=n;for(let i=0;i<s;i++)t.push(e+i);e+=s+1}return t}function YZ(r){return R8(()=>{let e=I8(r);if(e.length)return e})}function XZ(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(f3e(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(d3e(t,r))}return e.flat()}function R8(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function eQ(r,e,t){let n=Array(r).fill().map(()=>[]);for(let s=0;s<e;s++)u3e(r,t).forEach((i,a)=>n[a].push(i));return n}function f3e(r,e){let t=1+e(),n=e(),s=R8(e);return eQ(s.length,1+r,e).flatMap((a,o)=>{let[c,...u]=a;return Array(s[o]).fill().map((f,d)=>{let g=d*n;return[c+d*t,u.map(h=>h+g)]})})}function d3e(r,e){let t=1+e();return eQ(t,1+r,e).map(s=>[s[0],s.slice(1)])}function l3e(r){let e=[],t=I8(r);return s(n([]),[]),e;function n(i){let a=r(),o=R8(()=>{let c=I8(r).map(u=>t[u]);if(c.length)return n(c)});return{S:a,B:o,Q:i}}function s({S:i,B:a},o,c){if(!(i&4&&c===o[o.length-1])){i&2&&(c=o[o.length-1]),i&1&&e.push(o);for(let u of a)for(let f of u.Q)s(u,[...o,f],c)}}}function h3e(r){return r.toString(16).toUpperCase().padStart(2,"0")}function tQ(r){return`{${h3e(r)}}`}function TR(r){let e=[];for(let t=0,n=r.length;t<n;){let s=r.codePointAt(t);t+=s<65536?1:2,e.push(s)}return e}function rh(r){let t=r.length;if(t<4096)return String.fromCodePoint(...r);let n=[];for(let s=0;s<t;)n.push(String.fromCodePoint(...r.slice(s,s+=4096)));return n.join("")}function rQ(r,e){let t=r.length,n=t-e.length;for(let s=0;n==0&&s<t;s++)n=r[s]-e[s];return n}var b3e="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/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",j8=44032,f_=4352,d_=4449,l_=4519,nQ=19,sQ=21,x1=28,h_=sQ*x1,p3e=nQ*h_,g3e=j8+p3e,x3e=f_+nQ,y3e=d_+sQ,m3e=l_+x1;function B8(r){return r>>24&255}function iQ(r){return r&16777215}var vR,WZ,PR,u_;function w3e(){let r=QZ(b3e);vR=new Map(YZ(r).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),WZ=new Set(I8(r)),PR=new Map,u_=new Map;for(let[e,t]of XZ(r)){if(!WZ.has(e)&&t.length==2){let[n,s]=t,i=u_.get(n);i||(i=new Map,u_.set(n,i)),i.set(s,e)}PR.set(e,t.reverse())}}function aQ(r){return r>=j8&&r<g3e}function v3e(r,e){if(r>=f_&&r<x3e&&e>=d_&&e<y3e)return j8+(r-f_)*h_+(e-d_)*x1;if(aQ(r)&&e>l_&&e<m3e&&(r-j8)%x1==0)return r+(e-l_);{let t=u_.get(r);return t&&(t=t.get(e),t)?t:-1}}function oQ(r){vR||w3e();let e=[],t=[],n=!1;function s(i){let a=vR.get(i);a&&(n=!0,i|=a),e.push(i)}for(let i of r)for(;;){if(i<128)e.push(i);else if(aQ(i)){let a=i-j8,o=a/h_|0,c=a%h_/x1|0,u=a%x1;s(f_+o),s(d_+c),u>0&&s(l_+u)}else{let a=PR.get(i);a?t.push(...a):s(i)}if(!t.length)break;i=t.pop()}if(n&&e.length>1){let i=B8(e[0]);for(let a=1;a<e.length;a++){let o=B8(e[a]);if(o==0||i<=o){i=o;continue}let c=a-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(i=B8(e[--c]),i<=o))break}i=B8(e[a])}}return e}function P3e(r){let e=[],t=[],n=-1,s=0;for(let i of r){let a=B8(i),o=iQ(i);if(n==-1)a==0?n=o:e.push(o);else if(s>0&&s>=a)a==0?(e.push(n,...t),t.length=0,n=o):t.push(o),s=a;else{let c=v3e(n,o);c>=0?n=c:s==0&&a==0?(e.push(n),n=o):(t.push(o),s=a)}}return n>=0&&e.push(n,...t),e}function x_(r){return oQ(r).map(iQ)}function y1(r){return P3e(oQ(r))}var $Z=45,_3e=46,b_=".",cQ=65039,uQ=1,p_=r=>Array.from(r);function M8(r,e){return r.P.has(e)||r.Q.has(e)}var _R=class extends Array{get is_emoji(){return!0}},g_,OR,Hp,AR,fQ,dQ,g1,yR,p1,th,ER,SR;function m1(){if(g_)return;let r=QZ(s3e),e=()=>I8(r),t=()=>new Set(e()),n=(f,d)=>d.forEach(g=>f.add(g));g_=new Map(XZ(r)),OR=t(),Hp=e(),AR=new Set(e().map(f=>Hp[f])),Hp=new Set(Hp),fQ=t(),dQ=t();let s=YZ(r),i=r(),a=()=>{let f=new Set;return e().forEach(d=>n(f,s[d])),n(f,e()),f};g1=R8(f=>{let d=R8(r).map(g=>g+96);if(d.length){let g=f>=i;d[0]-=32,d=rh(d),g&&(d=`Restricted[${d}]`);let h=a(),m=a(),y=!r();return{N:d,P:h,Q:m,M:y,R:g}}}),yR=t(),p1=new Map;let o=e().concat(p_(yR)).sort((f,d)=>f-d);o.forEach((f,d)=>{let g=r(),h=o[d]=g?o[d-g]:{V:[],M:new Map};h.V.push(f),yR.has(f)||p1.set(f,h)});for(let{V:f,M:d}of new Set(p1.values())){let g=[];for(let m of f){let y=g1.filter(T=>M8(T,m)),S=g.find(({G:T})=>y.some(H=>T.has(H)));S||(S={G:new Set,V:[]},g.push(S)),S.V.push(m),n(S.G,y)}let h=g.flatMap(m=>p_(m.G));for(let{G:m,V:y}of g){let S=new Set(h.filter(T=>!m.has(T)));for(let T of y)d.set(T,S)}}th=new Set;let c=new Set,u=f=>th.has(f)?c.add(f):th.add(f);for(let f of g1){for(let d of f.P)u(d);for(let d of f.Q)u(d)}for(let f of th)!p1.has(f)&&!c.has(f)&&p1.set(f,uQ);n(th,x_(th)),ER=l3e(r).map(f=>_R.from(f)).sort(rQ),SR=new Map;for(let f of ER){let d=[SR];for(let g of f){let h=d.map(m=>{let y=m.get(g);return y||(y=new Map,m.set(g,y)),y});g===cQ?d.push(...h):d=h}for(let g of d)g.V=f}}function BR(r){return(NR(r)?"":`${kR(C8([r]))} `)+tQ(r)}function kR(r){return`"${r}"\u200E`}function A3e(r){if(r.length>=4&&r[2]==$Z&&r[3]==$Z)throw new Error(`invalid label extension: "${rh(r.slice(0,4))}"`)}function E3e(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function S3e(r){let e=r[0],t=VZ.get(e);if(t)throw k8(`leading ${t}`);let n=r.length,s=-1;for(let i=1;i<n;i++){e=r[i];let a=VZ.get(e);if(a){if(s==i)throw k8(`${t} + ${a}`);s=i+1,t=a}}if(s==n)throw k8(`trailing ${t}`)}function C8(r,e=1/0,t=tQ){let n=[];lQ(r[0])&&n.push("\u25CC"),r.length>e&&(e>>=1,r=[...r.slice(0,e),8230,...r.slice(-e)]);let s=0,i=r.length;for(let a=0;a<i;a++){let o=r[a];NR(o)&&(n.push(rh(r.slice(s,a))),n.push(t(o)),s=a+1)}return n.push(rh(r.slice(s,i))),n.join("")}function lQ(r){return m1(),Hp.has(r)}function NR(r){return m1(),fQ.has(r)}function T3e(){return m1(),ER.map(r=>r.slice())}function O3e(r,e){m1();let t=e?x_:y1;return r.split(b_).map(n=>rh(gQ(TR(n),t,y_).flat())).join(b_)}function B3e(r){return hQ(IR(r,y1,y_))}function k3e(r){let e=IR(r,y1,t=>t);for(let{type:t,output:n,error:s}of e){if(s)break;t!=="Greek"&&N3e(n,958,926)}return hQ(e)}function N3e(r,e,t){let n=0;for(;;){let s=r.indexOf(e,n);if(s<0)break;r[s]=t,n=s+1}}function I3e(r,e){return IR(r,y1,e?t=>t.slice():y_)}function IR(r,e,t){if(!r)return[];m1();let n=0;return r.split(b_).map(s=>{let i=TR(s),a={input:i,offset:n};n+=i.length+1;try{let o=a.tokens=gQ(i,e,t),c=o.length,u;if(!c)throw new Error("empty label");let f=a.output=o.flat();if(E3e(f),!(a.emoji=c>1||o[0].is_emoji)&&f.every(g=>g<128))A3e(f),u="ASCII";else{let g=o.flatMap(h=>h.is_emoji?[]:h);if(!g.length)u="Emoji";else{if(Hp.has(f[0]))throw k8("leading combining mark");for(let y=1;y<c;y++){let S=o[y];if(!S.is_emoji&&Hp.has(S[0]))throw k8(`emoji + combining mark: "${rh(o[y-1])} + ${C8([S[0]])}"`)}S3e(f);let h=p_(new Set(g)),[m]=j3e(h);M3e(m,g),R3e(m,h),u=m.N}}a.type=u}catch(o){a.error=o}return a})}function R3e(r,e){let t,n=[];for(let s of e){let i=p1.get(s);if(i===uQ)return;if(i){let a=i.M.get(s);if(t=t?t.filter(o=>a.has(o)):p_(a),!t.length)return}else n.push(s)}if(t){for(let s of t)if(n.every(i=>M8(s,i)))throw new Error(`whole-script confusable: ${r.N}/${s.N}`)}}function j3e(r){let e=g1;for(let t of r){let n=e.filter(s=>M8(s,t));if(!n.length)throw g1.some(s=>M8(s,t))?pQ(e[0],t):bQ(t);if(e=n,n.length==1)break}return e}function hQ(r){return r.map(({input:e,error:t,output:n})=>{if(t){let s=t.message;throw new Error(r.length==1?s:`Invalid label ${kR(C8(e,63))}: ${s}`)}return rh(n)}).join(b_)}function bQ(r){return new Error(`disallowed character: ${BR(r)}`)}function pQ(r,e){let t=BR(e),n=g1.find(s=>s.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function k8(r){return new Error(`illegal placement: ${r}`)}function M3e(r,e){for(let t of e)if(!M8(r,t))throw pQ(r,t);if(r.M){let t=x_(e);for(let n=1,s=t.length;n<s;n++)if(AR.has(t[n])){let i=n+1;for(let a;i<s&&AR.has(a=t[i]);i++)for(let o=n;o<i;o++)if(t[o]==a)throw new Error(`duplicate non-spacing marks: ${BR(a)}`);if(i-n>zZ)throw new Error(`excessive non-spacing marks: ${kR(C8(t.slice(n-1,i)))} (${i-n}/${zZ})`);n=i}}}function gQ(r,e,t){let n=[],s=[];for(r=r.slice().reverse();r.length;){let i=xQ(r);if(i)s.length&&(n.push(e(s)),s=[]),n.push(t(i));else{let a=r.pop();if(th.has(a))s.push(a);else{let o=g_.get(a);if(o)s.push(...o);else if(!OR.has(a))throw bQ(a)}}}return s.length&&n.push(e(s)),n}function y_(r){return r.filter(e=>e!=cQ)}function xQ(r,e){let t=SR,n,s=r.length;for(;s&&(t=t.get(r[--s]),!!t);){let{V:i}=t;i&&(n=i,e&&e.push(...r.slice(s).reverse()),r.length=s)}return n}var N8="valid",yQ="mapped",mR="ignored",C3e="disallowed",L3e="emoji",U3e="nfc",F3e="stop";function mQ(r,{nf:e=!0}={}){m1();let t=TR(r).reverse(),n=[],s=[];for(;t.length;){let i=xQ(t,n);if(i)s.push({type:L3e,emoji:i.slice(),input:n,cps:y_(i)}),n=[];else{let a=t.pop();if(a==_3e)s.push({type:F3e,cp:a});else if(th.has(a))s.push({type:N8,cps:[a]});else if(OR.has(a))s.push({type:mR,cp:a});else{let o=g_.get(a);o?s.push({type:yQ,cp:a,cps:o.slice()}):s.push({type:C3e,cp:a})}}}if(e)for(let i=0,a=-1;i<s.length;i++){let o=s[i];if(wR(o.type))if(JZ(o.cps)){let c=i+1;for(let g=c;g<s.length;g++){let{type:h,cps:m}=s[g];if(wR(h)){if(!JZ(m))break;c=g+1}else if(h!==mR)break}a<0&&(a=i);let u=s.slice(a,c),f=u.flatMap(g=>wR(g.type)?g.cps:[]),d=y1(f);rQ(d,f)?(s.splice(a,c-a,{type:U3e,input:f,cps:d,tokens0:ZZ(u),tokens:mQ(rh(d),{nf:!1})}),i=a):i=c-1,a=-1}else a=i;else o.type!==mR&&(a=-1)}return ZZ(s)}function wR(r){return r==N8||r==yQ}function JZ(r){return r.some(e=>dQ.has(e))}function ZZ(r){for(let e=0;e<r.length;e++)if(r[e].type==N8){let t=e+1;for(;t<r.length&&r[t].type==N8;)t++;r.splice(e,t-e,{type:N8,cps:r.slice(e,t).flatMap(n=>n.cps)})}return r}nc.ens_beautify=k3e;nc.ens_emoji=T3e;nc.ens_normalize=B3e;nc.ens_normalize_fragment=O3e;nc.ens_split=I3e;nc.ens_tokenize=mQ;nc.is_combining_mark=lQ;nc.nfc=y1;nc.nfd=x_;nc.safe_str_from_cps=C8;nc.should_escape=NR});var AQ=R(Gf=>{"use strict";b();p();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.dnsEncode=Gf.namehash=Gf.isValidName=Gf.ensNormalize=void 0;var wQ=si(),sc=ke(),q3e=RR(),PQ=new Uint8Array(32);PQ.fill(0);function vQ(r){return(0,sc.assertArgument)(r.length!==0,"invalid ENS name; empty component","comp",r),r}function jR(r){let e=(0,sc.toUtf8Bytes)(_Q(r)),t=[];if(r.length===0)return t;let n=0;for(let s=0;s<e.length;s++)e[s]===46&&(t.push(vQ(e.slice(n,s))),n=s+1);return(0,sc.assertArgument)(n<e.length,"invalid ENS name; empty component","name",r),t.push(vQ(e.slice(n))),t}function _Q(r){try{if(r.length===0)throw new Error("empty label");return(0,q3e.ens_normalize)(r)}catch(e){(0,sc.assertArgument)(!1,`invalid ENS name (${e.message})`,"name",r)}}Gf.ensNormalize=_Q;function D3e(r){try{return jR(r).length!==0}catch{}return!1}Gf.isValidName=D3e;function H3e(r){(0,sc.assertArgument)(typeof r=="string","invalid ENS name; not a string","name",r),(0,sc.assertArgument)(r.length,"invalid ENS name (empty label)","name",r);let e=PQ,t=jR(r);for(;t.length;)e=(0,wQ.keccak256)((0,sc.concat)([e,(0,wQ.keccak256)(t.pop())]));return(0,sc.hexlify)(e)}Gf.namehash=H3e;function K3e(r,e){let t=e??63;return(0,sc.assertArgument)(t<=255,"DNS encoded label cannot exceed 255","length",t),(0,sc.hexlify)((0,sc.concat)(jR(r).map(n=>{(0,sc.assertArgument)(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);let s=new Uint8Array(n.length+1);return s.set(n,1),s[0]=s.length-1,s})))+"00"}Gf.dnsEncode=K3e});var CR=R(m_=>{"use strict";b();p();Object.defineProperty(m_,"__esModule",{value:!0});m_.accessListify=void 0;var G3e=Ks(),L8=ke();function MR(r,e){return{address:(0,G3e.getAddress)(r),storageKeys:e.map((t,n)=>((0,L8.assertArgument)((0,L8.isHexString)(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function V3e(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?((0,L8.assertArgument)(t.length===2,"invalid slot set",`value[${n}]`,t),MR(t[0],t[1])):((0,L8.assertArgument)(t!=null&&typeof t=="object","invalid address-slot set","value",r),MR(t.address,t.storageKeys)));(0,L8.assertArgument)(r!=null&&typeof r=="object","invalid access list","value",r);let e=Object.keys(r).map(t=>{let n=r[t].reduce((s,i)=>(s[i]=!0,s),{});return MR(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}m_.accessListify=V3e});var UR=R(w1=>{"use strict";b();p();Object.defineProperty(w1,"__esModule",{value:!0});w1.recoverAddress=w1.computeAddress=void 0;var z3e=Ks(),LR=si();function EQ(r){let e;return typeof r=="string"?e=LR.SigningKey.computePublicKey(r,!1):e=r.publicKey,(0,z3e.getAddress)((0,LR.keccak256)("0x"+e.substring(4)).substring(26))}w1.computeAddress=EQ;function W3e(r,e){return EQ(LR.SigningKey.recoverPublicKey(r,e))}w1.recoverAddress=W3e});var BQ=R(P_=>{"use strict";b();p();Object.defineProperty(P_,"__esModule",{value:!0});P_.Transaction=void 0;var TQ=Ks(),OQ=$I(),ud=si(),pe=ke(),DR=CR(),$3e=UR(),ii=BigInt(0),J3e=BigInt(2),Z3e=BigInt(27),Q3e=BigInt(28),Y3e=BigInt(35),X3e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),FR=4096*32;function SQ(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,ud.sha256)(e).substring(4),"0x"+t}function v_(r){return r==="0x"?null:(0,TQ.getAddress)(r)}function HR(r,e){try{return(0,DR.accessListify)(r)}catch(t){(0,pe.assertArgument)(!1,t.message,e,r)}}function U8(r,e){return r==="0x"?0:(0,pe.getNumber)(r,e)}function os(r,e){if(r==="0x")return ii;let t=(0,pe.getBigInt)(r,e);return(0,pe.assertArgument)(t<=X3e,"value exceeds uint size",e,t),t}function ln(r,e){let t=(0,pe.getBigInt)(r,"value"),n=(0,pe.toBeArray)(t);return(0,pe.assertArgument)(n.length<=32,"value too large",`tx.${e}`,t),n}function KR(r){return(0,DR.accessListify)(r).map(e=>[e.address,e.storageKeys])}function e6e(r,e){(0,pe.assertArgument)(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)(0,pe.assertArgument)((0,pe.isHexString)(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function t6e(r){let e=(0,pe.decodeRlp)(r);(0,pe.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);let t={type:0,nonce:U8(e[0],"nonce"),gasPrice:os(e[1],"gasPrice"),gasLimit:os(e[2],"gasLimit"),to:v_(e[3]),value:os(e[4],"value"),data:(0,pe.hexlify)(e[5]),chainId:ii};if(e.length===6)return t;let n=os(e[6],"v"),s=os(e[7],"r"),i=os(e[8],"s");if(s===ii&&i===ii)t.chainId=n;else{let a=(n-Y3e)/J3e;a<ii&&(a=ii),t.chainId=a,(0,pe.assertArgument)(a!==ii||n===Z3e||n===Q3e,"non-canonical legacy v","v",e[6]),t.signature=ud.Signature.from({r:(0,pe.zeroPadValue)(e[7],32),s:(0,pe.zeroPadValue)(e[8],32),v:n})}return t}function r6e(r,e){let t=[ln(r.nonce,"nonce"),ln(r.gasPrice||0,"gasPrice"),ln(r.gasLimit,"gasLimit"),r.to||"0x",ln(r.value,"value"),r.data],n=ii;if(r.chainId!=ii)n=(0,pe.getBigInt)(r.chainId,"tx.chainId"),(0,pe.assertArgument)(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){let i=r.signature.legacyChainId;i!=null&&(n=i)}if(!e)return n!==ii&&(t.push((0,pe.toBeArray)(n)),t.push("0x"),t.push("0x")),(0,pe.encodeRlp)(t);let s=BigInt(27+e.yParity);return n!==ii?s=ud.Signature.getChainIdV(n,e.v):BigInt(e.v)!==s&&(0,pe.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",e),t.push((0,pe.toBeArray)(s)),t.push((0,pe.toBeArray)(e.r)),t.push((0,pe.toBeArray)(e.s)),(0,pe.encodeRlp)(t)}function GR(r,e){let t;try{if(t=U8(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{(0,pe.assertArgument)(!1,"invalid yParity","yParity",e[0])}let n=(0,pe.zeroPadValue)(e[1],32),s=(0,pe.zeroPadValue)(e[2],32),i=ud.Signature.from({r:n,s,yParity:t});r.signature=i}function n6e(r){let e=(0,pe.decodeRlp)((0,pe.getBytes)(r).slice(1));(0,pe.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",(0,pe.hexlify)(r));let t={type:2,chainId:os(e[0],"chainId"),nonce:U8(e[1],"nonce"),maxPriorityFeePerGas:os(e[2],"maxPriorityFeePerGas"),maxFeePerGas:os(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:os(e[4],"gasLimit"),to:v_(e[5]),value:os(e[6],"value"),data:(0,pe.hexlify)(e[7]),accessList:HR(e[8],"accessList")};return e.length===9||GR(t,e.slice(9)),t}function s6e(r,e){let t=[ln(r.chainId,"chainId"),ln(r.nonce,"nonce"),ln(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ln(r.maxFeePerGas||0,"maxFeePerGas"),ln(r.gasLimit,"gasLimit"),r.to||"0x",ln(r.value,"value"),r.data,KR(r.accessList||[])];return e&&(t.push(ln(e.yParity,"yParity")),t.push((0,pe.toBeArray)(e.r)),t.push((0,pe.toBeArray)(e.s))),(0,pe.concat)(["0x02",(0,pe.encodeRlp)(t)])}function i6e(r){let e=(0,pe.decodeRlp)((0,pe.getBytes)(r).slice(1));(0,pe.assertArgument)(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",(0,pe.hexlify)(r));let t={type:1,chainId:os(e[0],"chainId"),nonce:U8(e[1],"nonce"),gasPrice:os(e[2],"gasPrice"),gasLimit:os(e[3],"gasLimit"),to:v_(e[4]),value:os(e[5],"value"),data:(0,pe.hexlify)(e[6]),accessList:HR(e[7],"accessList")};return e.length===8||GR(t,e.slice(8)),t}function a6e(r,e){let t=[ln(r.chainId,"chainId"),ln(r.nonce,"nonce"),ln(r.gasPrice||0,"gasPrice"),ln(r.gasLimit,"gasLimit"),r.to||"0x",ln(r.value,"value"),r.data,KR(r.accessList||[])];return e&&(t.push(ln(e.yParity,"recoveryParam")),t.push((0,pe.toBeArray)(e.r)),t.push((0,pe.toBeArray)(e.s))),(0,pe.concat)(["0x01",(0,pe.encodeRlp)(t)])}function o6e(r){let e=(0,pe.decodeRlp)((0,pe.getBytes)(r).slice(1)),t="3",n=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";let i=e[1],a=e[2],o=e[3];(0,pe.assertArgument)(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),(0,pe.assertArgument)(Array.isArray(a),"invalid network format: commitments not an array","fields[2]",a),(0,pe.assertArgument)(Array.isArray(o),"invalid network format: proofs not an array","fields[3]",o),(0,pe.assertArgument)(i.length===a.length,"invalid network format: blobs/commitments length mismatch","fields",e),(0,pe.assertArgument)(i.length===o.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:i[c],commitment:a[c],proof:o[c]});e=e[0]}(0,pe.assertArgument)(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",(0,pe.hexlify)(r));let s={type:3,chainId:os(e[0],"chainId"),nonce:U8(e[1],"nonce"),maxPriorityFeePerGas:os(e[2],"maxPriorityFeePerGas"),maxFeePerGas:os(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:os(e[4],"gasLimit"),to:v_(e[5]),value:os(e[6],"value"),data:(0,pe.hexlify)(e[7]),accessList:HR(e[8],"accessList"),maxFeePerBlobGas:os(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(s.blobs=n),(0,pe.assertArgument)(s.to!=null,`invalid address for transaction type: ${t}`,"data",r),(0,pe.assertArgument)(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let i=0;i<s.blobVersionedHashes.length;i++)(0,pe.assertArgument)((0,pe.isHexString)(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",r);return e.length===11||GR(s,e.slice(11)),s}function c6e(r,e,t){let n=[ln(r.chainId,"chainId"),ln(r.nonce,"nonce"),ln(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ln(r.maxFeePerGas||0,"maxFeePerGas"),ln(r.gasLimit,"gasLimit"),r.to||OQ.ZeroAddress,ln(r.value,"value"),r.data,KR(r.accessList||[]),ln(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),e6e(r.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(ln(e.yParity,"yParity")),n.push((0,pe.toBeArray)(e.r)),n.push((0,pe.toBeArray)(e.s)),t)?(0,pe.concat)(["0x03",(0,pe.encodeRlp)([n,t.map(s=>s.data),t.map(s=>s.commitment),t.map(s=>s.proof)])]):(0,pe.concat)(["0x03",(0,pe.encodeRlp)(n)])}var Vf,v1,P1,_1,A1,E1,S1,T1,O1,B1,k1,N1,Kp,nh,cd,sh,I1,w_,od=class{constructor(){I(this,I1);I(this,Vf,void 0);I(this,v1,void 0);I(this,P1,void 0);I(this,_1,void 0);I(this,A1,void 0);I(this,E1,void 0);I(this,S1,void 0);I(this,T1,void 0);I(this,O1,void 0);I(this,B1,void 0);I(this,k1,void 0);I(this,N1,void 0);I(this,Kp,void 0);I(this,nh,void 0);I(this,cd,void 0);I(this,sh,void 0);_(this,Vf,null),_(this,v1,null),_(this,_1,0),_(this,A1,ii),_(this,E1,null),_(this,S1,null),_(this,T1,null),_(this,P1,"0x"),_(this,O1,ii),_(this,B1,ii),_(this,k1,null),_(this,N1,null),_(this,Kp,null),_(this,nh,null),_(this,sh,null),_(this,cd,null)}get type(){return l(this,Vf)}set type(e){switch(e){case null:_(this,Vf,null);break;case 0:case"legacy":_(this,Vf,0);break;case 1:case"berlin":case"eip-2930":_(this,Vf,1);break;case 2:case"london":case"eip-1559":_(this,Vf,2);break;case 3:case"cancun":case"eip-4844":_(this,Vf,3);break;default:(0,pe.assertArgument)(!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";case 3:return"eip-4844"}return null}get to(){let e=l(this,v1);return e==null&&this.type===3?OQ.ZeroAddress:e}set to(e){_(this,v1,e==null?null:(0,TQ.getAddress)(e))}get nonce(){return l(this,_1)}set nonce(e){_(this,_1,(0,pe.getNumber)(e,"value"))}get gasLimit(){return l(this,A1)}set gasLimit(e){_(this,A1,(0,pe.getBigInt)(e))}get gasPrice(){let e=l(this,E1);return e==null&&(this.type===0||this.type===1)?ii:e}set gasPrice(e){_(this,E1,e==null?null:(0,pe.getBigInt)(e,"gasPrice"))}get maxPriorityFeePerGas(){let e=l(this,S1);return e??(this.type===2||this.type===3?ii:null)}set maxPriorityFeePerGas(e){_(this,S1,e==null?null:(0,pe.getBigInt)(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){let e=l(this,T1);return e??(this.type===2||this.type===3?ii:null)}set maxFeePerGas(e){_(this,T1,e==null?null:(0,pe.getBigInt)(e,"maxFeePerGas"))}get data(){return l(this,P1)}set data(e){_(this,P1,(0,pe.hexlify)(e))}get value(){return l(this,O1)}set value(e){_(this,O1,(0,pe.getBigInt)(e,"value"))}get chainId(){return l(this,B1)}set chainId(e){_(this,B1,(0,pe.getBigInt)(e))}get signature(){return l(this,k1)||null}set signature(e){_(this,k1,e==null?null:ud.Signature.from(e))}get accessList(){let e=l(this,N1)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){_(this,N1,e==null?null:(0,DR.accessListify)(e))}get maxFeePerBlobGas(){let e=l(this,Kp);return e==null&&this.type===3?ii:e}set maxFeePerBlobGas(e){_(this,Kp,e==null?null:(0,pe.getBigInt)(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=l(this,nh);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){(0,pe.assertArgument)(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)(0,pe.assertArgument)((0,pe.isHexString)(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}_(this,nh,e)}get blobs(){return l(this,sh)==null?null:l(this,sh).map(e=>Object.assign({},e))}set blobs(e){if(e==null){_(this,sh,null);return}let t=[],n=[];for(let s=0;s<e.length;s++){let i=e[s];if((0,pe.isBytesLike)(i)){(0,pe.assert)(l(this,cd),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let a=(0,pe.getBytes)(i);if((0,pe.assertArgument)(a.length<=FR,"blob is too large",`blobs[${s}]`,i),a.length!==FR){let u=new Uint8Array(FR);u.set(a),a=u}let o=l(this,cd).blobToKzgCommitment(a),c=(0,pe.hexlify)(l(this,cd).computeBlobKzgProof(a,o));t.push({data:(0,pe.hexlify)(a),commitment:(0,pe.hexlify)(o),proof:c}),n.push(SQ(1,o))}else{let a=(0,pe.hexlify)(i.commitment);t.push({data:(0,pe.hexlify)(i.data),commitment:a,proof:(0,pe.hexlify)(i.proof)}),n.push(SQ(1,a))}}_(this,sh,t),_(this,nh,n)}get kzg(){return l(this,cd)}set kzg(e){_(this,cd,e)}get hash(){return this.signature==null?null:(0,ud.keccak256)($(this,I1,w_).call(this,!0,!1))}get unsignedHash(){return(0,ud.keccak256)(this.unsignedSerialized)}get from(){return this.signature==null?null:(0,$3e.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:ud.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return $(this,I1,w_).call(this,!0,!0)}get unsignedSerialized(){return $(this,I1,w_).call(this,!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,s=l(this,Kp)!=null||l(this,nh);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&(0,pe.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,pe.assert)(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,pe.assert)(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});let i=[];return this.type!=null?i.push(this.type):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return od.from(this)}toJSON(){let e=t=>t==null?null:t.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 od;if(typeof e=="string"){let n=(0,pe.getBytes)(e);if(n[0]>=127)return od.from(t6e(n));switch(n[0]){case 1:return od.from(i6e(n));case 2:return od.from(n6e(n));case 3:return od.from(o6e(n))}(0,pe.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}let t=new od;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=ud.Signature.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&((0,pe.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),(0,pe.assertArgument)(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&((0,pe.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),(0,pe.assertArgument)(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}},qR=od;Vf=new WeakMap,v1=new WeakMap,P1=new WeakMap,_1=new WeakMap,A1=new WeakMap,E1=new WeakMap,S1=new WeakMap,T1=new WeakMap,O1=new WeakMap,B1=new WeakMap,k1=new WeakMap,N1=new WeakMap,Kp=new WeakMap,nh=new WeakMap,cd=new WeakMap,sh=new WeakMap,I1=new WeakSet,w_=function(e,t){(0,pe.assert)(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});let n=e?this.signature:null;switch(this.inferType()){case 0:return r6e(this,n);case 1:return a6e(this,n);case 2:return s6e(this,n);case 3:return c6e(this,n,t?this.blobs:null)}(0,pe.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};P_.Transaction=qR});var Ma=R(zf=>{"use strict";b();p();Object.defineProperty(zf,"__esModule",{value:!0});zf.Transaction=zf.recoverAddress=zf.computeAddress=zf.accessListify=void 0;var u6e=CR();Object.defineProperty(zf,"accessListify",{enumerable:!0,get:function(){return u6e.accessListify}});var kQ=UR();Object.defineProperty(zf,"computeAddress",{enumerable:!0,get:function(){return kQ.computeAddress}});Object.defineProperty(zf,"recoverAddress",{enumerable:!0,get:function(){return kQ.recoverAddress}});var f6e=BQ();Object.defineProperty(zf,"Transaction",{enumerable:!0,get:function(){return f6e.Transaction}})});var IQ=R(R1=>{"use strict";b();p();Object.defineProperty(R1,"__esModule",{value:!0});R1.verifyMessage=R1.hashMessage=void 0;var d6e=si(),l6e=a1(),h6e=Ma(),__=ke();function NQ(r){return typeof r=="string"&&(r=(0,__.toUtf8Bytes)(r)),(0,d6e.keccak256)((0,__.concat)([(0,__.toUtf8Bytes)(l6e.MessagePrefix),(0,__.toUtf8Bytes)(String(r.length)),r]))}R1.hashMessage=NQ;function b6e(r,e){let t=NQ(r);return(0,h6e.recoverAddress)(t,e)}R1.verifyMessage=b6e});var MQ=R(ih=>{"use strict";b();p();Object.defineProperty(ih,"__esModule",{value:!0});ih.solidityPackedSha256=ih.solidityPackedKeccak256=ih.solidityPacked=void 0;var p6e=Ks(),RQ=si(),hn=ke(),g6e=new RegExp("^bytes([0-9]+)$"),x6e=new RegExp("^(u?int)([0-9]*)$"),y6e=new RegExp("^(.*)\\[([0-9]*)\\]$");function jQ(r,e,t){switch(r){case"address":return t?(0,hn.getBytes)((0,hn.zeroPadValue)(e,32)):(0,hn.getBytes)((0,p6e.getAddress)(e));case"string":return(0,hn.toUtf8Bytes)(e);case"bytes":return(0,hn.getBytes)(e);case"bool":return e=e?"0x01":"0x00",t?(0,hn.getBytes)((0,hn.zeroPadValue)(e,32)):(0,hn.getBytes)(e)}let n=r.match(x6e);if(n){let s=n[1]==="int",i=parseInt(n[2]||"256");return(0,hn.assertArgument)((!n[2]||n[2]===String(i))&&i%8===0&&i!==0&&i<=256,"invalid number type","type",r),t&&(i=256),s&&(e=(0,hn.toTwos)(e,i)),(0,hn.getBytes)((0,hn.zeroPadValue)((0,hn.toBeArray)(e),i/8))}if(n=r.match(g6e),n){let s=parseInt(n[1]);return(0,hn.assertArgument)(String(s)===n[1]&&s!==0&&s<=32,"invalid bytes type","type",r),(0,hn.assertArgument)((0,hn.dataLength)(e)===s,`invalid value for ${r}`,"value",e),t?(0,hn.getBytes)((0,hn.zeroPadBytes)(e,32)):e}if(n=r.match(y6e),n&&Array.isArray(e)){let s=n[1],i=parseInt(n[2]||String(e.length));(0,hn.assertArgument)(i===e.length,`invalid array length for ${r}`,"value",e);let a=[];return e.forEach(function(o){a.push(jQ(s,o,!0))}),(0,hn.getBytes)((0,hn.concat)(a))}(0,hn.assertArgument)(!1,"invalid type","type",r)}function VR(r,e){(0,hn.assertArgument)(r.length===e.length,"wrong number of values; expected ${ types.length }","values",e);let t=[];return r.forEach(function(n,s){t.push(jQ(n,e[s]))}),(0,hn.hexlify)((0,hn.concat)(t))}ih.solidityPacked=VR;function m6e(r,e){return(0,RQ.keccak256)(VR(r,e))}ih.solidityPackedKeccak256=m6e;function w6e(r,e){return(0,RQ.sha256)(VR(r,e))}ih.solidityPackedSha256=w6e});var VQ=R(C1=>{"use strict";b();p();Object.defineProperty(C1,"__esModule",{value:!0});C1.verifyTypedData=C1.TypedDataEncoder=void 0;var FQ=Ks(),j1=si(),v6e=Ma(),ct=ke(),qQ=xR(),DQ=new Uint8Array(32);DQ.fill(0);var P6e=BigInt(-1),HQ=BigInt(0),KQ=BigInt(1),_6e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function A6e(r){let e=(0,ct.getBytes)(r),t=e.length%32;return t?(0,ct.concat)([e,DQ.slice(t)]):(0,ct.hexlify)(e)}var E6e=(0,ct.toBeHex)(KQ,32),S6e=(0,ct.toBeHex)(HQ,32),CQ={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},zR=["name","version","chainId","verifyingContract","salt"];function LQ(r){return function(e){return(0,ct.assertArgument)(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}var T6e={name:LQ("name"),version:LQ("version"),chainId:function(r){let e=(0,ct.getBigInt)(r,"domain.chainId");return(0,ct.assertArgument)(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):(0,ct.toQuantity)(e)},verifyingContract:function(r){try{return(0,FQ.getAddress)(r).toLowerCase()}catch{}(0,ct.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){let e=(0,ct.getBytes)(r,"domain.salt");return(0,ct.assertArgument)(e.length===32,'invalid domain value "salt"',"domain.salt",r),(0,ct.hexlify)(e)}};function WR(r){{let e=r.match(/^(u?)int(\d+)$/);if(e){let t=e[1]==="",n=parseInt(e[2]);(0,ct.assertArgument)(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);let s=(0,ct.mask)(_6e,t?n-1:n),i=t?(s+KQ)*P6e:HQ;return function(a){let o=(0,ct.getBigInt)(a,"value");return(0,ct.assertArgument)(o>=i&&o<=s,`value out-of-bounds for ${r}`,"value",o),(0,ct.toBeHex)(t?(0,ct.toTwos)(o,256):o,32)}}}{let e=r.match(/^bytes(\d+)$/);if(e){let t=parseInt(e[1]);return(0,ct.assertArgument)(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){let s=(0,ct.getBytes)(n);return(0,ct.assertArgument)(s.length===t,`invalid length for ${r}`,"value",n),A6e(n)}}}switch(r){case"address":return function(e){return(0,ct.zeroPadValue)((0,FQ.getAddress)(e),32)};case"bool":return function(e){return e?E6e:S6e};case"bytes":return function(e){return(0,j1.keccak256)(e)};case"string":return function(e){return(0,qQ.id)(e)}}return null}function UQ(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function A_(r){let e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}var F8,fd,M1,S_,GQ,ic=class{constructor(e){I(this,S_);N(this,"primaryType");I(this,F8,void 0);I(this,fd,void 0);I(this,M1,void 0);_(this,fd,new Map),_(this,M1,new Map);let t=new Map,n=new Map,s=new Map,i={};Object.keys(e).forEach(c=>{i[c]=e[c].map(({name:u,type:f})=>{let{base:d,index:g}=A_(f);return d==="int"&&!e.int&&(d="int256"),d==="uint"&&!e.uint&&(d="uint256"),{name:u,type:d+(g||"")}}),t.set(c,new Set),n.set(c,[]),s.set(c,new Set)}),_(this,F8,JSON.stringify(i));for(let c in i){let u=new Set;for(let f of i[c]){(0,ct.assertArgument)(!u.has(f.name),`duplicate variable name ${JSON.stringify(f.name)} in ${JSON.stringify(c)}`,"types",e),u.add(f.name);let d=A_(f.type).base;(0,ct.assertArgument)(d!==c,`circular type reference to ${JSON.stringify(d)}`,"types",e),!WR(d)&&((0,ct.assertArgument)(n.has(d),`unknown type ${JSON.stringify(d)}`,"types",e),n.get(d).push(c),t.get(c).add(d))}}let a=Array.from(n.keys()).filter(c=>n.get(c).length===0);(0,ct.assertArgument)(a.length!==0,"missing primary type","types",e),(0,ct.assertArgument)(a.length===1,`ambiguous primary types or unused types: ${a.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),(0,ct.defineProperties)(this,{primaryType:a[0]});function o(c,u){(0,ct.assertArgument)(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),u.add(c);for(let f of t.get(c))if(!!n.has(f)){o(f,u);for(let d of u)s.get(d).add(f)}u.delete(c)}o(this.primaryType,new Set);for(let[c,u]of s){let f=Array.from(u);f.sort(),l(this,fd).set(c,UQ(c,i[c])+f.map(d=>UQ(d,i[d])).join(""))}}get types(){return JSON.parse(l(this,F8))}getEncoder(e){let t=l(this,M1).get(e);return t||(t=$(this,S_,GQ).call(this,e),l(this,M1).set(e,t)),t}encodeType(e){let t=l(this,fd).get(e);return(0,ct.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,j1.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(WR(e))return n(e,t);let s=A_(e).array;if(s)return(0,ct.assertArgument)(s.count===-1||s.count===t.length,`array length mismatch; expected length ${s.count}`,"value",t),t.map(a=>this._visit(s.prefix,a,n));let i=this.types[e];if(i)return i.reduce((a,{name:o,type:c})=>(a[o]=this._visit(c,t[o],n),a),{});(0,ct.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new ic(e)}static getPrimaryType(e){return ic.from(e).primaryType}static hashStruct(e,t,n){return ic.from(t).hashStruct(e,n)}static hashDomain(e){let t=[];for(let n in e){if(e[n]==null)continue;let s=CQ[n];(0,ct.assertArgument)(s,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:s})}return t.sort((n,s)=>zR.indexOf(n.name)-zR.indexOf(s.name)),ic.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return(0,ct.concat)(["0x1901",ic.hashDomain(e),ic.from(t).hash(n)])}static hash(e,t,n){return(0,j1.keccak256)(ic.encode(e,t,n))}static async resolveNames(e,t,n,s){e=Object.assign({},e);for(let o in e)e[o]==null&&delete e[o];let i={};e.verifyingContract&&!(0,ct.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let a=ic.from(t);a.visit(n,(o,c)=>(o==="address"&&!(0,ct.isHexString)(c,20)&&(i[c]="0x"),c));for(let o in i)i[o]=await s(o);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=a.visit(n,(o,c)=>o==="address"&&i[c]?i[c]:c),{domain:e,value:n}}static getPayload(e,t,n){ic.hashDomain(e);let s={},i=[];zR.forEach(c=>{let u=e[c];u!=null&&(s[c]=T6e[c](u),i.push({name:c,type:CQ[c]}))});let a=ic.from(t);t=a.types;let o=Object.assign({},t);return(0,ct.assertArgument)(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=i,a.encode(n),{types:o,domain:s,primaryType:a.primaryType,message:a.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return(0,ct.hexlify)((0,ct.getBytes)(u));if(c.match(/^u?int/))return(0,ct.getBigInt)(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return(0,ct.assertArgument)(typeof u=="string","invalid string","value",u),u}(0,ct.assertArgument)(!1,"unsupported type","type",c)})}}},E_=ic;F8=new WeakMap,fd=new WeakMap,M1=new WeakMap,S_=new WeakSet,GQ=function(e){{let s=WR(e);if(s)return s}let t=A_(e).array;if(t){let s=t.prefix,i=this.getEncoder(s);return a=>{(0,ct.assertArgument)(t.count===-1||t.count===a.length,`array length mismatch; expected length ${t.count}`,"value",a);let o=a.map(i);return l(this,fd).has(s)&&(o=o.map(j1.keccak256)),(0,j1.keccak256)((0,ct.concat)(o))}}let n=this.types[e];if(n){let s=(0,qQ.id)(l(this,fd).get(e));return i=>{let a=n.map(({name:o,type:c})=>{let u=this.getEncoder(c)(i[o]);return l(this,fd).has(c)?(0,j1.keccak256)(u):u});return a.unshift(s),(0,ct.concat)(a)}}(0,ct.assertArgument)(!1,`unknown type: ${e}`,"type",e)};C1.TypedDataEncoder=E_;function O6e(r,e,t,n){return(0,v6e.recoverAddress)(E_.hash(r,e,t),n)}C1.verifyTypedData=O6e});var Wf=R(Jr=>{"use strict";b();p();Object.defineProperty(Jr,"__esModule",{value:!0});Jr.verifyTypedData=Jr.TypedDataEncoder=Jr.solidityPackedSha256=Jr.solidityPackedKeccak256=Jr.solidityPacked=Jr.verifyMessage=Jr.hashMessage=Jr.dnsEncode=Jr.namehash=Jr.isValidName=Jr.ensNormalize=Jr.id=void 0;var B6e=xR();Object.defineProperty(Jr,"id",{enumerable:!0,get:function(){return B6e.id}});var T_=AQ();Object.defineProperty(Jr,"ensNormalize",{enumerable:!0,get:function(){return T_.ensNormalize}});Object.defineProperty(Jr,"isValidName",{enumerable:!0,get:function(){return T_.isValidName}});Object.defineProperty(Jr,"namehash",{enumerable:!0,get:function(){return T_.namehash}});Object.defineProperty(Jr,"dnsEncode",{enumerable:!0,get:function(){return T_.dnsEncode}});var zQ=IQ();Object.defineProperty(Jr,"hashMessage",{enumerable:!0,get:function(){return zQ.hashMessage}});Object.defineProperty(Jr,"verifyMessage",{enumerable:!0,get:function(){return zQ.verifyMessage}});var $R=MQ();Object.defineProperty(Jr,"solidityPacked",{enumerable:!0,get:function(){return $R.solidityPacked}});Object.defineProperty(Jr,"solidityPackedKeccak256",{enumerable:!0,get:function(){return $R.solidityPackedKeccak256}});Object.defineProperty(Jr,"solidityPackedSha256",{enumerable:!0,get:function(){return $R.solidityPackedSha256}});var WQ=VQ();Object.defineProperty(Jr,"TypedDataEncoder",{enumerable:!0,get:function(){return WQ.TypedDataEncoder}});Object.defineProperty(Jr,"verifyTypedData",{enumerable:!0,get:function(){return WQ.verifyTypedData}})});var N_=R(Ps=>{"use strict";b();p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.StructFragment=Ps.FunctionFragment=Ps.FallbackFragment=Ps.ConstructorFragment=Ps.EventFragment=Ps.ErrorFragment=Ps.NamedFragment=Ps.Fragment=Ps.ParamType=void 0;var pr=ke(),ZR=Wf();function aa(r){let e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}var k6e="external public payable override",N6e=aa(k6e.split(" ")),nY="constant external internal payable private public pure view override",I6e=aa(nY.split(" ")),sY="constructor error event fallback function receive struct",iY=aa(sY.split(" ")),aY="calldata memory storage payable indexed",R6e=aa(aY.split(" ")),j6e="tuple returns",M6e=[sY,aY,j6e,nY].join(" "),C6e=aa(M6e.split(" ")),L6e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},U6e=new RegExp("^(\\s*)"),F6e=new RegExp("^([0-9]+)"),q6e=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),oY=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),cY=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),wi,Mu,D8,JR,B_=class{constructor(e){I(this,D8);I(this,wi,void 0);I(this,Mu,void 0);_(this,wi,0),_(this,Mu,e.slice())}get offset(){return l(this,wi)}get length(){return l(this,Mu).length-l(this,wi)}clone(){return new B_(l(this,Mu))}reset(){_(this,wi,0)}popKeyword(e){let t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){let t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=$(this,D8,JR).call(this,l(this,wi)+1,e.match+1);return _(this,wi,e.match+1),t}popParams(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=[];for(;l(this,wi)<e.match-1;){let n=this.peek().linkNext;t.push($(this,D8,JR).call(this,l(this,wi)+1,n)),_(this,wi,n)}return _(this,wi,e.match+1),t}peek(){if(l(this,wi)>=l(this,Mu).length)throw new Error("out-of-bounds");return l(this,Mu)[l(this,wi)]}peekKeyword(e){let t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;let t=this.peek();return t.type===e?t.text:null}pop(){let e=this.peek();return $s(this,wi)._++,e}toString(){let e=[];for(let t=l(this,wi);t<l(this,Mu).length;t++){let n=l(this,Mu)[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}},Uu=B_;wi=new WeakMap,Mu=new WeakMap,D8=new WeakSet,JR=function(e=0,t=0){return new B_(l(this,Mu).slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};function ah(r){let e=[],t=a=>{let o=i<r.length?JSON.stringify(r[i]):"$EOI";throw new Error(`invalid token ${o} at ${i}: ${a}`)},n=[],s=[],i=0;for(;i<r.length;){let a=r.substring(i),o=a.match(U6e);o&&(i+=o[1].length,a=r.substring(i));let c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(c);let u=L6e[a[0]]||"";if(u){if(c.type=u,c.text=a[0],i++,u==="OPEN_PAREN")n.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.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"){let d=e.pop().text;f=d+f,e[e.length-1].value=(0,pr.getNumber)(d)}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=a.match(q6e),o){if(c.text=o[1],i+=c.text.length,C6e.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(cY)){c.type="TYPE";continue}c.type="ID";continue}if(o=a.match(F6e),o){c.text=o[1],c.type="NUMBER",i+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new Uu(e.map(a=>Object.freeze(a)))}function $Q(r,e){let t=[];for(let n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function k_(r,e){if(e.peekKeyword(iY)){let t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function ld(r,e){let t=new Set;for(;;){let n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function uY(r){let e=ld(r,I6e);return $Q(e,aa("constant payable nonpayable".split(" "))),$Q(e,aa("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 dd(r,e){return r.popParams().map(t=>Ca.from(t,e))}function fY(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return(0,pr.getBigInt)(r.pop().text);throw new Error("invalid gas")}return null}function Gp(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}var D6e=new RegExp(/^(.*)\[([0-9]*)\]$/);function JQ(r){let e=r.match(cY);if((0,pr.assertArgument)(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){let t=parseInt(e[2]);(0,pr.assertArgument)(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){let t=parseInt(e[3]);(0,pr.assertArgument)(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}var Fn={},La=Symbol.for("_ethers_internal"),ZQ="_ParamTypeInternal",QQ="_ErrorInternal",YQ="_EventInternal",XQ="_ConstructorInternal",eY="_FallbackInternal",tY="_FunctionInternal",rY="_StructInternal",L1,O_,ac=class{constructor(e,t,n,s,i,a,o,c){I(this,L1);N(this,"name");N(this,"type");N(this,"baseType");N(this,"indexed");N(this,"components");N(this,"arrayLength");N(this,"arrayChildren");if((0,pr.assertPrivate)(e,Fn,"ParamType"),Object.defineProperty(this,La,{value:ZQ}),a&&(a=Object.freeze(a.slice())),s==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");(0,pr.defineProperties)(this,{name:t,type:n,baseType:s,indexed:i,components:a,arrayLength:o,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){let n=this.name||"";if(this.isArray()){let i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}let s={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){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");let n=this;return e.map(s=>n.arrayChildren.walk(s,t))}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");let n=this;return e.map((s,i)=>n.components[i].walk(s,t))}return t(this.type,e)}async walkAsync(e,t){let n=[],s=[e];return $(this,L1,O_).call(this,n,e,t,i=>{s[0]=i}),n.length&&await Promise.all(n),s[0]}static from(e,t){if(ac.isParamType(e))return e;if(typeof e=="string")try{return ac.from(ah(e),t)}catch{(0,pr.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof Uu){let o="",c="",u=null;ld(e,aa(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(y=>ac.from(y)),o=`tuple(${u.map(y=>y.format()).join(",")})`):(o=JQ(e.popType("TYPE")),c=o);let f=null,d=null;for(;e.length&&e.peekType("BRACKET");){let y=e.pop();f=new ac(Fn,"",o,c,null,u,d,f),d=y.value,o+=y.text,c="array",u=null}let g=null;if(ld(e,R6e).has("indexed")){if(!t)throw new Error("");g=!0}let m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new ac(Fn,m,o,c,g,u,d,f)}let n=e.name;(0,pr.assertArgument)(!n||typeof n=="string"&&n.match(oY),"invalid name","obj.name",n);let s=e.indexed;s!=null&&((0,pr.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,a=i.match(D6e);if(a){let o=parseInt(a[2]||"-1"),c=ac.from({type:a[1],components:e.components});return new ac(Fn,n||"",i,"array",s,null,o,c)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){let o=e.components!=null?e.components.map(u=>ac.from(u)):null;return new ac(Fn,n||"",i,"tuple",s,o,null,null)}return i=JQ(e.type),new ac(Fn,n||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[La]===ZQ}},Ca=ac;L1=new WeakSet,O_=function(e,t,n,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let a=this.arrayChildren,o=t.slice();o.forEach((c,u)=>{var f;$(f=a,L1,O_).call(f,e,c,n,d=>{o[u]=d})}),s(o);return}if(this.isTuple()){let a=this.components,o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,u)=>{var f;$(f=a[u],L1,O_).call(f,e,c,n,d=>{o[u]=d})}),s(o);return}let i=n(this.type,t);i.then?e.push(async function(){s(await i)}()):s(i)};Ps.ParamType=Ca;var hd=class{constructor(e,t,n){N(this,"type");N(this,"inputs");(0,pr.assertPrivate)(e,Fn,"Fragment"),n=Object.freeze(n.slice()),(0,pr.defineProperties)(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{hd.from(JSON.parse(e))}catch{}return hd.from(ah(e))}if(e instanceof Uu)switch(e.peekKeyword(iY)){case"constructor":return Lu.from(e);case"error":return Cu.from(e);case"event":return cc.from(e);case"fallback":case"receive":return oc.from(e);case"function":return uc.from(e);case"struct":return $f.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Lu.from(e);case"error":return Cu.from(e);case"event":return cc.from(e);case"fallback":case"receive":return oc.from(e);case"function":return uc.from(e);case"struct":return $f.from(e)}(0,pr.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,pr.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Lu.isFragment(e)}static isError(e){return Cu.isFragment(e)}static isEvent(e){return cc.isFragment(e)}static isFunction(e){return uc.isFragment(e)}static isStruct(e){return $f.isFragment(e)}};Ps.Fragment=hd;var Vp=class extends hd{constructor(t,n,s,i){super(t,n,i);N(this,"name");(0,pr.assertArgument)(typeof s=="string"&&s.match(oY),"invalid identifier","name",s),i=Object.freeze(i.slice()),(0,pr.defineProperties)(this,{name:s})}};Ps.NamedFragment=Vp;function q8(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}var Cu=class extends Vp{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,La,{value:QQ})}get selector(){return(0,ZR.id)(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)))});let t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+q8(e,this.inputs)),t.join(" ")}static from(e){if(Cu.isFragment(e))return e;if(typeof e=="string")return Cu.from(ah(e));if(e instanceof Uu){let t=k_("error",e),n=dd(e);return Gp(e),new Cu(Fn,t,n)}return new Cu(Fn,e.name,e.inputs?e.inputs.map(Ca.from):[])}static isFragment(e){return e&&e[La]===QQ}};Ps.ErrorFragment=Cu;var cc=class extends Vp{constructor(t,n,s,i){super(t,"event",n,s);N(this,"anonymous");Object.defineProperty(this,La,{value:YQ}),(0,pr.defineProperties)(this,{anonymous:i})}get topicHash(){return(0,ZR.id)(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(t)))});let n=[];return t!=="sighash"&&n.push("event"),n.push(this.name+q8(t,this.inputs)),t!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(t,n){return n=(n||[]).map(i=>Ca.from(i)),new cc(Fn,t,n,!1).topicHash}static from(t){if(cc.isFragment(t))return t;if(typeof t=="string")try{return cc.from(ah(t))}catch{(0,pr.assertArgument)(!1,"invalid event fragment","obj",t)}else if(t instanceof Uu){let n=k_("event",t),s=dd(t,!0),i=!!ld(t,aa(["anonymous"])).has("anonymous");return Gp(t),new cc(Fn,n,s,i)}return new cc(Fn,t.name,t.inputs?t.inputs.map(n=>Ca.from(n,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[La]===YQ}};Ps.EventFragment=cc;var Lu=class extends hd{constructor(t,n,s,i,a){super(t,n,s);N(this,"payable");N(this,"gas");Object.defineProperty(this,La,{value:XQ}),(0,pr.defineProperties)(this,{payable:i,gas:a})}format(t){if((0,pr.assert)(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="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(s=>JSON.parse(s.format(t)))});let n=[`constructor${q8(t,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(t){if(Lu.isFragment(t))return t;if(typeof t=="string")try{return Lu.from(ah(t))}catch{(0,pr.assertArgument)(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof Uu){ld(t,aa(["constructor"]));let n=dd(t),s=!!ld(t,N6e).has("payable"),i=fY(t);return Gp(t),new Lu(Fn,"constructor",n,s,i)}return new Lu(Fn,"constructor",t.inputs?t.inputs.map(Ca.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[La]===XQ}};Ps.ConstructorFragment=Lu;var oc=class extends hd{constructor(t,n,s){super(t,"fallback",n);N(this,"payable");Object.defineProperty(this,La,{value:eY}),(0,pr.defineProperties)(this,{payable:s})}format(t){let n=this.inputs.length===0?"receive":"fallback";if(t==="json"){let s=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:s})}return`${n}()${this.payable?" payable":""}`}static from(t){if(oc.isFragment(t))return t;if(typeof t=="string")try{return oc.from(ah(t))}catch{(0,pr.assertArgument)(!1,"invalid fallback fragment","obj",t)}else if(t instanceof Uu){let n=t.toString(),s=t.peekKeyword(aa(["fallback","receive"]));if((0,pr.assertArgument)(s,"type must be fallback or receive","obj",n),t.popKeyword(aa(["fallback","receive"]))==="receive"){let c=dd(t);return(0,pr.assertArgument)(c.length===0,"receive cannot have arguments","obj.inputs",c),ld(t,aa(["payable"])),Gp(t),new oc(Fn,[],!0)}let a=dd(t);a.length?(0,pr.assertArgument)(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(c=>c.format("minimal")).join(", ")):a=[Ca.from("bytes")];let o=uY(t);if((0,pr.assertArgument)(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),ld(t,aa(["returns"])).has("returns")){let c=dd(t);(0,pr.assertArgument)(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return Gp(t),new oc(Fn,a,o==="payable")}if(t.type==="receive")return new oc(Fn,[],!0);if(t.type==="fallback"){let n=[Ca.from("bytes")],s=t.stateMutability==="payable";return new oc(Fn,n,s)}(0,pr.assertArgument)(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[La]===eY}};Ps.FallbackFragment=oc;var uc=class extends Vp{constructor(t,n,s,i,a,o){super(t,"function",n,i);N(this,"constant");N(this,"outputs");N(this,"stateMutability");N(this,"payable");N(this,"gas");Object.defineProperty(this,La,{value:tY}),a=Object.freeze(a.slice());let c=s==="view"||s==="pure",u=s==="payable";(0,pr.defineProperties)(this,{constant:c,gas:o,outputs:a,payable:u,stateMutability:s})}get selector(){return(0,ZR.id)(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="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(s=>JSON.parse(s.format(t))),outputs:this.outputs.map(s=>JSON.parse(s.format(t)))});let n=[];return t!=="sighash"&&n.push("function"),n.push(this.name+q8(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(q8(t,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(t,n){return n=(n||[]).map(i=>Ca.from(i)),new uc(Fn,t,"view",n,[],null).selector}static from(t){if(uc.isFragment(t))return t;if(typeof t=="string")try{return uc.from(ah(t))}catch{(0,pr.assertArgument)(!1,"invalid function fragment","obj",t)}else if(t instanceof Uu){let s=k_("function",t),i=dd(t),a=uY(t),o=[];ld(t,aa(["returns"])).has("returns")&&(o=dd(t));let c=fY(t);return Gp(t),new uc(Fn,s,a,i,o,c)}let n=t.stateMutability;return n==null&&(n="payable",typeof t.constant=="boolean"?(n="view",t.constant||(n="payable",typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable")),new uc(Fn,t.name,n,t.inputs?t.inputs.map(Ca.from):[],t.outputs?t.outputs.map(Ca.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[La]===tY}};Ps.FunctionFragment=uc;var $f=class extends Vp{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,La,{value:rY})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return $f.from(ah(e))}catch{(0,pr.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof Uu){let t=k_("struct",e),n=dd(e);return Gp(e),new $f(Fn,t,n)}return new $f(Fn,e.name,e.inputs?e.inputs.map(Ca.from):[])}static isFragment(e){return e&&e[La]===rY}};Ps.StructFragment=$f});var ej=R(j_=>{"use strict";b();p();Object.defineProperty(j_,"__esModule",{value:!0});j_.AbiCoder=void 0;var H8=ke(),dY=Yo(),H6e=IZ(),K6e=aR(),G6e=CZ(),V6e=uR(),z6e=UZ(),W6e=FZ(),$6e=qZ(),J6e=HZ(),I_=GZ(),QR=N_(),lY=Ks(),K8=ke(),Fu=new Map;Fu.set(0,"GENERIC_PANIC");Fu.set(1,"ASSERT_FALSE");Fu.set(17,"OVERFLOW");Fu.set(18,"DIVIDE_BY_ZERO");Fu.set(33,"ENUM_RANGE_ERROR");Fu.set(34,"BAD_STORAGE_DATA");Fu.set(49,"STACK_UNDERFLOW");Fu.set(50,"ARRAY_RANGE_ERROR");Fu.set(65,"OUT_OF_MEMORY");Fu.set(81,"UNINITIALIZED_FUNCTION_CALL");var Z6e=new RegExp(/^bytes([0-9]*)$/),Q6e=new RegExp(/^(u?int)([0-9]*)$/),YR=null,hY=1024;function Y6e(r,e,t,n){let s="missing revert data",i=null,a=null,o=null;if(t){s="execution reverted";let u=(0,K8.getBytes)(t);if(t=(0,K8.hexlify)(t),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if((0,K8.hexlify)(u.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],u.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if((0,K8.hexlify)(u.slice(0,4))==="0x4e487b71")try{let f=Number(n.decode(["uint256"],u.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[f]},i=`Panic due to ${Fu.get(f)||"UNKNOWN"}(${f})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}let c={to:e.to?(0,lY.getAddress)(e.to):null,data:e.data||"0x"};return e.from&&(c.from=(0,lY.getAddress)(e.from)),(0,K8.makeError)(s,"CALL_EXCEPTION",{action:r,data:t,reason:i,transaction:c,invocation:a,revert:o})}var oh,U1,R_=class{constructor(){I(this,oh)}getDefaultValue(e){let t=e.map(s=>$(this,oh,U1).call(this,QR.ParamType.from(s)));return new I_.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,H8.assertArgumentCount)(t.length,e.length,"types/values length mismatch");let n=e.map(a=>$(this,oh,U1).call(this,QR.ParamType.from(a))),s=new I_.TupleCoder(n,"_"),i=new dY.Writer;return s.encode(i,t),i.data}decode(e,t,n){let s=e.map(a=>$(this,oh,U1).call(this,QR.ParamType.from(a)));return new I_.TupleCoder(s,"_").decode(new dY.Reader(t,n,hY))}static _setDefaultMaxInflation(e){(0,H8.assertArgument)(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),hY=e}static defaultAbiCoder(){return YR==null&&(YR=new R_),YR}static getBuiltinCallException(e,t,n){return Y6e(e,t,n,R_.defaultAbiCoder())}},XR=R_;oh=new WeakSet,U1=function(e){if(e.isArray())return new K6e.ArrayCoder($(this,oh,U1).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new I_.TupleCoder(e.components.map(n=>$(this,oh,U1).call(this,n)),e.name);switch(e.baseType){case"address":return new H6e.AddressCoder(e.name);case"bool":return new G6e.BooleanCoder(e.name);case"string":return new J6e.StringCoder(e.name);case"bytes":return new V6e.BytesCoder(e.name);case"":return new W6e.NullCoder(e.name)}let t=e.type.match(Q6e);if(t){let n=parseInt(t[2]||"256");return(0,H8.assertArgument)(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new $6e.NumberCoder(n/8,t[1]==="int",e.name)}if(t=e.type.match(Z6e),t){let n=parseInt(t[1]);return(0,H8.assertArgument)(n!==0&&n<=32,"invalid bytes length","param",e),new z6e.FixedBytesCoder(n,e.name)}(0,H8.assertArgument)(!1,"invalid type","type",e.type)};j_.AbiCoder=XR});var bY=R(F1=>{"use strict";b();p();Object.defineProperty(F1,"__esModule",{value:!0});F1.decodeBytes32String=F1.encodeBytes32String=void 0;var M_=ke();function X6e(r){let e=(0,M_.toUtf8Bytes)(r);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,M_.zeroPadBytes)(e,32)}F1.encodeBytes32String=X6e;function ewe(r){let e=(0,M_.getBytes)(r,"bytes");if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let t=31;for(;e[t-1]===0;)t--;return(0,M_.toUtf8String)(e.slice(0,t))}F1.decodeBytes32String=ewe});var wY=R(Ui=>{"use strict";b();p();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.Interface=Ui.Indexed=Ui.ErrorDescription=Ui.TransactionDescription=Ui.LogDescription=Ui.Result=Ui.checkResultErrors=void 0;var pY=si(),gY=Wf(),Ge=ke(),xY=ej(),nj=Yo();Object.defineProperty(Ui,"checkResultErrors",{enumerable:!0,get:function(){return nj.checkResultErrors}});Object.defineProperty(Ui,"Result",{enumerable:!0,get:function(){return nj.Result}});var qu=N_(),tj=Kf(),U_=class{constructor(e,t,n){N(this,"fragment");N(this,"name");N(this,"signature");N(this,"topic");N(this,"args");let s=e.name,i=e.format();(0,Ge.defineProperties)(this,{fragment:e,name:s,signature:i,topic:t,args:n})}};Ui.LogDescription=U_;var F_=class{constructor(e,t,n,s){N(this,"fragment");N(this,"name");N(this,"args");N(this,"signature");N(this,"selector");N(this,"value");let i=e.name,a=e.format();(0,Ge.defineProperties)(this,{fragment:e,name:i,args:n,signature:a,selector:t,value:s})}};Ui.TransactionDescription=F_;var q_=class{constructor(e,t,n){N(this,"fragment");N(this,"name");N(this,"args");N(this,"signature");N(this,"selector");let s=e.name,i=e.format();(0,Ge.defineProperties)(this,{fragment:e,name:s,args:n,signature:i,selector:t})}};Ui.ErrorDescription=q_;var G8=class{constructor(e){N(this,"hash");N(this,"_isIndexed");(0,Ge.defineProperties)(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};Ui.Indexed=G8;var yY={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"},mY={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&yY[r.toString()]&&(e=yY[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}},Jf,Zf,Qf,Li,q1,C_,D1,L_,zp=class{constructor(e){I(this,q1);I(this,D1);N(this,"fragments");N(this,"deploy");N(this,"fallback");N(this,"receive");I(this,Jf,void 0);I(this,Zf,void 0);I(this,Qf,void 0);I(this,Li,void 0);let t=[];typeof e=="string"?t=JSON.parse(e):t=e,_(this,Qf,new Map),_(this,Jf,new Map),_(this,Zf,new Map);let n=[];for(let a of t)try{n.push(qu.Fragment.from(a))}catch(o){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,o.message)}(0,Ge.defineProperties)(this,{fragments:Object.freeze(n)});let s=null,i=!1;_(this,Li,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let c;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}(0,Ge.defineProperties)(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:((0,Ge.assertArgument)(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${o}]`,a),s=a,i=s.payable);return;case"function":c=l(this,Qf);break;case"event":c=l(this,Zf);break;case"error":c=l(this,Jf);break;default:return}let u=a.format();c.has(u)||c.set(u,a)}),this.deploy||(0,Ge.defineProperties)(this,{deploy:qu.ConstructorFragment.from("constructor()")}),(0,Ge.defineProperties)(this,{fallback:s,receive:i})}format(e){let t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){let e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return xY.AbiCoder.defaultAbiCoder()}getFunctionName(e){let t=$(this,q1,C_).call(this,e,null,!1);return(0,Ge.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!$(this,q1,C_).call(this,e,null,!1)}getFunction(e,t){return $(this,q1,C_).call(this,e,t||null,!0)}forEachFunction(e){let t=Array.from(l(this,Qf).keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(l(this,Qf).get(s),n)}}getEventName(e){let t=$(this,D1,L_).call(this,e,null,!1);return(0,Ge.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!$(this,D1,L_).call(this,e,null,!1)}getEvent(e,t){return $(this,D1,L_).call(this,e,t||null,!0)}forEachEvent(e){let t=Array.from(l(this,Zf).keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(l(this,Zf).get(s),n)}}getError(e,t){if((0,Ge.isHexString)(e)){let s=e.toLowerCase();if(mY[s])return qu.ErrorFragment.from(mY[s].signature);for(let i of l(this,Jf).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){let s=[];for(let[i,a]of l(this,Jf))i.split("(")[0]===e&&s.push(a);if(s.length===0)return e==="Error"?qu.ErrorFragment.from("error Error(string)"):e==="Panic"?qu.ErrorFragment.from("error Panic(uint256)"):null;if(s.length>1){let i=s.map(a=>JSON.stringify(a.format())).join(", ");(0,Ge.assertArgument)(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=qu.ErrorFragment.from(e).format(),e==="Error(string)")return qu.ErrorFragment.from("error Error(string)");if(e==="Panic(uint256)")return qu.ErrorFragment.from("error Panic(uint256)");let n=l(this,Jf).get(e);return n||null}forEachError(e){let t=Array.from(l(this,Jf).keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(l(this,Jf).get(s),n)}}_decodeParams(e,t){return l(this,Li).decode(e,t)}_encodeParams(e,t){return l(this,Li).encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,Ge.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,Ge.assertArgument)((0,Ge.dataSlice)(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,Ge.dataSlice)(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,Ge.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,Ge.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Ge.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Ge.assertArgument)((0,Ge.dataSlice)(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,Ge.dataSlice)(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Ge.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Ge.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){let i=this.getFunction(e);(0,Ge.assertArgument)(i,"unknown function","fragment",e),e=i}let n="invalid length for result data",s=(0,Ge.getBytesCopy)(t);if(s.length%32===0)try{return l(this,Li).decode(e.outputs,s)}catch{n="could not decode result data"}(0,Ge.assert)(!1,n,"BAD_DATA",{value:(0,Ge.hexlify)(s),info:{method:e.name,signature:e.format()}})}makeError(e,t){let n=(0,Ge.getBytes)(e,"data"),s=xY.AbiCoder.getBuiltinCallException("call",t,n),i="execution reverted (unknown custom error)";if(s.message.startsWith(i)){let o=(0,Ge.hexlify)(n.slice(0,4)),c=this.getError(o);if(c)try{let u=l(this,Li).decode(c.inputs,n.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}let a=this.parseTransaction(t);return a&&(s.invocation={method:a.name,signature:a.signature,args:a.args}),s}encodeFunctionResult(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Ge.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Ge.hexlify)(l(this,Li).encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){let i=this.getEvent(e);(0,Ge.assertArgument)(i,"unknown event","eventFragment",e),e=i}(0,Ge.assert)(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});let n=[];e.anonymous||n.push(e.topicHash);let s=(i,a)=>i.type==="string"?(0,gY.id)(a):i.type==="bytes"?(0,pY.keccak256)((0,Ge.hexlify)(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=(0,Ge.toBeHex)(a):i.type.match(/^bytes/)?a=(0,Ge.zeroPadBytes)(a,32):i.type==="address"&&l(this,Li).encode(["address"],[a]),(0,Ge.zeroPadValue)((0,Ge.hexlify)(a),32));for(t.forEach((i,a)=>{let o=e.inputs[a];if(!o.indexed){(0,Ge.assertArgument)(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?(0,Ge.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?n.push(i.map(c=>s(o,c))):n.push(s(o,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){let a=this.getEvent(e);(0,Ge.assertArgument)(a,"unknown event","eventFragment",e),e=a}let n=[],s=[],i=[];return e.anonymous||n.push(e.topicHash),(0,Ge.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{let c=t[o];if(a.indexed)if(a.type==="string")n.push((0,gY.id)(c));else if(a.type==="bytes")n.push((0,pY.keccak256)(c));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(l(this,Li).encode([a.type],[c]))}else s.push(a),i.push(c)}),{data:l(this,Li).encode(s,i),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){let h=this.getEvent(e);(0,Ge.assertArgument)(h,"unknown event","eventFragment",e),e=h}if(n!=null&&!e.anonymous){let h=e.topicHash;(0,Ge.assertArgument)((0,Ge.isHexString)(n[0],32)&&n[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}let s=[],i=[],a=[];e.inputs.forEach((h,m)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(qu.ParamType.from({type:"bytes32",name:h.name})),a.push(!0)):(s.push(h),a.push(!1)):(i.push(h),a.push(!1))});let o=n!=null?l(this,Li).decode(s,(0,Ge.concat)(n)):null,c=l(this,Li).decode(i,t,!0),u=[],f=[],d=0,g=0;return e.inputs.forEach((h,m)=>{let y=null;if(h.indexed)if(o==null)y=new G8(null);else if(a[m])y=new G8(o[g++]);else try{y=o[g++]}catch(S){y=S}else try{y=c[d++]}catch(S){y=S}u.push(y),f.push(h.name||null)}),nj.Result.fromItems(u,f)}parseTransaction(e){let t=(0,Ge.getBytes)(e.data,"tx.data"),n=(0,Ge.getBigInt)(e.value!=null?e.value:0,"tx.value"),s=this.getFunction((0,Ge.hexlify)(t.slice(0,4)));if(!s)return null;let i=l(this,Li).decode(s.inputs,t.slice(4));return new F_(s,s.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new U_(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){let t=(0,Ge.hexlify)(e),n=this.getError((0,Ge.dataSlice)(t,0,4));if(!n)return null;let s=l(this,Li).decode(n.inputs,(0,Ge.dataSlice)(t,4));return new q_(n,n.selector,s)}static from(e){return e instanceof zp?e:typeof e=="string"?new zp(JSON.parse(e)):typeof e.formatJson=="function"?new zp(e.formatJson()):typeof e.format=="function"?new zp(e.format("json")):new zp(e)}},rj=zp;Jf=new WeakMap,Zf=new WeakMap,Qf=new WeakMap,Li=new WeakMap,q1=new WeakSet,C_=function(e,t,n){if((0,Ge.isHexString)(e)){let i=e.toLowerCase();for(let a of l(this,Qf).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){let i=[];for(let[a,o]of l(this,Qf))a.split("(")[0]===e&&i.push(o);if(t){let a=t.length>0?t[t.length-1]:null,o=t.length,c=!0;tj.Typed.isTyped(a)&&a.type==="overrides"&&(c=!1,o--);for(let u=i.length-1;u>=0;u--){let f=i[u].inputs.length;f!==o&&(!c||f!==o-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){let f=i[u].inputs;for(let d=0;d<t.length;d++)if(!!tj.Typed.isTyped(t[d])){if(d>=f.length){if(t[d].type==="overrides")continue;i.splice(u,1);break}if(t[d].type!==f[d].baseType){i.splice(u,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){let a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){let a=i.map(o=>JSON.stringify(o.format())).join(", ");(0,Ge.assertArgument)(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return i[0]}let s=l(this,Qf).get(qu.FunctionFragment.from(e).format());return s||null},D1=new WeakSet,L_=function(e,t,n){if((0,Ge.isHexString)(e)){let i=e.toLowerCase();for(let a of l(this,Zf).values())if(i===a.topicHash)return a;return null}if(e.indexOf("(")===-1){let i=[];for(let[a,o]of l(this,Zf))a.split("(")[0]===e&&i.push(o);if(t){for(let a=i.length-1;a>=0;a--)i[a].inputs.length<t.length&&i.splice(a,1);for(let a=i.length-1;a>=0;a--){let o=i[a].inputs;for(let c=0;c<t.length;c++)if(!!tj.Typed.isTyped(t[c])&&t[c].type!==o[c].baseType){i.splice(a,1);break}}}if(i.length===0)return null;if(i.length>1&&n){let a=i.map(o=>JSON.stringify(o.format())).join(", ");(0,Ge.assertArgument)(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return i[0]}let s=l(this,Zf).get(qu.EventFragment.from(e).format());return s||null};Ui.Interface=rj});var H1=R(Ot=>{"use strict";b();p();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Typed=Ot.Result=Ot.TransactionDescription=Ot.LogDescription=Ot.ErrorDescription=Ot.Interface=Ot.Indexed=Ot.checkResultErrors=Ot.StructFragment=Ot.ParamType=Ot.NamedFragment=Ot.FunctionFragment=Ot.Fragment=Ot.FallbackFragment=Ot.EventFragment=Ot.ErrorFragment=Ot.ConstructorFragment=Ot.encodeBytes32String=Ot.decodeBytes32String=Ot.AbiCoder=void 0;var twe=ej();Object.defineProperty(Ot,"AbiCoder",{enumerable:!0,get:function(){return twe.AbiCoder}});var vY=bY();Object.defineProperty(Ot,"decodeBytes32String",{enumerable:!0,get:function(){return vY.decodeBytes32String}});Object.defineProperty(Ot,"encodeBytes32String",{enumerable:!0,get:function(){return vY.encodeBytes32String}});var bd=N_();Object.defineProperty(Ot,"ConstructorFragment",{enumerable:!0,get:function(){return bd.ConstructorFragment}});Object.defineProperty(Ot,"ErrorFragment",{enumerable:!0,get:function(){return bd.ErrorFragment}});Object.defineProperty(Ot,"EventFragment",{enumerable:!0,get:function(){return bd.EventFragment}});Object.defineProperty(Ot,"FallbackFragment",{enumerable:!0,get:function(){return bd.FallbackFragment}});Object.defineProperty(Ot,"Fragment",{enumerable:!0,get:function(){return bd.Fragment}});Object.defineProperty(Ot,"FunctionFragment",{enumerable:!0,get:function(){return bd.FunctionFragment}});Object.defineProperty(Ot,"NamedFragment",{enumerable:!0,get:function(){return bd.NamedFragment}});Object.defineProperty(Ot,"ParamType",{enumerable:!0,get:function(){return bd.ParamType}});Object.defineProperty(Ot,"StructFragment",{enumerable:!0,get:function(){return bd.StructFragment}});var Wp=wY();Object.defineProperty(Ot,"checkResultErrors",{enumerable:!0,get:function(){return Wp.checkResultErrors}});Object.defineProperty(Ot,"Indexed",{enumerable:!0,get:function(){return Wp.Indexed}});Object.defineProperty(Ot,"Interface",{enumerable:!0,get:function(){return Wp.Interface}});Object.defineProperty(Ot,"ErrorDescription",{enumerable:!0,get:function(){return Wp.ErrorDescription}});Object.defineProperty(Ot,"LogDescription",{enumerable:!0,get:function(){return Wp.LogDescription}});Object.defineProperty(Ot,"TransactionDescription",{enumerable:!0,get:function(){return Wp.TransactionDescription}});Object.defineProperty(Ot,"Result",{enumerable:!0,get:function(){return Wp.Result}});var rwe=Kf();Object.defineProperty(Ot,"Typed",{enumerable:!0,get:function(){return rwe.Typed}})});var G1=R(Ua=>{"use strict";b();p();Object.defineProperty(Ua,"__esModule",{value:!0});Ua.TransactionResponse=Ua.TransactionReceipt=Ua.Log=Ua.Block=Ua.copyRequest=Ua.FeeData=void 0;var bn=ke(),nwe=Ma(),PY=BigInt(0);function K1(r){return r??null}function cs(r){return r==null?null:r.toString()}var sj=class{constructor(e,t,n){N(this,"gasPrice");N(this,"maxFeePerGas");N(this,"maxPriorityFeePerGas");(0,bn.defineProperties)(this,{gasPrice:K1(e),maxFeePerGas:K1(t),maxPriorityFeePerGas:K1(n)})}toJSON(){let{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:cs(e),maxFeePerGas:cs(t),maxPriorityFeePerGas:cs(n)}}};Ua.FeeData=sj;function swe(r){let e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=(0,bn.hexlify)(r.data));let t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let s of t)!(s in r)||r[s]==null||(e[s]=(0,bn.getBigInt)(r[s],`request.${s}`));let n="type,nonce".split(/,/);for(let s of n)!(s in r)||r[s]==null||(e[s]=(0,bn.getNumber)(r[s],`request.${s}`));return r.accessList&&(e.accessList=(0,nwe.accessListify)(r.accessList)),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(s=>(0,bn.isBytesLike)(s)?(0,bn.hexlify)(s):Object.assign({},s))),e}Ua.copyRequest=swe;var pd,ij=class{constructor(e,t){N(this,"provider");N(this,"number");N(this,"hash");N(this,"timestamp");N(this,"parentHash");N(this,"parentBeaconBlockRoot");N(this,"nonce");N(this,"difficulty");N(this,"gasLimit");N(this,"gasUsed");N(this,"stateRoot");N(this,"receiptsRoot");N(this,"blobGasUsed");N(this,"excessBlobGas");N(this,"miner");N(this,"prevRandao");N(this,"extraData");N(this,"baseFeePerGas");I(this,pd,void 0);_(this,pd,e.transactions.map(n=>typeof n!="string"?new H_(n,t):n)),(0,bn.defineProperties)(this,{provider:t,hash:K1(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:K1(e.prevRandao),extraData:e.extraData,baseFeePerGas:K1(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return l(this,pd).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){let e=l(this,pd).slice();return e.length===0?[]:((0,bn.assert)(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){let{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:s,gasUsed:i,hash:a,miner:o,prevRandao:c,nonce:u,number:f,parentHash:d,parentBeaconBlockRoot:g,stateRoot:h,receiptsRoot:m,timestamp:y,transactions:S}=this;return{_type:"Block",baseFeePerGas:cs(e),difficulty:cs(t),extraData:n,gasLimit:cs(s),gasUsed:cs(i),blobGasUsed:cs(this.blobGasUsed),excessBlobGas:cs(this.excessBlobGas),hash:a,miner:o,prevRandao:c,nonce:u,number:f,parentHash:d,timestamp:y,parentBeaconBlockRoot:g,stateRoot:h,receiptsRoot:m,transactions:S}}[Symbol.iterator](){let e=0,t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return l(this,pd).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=l(this,pd)[e];else{let n=e.toLowerCase();for(let s of l(this,pd))if(typeof s=="string"){if(s!==n)continue;t=s;break}else{if(s.hash!==n)continue;t=s;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){let t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(let n of t)if(n.hash===e)return n;(0,bn.assertArgument)(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return iwe(this)}};pd=new WeakMap;Ua.Block=ij;var D_=class{constructor(e,t){N(this,"provider");N(this,"transactionHash");N(this,"blockHash");N(this,"blockNumber");N(this,"removed");N(this,"address");N(this,"data");N(this,"topics");N(this,"index");N(this,"transactionIndex");this.provider=t;let n=Object.freeze(e.topics.slice());(0,bn.defineProperties)(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(){let{address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:u}}async getBlock(){let e=await this.provider.getBlock(this.blockHash);return(0,bn.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){let e=await this.provider.getTransaction(this.transactionHash);return(0,bn.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){let e=await this.provider.getTransactionReceipt(this.transactionHash);return(0,bn.assert)(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return awe(this)}};Ua.Log=D_;var V8,aj=class{constructor(e,t){N(this,"provider");N(this,"to");N(this,"from");N(this,"contractAddress");N(this,"hash");N(this,"index");N(this,"blockHash");N(this,"blockNumber");N(this,"logsBloom");N(this,"gasUsed");N(this,"blobGasUsed");N(this,"cumulativeGasUsed");N(this,"gasPrice");N(this,"blobGasPrice");N(this,"type");N(this,"status");N(this,"root");I(this,V8,void 0);_(this,V8,Object.freeze(e.logs.map(s=>new D_(s,t))));let n=PY;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),(0,bn.defineProperties)(this,{provider:t,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,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return l(this,V8)}toJSON(){let{to:e,from:t,contractAddress:n,hash:s,index:i,blockHash:a,blockNumber:o,logsBloom:c,logs:u,status:f,root:d}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:cs(this.cumulativeGasUsed),from:t,gasPrice:cs(this.gasPrice),blobGasUsed:cs(this.blobGasUsed),blobGasPrice:cs(this.blobGasPrice),gasUsed:cs(this.gasUsed),hash:s,index:i,logs:u,logsBloom:c,root:d,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(){let e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){let 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 AY(this)}reorderedEvent(e){return(0,bn.assert)(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),_Y(this,e)}};V8=new WeakMap;Ua.TransactionReceipt=aj;var ch,oj=class{constructor(e,t){N(this,"provider");N(this,"blockNumber");N(this,"blockHash");N(this,"index");N(this,"hash");N(this,"type");N(this,"to");N(this,"from");N(this,"nonce");N(this,"gasLimit");N(this,"gasPrice");N(this,"maxPriorityFeePerGas");N(this,"maxFeePerGas");N(this,"maxFeePerBlobGas");N(this,"data");N(this,"value");N(this,"chainId");N(this,"signature");N(this,"accessList");N(this,"blobVersionedHashes");I(this,ch,void 0);this.provider=t,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.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,_(this,ch,-1)}toJSON(){let{blockNumber:e,blockHash:t,index:n,hash:s,type:i,to:a,from:o,nonce:c,data:u,signature:f,accessList:d,blobVersionedHashes:g}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:e,blockHash:t,blobVersionedHashes:g,chainId:cs(this.chainId),data:u,from:o,gasLimit:cs(this.gasLimit),gasPrice:cs(this.gasPrice),hash:s,maxFeePerGas:cs(this.maxFeePerGas),maxPriorityFeePerGas:cs(this.maxPriorityFeePerGas),maxFeePerBlobGas:cs(this.maxFeePerBlobGas),nonce:c,signature:f,to:a,index:n,type:i,value:cs(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){let n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;let t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:t,blockNumber:n}=await(0,bn.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){let n=e??1,s=t??0,i=l(this,ch),a=-1,o=i===-1,c=async()=>{if(o)return null;let{blockNumber:g,nonce:h}=await(0,bn.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=g;return}if(o)return null;let m=await this.getTransaction();if(!(m&&m.blockNumber!=null))for(a===-1&&(a=i-3,a<l(this,ch)&&(a=l(this,ch)));a<=g;){if(o)return null;let y=await this.provider.getBlock(a,!0);if(y==null)return;for(let S of y)if(S===this.hash)return;for(let S=0;S<y.length;S++){let T=await y.getTransaction(S);if(T.from===this.from&&T.nonce===this.nonce){if(o)return null;let H=await this.provider.getTransactionReceipt(T.hash);if(H==null||g-H.blockNumber+1<n)return;let C="replaced";T.data===this.data&&T.to===this.to&&T.value===this.value?C="repriced":T.data==="0x"&&T.from===T.to&&T.value===PY&&(C="cancelled"),(0,bn.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:C==="replaced"||C==="cancelled",reason:C,replacement:T.replaceableTransaction(i),hash:T.hash,receipt:H})}}a++}},u=g=>{if(g==null||g.status!==0)return g;(0,bn.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:g.to,from:g.from,data:""},receipt:g})},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((g,h)=>{let m=[],y=()=>{m.forEach(T=>T())};if(m.push(()=>{o=!0}),s>0){let T=setTimeout(()=>{y(),h((0,bn.makeError)("wait for transaction timeout","TIMEOUT"))},s);m.push(()=>{clearTimeout(T)})}let S=async T=>{if(await T.confirmations()>=n){y();try{g(u(T))}catch(H){h(H)}}};if(m.push(()=>{this.provider.off(this.hash,S)}),this.provider.on(this.hash,S),i>=0){let T=async()=>{try{await c()}catch(H){if((0,bn.isError)(H,"TRANSACTION_REPLACED")){y(),h(H);return}}o||this.provider.once("block",T)};m.push(()=>{this.provider.off("block",T)}),this.provider.once("block",T)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return(0,bn.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),AY(this)}reorderedEvent(e){return(0,bn.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,bn.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),_Y(this,e)}replaceableTransaction(e){(0,bn.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);let t=new oj(this,this.provider);return _(t,ch,e),t}},H_=oj;ch=new WeakMap;Ua.TransactionResponse=H_;function iwe(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function _Y(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function AY(r){return{orphan:"drop-transaction",tx:r}}function awe(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}});var fj=R(Fa=>{"use strict";b();p();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.ContractEventPayload=Fa.ContractUnknownEventPayload=Fa.ContractTransactionResponse=Fa.ContractTransactionReceipt=Fa.UndecodedEventLog=Fa.EventLog=void 0;var z_=G1(),z8=ke(),W8=class extends z_.Log{constructor(t,n,s){super(t,t.provider);N(this,"interface");N(this,"fragment");N(this,"args");let i=n.decodeEventLog(s,t.data,t.topics);(0,z8.defineProperties)(this,{args:i,fragment:s,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};Fa.EventLog=W8;var K_=class extends z_.Log{constructor(t,n){super(t,t.provider);N(this,"error");(0,z8.defineProperties)(this,{error:n})}};Fa.UndecodedEventLog=K_;var V1,G_=class extends z_.TransactionReceipt{constructor(t,n,s){super(s,n);I(this,V1,void 0);_(this,V1,t)}get logs(){return super.logs.map(t=>{let n=t.topics.length?l(this,V1).getEvent(t.topics[0]):null;if(n)try{return new W8(t,l(this,V1),n)}catch(s){return new K_(t,s)}return t})}};V1=new WeakMap;Fa.ContractTransactionReceipt=G_;var $8,cj=class extends z_.TransactionResponse{constructor(t,n,s){super(s,n);I(this,$8,void 0);_(this,$8,t)}async wait(t,n){let s=await super.wait(t,n);return s==null?null:new G_(l(this,$8),this.provider,s)}};$8=new WeakMap;Fa.ContractTransactionResponse=cj;var V_=class extends z8.EventPayload{constructor(t,n,s,i){super(t,n,s);N(this,"log");(0,z8.defineProperties)(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}};Fa.ContractUnknownEventPayload=V_;var uj=class extends V_{constructor(e,t,n,s,i){super(e,t,n,new W8(i,e.interface,s));let a=e.interface.decodeEventLog(s,this.log.data,this.log.topics);(0,z8.defineProperties)(this,{args:a,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};Fa.ContractEventPayload=uj});var yj=R(Yf=>{"use strict";b();p();Object.defineProperty(Yf,"__esModule",{value:!0});Yf.Contract=Yf.BaseContract=Yf.resolveArgs=Yf.copyOverrides=void 0;var pj=H1(),z1=Ks(),TY=G1(),wt=ke(),Jp=fj(),EY=BigInt(0);function OY(r){return r&&typeof r.call=="function"}function BY(r){return r&&typeof r.estimateGas=="function"}function Z_(r){return r&&typeof r.resolveName=="function"}function kY(r){return r&&typeof r.sendTransaction=="function"}function NY(r){if(r!=null){if(Z_(r))return r;if(r.provider)return r.provider}}var Q8,dj=class{constructor(e,t,n){I(this,Q8,void 0);N(this,"fragment");if((0,wt.defineProperties)(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");let s=Zp(e.runner,"resolveName"),i=Z_(s)?s:null;_(this,Q8,async function(){let a=await Promise.all(t.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(f,d)=>f==="address"?Array.isArray(d)?Promise.all(d.map(g=>(0,z1.resolveAddress)(g,i))):(0,z1.resolveAddress)(d,i):d)));return e.interface.encodeFilterTopics(t,a)}())}getTopicFilter(){return l(this,Q8)}};Q8=new WeakMap;function Zp(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function $p(r){return r==null?null:r.provider||null}async function gj(r,e){let t=pj.Typed.dereference(r,"overrides");(0,wt.assertArgument)(typeof t=="object","invalid overrides parameter","overrides",r);let n=(0,TY.copyRequest)(t);return(0,wt.assertArgument)(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),(0,wt.assertArgument)(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}Yf.copyOverrides=gj;async function IY(r,e,t){let n=Zp(r,"resolveName"),s=Z_(n)?n:null;return await Promise.all(e.map((i,a)=>i.walkAsync(t[a],(o,c)=>(c=pj.Typed.dereference(c,o),o==="address"?(0,z1.resolveAddress)(c,s):c))))}Yf.resolveArgs=IY;function owe(r){let e=async function(a){let o=await gj(a,["data"]);o.to=await r.getAddress(),o.from&&(o.from=await(0,z1.resolveAddress)(o.from,NY(r.runner)));let c=r.interface,u=(0,wt.getBigInt)(o.value||EY,"overrides.value")===EY,f=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!u&&(0,wt.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),(0,wt.assertArgument)(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data);let d=c.receive||c.fallback&&c.fallback.payable;return(0,wt.assertArgument)(d||u,"cannot send value to non-payable fallback","overrides.value",o.value),(0,wt.assertArgument)(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){let o=Zp(r.runner,"call");(0,wt.assert)(OY(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await e(a);try{return await o.call(c)}catch(u){throw(0,wt.isCallException)(u)&&u.data?r.interface.makeError(u.data,c):u}},n=async function(a){let o=r.runner;(0,wt.assert)(kY(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await o.sendTransaction(await e(a)),u=$p(r.runner);return new Jp.ContractTransactionResponse(r.interface,u,c)},s=async function(a){let o=Zp(r.runner,"estimateGas");return(0,wt.assert)(BY(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},i=async a=>await n(a);return(0,wt.defineProperties)(i,{_contract:r,estimateGas:s,populateTransaction:e,send:n,staticCall:t}),i}function cwe(r,e){let t=function(...u){let f=r.interface.getFunction(e,u);return(0,wt.assert)(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){let f=t(...u),d={};if(f.inputs.length+1===u.length&&(d=await gj(u.pop()),d.from&&(d.from=await(0,z1.resolveAddress)(d.from,NY(r.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let g=await IY(r.runner,f.inputs,u);return Object.assign({},d,await(0,wt.resolveProperties)({to:r.getAddress(),data:r.interface.encodeFunctionData(f,g)}))},s=async function(...u){let f=await o(...u);return f.length===1?f[0]:f},i=async function(...u){let f=r.runner;(0,wt.assert)(kY(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let d=await f.sendTransaction(await n(...u)),g=$p(r.runner);return new Jp.ContractTransactionResponse(r.interface,g,d)},a=async function(...u){let f=Zp(r.runner,"estimateGas");return(0,wt.assert)(BY(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},o=async function(...u){let f=Zp(r.runner,"call");(0,wt.assert)(OY(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let d=await n(...u),g="0x";try{g=await f.call(d)}catch(m){throw(0,wt.isCallException)(m)&&m.data?r.interface.makeError(m.data,d):m}let h=t(...u);return r.interface.decodeFunctionResult(h,g)},c=async(...u)=>t(...u).constant?await s(...u):await i(...u);return(0,wt.defineProperties)(c,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:a,populateTransaction:n,send:i,staticCall:s,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let u=r.interface.getFunction(e);return(0,wt.assert)(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function uwe(r,e){let t=function(...s){let i=r.interface.getEvent(e,s);return(0,wt.assert)(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},n=function(...s){return new dj(r,t(...s),s)};return(0,wt.defineProperties)(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{let s=r.interface.getEvent(e);return(0,wt.assert)(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),n}var $_=Symbol.for("_ethersInternal_contract"),RY=new WeakMap;function fwe(r,e){RY.set(r[$_],e)}function yo(r){return RY.get(r[$_])}function dwe(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function xj(r,e){let t,n=null;if(Array.isArray(e)){let i=function(a){if((0,wt.isHexString)(a,32))return a;let o=r.interface.getEvent(a);return(0,wt.assertArgument)(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else e==="*"?t=[null]:typeof e=="string"?(0,wt.isHexString)(e,32)?t=[e]:(n=r.interface.getEvent(e),(0,wt.assertArgument)(n,"unknown fragment","event",e),t=[n.topicHash]):dwe(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):(0,wt.assertArgument)(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){let a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});let s=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:s,topics:t}}async function J8(r,e){let{subs:t}=yo(r);return t.get((await xj(r,e)).tag)||null}async function SY(r,e,t){let n=$p(r.runner);(0,wt.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});let{fragment:s,tag:i,topics:a}=await xj(r,t),{addr:o,subs:c}=yo(r),u=c.get(i);if(!u){let d={address:o||r,topics:a},g=S=>{let T=s;if(T==null)try{T=r.interface.getEvent(S.topics[0])}catch{}if(T){let H=T,C=s?r.interface.decodeEventLog(s,S.data,S.topics):[];hj(r,t,C,J=>new Jp.ContractEventPayload(r,J,t,H,S))}else hj(r,t,[],H=>new Jp.ContractUnknownEventPayload(r,H,t,S))},h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(n.on(d,g))},stop:async()=>{if(h.length==0)return;let S=h;h=[],await Promise.all(S),n.off(d,g)}},c.set(i,u)}return u}var lj=Promise.resolve();async function lwe(r,e,t,n){await lj;let s=await J8(r,e);if(!s)return!1;let i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:a,once:o})=>{let c=Array.from(t);n&&c.push(n(o?null:a));try{a.call(r,...c)}catch{}return!o}),s.listeners.length===0&&(s.stop(),yo(r).subs.delete(s.tag)),i>0}async function hj(r,e,t,n){try{await lj}catch{}let s=lwe(r,e,t,n);return lj=s,await s}var W_=["then"],bwe,Z8=class{constructor(e,t,n,s){N(this,"target");N(this,"interface");N(this,"runner");N(this,"filters");N(this,bwe);N(this,"fallback");(0,wt.assertArgument)(typeof e=="string"||(0,z1.isAddressable)(e),"invalid value for Contract target","target",e),n==null&&(n=null);let i=pj.Interface.from(t);(0,wt.defineProperties)(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,$_,{value:{}});let a,o=null,c=null;if(s){let d=$p(n);c=new Jp.ContractTransactionResponse(this.interface,d,s)}let u=new Map;if(typeof e=="string")if((0,wt.isHexString)(e))o=e,a=Promise.resolve(e);else{let d=Zp(n,"resolveName");if(!Z_(d))throw(0,wt.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=d.resolveName(e).then(g=>{if(g==null)throw(0,wt.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return yo(this).addr=g,g})}else a=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return yo(this).addr=d,d});fwe(this,{addrPromise:a,addr:o,deployTx:c,subs:u});let f=new Proxy({},{get:(d,g,h)=>{if(typeof g=="symbol"||W_.indexOf(g)>=0)return Reflect.get(d,g,h);try{return this.getEvent(g)}catch(m){if(!(0,wt.isError)(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(d,g)=>W_.indexOf(g)>=0?Reflect.has(d,g):Reflect.has(d,g)||this.interface.hasEvent(String(g))});return(0,wt.defineProperties)(this,{filters:f}),(0,wt.defineProperties)(this,{fallback:i.receive||i.fallback?owe(this):null}),new Proxy(this,{get:(d,g,h)=>{if(typeof g=="symbol"||g in d||W_.indexOf(g)>=0)return Reflect.get(d,g,h);try{return d.getFunction(g)}catch(m){if(!(0,wt.isError)(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(d,g)=>typeof g=="symbol"||g in d||W_.indexOf(g)>=0?Reflect.has(d,g):d.interface.hasFunction(g)})}connect(e){return new Z8(this.target,this.interface,e)}attach(e){return new Z8(e,this.interface,this.runner)}async getAddress(){return await yo(this).addrPromise}async getDeployedCode(){let e=$p(this.runner);(0,wt.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){let e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;let n=$p(this.runner);return(0,wt.assert)(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{let a=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);n.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return yo(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),cwe(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),uwe(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");let{addr:s,addrPromise:i}=yo(this),a=s||await i,{fragment:o,topics:c}=await xj(this,e),u={address:a,topics:c,fromBlock:t,toBlock:n},f=$p(this.runner);return(0,wt.assert)(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(d=>{let g=o;if(g==null)try{g=this.interface.getEvent(d.topics[0])}catch{}if(g)try{return new Jp.EventLog(d,this.interface,g)}catch(h){return new Jp.UndecodedEventLog(d,h)}return new TY.Log(d,f)})}async on(e,t){let n=await SY(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){let n=await SY(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await hj(this,e,t,null)}async listenerCount(e){if(e){let s=await J8(this,e);return s?s.listeners.length:0}let{subs:t}=yo(this),n=0;for(let{listeners:s}of t.values())n+=s.length;return n}async listeners(e){if(e){let s=await J8(this,e);return s?s.listeners.map(({listener:i})=>i):[]}let{subs:t}=yo(this),n=[];for(let{listeners:s}of t.values())n=n.concat(s.map(({listener:i})=>i));return n}async off(e,t){let n=await J8(this,e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(t==null||n.listeners.length===0)&&(n.stop(),yo(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){let t=await J8(this,e);if(!t)return this;t.stop(),yo(this).subs.delete(t.tag)}else{let{subs:t}=yo(this);for(let{tag:n,stop:s}of t.values())s(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends Z8{constructor(s,i=null){super(s,e,i)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}},J_=Z8;bwe=$_;Yf.BaseContract=J_;function hwe(){return J_}var bj=class extends hwe(){};Yf.Contract=bj});var jY=R(Y_=>{"use strict";b();p();Object.defineProperty(Y_,"__esModule",{value:!0});Y_.ContractFactory=void 0;var pwe=H1(),gwe=Ks(),uh=ke(),Q_=yj(),Y8=class{constructor(e,t,n){N(this,"interface");N(this,"bytecode");N(this,"runner");let s=pwe.Interface.from(e);t instanceof Uint8Array||(typeof t=="object"&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,uh.hexlify)((0,uh.getBytes)(t)),(0,uh.defineProperties)(this,{bytecode:t,interface:s,runner:n||null})}attach(e){return new Q_.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={},n=this.interface.deploy;if(n.inputs.length+1===e.length&&(t=await(0,Q_.copyOverrides)(e.pop())),n.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");let s=await(0,Q_.resolveArgs)(this.runner,n.inputs,e),i=(0,uh.concat)([this.bytecode,this.interface.encodeDeploy(s)]);return Object.assign({},t,{data:i})}async deploy(...e){let t=await this.getDeployTransaction(...e);(0,uh.assert)(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let n=await this.runner.sendTransaction(t),s=(0,gwe.getCreateAddress)(n);return new Q_.BaseContract(s,this.interface,this.runner,n)}connect(e){return new Y8(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,uh.assertArgument)(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));let n=e.abi,s="";return e.bytecode?s=e.bytecode:e.evm&&e.evm.bytecode&&(s=e.evm.bytecode),new this(n,s,t)}};Y_.ContractFactory=Y8});var X8=R(_s=>{"use strict";b();p();Object.defineProperty(_s,"__esModule",{value:!0});_s.UndecodedEventLog=_s.EventLog=_s.ContractTransactionResponse=_s.ContractTransactionReceipt=_s.ContractUnknownEventPayload=_s.ContractEventPayload=_s.ContractFactory=_s.Contract=_s.BaseContract=void 0;var MY=yj();Object.defineProperty(_s,"BaseContract",{enumerable:!0,get:function(){return MY.BaseContract}});Object.defineProperty(_s,"Contract",{enumerable:!0,get:function(){return MY.Contract}});var xwe=jY();Object.defineProperty(_s,"ContractFactory",{enumerable:!0,get:function(){return xwe.ContractFactory}});var W1=fj();Object.defineProperty(_s,"ContractEventPayload",{enumerable:!0,get:function(){return W1.ContractEventPayload}});Object.defineProperty(_s,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return W1.ContractUnknownEventPayload}});Object.defineProperty(_s,"ContractTransactionReceipt",{enumerable:!0,get:function(){return W1.ContractTransactionReceipt}});Object.defineProperty(_s,"ContractTransactionResponse",{enumerable:!0,get:function(){return W1.ContractTransactionResponse}});Object.defineProperty(_s,"EventLog",{enumerable:!0,get:function(){return W1.EventLog}});Object.defineProperty(_s,"UndecodedEventLog",{enumerable:!0,get:function(){return W1.UndecodedEventLog}})});var _j=R(lh=>{"use strict";b();p();Object.defineProperty(lh,"__esModule",{value:!0});lh.EnsResolver=lh.BasicMulticoinProviderPlugin=lh.MulticoinProviderPlugin=void 0;var ywe=Ks(),CY=a1(),mj=X8(),wj=Wf(),oa=ke();function vj(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):(0,oa.assertArgument)(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}var t5=class{constructor(e){N(this,"name");(0,oa.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}};lh.MulticoinProviderPlugin=t5;var mwe="org.ethers.plugins.provider.BasicMulticoin",Pj=class extends t5{constructor(){super(mwe)}};lh.BasicMulticoinProviderPlugin=Pj;var UY=new RegExp("^(ipfs)://(.*)$","i"),LY=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),UY,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],fh,Qp,dh,$1,eA,FY,e5=class{constructor(e,t,n){I(this,dh);N(this,"provider");N(this,"address");N(this,"name");I(this,fh,void 0);I(this,Qp,void 0);(0,oa.defineProperties)(this,{provider:e,address:t,name:n}),_(this,fh,null),_(this,Qp,new mj.Contract(t,["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 l(this,fh)==null&&_(this,fh,(async()=>{try{return await l(this,Qp).supportsInterface("0x9061b923")}catch(e){if((0,oa.isError)(e,"CALL_EXCEPTION"))return!1;throw _(this,fh,null),e}})()),await l(this,fh)}async getAddress(e){if(e==null&&(e=60),e===60)try{let i=await $(this,dh,$1).call(this,"addr(bytes32)");return i==null||i===CY.ZeroAddress?null:i}catch(i){if((0,oa.isError)(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648,a=await $(this,dh,$1).call(this,"addr(bytes32,uint)",[i]);if((0,oa.isHexString)(a,20))return(0,ywe.getAddress)(a)}let t=null;for(let i of this.provider.plugins)if(i instanceof t5&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;let n=await $(this,dh,$1).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;let s=await t.decodeAddress(e,n);if(s!=null)return s;(0,oa.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){let t=await $(this,dh,$1).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){let e=await $(this,dh,$1).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;let t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){let s=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${s}://${(0,oa.encodeBase58)("0x"+t[2])}`}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;(0,oa.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){let e=[{type:"name",value:this.name}];try{let t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<LY.length;n++){let s=t.match(LY[n]);if(s==null)continue;let i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{let a=vj(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:a}),{linkage:e,url:a}}case"erc721":case"erc1155":{let a=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});let o=await this.getAddress();if(o==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};let c=(s[2]||"").split("/");if(c.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};let u=c[1],f=new mj.Contract(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(i==="erc721"){let y=await f.ownerOf(u);if(o!==y)return e.push({type:"!owner",value:y}),{url:null,linkage:e};e.push({type:"owner",value:y})}else if(i==="erc1155"){let y=await f.balanceOf(o,u);if(!y)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:y.toString()})}let d=await f[a](u);if(d==null||d==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:d}),i==="erc1155"&&(d=d.replace("{id}",(0,oa.toBeHex)(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=vj(d)),e.push({type:"metadata-url",value:d});let g={},h=await new oa.FetchRequest(d).send();h.assertOk();try{g=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{let T=h.body;return T&&e.push({type:"!metadata",value:(0,oa.hexlify)(T)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!g)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(g)});let m=g.image;if(typeof m!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!m.match(/^(https:\/\/|data:)/i)){if(m.match(UY)==null)return e.push({type:"!imageUrl-ipfs",value:m}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:m}),m=vj(m)}return e.push({type:"url",value:m}),{linkage:e,url:m}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){let t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return(0,oa.assert)(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async fromName(e,t){var s;let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;let i=await $(s=e5,eA,FY).call(s,e,n);if(i!=null){let a=new e5(e,i,t);return n!==t&&!await a.supportsWildcard()?null:a}n=n.split(".").slice(1).join(".")}}},X_=e5;fh=new WeakMap,Qp=new WeakMap,dh=new WeakSet,$1=async function(e,t){t=(t||[]).slice();let n=l(this,Qp).interface;t.unshift((0,wj.namehash)(this.name));let s=null;await this.supportsWildcard()&&(s=n.getFunction(e),(0,oa.assert)(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,wj.dnsEncode)(this.name,255),n.encodeFunctionData(s,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{let i=await l(this,Qp)[e](...t);return s?n.decodeFunctionResult(s,i)[0]:i}catch(i){if(!(0,oa.isError)(i,"CALL_EXCEPTION"))throw i}return null},eA=new WeakSet,FY=async function(e,t){let n=await e5.getEnsAddress(e);try{let i=await new mj.Contract(n,["function resolver(bytes32) view returns (address)"],e).resolver((0,wj.namehash)(t),{enableCcipRead:!0});return i===CY.ZeroAddress?null:i}catch(s){throw s}return null},I(X_,eA);lh.EnsResolver=X_});var VY=R(Zr=>{"use strict";b();p();Object.defineProperty(Zr,"__esModule",{value:!0});Zr.formatTransactionResponse=Zr.formatTransactionReceipt=Zr.formatReceiptLog=Zr.formatBlock=Zr.formatLog=Zr.formatUint256=Zr.formatHash=Zr.formatData=Zr.formatBoolean=Zr.object=Zr.arrayOf=Zr.allowNull=void 0;var Xf=Ks(),qY=si(),wwe=Ma(),gt=ke(),DY=BigInt(0);function rr(r,e){return function(t){return t==null?e:r(t)}}Zr.allowNull=rr;function r5(r,e){return t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))}}Zr.arrayOf=r5;function J1(r,e){return t=>{let n={};for(let s in r){let i=s;if(e&&s in e&&!(i in t)){for(let a of e[s])if(a in t){i=a;break}}try{let a=r[s](t[i]);a!==void 0&&(n[s]=a)}catch(a){let o=a instanceof Error?a.message:"not-an-error";(0,gt.assert)(!1,`invalid value for value.${s} (${o})`,"BAD_DATA",{value:t})}}return n}}Zr.object=J1;function HY(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}(0,gt.assertArgument)(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}Zr.formatBoolean=HY;function Yp(r){return(0,gt.assertArgument)((0,gt.isHexString)(r,!0),"invalid data","value",r),r}Zr.formatData=Yp;function ai(r){return(0,gt.assertArgument)((0,gt.isHexString)(r,32),"invalid hash","value",r),r}Zr.formatHash=ai;function vwe(r){if(!(0,gt.isHexString)(r))throw new Error("invalid uint256");return(0,gt.zeroPadValue)(r,32)}Zr.formatUint256=vwe;var Pwe=J1({address:Xf.getAddress,blockHash:ai,blockNumber:gt.getNumber,data:Yp,index:gt.getNumber,removed:rr(HY,!1),topics:r5(ai),transactionHash:ai,transactionIndex:gt.getNumber},{index:["logIndex"]});function _we(r){return Pwe(r)}Zr.formatLog=_we;var Awe=J1({hash:rr(ai),parentHash:ai,parentBeaconBlockRoot:rr(ai,null),number:gt.getNumber,timestamp:gt.getNumber,nonce:rr(Yp),difficulty:gt.getBigInt,gasLimit:gt.getBigInt,gasUsed:gt.getBigInt,stateRoot:rr(ai,null),receiptsRoot:rr(ai,null),blobGasUsed:rr(gt.getBigInt,null),excessBlobGas:rr(gt.getBigInt,null),miner:rr(Xf.getAddress),prevRandao:rr(ai,null),extraData:Yp,baseFeePerGas:rr(gt.getBigInt)},{prevRandao:["mixHash"]});function Ewe(r){let e=Awe(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:GY(t)),e}Zr.formatBlock=Ewe;var Swe=J1({transactionIndex:gt.getNumber,blockNumber:gt.getNumber,transactionHash:ai,address:Xf.getAddress,topics:r5(ai),data:Yp,index:gt.getNumber,blockHash:ai},{index:["logIndex"]});function KY(r){return Swe(r)}Zr.formatReceiptLog=KY;var Twe=J1({to:rr(Xf.getAddress,null),from:rr(Xf.getAddress,null),contractAddress:rr(Xf.getAddress,null),index:gt.getNumber,root:rr(gt.hexlify),gasUsed:gt.getBigInt,blobGasUsed:rr(gt.getBigInt,null),logsBloom:rr(Yp),blockHash:ai,hash:ai,logs:r5(KY),blockNumber:gt.getNumber,cumulativeGasUsed:gt.getBigInt,effectiveGasPrice:rr(gt.getBigInt),blobGasPrice:rr(gt.getBigInt,null),status:rr(gt.getNumber),type:rr(gt.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Owe(r){return Twe(r)}Zr.formatTransactionReceipt=Owe;function GY(r){r.to&&(0,gt.getBigInt)(r.to)===DY&&(r.to="0x0000000000000000000000000000000000000000");let e=J1({hash:ai,index:rr(gt.getNumber,void 0),type:t=>t==="0x"||t==null?0:(0,gt.getNumber)(t),accessList:rr(wwe.accessListify,null),blobVersionedHashes:rr(r5(ai,!0),null),blockHash:rr(ai,null),blockNumber:rr(gt.getNumber,null),transactionIndex:rr(gt.getNumber,null),from:Xf.getAddress,gasPrice:rr(gt.getBigInt),maxPriorityFeePerGas:rr(gt.getBigInt),maxFeePerGas:rr(gt.getBigInt),maxFeePerBlobGas:rr(gt.getBigInt,null),gasLimit:gt.getBigInt,to:rr(Xf.getAddress,null),value:gt.getBigInt,nonce:gt.getNumber,data:Yp,creates:rr(Xf.getAddress,null),chainId:rr(gt.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=(0,Xf.getCreateAddress)(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=qY.Signature.from(r.signature):e.signature=qY.Signature.from(r),e.chainId==null){let t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&(0,gt.getBigInt)(e.blockHash)===DY&&(e.blockHash=null),e}Zr.formatTransactionResponse=GY});var tA=R(fc=>{"use strict";b();p();Object.defineProperty(fc,"__esModule",{value:!0});fc.FetchUrlFeeDataNetworkPlugin=fc.FeeDataNetworkPlugin=fc.EnsPlugin=fc.GasCostPlugin=fc.NetworkPlugin=void 0;var Sj=Ml(),Bwe=ke(),kwe="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",gd=class{constructor(e){N(this,"name");(0,Sj.defineProperties)(this,{name:e})}clone(){return new gd(this.name)}};fc.NetworkPlugin=gd;var n5=class extends gd{constructor(t,n){t==null&&(t=0);super(`org.ethers.network.plugins.GasCost#${t||0}`);N(this,"effectiveBlock");N(this,"txBase");N(this,"txCreate");N(this,"txDataZero");N(this,"txDataNonzero");N(this,"txAccessListStorageKey");N(this,"txAccessListAddress");let s={effectiveBlock:t};function i(a,o){let c=(n||{})[a];c==null&&(c=o),(0,Bwe.assertArgument)(typeof c=="number",`invalud value for ${a}`,"costs",n),s[a]=c}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),(0,Sj.defineProperties)(this,s)}clone(){return new n5(this.effectiveBlock,this)}};fc.GasCostPlugin=n5;var s5=class extends gd{constructor(t,n){super("org.ethers.plugins.network.Ens");N(this,"address");N(this,"targetNetwork");(0,Sj.defineProperties)(this,{address:t||kwe,targetNetwork:n??1})}clone(){return new s5(this.address,this.targetNetwork)}};fc.EnsPlugin=s5;var Xp,Tj=class extends gd{constructor(t){super("org.ethers.plugins.network.FeeData");I(this,Xp,void 0);_(this,Xp,t)}get feeDataFunc(){return l(this,Xp)}async getFeeData(t){return await l(this,Xp).call(this,t)}clone(){return new Tj(l(this,Xp))}},Aj=Tj;Xp=new WeakMap;fc.FeeDataNetworkPlugin=Aj;var i5,a5,Ej=class extends gd{constructor(t,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");I(this,i5,void 0);I(this,a5,void 0);_(this,i5,t),_(this,a5,n)}get url(){return l(this,i5)}get processFunc(){return l(this,a5)}clone(){return this}};i5=new WeakMap,a5=new WeakMap;fc.FetchUrlFeeDataNetworkPlugin=Ej});var qa=R(rA=>{"use strict";b();p();Object.defineProperty(rA,"__esModule",{value:!0});rA.Network=void 0;var Nwe=Ma(),e0=ke(),o5=tA(),Oj=new Map,Q1,Y1,hh,Z1=class{constructor(e,t){I(this,Q1,void 0);I(this,Y1,void 0);I(this,hh,void 0);_(this,Q1,e),_(this,Y1,(0,e0.getBigInt)(t)),_(this,hh,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return l(this,Q1)}set name(e){_(this,Q1,e)}get chainId(){return l(this,Y1)}set chainId(e){_(this,Y1,(0,e0.getBigInt)(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===(0,e0.getBigInt)(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===(0,e0.getBigInt)(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===(0,e0.getBigInt)(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(l(this,hh).values())}attachPlugin(e){if(l(this,hh).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return l(this,hh).set(e.name,e.clone()),this}getPlugin(e){return l(this,hh).get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){let e=new Z1(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){let t=this.getPlugin("org.ethers.plugins.network.GasCost")||new o5.GasCostPlugin,n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){let s=(0,Nwe.accessListify)(e.accessList);for(let i in s)n+=t.txAccessListAddress+t.txAccessListStorageKey*s[i].storageKeys.length}return n}static from(e){if(Iwe(),e==null)return Z1.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){let t=Oj.get(e);if(t)return t();if(typeof e=="bigint")return new Z1("unknown",e);(0,e0.assertArgument)(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){(0,e0.assertArgument)(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);let t=new Z1(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new o5.EnsPlugin(e.ensAddress,e.ensNetwork)),t}(0,e0.assertArgument)(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));let n=Oj.get(e);n&&(0,e0.assertArgument)(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),Oj.set(e,t)}},eg=Z1;Q1=new WeakMap,Y1=new WeakMap,hh=new WeakMap;rA.Network=eg;function zY(r,e){let t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);let n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let s=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||s++,n[1]=s.toString()}return BigInt(n[0]+n[1])}function WY(r){return new o5.FetchUrlFeeDataNetworkPlugin(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let s;try{let[i,a]=await Promise.all([n.send(),e()]);s=i;let o=s.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:zY(o.maxFee,9),maxPriorityFeePerGas:zY(o.maxPriorityFee,9)}}catch(i){(0,e0.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:s,error:i})}})}var $Y=!1;function Iwe(){if($Y)return;$Y=!0;function r(e,t,n){let s=function(){let i=new eg(e,t);return n.ensNetwork!=null&&i.attachPlugin(new o5.EnsPlugin(null,n.ensNetwork)),i.attachPlugin(new o5.GasCostPlugin),(n.plugins||[]).forEach(a=>{i.attachPlugin(a)}),i};eg.register(e,s),eg.register(t,s),n.altNames&&n.altNames.forEach(i=>{eg.register(i,s)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[WY("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[WY("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}});var oA=R(Fi=>{"use strict";b();p();Object.defineProperty(Fi,"__esModule",{value:!0});Fi.PollingEventSubscriber=Fi.PollingTransactionSubscriber=Fi.PollingOrphanSubscriber=Fi.PollingBlockTagSubscriber=Fi.OnBlockSubscriber=Fi.PollingBlockSubscriber=Fi.getPollingSubscriber=void 0;var JY=ke();function Bj(r){return JSON.parse(JSON.stringify(r))}function Rwe(r,e){if(e==="block")return new sA(r);if((0,JY.isHexString)(e,32))return new iA(r,e);(0,JY.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:e}})}Fi.getPollingSubscriber=Rwe;var xd,dc,bh,t0,X1,nA,sA=class{constructor(e){I(this,X1);I(this,xd,void 0);I(this,dc,void 0);I(this,bh,void 0);I(this,t0,void 0);_(this,xd,e),_(this,dc,null),_(this,bh,4e3),_(this,t0,-2)}get pollingInterval(){return l(this,bh)}set pollingInterval(e){_(this,bh,e)}start(){l(this,dc)||(_(this,dc,l(this,xd)._setTimeout($(this,X1,nA).bind(this),l(this,bh))),$(this,X1,nA).call(this))}stop(){!l(this,dc)||(l(this,xd)._clearTimeout(l(this,dc)),_(this,dc,null))}pause(e){this.stop(),e&&_(this,t0,-2)}resume(){this.start()}};xd=new WeakMap,dc=new WeakMap,bh=new WeakMap,t0=new WeakMap,X1=new WeakSet,nA=async function(){try{let e=await l(this,xd).getBlockNumber();if(l(this,t0)===-2){_(this,t0,e);return}if(e!==l(this,t0)){for(let t=l(this,t0)+1;t<=e;t++){if(l(this,dc)==null)return;await l(this,xd).emit("block",t)}_(this,t0,e)}}catch{}l(this,dc)!=null&&_(this,dc,l(this,xd)._setTimeout($(this,X1,nA).bind(this),l(this,bh)))};Fi.PollingBlockSubscriber=sA;var tg,rg,ph,sm=class{constructor(e){I(this,tg,void 0);I(this,rg,void 0);I(this,ph,void 0);_(this,tg,e),_(this,ph,!1),_(this,rg,t=>{this._poll(t,l(this,tg))})}async _poll(e,t){throw new Error("sub-classes must override this")}start(){l(this,ph)||(_(this,ph,!0),l(this,rg).call(this,-2),l(this,tg).on("block",l(this,rg)))}stop(){!l(this,ph)||(_(this,ph,!1),l(this,tg).off("block",l(this,rg)))}pause(e){this.stop()}resume(){this.start()}};tg=new WeakMap,rg=new WeakMap,ph=new WeakMap;Fi.OnBlockSubscriber=sm;var em,yd,kj=class extends sm{constructor(t,n){super(t);I(this,em,void 0);I(this,yd,void 0);_(this,em,n),_(this,yd,-2)}pause(t){t&&_(this,yd,-2),super.pause(t)}async _poll(t,n){let s=await n.getBlock(l(this,em));s!=null&&(l(this,yd)===-2?_(this,yd,s.number):s.number>l(this,yd)&&(n.emit(l(this,em),s.number),_(this,yd,s.number)))}};em=new WeakMap,yd=new WeakMap;Fi.PollingBlockTagSubscriber=kj;var c5,Nj=class extends sm{constructor(t,n){super(t);I(this,c5,void 0);_(this,c5,Bj(n))}async _poll(t,n){throw new Error("@TODO")}};c5=new WeakMap;Fi.PollingOrphanSubscriber=Nj;var tm,iA=class extends sm{constructor(t,n){super(t);I(this,tm,void 0);_(this,tm,n)}async _poll(t,n){let s=await n.getTransactionReceipt(l(this,tm));s&&n.emit(l(this,tm),s)}};tm=new WeakMap;Fi.PollingTransactionSubscriber=iA;var md,rm,nm,gh,lc,aA,ZY,Ij=class{constructor(e,t){I(this,aA);I(this,md,void 0);I(this,rm,void 0);I(this,nm,void 0);I(this,gh,void 0);I(this,lc,void 0);_(this,md,e),_(this,rm,Bj(t)),_(this,nm,$(this,aA,ZY).bind(this)),_(this,gh,!1),_(this,lc,-2)}start(){l(this,gh)||(_(this,gh,!0),l(this,lc)===-2&&l(this,md).getBlockNumber().then(e=>{_(this,lc,e)}),l(this,md).on("block",l(this,nm)))}stop(){!l(this,gh)||(_(this,gh,!1),l(this,md).off("block",l(this,nm)))}pause(e){this.stop(),e&&_(this,lc,-2)}resume(){this.start()}};md=new WeakMap,rm=new WeakMap,nm=new WeakMap,gh=new WeakMap,lc=new WeakMap,aA=new WeakSet,ZY=async function(e){if(l(this,lc)===-2)return;let t=Bj(l(this,rm));t.fromBlock=l(this,lc)+1,t.toBlock=e;let n=await l(this,md).getLogs(t);if(n.length===0){l(this,lc)<e-60&&_(this,lc,e-60);return}for(let s of n)l(this,md).emit(l(this,rm),s),_(this,lc,s.blockNumber)};Fi.PollingEventSubscriber=Ij});var fm=R(um=>{"use strict";b();p();Object.defineProperty(um,"__esModule",{value:!0});um.AbstractProvider=um.UnmanagedSubscriber=void 0;var f5=Ks(),jwe=a1(),QY=X8(),Mwe=Wf(),Cwe=Ma(),ve=ke(),YY=_j(),cA=VY(),Lwe=qa(),xh=G1(),u5=oA(),Uwe=BigInt(2),Fwe=10;function uA(r){return r&&typeof r.then=="function"}function fA(r,e){return r+":"+JSON.stringify(e,(t,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)){let s=Object.keys(n);return s.sort(),s.reduce((i,a)=>(i[a]=n[a],i),{})}return n})}var lA=class{constructor(e){N(this,"name");(0,ve.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};um.UnmanagedSubscriber=lA;function qwe(r){return JSON.parse(JSON.stringify(r))}function Mj(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function Rj(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if((0,ve.isHexString)(r,32)){let t=r.toLowerCase();return{type:"transaction",tag:fA("tx",{hash:t}),hash:t}}if(r.orphan){let t=r;return{type:"orphan",tag:fA("orphan",t),filter:qwe(t)}}if(r.address||r.topics){let t=r,n={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?Mj(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(t.address){let s=[],i=[],a=o=>{(0,ve.isHexString)(o)?s.push(o):i.push((async()=>{s.push(await(0,f5.resolveAddress)(o,e))})())};Array.isArray(t.address)?t.address.forEach(a):a(t.address),i.length&&await Promise.all(i),n.address=Mj(s.map(o=>o.toLowerCase()))}return{filter:n,tag:fA("event",n),type:"event"}}(0,ve.assertArgument)(!1,"unknown ProviderEvent","event",r)}function jj(){return new Date().getTime()}var Dwe={cacheTimeout:250,pollingInterval:4e3},qi,yh,Di,im,wo,ng,mh,wd,h5,hc,am,om,ca,mo,b5,Lj,p5,Uj,sg,d5,g5,Fj,ig,l5,cm,dA,Cj=class{constructor(e,t){I(this,ca);I(this,b5);I(this,p5);I(this,sg);I(this,g5);I(this,ig);I(this,cm);I(this,qi,void 0);I(this,yh,void 0);I(this,Di,void 0);I(this,im,void 0);I(this,wo,void 0);I(this,ng,void 0);I(this,mh,void 0);I(this,wd,void 0);I(this,h5,void 0);I(this,hc,void 0);I(this,am,void 0);I(this,om,void 0);if(_(this,om,Object.assign({},Dwe,t||{})),e==="any")_(this,ng,!0),_(this,wo,null);else if(e){let n=Lwe.Network.from(e);_(this,ng,!1),_(this,wo,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else _(this,ng,!1),_(this,wo,null);_(this,wd,-1),_(this,mh,new Map),_(this,qi,new Map),_(this,yh,new Map),_(this,Di,null),_(this,im,!1),_(this,h5,1),_(this,hc,new Map),_(this,am,!1)}get pollingInterval(){return l(this,om).pollingInterval}get provider(){return this}get plugins(){return Array.from(l(this,yh).values())}attachPlugin(e){if(l(this,yh).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return l(this,yh).set(e.name,e.connect(this)),this}getPlugin(e){return l(this,yh).get(e)||null}get disableCcipRead(){return l(this,am)}set disableCcipRead(e){_(this,am,!!e)}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;let s=e.to.toLowerCase(),i=t.toLowerCase(),a=[];for(let o=0;o<n.length;o++){let c=n[o],u=c.replace("{sender}",s).replace("{data}",i),f=new ve.FetchRequest(u);c.indexOf("{data}")===-1&&(f.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:f,index:o,urls:n});let d="unknown error",g;try{g=await f.send()}catch(h){a.push(h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:f,result:{error:h}});continue}try{let h=g.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:f,result:h}),h.data;h.message&&(d=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:f,result:h})}catch{}(0,ve.assert)(g.statusCode<400||g.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:d}}),a.push(d)}(0,ve.assert)(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,t){return new xh.Block((0,cA.formatBlock)(e),this)}_wrapLog(e,t){return new xh.Log((0,cA.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new xh.TransactionReceipt((0,cA.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new xh.TransactionResponse((0,cA.formatTransactionResponse)(e),this)}_detectNetwork(){(0,ve.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,ve.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){let e=(0,ve.getNumber)(await $(this,ca,mo).call(this,{method:"getBlockNumber"}),"%response");return l(this,wd)>=0&&_(this,wd,e),e}_getAddress(e){return(0,f5.resolveAddress)(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if((0,ve.isHexString)(e))return(0,ve.isHexString)(e,32)?e:(0,ve.toQuantity)(e);if(typeof e=="bigint"&&(e=(0,ve.getNumber)(e,"blockTag")),typeof e=="number")return e>=0?(0,ve.toQuantity)(e):l(this,wd)>=0?(0,ve.toQuantity)(l(this,wd)+e):this.getBlockNumber().then(t=>(0,ve.toQuantity)(t+e));(0,ve.assertArgument)(!1,"invalid blockTag","blockTag",e)}_getFilter(e){let t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?Mj(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,s=(c,u,f)=>{let d;switch(c.length){case 0:break;case 1:d=c[0];break;default:c.sort(),d=c}if(n&&(u!=null||f!=null))throw new Error("invalid filter");let g={};return d&&(g.address=d),t.length&&(g.topics=t),u&&(g.fromBlock=u),f&&(g.toBlock=f),n&&(g.blockHash=n),g},i=[];if(e.address)if(Array.isArray(e.address))for(let c of e.address)i.push(this._getAddress(c));else i.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),i.filter(c=>typeof c!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(i),a,o]).then(c=>s(c[0],c[1],c[2])):s(i,a,o)}_getTransactionRequest(e){let t=(0,xh.copyRequest)(e),n=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;let i=(0,f5.resolveAddress)(t[s],this);uA(i)?n.push(async function(){t[s]=await i}()):t[s]=i}),t.blockTag!=null){let s=this._getBlockTag(t.blockTag);uA(s)?n.push(async function(){t.blockTag=await s}()):t.blockTag=s}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(l(this,wo)==null){let s=(async()=>{try{let i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw l(this,wo)===s&&_(this,wo,null),i}})();return _(this,wo,s),(await s).clone()}let e=l(this,wo),[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(l(this,ng)?(this.emit("network",n,t),l(this,wo)===e&&_(this,wo,Promise.resolve(n))):(0,ve.assert)(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){let e=await this.getNetwork(),t=async()=>{let{_block:s,gasPrice:i,priorityFee:a}=await(0,ve.resolveProperties)({_block:$(this,g5,Fj).call(this,"latest",!1),gasPrice:(async()=>{try{let f=await $(this,ca,mo).call(this,{method:"getGasPrice"});return(0,ve.getBigInt)(f,"%response")}catch{}return null})(),priorityFee:(async()=>{try{let f=await $(this,ca,mo).call(this,{method:"getPriorityFee"});return(0,ve.getBigInt)(f,"%response")}catch{}return null})()}),o=null,c=null,u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(c=a??BigInt("1000000000"),o=u.baseFeePerGas*Uwe+c),new xh.FeeData(i,o,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){let s=new ve.FetchRequest(n.url),i=await n.processFunc(t,this,s);return new xh.FeeData(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return uA(t)&&(t=await t),(0,ve.getBigInt)(await $(this,ca,mo).call(this,{method:"estimateGas",transaction:t}),"%response")}async call(e){let{tx:t,blockTag:n}=await(0,ve.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await $(this,p5,Uj).call(this,$(this,b5,Lj).call(this,t,n,e.enableCcipRead?0:-1))}async getBalance(e,t){return(0,ve.getBigInt)(await $(this,sg,d5).call(this,{method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,ve.getNumber)(await $(this,sg,d5).call(this,{method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,ve.hexlify)(await $(this,sg,d5).call(this,{method:"getCode"},e,t))}async getStorage(e,t,n){let s=(0,ve.getBigInt)(t,"position");return(0,ve.hexlify)(await $(this,sg,d5).call(this,{method:"getStorage",position:s},e,n))}async broadcastTransaction(e){let{blockNumber:t,hash:n,network:s}=await(0,ve.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Cwe.Transaction.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(t)}async getBlock(e,t){let{network:n,params:s}=await(0,ve.resolveProperties)({network:this.getNetwork(),params:$(this,g5,Fj).call(this,e,!!t)});return s==null?null:this._wrapBlock(s,n)}async getTransaction(e){let{network:t,params:n}=await(0,ve.resolveProperties)({network:this.getNetwork(),params:$(this,ca,mo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){let{network:t,params:n}=await(0,ve.resolveProperties)({network:this.getNetwork(),params:$(this,ca,mo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){let s=await $(this,ca,mo).call(this,{method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){let{result:t}=await(0,ve.resolveProperties)({network:this.getNetwork(),result:$(this,ca,mo).call(this,{method:"getTransactionResult",hash:e})});return t==null?null:(0,ve.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);uA(t)&&(t=await t);let{network:n,params:s}=await(0,ve.resolveProperties)({network:this.getNetwork(),params:$(this,ca,mo).call(this,{method:"getLogs",filter:t})});return s.map(i=>this._wrapLog(i,n))}_getProvider(e){(0,ve.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await YY.EnsResolver.fromName(this,e)}async getAvatar(e){let t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){let t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=(0,f5.getAddress)(e);let t=(0,Mwe.namehash)(e.substring(2).toLowerCase()+".addr.reverse");try{let n=await YY.EnsResolver.getEnsAddress(this),i=await new QY.Contract(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===jwe.ZeroAddress)return null;let o=await new QY.Contract(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(n){if((0,ve.isError)(n,"BAD_DATA")&&n.value==="0x"||(0,ve.isError)(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){let s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,a)=>{let o=null,c=async u=>{try{let f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=s){i(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),a((0,ve.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){(0,ve.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){let t=l(this,hc).get(e);!t||(t.timer&&clearTimeout(t.timer),l(this,hc).delete(e))}_setTimeout(e,t){t==null&&(t=0);let n=$s(this,h5)._++,s=()=>{l(this,hc).delete(n),e()};if(this.paused)l(this,hc).set(n,{timer:null,func:s,time:t});else{let i=setTimeout(s,t);l(this,hc).set(n,{timer:i,func:s,time:jj()})}return n}_forEachSubscriber(e){for(let t of l(this,qi).values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new lA(e.type);case"block":{let t=new u5.PollingBlockSubscriber(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new u5.PollingBlockTagSubscriber(this,e.type);case"event":return new u5.PollingEventSubscriber(this,e.filter);case"transaction":return new u5.PollingTransactionSubscriber(this,e.hash);case"orphan":return new u5.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(let n of l(this,qi).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),l(this,Di)!=null&&t.pause(l(this,Di));break}}async on(e,t){let n=await $(this,cm,dA).call(this,e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,l(this,Di)!=null&&n.subscriber.pause(l(this,Di))),this}async once(e,t){let n=await $(this,cm,dA).call(this,e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,l(this,Di)!=null&&n.subscriber.pause(l(this,Di))),this}async emit(e,...t){let n=await $(this,ig,l5).call(this,e,t);if(!n||n.listeners.length===0)return!1;let s=n.listeners.length;return n.listeners=n.listeners.filter(({listener:i,once:a})=>{let o=new ve.EventPayload(this,a?null:i,e);try{i.call(this,...t,o)}catch{}return!a}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),l(this,qi).delete(n.tag)),s>0}async listenerCount(e){if(e){let n=await $(this,ig,l5).call(this,e);return n?n.listeners.length:0}let t=0;for(let{listeners:n}of l(this,qi).values())t+=n.length;return t}async listeners(e){if(e){let n=await $(this,ig,l5).call(this,e);return n?n.listeners.map(({listener:s})=>s):[]}let t=[];for(let{listeners:n}of l(this,qi).values())t=t.concat(n.map(({listener:s})=>s));return t}async off(e,t){let n=await $(this,ig,l5).call(this,e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),l(this,qi).delete(n.tag)),this}async removeAllListeners(e){if(e){let{tag:t,started:n,subscriber:s}=await $(this,cm,dA).call(this,e);n&&s.stop(),l(this,qi).delete(t)}else for(let[t,{started:n,subscriber:s}]of l(this,qi))n&&s.stop(),l(this,qi).delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return l(this,im)}destroy(){this.removeAllListeners();for(let e of l(this,hc).keys())this._clearTimeout(e);_(this,im,!0)}get paused(){return l(this,Di)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(_(this,wd,-1),l(this,Di)!=null){if(l(this,Di)==!!e)return;(0,ve.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),_(this,Di,!!e);for(let t of l(this,hc).values())t.timer&&clearTimeout(t.timer),t.time=jj()-t.time}resume(){if(l(this,Di)!=null){this._forEachSubscriber(e=>e.resume()),_(this,Di,null);for(let e of l(this,hc).values()){let t=e.time;t<0&&(t=0),e.time=jj(),setTimeout(e.func,t)}}}};qi=new WeakMap,yh=new WeakMap,Di=new WeakMap,im=new WeakMap,wo=new WeakMap,ng=new WeakMap,mh=new WeakMap,wd=new WeakMap,h5=new WeakMap,hc=new WeakMap,am=new WeakMap,om=new WeakMap,ca=new WeakSet,mo=async function(e){let t=l(this,om).cacheTimeout;if(t<0)return await this._perform(e);let n=fA(e.method,e),s=l(this,mh).get(n);return s||(s=this._perform(e),l(this,mh).set(n,s),setTimeout(()=>{l(this,mh).get(n)===s&&l(this,mh).delete(n)},t)),await s},b5=new WeakSet,Lj=async function(e,t,n){(0,ve.assert)(n<Fwe,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});let s=(0,xh.copyRequest)(e);try{return(0,ve.hexlify)(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(i){if(!this.disableCcipRead&&(0,ve.isCallException)(i)&&i.data&&n>=0&&t==="latest"&&s.to!=null&&(0,ve.dataSlice)(i.data,0,4)==="0x556f1830"){let a=i.data,o=await(0,f5.resolveAddress)(s.to,this),c;try{c=zwe((0,ve.dataSlice)(i.data,4))}catch(d){(0,ve.assert)(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:a}})}(0,ve.assert)(c.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});let u=await this.ccipReadFetch(s,c.calldata,c.urls);(0,ve.assert)(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:c.errorArgs}});let f={to:o,data:(0,ve.concat)([c.selector,Vwe([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{let d=await $(this,b5,Lj).call(this,f,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:d}),d}}throw i}},p5=new WeakSet,Uj=async function(e){let{value:t}=await(0,ve.resolveProperties)({network:this.getNetwork(),value:e});return t},sg=new WeakSet,d5=async function(e,t,n){let s=this._getAddress(t),i=this._getBlockTag(n);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await $(this,p5,Uj).call(this,$(this,ca,mo).call(this,Object.assign(e,{address:s,blockTag:i})))},g5=new WeakSet,Fj=async function(e,t){if((0,ve.isHexString)(e,32))return await $(this,ca,mo).call(this,{method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await $(this,ca,mo).call(this,{method:"getBlock",blockTag:n,includeTransactions:t})},ig=new WeakSet,l5=async function(e,t){let n=await Rj(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await Rj({orphan:"drop-log",log:t[0]},this)),l(this,qi).get(n.tag)||null},cm=new WeakSet,dA=async function(e){let t=await Rj(e,this),n=t.tag,s=l(this,qi).get(n);return s||(s={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},l(this,qi).set(n,s)),s};um.AbstractProvider=Cj;function Hwe(r,e){try{let t=qj(r,e);if(t)return(0,ve.toUtf8String)(t)}catch{}return null}function qj(r,e){if(r==="0x")return null;try{let t=(0,ve.getNumber)((0,ve.dataSlice)(r,e,e+32)),n=(0,ve.getNumber)((0,ve.dataSlice)(r,t,t+32));return(0,ve.dataSlice)(r,t+32,t+32+n)}catch{}return null}function XY(r){let e=(0,ve.toBeArray)(r);if(e.length>32)throw new Error("internal; should not happen");let t=new Uint8Array(32);return t.set(e,32-e.length),t}function Kwe(r){if(r.length%32===0)return r;let e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}var Gwe=new Uint8Array([]);function Vwe(r){let e=[],t=0;for(let n=0;n<r.length;n++)e.push(Gwe),t+=32;for(let n=0;n<r.length;n++){let s=(0,ve.getBytes)(r[n]);e[n]=XY(t),e.push(XY(s.length)),e.push(Kwe(s)),t+=32+Math.ceil(s.length/32)*32}return(0,ve.concat)(e)}var eX="0x0000000000000000000000000000000000000000000000000000000000000000";function zwe(r){let e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,ve.assert)((0,ve.dataLength)(r)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});let t=(0,ve.dataSlice)(r,0,32);(0,ve.assert)((0,ve.dataSlice)(t,0,12)===(0,ve.dataSlice)(eX,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=(0,ve.dataSlice)(t,12);try{let n=[],s=(0,ve.getNumber)((0,ve.dataSlice)(r,32,64)),i=(0,ve.getNumber)((0,ve.dataSlice)(r,s,s+32)),a=(0,ve.dataSlice)(r,s+32);for(let o=0;o<i;o++){let c=Hwe(a,o*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{(0,ve.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{let n=qj(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{(0,ve.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,ve.assert)((0,ve.dataSlice)(r,100,128)===(0,ve.dataSlice)(eX,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=(0,ve.dataSlice)(r,96,100);try{let n=qj(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{(0,ve.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}});var pA=R(hm=>{"use strict";b();p();Object.defineProperty(hm,"__esModule",{value:!0});hm.VoidSigner=hm.AbstractSigner=void 0;var tX=Ks(),Wwe=Ma(),Da=ke(),$we=G1();function dm(r,e){if(r.provider)return r.provider;(0,Da.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function rX(r,e){let t=(0,$we.copyRequest)(e);if(t.to!=null&&(t.to=(0,tX.resolveAddress)(t.to,r)),t.from!=null){let n=t.from;t.from=Promise.all([r.getAddress(),(0,tX.resolveAddress)(n,r)]).then(([s,i])=>((0,Da.assertArgument)(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else t.from=r.getAddress();return await(0,Da.resolveProperties)(t)}var bA=class{constructor(e){N(this,"provider");(0,Da.defineProperties)(this,{provider:e||null})}async getNonce(e){return dm(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await rX(this,e)}async populateTransaction(e){let t=dm(this,"populateTransaction"),n=await rX(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));let s=await this.provider.getNetwork();if(n.chainId!=null){let a=(0,Da.getBigInt)(n.chainId);(0,Da.assertArgument)(a===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=s.chainId;let i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?(0,Da.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&i&&(0,Da.assertArgument)(!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){let a=await t.getFeeData();(0,Da.assert)(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{let a=await t.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){let o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?((0,Da.assert)(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):(0,Da.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await(0,Da.resolveProperties)(n)}async estimateGas(e){return dm(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return dm(this,"call").call(await this.populateCall(e))}async resolveName(e){return await dm(this,"resolveName").resolveName(e)}async sendTransaction(e){let t=dm(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;let s=Wwe.Transaction.from(n);return await t.broadcastTransaction(await this.signTransaction(s))}};hm.AbstractSigner=bA;var lm,hA,Hj=class extends bA{constructor(t,n){super(n);I(this,lm);N(this,"address");(0,Da.defineProperties)(this,{address:t})}async getAddress(){return this.address}connect(t){return new Hj(this.address,t)}async signTransaction(t){$(this,lm,hA).call(this,"transactions","signTransaction")}async signMessage(t){$(this,lm,hA).call(this,"messages","signMessage")}async signTypedData(t,n,s){$(this,lm,hA).call(this,"typed-data","signTypedData")}},Dj=Hj;lm=new WeakSet,hA=function(t,n){(0,Da.assert)(!1,`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:n})};hm.VoidSigner=Dj});var vd=R(gA=>{"use strict";b();p();Object.defineProperty(gA,"__esModule",{value:!0});gA.showThrottleMessage=void 0;var nX=new Set;function Jwe(r){nX.has(r)||(nX.add(r),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${r} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}gA.showThrottleMessage=Jwe});var sX=R(vh=>{"use strict";b();p();Object.defineProperty(vh,"__esModule",{value:!0});vh.FilterIdPendingSubscriber=vh.FilterIdEventSubscriber=vh.FilterIdSubscriber=void 0;var Zwe=ke(),Qwe=oA();function Ywe(r){return JSON.parse(JSON.stringify(r))}var ua,r0,ag,wh,og,bm,y5,Kj,m5,Gj,x5=class{constructor(e){I(this,y5);I(this,m5);I(this,ua,void 0);I(this,r0,void 0);I(this,ag,void 0);I(this,wh,void 0);I(this,og,void 0);I(this,bm,void 0);_(this,ua,e),_(this,r0,null),_(this,ag,$(this,y5,Kj).bind(this)),_(this,wh,!1),_(this,og,null),_(this,bm,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){l(this,wh)||(_(this,wh,!0),$(this,y5,Kj).call(this,-2))}stop(){!l(this,wh)||(_(this,wh,!1),_(this,bm,!0),$(this,m5,Gj).call(this),l(this,ua).off("block",l(this,ag)))}pause(e){e&&$(this,m5,Gj).call(this),l(this,ua).off("block",l(this,ag))}resume(){this.start()}};ua=new WeakMap,r0=new WeakMap,ag=new WeakMap,wh=new WeakMap,og=new WeakMap,bm=new WeakMap,y5=new WeakSet,Kj=async function(e){try{l(this,r0)==null&&_(this,r0,this._subscribe(l(this,ua)));let t=null;try{t=await l(this,r0)}catch(i){if(!(0,Zwe.isError)(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){_(this,r0,null),l(this,ua)._recoverSubscriber(this,this._recover(l(this,ua)));return}let n=await l(this,ua).getNetwork();if(l(this,og)||_(this,og,n),l(this,og).chainId!==n.chainId)throw new Error("chaid changed");if(l(this,bm))return;let s=await l(this,ua).send("eth_getFilterChanges",[t]);await this._emitResults(l(this,ua),s)}catch(t){console.log("@TODO",t)}l(this,ua).once("block",l(this,ag))},m5=new WeakSet,Gj=function(){let e=l(this,r0);e&&(_(this,r0,null),e.then(t=>{l(this,ua).destroyed||l(this,ua).send("eth_uninstallFilter",[t])}))};vh.FilterIdSubscriber=x5;var cg,Vj=class extends x5{constructor(t,n){super(t);I(this,cg,void 0);_(this,cg,Ywe(n))}_recover(t){return new Qwe.PollingEventSubscriber(t,l(this,cg))}async _subscribe(t){return await t.send("eth_newFilter",[l(this,cg)])}async _emitResults(t,n){for(let s of n)t.emit(l(this,cg),t._wrapLog(s,t._network))}};cg=new WeakMap;vh.FilterIdEventSubscriber=Vj;var zj=class extends x5{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(let n of t)e.emit("pending",n)}};vh.FilterIdPendingSubscriber=zj});var pc=R(s0=>{"use strict";b();p();Object.defineProperty(s0,"__esModule",{value:!0});s0.JsonRpcProvider=s0.JsonRpcApiPollingProvider=s0.JsonRpcApiProvider=s0.JsonRpcSigner=void 0;var Xwe=H1(),ug=Ks(),iX=Wf(),e8e=Ma(),Ut=ke(),aX=fm(),t8e=pA(),Wj=qa(),oX=sX(),r8e=oA(),n8e="bigint,boolean,function,number,string,symbol".split(/,/g);function xA(r){if(r==null||n8e.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(xA);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function s8e(r){return new Promise(e=>{setTimeout(e,r)})}function pm(r){return r&&r.toLowerCase()}function cX(r){return r&&typeof r.pollingInterval=="number"}var uX={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3},gm=class extends t8e.AbstractSigner{constructor(t,n){super(t);N(this,"address");n=(0,ug.getAddress)(n),(0,Ut.defineProperties)(this,{address:n})}connect(t){(0,Ut.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){let n=xA(t),s=[];if(n.from){let a=n.from;s.push((async()=>{let o=await(0,ug.resolveAddress)(a,this.provider);(0,Ut.assertArgument)(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&s.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){let a=n.to;s.push((async()=>{n.to=await(0,ug.resolveAddress)(a,this.provider)})())}s.length&&await Promise.all(s);let i=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(t){let n=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(t);return await new Promise((i,a)=>{let o=[1e3,100],c=0,u=async()=>{try{let f=await this.provider.getTransaction(s);if(f!=null){i(f.replaceableTransaction(n));return}}catch(f){if((0,Ut.isError)(f,"CANCELLED")||(0,Ut.isError)(f,"BAD_DATA")||(0,Ut.isError)(f,"NETWORK_ERROR")||(0,Ut.isError)(f,"UNSUPPORTED_OPERATION")){f.info==null&&(f.info={}),f.info.sendTransactionHash=s,a(f);return}if((0,Ut.isError)(f,"INVALID_ARGUMENT")&&(c++,f.info==null&&(f.info={}),f.info.sendTransactionHash=s,c>10)){a(f);return}this.provider.emit("error",(0,Ut.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:f}))}this.provider._setTimeout(()=>{u()},o.pop()||4e3)};u()})}async signTransaction(t){let n=xA(t);if(n.from){let i=await(0,ug.resolveAddress)(n.from,this.provider);(0,Ut.assertArgument)(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=i}else n.from=this.address;let s=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[s])}async signMessage(t){let n=typeof t=="string"?(0,Ut.toUtf8Bytes)(t):t;return await this.provider.send("personal_sign",[(0,Ut.hexlify)(n),this.address.toLowerCase()])}async signTypedData(t,n,s){let i=xA(s),a=await iX.TypedDataEncoder.resolveNames(t,n,i,async o=>{let c=await(0,ug.resolveAddress)(o);return(0,Ut.assertArgument)(c!=null,"TypedData does not support null address","value",o),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(iX.TypedDataEncoder.getPayload(a.domain,n,a.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){let n=typeof t=="string"?(0,Ut.toUtf8Bytes)(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,Ut.hexlify)(n)])}};s0.JsonRpcSigner=gm;var fg,xm,Pd,n0,Du,bc,Ha,w5,$j,yA=class extends aX.AbstractProvider{constructor(t,n){super(t,n);I(this,w5);I(this,fg,void 0);I(this,xm,void 0);I(this,Pd,void 0);I(this,n0,void 0);I(this,Du,void 0);I(this,bc,void 0);I(this,Ha,void 0);_(this,xm,1),_(this,fg,Object.assign({},uX,n||{})),_(this,Pd,[]),_(this,n0,null),_(this,bc,null),_(this,Ha,null);{let i=null,a=new Promise(o=>{i=o});_(this,Du,{promise:a,resolve:i})}let s=this._getOption("staticNetwork");typeof s=="boolean"?((0,Ut.assertArgument)(!s||t!=="any","staticNetwork cannot be used on special network 'any'","options",n),s&&t!=null&&_(this,bc,Wj.Network.from(t))):s&&((0,Ut.assertArgument)(t==null||s.matches(t),"staticNetwork MUST match network object","options",n),_(this,bc,s))}_getOption(t){return l(this,fg)[t]}get _network(){return(0,Ut.assert)(l(this,bc),"network is not available yet","NETWORK_ERROR"),l(this,bc)}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let s=t.transaction;if(s&&s.type!=null&&(0,Ut.getBigInt)(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){let i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},s,{type:void 0})}))}}let n=this.getRpcRequest(t);return n!=null?await this.send(n.method,n.args):super._perform(t)}async _detectNetwork(){let t=this._getOption("staticNetwork");if(t)if(t===!0){if(l(this,bc))return l(this,bc)}else return t;return l(this,Ha)?await l(this,Ha):this.ready?(_(this,Ha,(async()=>{try{let n=Wj.Network.from((0,Ut.getBigInt)(await this.send("eth_chainId",[])));return _(this,Ha,null),n}catch(n){throw _(this,Ha,null),n}})()),await l(this,Ha)):(_(this,Ha,(async()=>{let n={id:$s(this,xm)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let s;try{s=(await this._send(n))[0],_(this,Ha,null)}catch(i){throw _(this,Ha,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return Wj.Network.from((0,Ut.getBigInt)(s.result));throw this.getRpcError(n,s)})()),await l(this,Ha))}_start(){l(this,Du)==null||l(this,Du).resolve==null||(l(this,Du).resolve(),_(this,Du,null),(async()=>{for(;l(this,bc)==null&&!this.destroyed;)try{_(this,bc,await this._detectNetwork())}catch(t){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",(0,Ut.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await s8e(1e3)}$(this,w5,$j).call(this)})())}async _waitUntilReady(){if(l(this,Du)!=null)return await l(this,Du).promise}_getSubscriber(t){return t.type==="pending"?new oX.FilterIdPendingSubscriber(this):t.type==="event"?this._getOption("polling")?new r8e.PollingEventSubscriber(this,t.filter):new oX.FilterIdEventSubscriber(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new aX.UnmanagedSubscriber("orphan"):super._getSubscriber(t)}get ready(){return l(this,Du)==null}getRpcTransaction(t){let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(t[s]==null)return;let i=s;s==="gasLimit"&&(i="gas"),n[i]=(0,Ut.toQuantity)((0,Ut.getBigInt)(t[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{t[s]!=null&&(n[s]=(0,Ut.hexlify)(t[s]))}),t.accessList&&(n.accessList=(0,e8e.accessListify)(t.accessList)),t.blobVersionedHashes&&(n.blobVersionedHashes=t.blobVersionedHashes.map(s=>s.toLowerCase())),n}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[pm(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[pm(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[pm(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[pm(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(pm):t.filter.address=pm(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,n){let{method:s}=t,{error:i}=n;if(s==="eth_estimateGas"&&i.message){let c=i.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return(0,Ut.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){let c=Zj(i),u=Xwe.AbiCoder.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",t.params[0],c?c.data:null);return u.info={error:i,payload:t},u}let a=JSON.stringify(i8e(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i)){let c={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,Ut.makeError)("user rejected action","ACTION_REJECTED",{action:c[s]||"unknown",reason:"rejected",info:{payload:t,error:i}})}if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){let c=t.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return(0,Ut.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:i}});if(a.match(/nonce/i)&&a.match(/too low/i))return(0,Ut.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:i}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return(0,Ut.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:i}});if(a.match(/only replay-protected/i))return(0,Ut.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:c,info:{error:i}}})}let o=!!a.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?(0,Ut.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:i,payload:t}}):(0,Ut.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:t})}send(t,n){if(this.destroyed)return Promise.reject((0,Ut.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));let s=$s(this,xm)._++,i=new Promise((a,o)=>{l(this,Pd).push({resolve:a,reject:o,payload:{method:t,params:n,id:s,jsonrpc:"2.0"}})});return $(this,w5,$j).call(this),i}async getSigner(t){t==null&&(t=0);let n=this.send("eth_accounts",[]);if(typeof t=="number"){let i=await n;if(t>=i.length)throw new Error("no such account");return new gm(this,i[t])}let{accounts:s}=await(0,Ut.resolveProperties)({network:this.getNetwork(),accounts:n});t=(0,ug.getAddress)(t);for(let i of s)if((0,ug.getAddress)(i)===t)return new gm(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new gm(this,n))}destroy(){l(this,n0)&&(clearTimeout(l(this,n0)),_(this,n0,null));for(let{payload:t,reject:n}of l(this,Pd))n((0,Ut.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));_(this,Pd,[]),super.destroy()}};fg=new WeakMap,xm=new WeakMap,Pd=new WeakMap,n0=new WeakMap,Du=new WeakMap,bc=new WeakMap,Ha=new WeakMap,w5=new WeakSet,$j=function(){if(l(this,n0))return;let t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");_(this,n0,setTimeout(()=>{_(this,n0,null);let n=l(this,Pd);for(_(this,Pd,[]);n.length;){let s=[n.shift()];for(;n.length&&s.length!==l(this,fg).batchMaxCount;)if(s.push(n.shift()),JSON.stringify(s.map(a=>a.payload)).length>l(this,fg).batchMaxSize){n.unshift(s.pop());break}(async()=>{let i=s.length===1?s[0].payload:s.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{let a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(let{resolve:o,reject:c,payload:u}of s){if(this.destroyed){c((0,Ut.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}let f=a.filter(d=>d.id===u.id)[0];if(f==null){let d=(0,Ut.makeError)("missing response for request","BAD_DATA",{value:a,info:{payload:u}});this.emit("error",d),c(d);continue}if("error"in f){c(this.getRpcError(u,f));continue}o(f.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(let{reject:o}of s)o(a)}})()}},t))};s0.JsonRpcApiProvider=yA;var Ph,mA=class extends yA{constructor(t,n){super(t,n);I(this,Ph,void 0);let s=this._getOption("pollingInterval");s==null&&(s=uX.pollingInterval),_(this,Ph,s)}_getSubscriber(t){let n=super._getSubscriber(t);return cX(n)&&(n.pollingInterval=l(this,Ph)),n}get pollingInterval(){return l(this,Ph)}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");_(this,Ph,t),this._forEachSubscriber(n=>{cX(n)&&(n.pollingInterval=l(this,Ph))})}};Ph=new WeakMap;s0.JsonRpcApiPollingProvider=mA;var ym,Jj=class extends mA{constructor(t,n,s){t==null&&(t="http://localhost:8545");super(n,s);I(this,ym,void 0);typeof t=="string"?_(this,ym,new Ut.FetchRequest(t)):_(this,ym,t.clone())}_getConnection(){return l(this,ym).clone()}async send(t,n){return await this._start(),await super.send(t,n)}async _send(t){let n=this._getConnection();n.body=JSON.stringify(t),n.setHeader("content-type","application/json");let s=await n.send();s.assertOk();let i=s.bodyJson;return Array.isArray(i)||(i=[i]),i}};ym=new WeakMap;s0.JsonRpcProvider=Jj;function Zj(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&(0,Ut.isHexString)(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(let e in r){let t=Zj(r[e]);if(t)return t}return null}if(typeof r=="string")try{return Zj(JSON.parse(r))}catch{}return null}function Qj(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(let t in r)Qj(r[t],e);if(typeof r=="string")try{return Qj(JSON.parse(r),e)}catch{}}}function i8e(r){let e=[];return Qj(r,e),e}});var Xj=R(vA=>{"use strict";b();p();Object.defineProperty(vA,"__esModule",{value:!0});vA.AnkrProvider=void 0;var Yj=ke(),a8e=vd(),o8e=qa(),c8e=pc(),wA="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function u8e(r){switch(r){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,Yj.assertArgument)(!1,"unsupported network","network",r)}var mm=class extends c8e.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=o8e.Network.from(t);n==null&&(n=wA);let i={polling:!0,staticNetwork:s},a=mm.getRequest(s,n);super(a,s,i);N(this,"apiKey");(0,Yj.defineProperties)(this,{apiKey:n})}_getProvider(t){try{return new mm(t,this.apiKey)}catch{}return super._getProvider(t)}static getRequest(t,n){n==null&&(n=wA);let s=new Yj.FetchRequest(`https://${u8e(t.name)}/${n}`);return s.allowGzip=!0,n===wA&&(s.retryFunc=async(i,a,o)=>((0,a8e.showThrottleMessage)("AnkrProvider"),!0)),s}getRpcError(t,n){return t.method==="eth_sendRawTransaction"&&n&&n.error&&n.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(n.error.message="replacement transaction underpriced"),super.getRpcError(t,n)}isCommunityResource(){return this.apiKey===wA}};vA.AnkrProvider=mm});var eM=R(_A=>{"use strict";b();p();Object.defineProperty(_A,"__esModule",{value:!0});_A.AlchemyProvider=void 0;var wm=ke(),f8e=vd(),d8e=qa(),l8e=pc(),PA="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function h8e(r){switch(r){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,wm.assertArgument)(!1,"unsupported network","network",r)}var vm=class extends l8e.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=d8e.Network.from(t);n==null&&(n=PA);let i=vm.getRequest(s,n);super(i,s,{staticNetwork:s});N(this,"apiKey");(0,wm.defineProperties)(this,{apiKey:n})}_getProvider(t){try{return new vm(t,this.apiKey)}catch{}return super._getProvider(t)}async _perform(t){if(t.method==="getTransactionResult"){let{trace:n,tx:s}=await(0,wm.resolveProperties)({trace:this.send("trace_transaction",[t.hash]),tx:this.getTransaction(t.hash)});if(n==null||s==null)return null;let i,a=!1;try{i=n[0].result.output,a=n[0].error==="Reverted"}catch{}if(i)return(0,wm.assert)(!a,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:s,invocation:null,revert:null}),i;(0,wm.assert)(!1,"could not parse trace result","BAD_DATA",{value:n})}return await super._perform(t)}isCommunityResource(){return this.apiKey===PA}static getRequest(t,n){n==null&&(n=PA);let s=new wm.FetchRequest(`https://${h8e(t.name)}/v2/${n}`);return s.allowGzip=!0,n===PA&&(s.retryFunc=async(i,a,o)=>((0,f8e.showThrottleMessage)("alchemy"),!0)),s}};_A.AlchemyProvider=vm});var tM=R(SA=>{"use strict";b();p();Object.defineProperty(SA,"__esModule",{value:!0});SA.ChainstackProvider=void 0;var EA=ke(),b8e=vd(),p8e=qa(),g8e=pc();function AA(r){switch(r){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}(0,EA.assertArgument)(!1,"unsupported network","network",r)}function x8e(r){switch(r){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}(0,EA.assertArgument)(!1,"unsupported network","network",r)}var Pm=class extends g8e.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=p8e.Network.from(t);n==null&&(n=AA(s.name));let i=Pm.getRequest(s,n);super(i,s,{staticNetwork:s});N(this,"apiKey");(0,EA.defineProperties)(this,{apiKey:n})}_getProvider(t){try{return new Pm(t,this.apiKey)}catch{}return super._getProvider(t)}isCommunityResource(){return this.apiKey===AA(this._network.name)}static getRequest(t,n){n==null&&(n=AA(t.name));let s=new EA.FetchRequest(`https://${x8e(t.name)}/${n}`);return s.allowGzip=!0,n===AA(t.name)&&(s.retryFunc=async(i,a,o)=>((0,b8e.showThrottleMessage)("ChainstackProvider"),!0)),s}};SA.ChainstackProvider=Pm});var nM=R(TA=>{"use strict";b();p();Object.defineProperty(TA,"__esModule",{value:!0});TA.CloudflareProvider=void 0;var y8e=ke(),m8e=qa(),w8e=pc(),rM=class extends w8e.JsonRpcProvider{constructor(e){e==null&&(e="mainnet");let t=m8e.Network.from(e);(0,y8e.assertArgument)(t.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}};TA.CloudflareProvider=rM});var iM=R(Am=>{"use strict";b();p();Object.defineProperty(Am,"__esModule",{value:!0});Am.EtherscanProvider=Am.EtherscanPlugin=void 0;var v8e=H1(),P8e=X8(),fX=Ma(),As=ke(),_8e=fm(),A8e=qa(),E8e=tA(),S8e=vd(),dX=2e3;function T8e(r){return r&&typeof r.then=="function"}var lX="org.ethers.plugins.provider.Etherscan",v5=class extends E8e.NetworkPlugin{constructor(t){super(lX);N(this,"baseUrl");(0,As.defineProperties)(this,{baseUrl:t})}clone(){return new v5(this.baseUrl)}};Am.EtherscanPlugin=v5;var O8e=["enableCcipRead"],B8e=1,_m,sM=class extends _8e.AbstractProvider{constructor(t,n){let s=n??null;super();N(this,"network");N(this,"apiKey");I(this,_m,void 0);let i=A8e.Network.from(t);_(this,_m,i.getPlugin(lX)),(0,As.defineProperties)(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(l(this,_m))return l(this,_m).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";default:}(0,As.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(t,n){let s=Object.keys(n).reduce((a,o)=>{let c=n[o];return c!=null&&(a+=`&${o}=${c}`),a},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${t}${s}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(t,n){return n.module=t,n.apikey=this.apiKey,n}async detectNetwork(){return this.network}async fetch(t,n,s){let i=B8e++,a=s?this.getPostUrl():this.getUrl(t,n),o=s?this.getPostData(t,n):null;this.emit("debug",{action:"sendRequest",id:i,url:a,payload:o});let c=new As.FetchRequest(a);c.setThrottleParams({slotInterval:1e3}),c.retryFunc=(d,g,h)=>(this.isCommunityResource()&&(0,S8e.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),c.processFunc=async(d,g)=>{let h=g.hasBody()?JSON.parse((0,As.toUtf8String)(g.body)):{},m=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return t==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&m&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:h}),g.throwThrottleError(h.result,dX)):m&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),g.throwThrottleError(h.result,dX)),g},o&&(c.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),c.body=Object.keys(o).map(d=>`${d}=${o[d]}`).join("&"));let u=await c.send();try{u.assertOk()}catch(d){this.emit("debug",{action:"receiveError",id:i,error:d,reason:"assertOk"}),(0,As.assert)(!1,"response error","SERVER_ERROR",{request:c,response:u})}u.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),(0,As.assert)(!1,"missing response","SERVER_ERROR",{request:c,response:u}));let f=JSON.parse((0,As.toUtf8String)(u.body));return t==="proxy"?(f.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:f,reason:"invalid JSON-RPC"}),(0,As.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:c,response:u,info:{result:f}})),f.error&&(this.emit("debug",{action:"receiveError",id:i,result:f,reason:"JSON-RPC error"}),(0,As.assert)(!1,"error response","SERVER_ERROR",{request:c,response:u,info:{result:f}})),this.emit("debug",{action:"receiveRequest",id:i,result:f}),f.result):f.status==0&&(f.message==="No records found"||f.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:f}),f.result):((f.status!=1||typeof f.message=="string"&&!f.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:f}),(0,As.assert)(!1,"error response","SERVER_ERROR",{request:c,response:u,info:{result:f}})),this.emit("debug",{action:"receiveRequest",id:i,result:f}),f.result)}_getTransactionPostData(t){let n={};for(let s in t){if(O8e.indexOf(s)>=0||t[s]==null)continue;let i=t[s];if(!(s==="type"&&i===0)&&!(s==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[s])i=(0,As.toQuantity)(i);else if(s==="accessList")i="["+(0,fX.accessListify)(i).map(a=>`{address:"${a.address}",storageKeys:["${a.storageKeys.join('","')}"]}`).join(",")+"]";else if(s==="blobVersionedHashes"){if(i.length===0)continue;(0,As.assert)(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:t}})}else i=(0,As.hexlify)(i);n[s]=i}}return n}_checkError(t,n,s){let i="";if((0,As.isError)(n,"SERVER_ERROR")){try{i=n.info.result.error.message}catch{}if(!i)try{i=n.info.message}catch{}}if(t.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&(0,As.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.transaction}),(t.method==="call"||t.method==="estimateGas")&&i.match(/execution reverted/i)){let a="";try{a=n.info.result.error.data}catch{}let o=v8e.AbiCoder.getBuiltinCallException(t.method,t.transaction,a);throw o.info={request:t,error:n},o}if(i&&t.method==="broadcastTransaction"){let a=fX.Transaction.from(t.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&(0,As.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a}),i.match(/insufficient funds/)&&(0,As.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,As.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:a})}throw n}async _detectNetwork(){return this.network}async _perform(t){switch(t.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch(n=>this._checkError(t,n,t.signedTransaction));case"getBlock":if("blockTag"in t)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});(0,As.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.hash});case"call":{if(t.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");let n=this._getTransactionPostData(t.transaction);n.module="proxy",n.action="eth_call";try{return await this.fetch("proxy",n,!0)}catch(s){return this._checkError(t,s,t.transaction)}}case"estimateGas":{let n=this._getTransactionPostData(t.transaction);n.module="proxy",n.action="eth_estimateGas";try{return await this.fetch("proxy",n,!0)}catch(s){return this._checkError(t,s,t.transaction)}}default:break}return super._perform(t)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(t){let n=this._getAddress(t);T8e(n)&&(n=await n);try{let s=await this.fetch("contract",{action:"getabi",address:n}),i=JSON.parse(s);return new P8e.Contract(n,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}};_m=new WeakMap;Am.EtherscanProvider=sM});var hX=R(OA=>{"use strict";b();p();Object.defineProperty(OA,"__esModule",{value:!0});OA.WebSocket=void 0;function k8e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}var N8e=k8e().WebSocket;OA.WebSocket=N8e});var IA=R(gc=>{"use strict";b();p();Object.defineProperty(gc,"__esModule",{value:!0});gc.SocketProvider=gc.SocketEventSubscriber=gc.SocketPendingSubscriber=gc.SocketBlockSubscriber=gc.SocketSubscriber=void 0;var bX=fm(),P5=ke(),I8e=pc(),i0,_5,_h,dg,Ah,Sm=class{constructor(e,t){I(this,i0,void 0);I(this,_5,void 0);I(this,_h,void 0);I(this,dg,void 0);I(this,Ah,void 0);_(this,i0,e),_(this,_5,JSON.stringify(t)),_(this,_h,null),_(this,dg,null),_(this,Ah,null)}get filter(){return JSON.parse(l(this,_5))}start(){_(this,_h,l(this,i0).send("eth_subscribe",this.filter).then(e=>(l(this,i0)._register(e,this),e)))}stop(){l(this,_h).then(e=>{l(this,i0).destroyed||l(this,i0).send("eth_unsubscribe",[e])}),_(this,_h,null)}pause(e){(0,P5.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),_(this,dg,!!e)}resume(){_(this,dg,null)}_handleMessage(e){if(l(this,_h)!=null&&l(this,dg)===null){let t=l(this,Ah);t==null?t=this._emit(l(this,i0),e):t=t.then(async()=>{await this._emit(l(this,i0),e)}),_(this,Ah,t.then(()=>{l(this,Ah)===t&&_(this,Ah,null)}))}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}};i0=new WeakMap,_5=new WeakMap,_h=new WeakMap,dg=new WeakMap,Ah=new WeakMap;gc.SocketSubscriber=Sm;var BA=class extends Sm{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}};gc.SocketBlockSubscriber=BA;var kA=class extends Sm{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}};gc.SocketPendingSubscriber=kA;var A5,NA=class extends Sm{constructor(t,n){super(t,["logs",n]);I(this,A5,void 0);_(this,A5,JSON.stringify(n))}get logFilter(){return JSON.parse(l(this,A5))}async _emit(t,n){t.emit(this.logFilter,t._wrapLog(n,t._network))}};A5=new WeakMap;gc.SocketEventSubscriber=NA;var lg,Em,Eh,aM=class extends I8e.JsonRpcApiProvider{constructor(t,n){let s=Object.assign({},n??{});(0,P5.assertArgument)(s.batchMaxCount==null||s.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",n),s.batchMaxCount=1,s.staticNetwork==null&&(s.staticNetwork=!0);super(t,s);I(this,lg,void 0);I(this,Em,void 0);I(this,Eh,void 0);_(this,lg,new Map),_(this,Em,new Map),_(this,Eh,new Map)}_getSubscriber(t){switch(t.type){case"close":return new bX.UnmanagedSubscriber("close");case"block":return new BA(this);case"pending":return new kA(this);case"event":return new NA(this,t.filter);case"orphan":if(t.filter.orphan==="drop-log")return new bX.UnmanagedSubscriber("drop-log")}return super._getSubscriber(t)}_register(t,n){l(this,Em).set(t,n);let s=l(this,Eh).get(t);if(s){for(let i of s)n._handleMessage(i);l(this,Eh).delete(t)}}async _send(t){(0,P5.assertArgument)(!Array.isArray(t),"WebSocket does not support batch send","payload",t);let n=new Promise((s,i)=>{l(this,lg).set(t.id,{payload:t,resolve:s,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(t)),[await n]}async _processMessage(t){let n=JSON.parse(t);if(n&&typeof n=="object"&&"id"in n){let s=l(this,lg).get(n.id);if(s==null){this.emit("error",(0,P5.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:n}));return}l(this,lg).delete(n.id),s.resolve(n)}else if(n&&n.method==="eth_subscription"){let s=n.params.subscription,i=l(this,Em).get(s);if(i)i._handleMessage(n.params.result);else{let a=l(this,Eh).get(s);a==null&&(a=[],l(this,Eh).set(s,a)),a.push(n.params.result)}}else{this.emit("error",(0,P5.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:n}));return}}async _write(t){throw new Error("sub-classes must override this")}};lg=new WeakMap,Em=new WeakMap,Eh=new WeakMap;gc.SocketProvider=aM});var jA=R(RA=>{"use strict";b();p();Object.defineProperty(RA,"__esModule",{value:!0});RA.WebSocketProvider=void 0;var R8e=hX(),j8e=IA(),hg,Hu,oM=class extends j8e.SocketProvider{constructor(t,n,s){super(n,s);I(this,hg,void 0);I(this,Hu,void 0);typeof t=="string"?(_(this,hg,()=>new R8e.WebSocket(t)),_(this,Hu,l(this,hg).call(this))):typeof t=="function"?(_(this,hg,t),_(this,Hu,t())):(_(this,hg,null),_(this,Hu,t)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(l(this,Hu)==null)throw new Error("websocket closed");return l(this,Hu)}async _write(t){this.websocket.send(t)}async destroy(){l(this,Hu)!=null&&(l(this,Hu).close(),_(this,Hu,null)),super.destroy()}};hg=new WeakMap,Hu=new WeakMap;RA.WebSocketProvider=oM});var cM=R(Tm=>{"use strict";b();p();Object.defineProperty(Tm,"__esModule",{value:!0});Tm.InfuraProvider=Tm.InfuraWebSocketProvider=void 0;var S5=ke(),M8e=vd(),C8e=qa(),L8e=pc(),U8e=jA(),E5="84842078b09946638c03157f83405213";function F8e(r){switch(r){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,S5.assertArgument)(!1,"unsupported network","network",r)}var MA=class extends U8e.WebSocketProvider{constructor(t,n){let s=new bg(t,n),i=s._getConnection();(0,S5.assert)(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});let a=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(a,s._network);N(this,"projectId");N(this,"projectSecret");(0,S5.defineProperties)(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===E5}};Tm.InfuraWebSocketProvider=MA;var bg=class extends L8e.JsonRpcProvider{constructor(t,n,s){t==null&&(t="mainnet");let i=C8e.Network.from(t);n==null&&(n=E5),s==null&&(s=null);let a=bg.getRequest(i,n,s);super(a,i,{staticNetwork:i});N(this,"projectId");N(this,"projectSecret");(0,S5.defineProperties)(this,{projectId:n,projectSecret:s})}_getProvider(t){try{return new bg(t,this.projectId,this.projectSecret)}catch{}return super._getProvider(t)}isCommunityResource(){return this.projectId===E5}static getWebSocketProvider(t,n){return new MA(t,n)}static getRequest(t,n,s){n==null&&(n=E5),s==null&&(s=null);let i=new S5.FetchRequest(`https://${F8e(t.name)}/v3/${n}`);return i.allowGzip=!0,s&&i.setCredentials("",s),n===E5&&(i.retryFunc=async(a,o,c)=>((0,M8e.showThrottleMessage)("InfuraProvider"),!0)),i}};Tm.InfuraProvider=bg});var fM=R(LA=>{"use strict";b();p();Object.defineProperty(LA,"__esModule",{value:!0});LA.QuickNodeProvider=void 0;var uM=ke(),q8e=vd(),D8e=qa(),H8e=pc(),CA="919b412a057b5e9c9b6dce193c5a60242d6efadb";function K8e(r){switch(r){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,uM.assertArgument)(!1,"unsupported network","network",r)}var Om=class extends H8e.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=D8e.Network.from(t);n==null&&(n=CA);let i=Om.getRequest(s,n);super(i,s,{staticNetwork:s});N(this,"token");(0,uM.defineProperties)(this,{token:n})}_getProvider(t){try{return new Om(t,this.token)}catch{}return super._getProvider(t)}isCommunityResource(){return this.token===CA}static getRequest(t,n){n==null&&(n=CA);let s=new uM.FetchRequest(`https://${K8e(t.name)}/${n}`);return s.allowGzip=!0,n===CA&&(s.retryFunc=async(i,a,o)=>((0,q8e.showThrottleMessage)("QuickNodeProvider"),!0)),s}};LA.QuickNodeProvider=Om});var mM=R(HA=>{"use strict";b();p();Object.defineProperty(HA,"__esModule",{value:!0});HA.FallbackProvider=void 0;var Ku=ke(),pX=fm(),G8e=qa(),V8e=BigInt("1"),z8e=BigInt("2");function W8e(r){for(let e=r.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1)),n=r[e];r[e]=r[t],r[t]=n}}function $8e(r){return new Promise(e=>{setTimeout(e,r)})}function bM(){return new Date().getTime()}function dM(r){return JSON.stringify(r,(e,t)=>typeof t=="bigint"?{type:"bigint",value:t.toString()}:t)}var gX={stallTimeout:400,priority:1,weight:1},xX={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function J8e(r,e){for(;(r.blockNumber<0||r.blockNumber<e)&&(r._updateNumber||(r._updateNumber=(async()=>{try{let t=await r.provider.getBlockNumber();t>r.blockNumber&&(r.blockNumber=t)}catch(t){r.blockNumber=-2,r._lastFatalError=t,r._lastFatalErrorTimestamp=bM()}r._updateNumber=null})()),await r._updateNumber,r.outOfSync++,!r._lastFatalError););}function T5(r){if(r==null)return"null";if(Array.isArray(r))return"["+r.map(T5).join(",")+"]";if(typeof r=="object"&&typeof r.toJSON=="function")return T5(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":case"number":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{"+e.map(t=>`${JSON.stringify(t)}:${T5(r[t])}`).join(",")+"}"}}throw console.log("Could not serialize",r),new Error("Hmm...")}function lM(r){if("error"in r){let t=r.error;return{tag:T5(t),value:t}}let e=r.result;return{tag:T5(e),value:e}}function UA(r,e){let t=new Map;for(let{value:s,tag:i,weight:a}of e){let o=t.get(i)||{value:s,weight:0};o.weight+=a,t.set(i,o)}let n=null;for(let s of t.values())s.weight>=r&&(!n||s.weight>n.weight)&&(n=s);if(n)return n.value}function pM(r,e){let t=0,n=new Map,s=null,i=[];for(let{value:o,tag:c,weight:u}of e)if(o instanceof Error){let f=n.get(c)||{value:o,weight:0};f.weight+=u,n.set(c,f),(s==null||f.weight>s.weight)&&(s=f)}else i.push(BigInt(o)),t+=u;if(t<r)return s&&s.weight>=r?s.value:void 0;i.sort((o,c)=>o<c?-1:c>o?1:0);let a=Math.floor(i.length/2);return i.length%2?i[a]:(i[a-1]+i[a]+V8e)/z8e}function hM(r,e){let t=UA(r,e);if(t!==void 0)return t;for(let n of e)if(n.value)return n.value}function Z8e(r,e){if(r===1)return(0,Ku.getNumber)(pM(r,e),"%internal");let t=new Map,n=(a,o)=>{let c=t.get(a)||{result:a,weight:0};c.weight+=o,t.set(a,c)};for(let{weight:a,value:o}of e){let c=(0,Ku.getNumber)(o);n(c-1,a),n(c,a),n(c+1,a)}let s=0,i;for(let{weight:a,result:o}of t.values())a>=r&&(a>s||i!=null&&a===s&&o>i)&&(s=a,i=o);return i}var Ka,_d,Bm,FA,yX,O5,xM,qA,mX,DA,wX,B5,yM,gM=class extends pX.AbstractProvider{constructor(t,n,s){super(n,s);I(this,FA);I(this,O5);I(this,qA);I(this,DA);I(this,B5);N(this,"quorum");N(this,"eventQuorum");N(this,"eventWorkers");I(this,Ka,void 0);I(this,_d,void 0);I(this,Bm,void 0);_(this,Ka,t.map(i=>i instanceof pX.AbstractProvider?Object.assign({provider:i},gX,xX):Object.assign({},gX,i,xX))),_(this,_d,-2),_(this,Bm,null),s&&s.quorum!=null?this.quorum=s.quorum:this.quorum=Math.ceil(l(this,Ka).reduce((i,a)=>(i+=a.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,Ku.assertArgument)(this.quorum<=l(this,Ka).reduce((i,a)=>i+a.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return l(this,Ka).map(t=>{let n=Object.assign({},t);for(let s in n)s[0]==="_"&&delete n[s];return n})}async _detectNetwork(){return G8e.Network.from((0,Ku.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(t,n){switch(n.method){case"broadcastTransaction":return await t.broadcastTransaction(n.signedTransaction);case"call":return await t.call(Object.assign({},n.transaction,{blockTag:n.blockTag}));case"chainId":return(await t.getNetwork()).chainId;case"estimateGas":return await t.estimateGas(n.transaction);case"getBalance":return await t.getBalance(n.address,n.blockTag);case"getBlock":{let s="blockHash"in n?n.blockHash:n.blockTag;return await t.getBlock(s,n.includeTransactions)}case"getBlockNumber":return await t.getBlockNumber();case"getCode":return await t.getCode(n.address,n.blockTag);case"getGasPrice":return(await t.getFeeData()).gasPrice;case"getPriorityFee":return(await t.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await t.getLogs(n.filter);case"getStorage":return await t.getStorage(n.address,n.position,n.blockTag);case"getTransaction":return await t.getTransaction(n.hash);case"getTransactionCount":return await t.getTransactionCount(n.address,n.blockTag);case"getTransactionReceipt":return await t.getTransactionReceipt(n.hash);case"getTransactionResult":return await t.getTransactionResult(n.hash)}}async _perform(t){if(t.method==="broadcastTransaction"){let a=l(this,Ka).map(u=>null),o=l(this,Ka).map(async({provider:u,weight:f},d)=>{try{let g=await u._perform(t);a[d]=Object.assign(lM({result:g}),{weight:f})}catch(g){a[d]=Object.assign(lM({error:g}),{weight:f})}});for(;;){let u=a.filter(g=>g!=null);for(let{value:g}of u)if(!(g instanceof Error))return g;let f=UA(this.quorum,a.filter(g=>g!=null));if((0,Ku.isError)(f,"INSUFFICIENT_FUNDS"))throw f;let d=o.filter((g,h)=>a[h]==null);if(d.length===0)break;await Promise.race(d)}let c=hM(this.quorum,a);if((0,Ku.assert)(c!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:a.map(dM)}}),c instanceof Error)throw c;return c}await $(this,qA,mX).call(this);let n=new Set,s=0;for(;;){let a=$(this,O5,xM).call(this,n,t);if(a==null||(s+=a.config.weight,s>=this.quorum))break}let i=await $(this,B5,yM).call(this,n,t);for(let a of n)a.perform&&a.result==null&&a.config.lateResponses++;return i}async destroy(){for(let{provider:t}of l(this,Ka))t.destroy();super.destroy()}};Ka=new WeakMap,_d=new WeakMap,Bm=new WeakMap,FA=new WeakSet,yX=function(t){let n=Array.from(t).map(i=>i.config),s=l(this,Ka).slice();W8e(s),s.sort((i,a)=>i.priority-a.priority);for(let i of s)if(!i._lastFatalError&&n.indexOf(i)===-1)return i;return null},O5=new WeakSet,xM=function(t,n){let s=$(this,FA,yX).call(this,t);if(s==null)return null;let i={config:s,result:null,didBump:!1,perform:null,staller:null},a=bM();return i.perform=(async()=>{try{s.requests++;let c=await this._translatePerform(s.provider,n);i.result={result:c}}catch(c){s.errorResponses++,i.result={error:c}}let o=bM()-a;s._totalTime+=o,s.rollingDuration=.95*s.rollingDuration+.05*o,i.perform=null})(),i.staller=(async()=>{await $8e(s.stallTimeout),i.staller=null})(),t.add(i),i},qA=new WeakSet,mX=async function(){let t=l(this,Bm);if(!t){let n=[];l(this,Ka).forEach(s=>{n.push((async()=>{await J8e(s,0),s._lastFatalError||(s._network=await s.provider.getNetwork())})())}),_(this,Bm,t=(async()=>{await Promise.all(n);let s=null;for(let i of l(this,Ka)){if(i._lastFatalError)continue;let a=i._network;s==null?s=a.chainId:a.chainId!==s&&(0,Ku.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await t},DA=new WeakSet,wX=async function(t,n){let s=[];for(let i of t)if(i.result!=null){let{tag:a,value:o}=lM(i.result);s.push({tag:a,value:o,weight:i.config.weight})}if(!(s.reduce((i,a)=>i+a.weight,0)<this.quorum)){switch(n.method){case"getBlockNumber":{l(this,_d)===-2&&_(this,_d,Math.ceil((0,Ku.getNumber)(pM(this.quorum,l(this,Ka).filter(a=>!a._lastFatalError).map(a=>({value:a.blockNumber,tag:(0,Ku.getNumber)(a.blockNumber).toString(),weight:a.weight}))))));let i=Z8e(this.quorum,s);return i===void 0?void 0:(i>l(this,_d)&&_(this,_d,i),l(this,_d))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return pM(this.quorum,s);case"getBlock":return"blockTag"in n&&n.blockTag==="pending"?hM(this.quorum,s):UA(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return UA(this.quorum,s);case"broadcastTransaction":return hM(this.quorum,s)}(0,Ku.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${dM(n.method)})`})}},B5=new WeakSet,yM=async function(t,n){if(t.size===0)throw new Error("no runners?!");let s=[],i=0;for(let o of t){if(o.perform&&s.push(o.perform),o.staller){s.push(o.staller);continue}o.didBump||(o.didBump=!0,i++)}let a=await $(this,DA,wX).call(this,t,n);if(a!==void 0){if(a instanceof Error)throw a;return a}for(let o=0;o<i;o++)$(this,O5,xM).call(this,t,n);return(0,Ku.assert)(s.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:Array.from(t).map(o=>dM(o.result))}}),await Promise.race(s),await $(this,B5,yM).call(this,t,n)};HA.FallbackProvider=gM});var vX=R(KA=>{"use strict";b();p();Object.defineProperty(KA,"__esModule",{value:!0});KA.getDefaultProvider=void 0;var Q8e=ke(),Y8e=Xj(),X8e=eM(),e5e=tM(),t5e=nM(),r5e=iM(),n5e=cM(),s5e=fM(),i5e=mM(),wM=pc(),a5e=qa(),o5e=jA();function c5e(r){return r&&typeof r.send=="function"&&typeof r.close=="function"}var u5e="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function f5e(r,e){e==null&&(e={});let t=a=>e[a]==="-"?!1:typeof e.exclusive=="string"?a===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(a)!==-1:!0;if(typeof r=="string"&&r.match(/^https?:/))return new wM.JsonRpcProvider(r);if(typeof r=="string"&&r.match(/^wss?:/)||c5e(r))return new o5e.WebSocketProvider(r);let n=null;try{n=a5e.Network.from(r)}catch{}let s=[];if(t("publicPolygon")&&n&&(n.name==="matic"?s.push(new wM.JsonRpcProvider("https://polygon-rpc.com/",n,{staticNetwork:n})):n.name==="matic-amoy"&&s.push(new wM.JsonRpcProvider("https://rpc-amoy.polygon.technology/",n,{staticNetwork:n}))),t("alchemy"))try{s.push(new X8e.AlchemyProvider(r,e.alchemy))}catch{}if(t("ankr")&&e.ankr!=null)try{s.push(new Y8e.AnkrProvider(r,e.ankr))}catch{}if(t("chainstack"))try{s.push(new e5e.ChainstackProvider(r,e.chainstack))}catch{}if(t("cloudflare"))try{s.push(new t5e.CloudflareProvider(r))}catch{}if(t("etherscan"))try{s.push(new r5e.EtherscanProvider(r,e.etherscan))}catch{}if(t("infura"))try{let a=e.infura,o;typeof a=="object"&&(o=a.projectSecret,a=a.projectId),s.push(new n5e.InfuraProvider(r,a,o))}catch{}if(t("quicknode"))try{let a=e.quicknode;s.push(new s5e.QuickNodeProvider(r,a))}catch{}if((0,Q8e.assert)(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),n&&u5e.indexOf(n.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new i5e.FallbackProvider(s,void 0,{quorum:i})}KA.getDefaultProvider=f5e});var PX=R(GA=>{"use strict";b();p();Object.defineProperty(GA,"__esModule",{value:!0});GA.NonceManager=void 0;var d5e=ke(),l5e=pA(),Sh,pg,PM=class extends l5e.AbstractSigner{constructor(t){super(t.provider);N(this,"signer");I(this,Sh,void 0);I(this,pg,void 0);(0,d5e.defineProperties)(this,{signer:t}),_(this,Sh,null),_(this,pg,0)}async getAddress(){return this.signer.getAddress()}connect(t){return new PM(this.signer.connect(t))}async getNonce(t){if(t==="pending"){l(this,Sh)==null&&_(this,Sh,super.getNonce("pending"));let n=l(this,pg);return await l(this,Sh)+n}return super.getNonce(t)}increment(){$s(this,pg)._++}reset(){_(this,pg,0),_(this,Sh,null)}async sendTransaction(t){let n=this.getNonce("pending");return this.increment(),t=await this.signer.populateTransaction(t),t.nonce=await n,await this.signer.sendTransaction(t)}signTransaction(t){return this.signer.signTransaction(t)}signMessage(t){return this.signer.signMessage(t)}signTypedData(t,n,s){return this.signer.signTypedData(t,n,s)}},vM=PM;Sh=new WeakMap,pg=new WeakMap;GA.NonceManager=vM});var AX=R(VA=>{"use strict";b();p();Object.defineProperty(VA,"__esModule",{value:!0});VA.BrowserProvider=void 0;var _X=ke(),h5e=pc(),km,_M=class extends h5e.JsonRpcApiPollingProvider{constructor(t,n,s){let i=Object.assign({},s??{},{batchMaxCount:1});(0,_X.assertArgument)(t&&t.request,"invalid EIP-1193 provider","ethereum",t);super(n,i);I(this,km,void 0);_(this,km,async(a,o)=>{let c={method:a,params:o};this.emit("debug",{action:"sendEip1193Request",payload:c});try{let u=await t.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:u}),u}catch(u){let f=new Error(u.message);throw f.code=u.code,f.data=u.data,f.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:f}),f}})}async send(t,n){return await this._start(),await super.send(t,n)}async _send(t){(0,_X.assertArgument)(!Array.isArray(t),"EIP-1193 does not support batch request","payload",t);try{let n=await l(this,km).call(this,t.method,t.params||[]);return[{id:t.id,result:n}]}catch(n){return[{id:t.id,error:{code:n.code,data:n.data,message:n.message}}]}}getRpcError(t,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(t,n)}async hasSigner(t){t==null&&(t=0);let n=await this.send("eth_accounts",[]);return typeof t=="number"?n.length>t:(t=t.toLowerCase(),n.filter(s=>s.toLowerCase()===t).length!==0)}async getSigner(t){if(t==null&&(t=0),!await this.hasSigner(t))try{await l(this,km).call(this,"eth_requestAccounts",[])}catch(n){let s=n.payload;throw this.getRpcError(s,{id:s.id,error:n})}return await super.getSigner(t)}};km=new WeakMap;VA.BrowserProvider=_M});var EX=R(WA=>{"use strict";b();p();Object.defineProperty(WA,"__esModule",{value:!0});WA.PocketProvider=void 0;var AM=ke(),b5e=vd(),p5e=qa(),g5e=pc(),zA="62e1ad51b37b8e00394bda3b";function x5e(r){switch(r){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,AM.assertArgument)(!1,"unsupported network","network",r)}var Nm=class extends g5e.JsonRpcProvider{constructor(t,n,s){t==null&&(t="mainnet");let i=p5e.Network.from(t);n==null&&(n=zA),s==null&&(s=null);let a={staticNetwork:i},o=Nm.getRequest(i,n,s);super(o,i,a);N(this,"applicationId");N(this,"applicationSecret");(0,AM.defineProperties)(this,{applicationId:n,applicationSecret:s})}_getProvider(t){try{return new Nm(t,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(t)}static getRequest(t,n,s){n==null&&(n=zA);let i=new AM.FetchRequest(`https://${x5e(t.name)}/v1/lb/${n}`);return i.allowGzip=!0,s&&i.setCredentials("",s),n===zA&&(i.retryFunc=async(a,o,c)=>((0,b5e.showThrottleMessage)("PocketProvider"),!0)),i}isCommunityResource(){return this.applicationId===zA}};WA.PocketProvider=Nm});var SX=R($A=>{"use strict";b();p();Object.defineProperty($A,"__esModule",{value:!0});$A.IpcSocketProvider=void 0;var y5e=void 0;$A.IpcSocketProvider=y5e});var ZA=R(ye=>{"use strict";b();p();Object.defineProperty(ye,"__esModule",{value:!0});ye.SocketEventSubscriber=ye.SocketPendingSubscriber=ye.SocketBlockSubscriber=ye.SocketSubscriber=ye.WebSocketProvider=ye.SocketProvider=ye.IpcSocketProvider=ye.QuickNodeProvider=ye.PocketProvider=ye.InfuraWebSocketProvider=ye.InfuraProvider=ye.EtherscanPlugin=ye.EtherscanProvider=ye.ChainstackProvider=ye.CloudflareProvider=ye.AnkrProvider=ye.AlchemyProvider=ye.BrowserProvider=ye.JsonRpcSigner=ye.JsonRpcProvider=ye.JsonRpcApiProvider=ye.FallbackProvider=ye.copyRequest=ye.TransactionResponse=ye.TransactionReceipt=ye.Log=ye.FeeData=ye.Block=ye.FetchUrlFeeDataNetworkPlugin=ye.FeeDataNetworkPlugin=ye.EnsPlugin=ye.GasCostPlugin=ye.NetworkPlugin=ye.NonceManager=ye.Network=ye.MulticoinProviderPlugin=ye.EnsResolver=ye.getDefaultProvider=ye.showThrottleMessage=ye.VoidSigner=ye.AbstractSigner=ye.UnmanagedSubscriber=ye.AbstractProvider=void 0;var TX=fm();Object.defineProperty(ye,"AbstractProvider",{enumerable:!0,get:function(){return TX.AbstractProvider}});Object.defineProperty(ye,"UnmanagedSubscriber",{enumerable:!0,get:function(){return TX.UnmanagedSubscriber}});var OX=pA();Object.defineProperty(ye,"AbstractSigner",{enumerable:!0,get:function(){return OX.AbstractSigner}});Object.defineProperty(ye,"VoidSigner",{enumerable:!0,get:function(){return OX.VoidSigner}});var m5e=vd();Object.defineProperty(ye,"showThrottleMessage",{enumerable:!0,get:function(){return m5e.showThrottleMessage}});var w5e=vX();Object.defineProperty(ye,"getDefaultProvider",{enumerable:!0,get:function(){return w5e.getDefaultProvider}});var BX=_j();Object.defineProperty(ye,"EnsResolver",{enumerable:!0,get:function(){return BX.EnsResolver}});Object.defineProperty(ye,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return BX.MulticoinProviderPlugin}});var v5e=qa();Object.defineProperty(ye,"Network",{enumerable:!0,get:function(){return v5e.Network}});var P5e=PX();Object.defineProperty(ye,"NonceManager",{enumerable:!0,get:function(){return P5e.NonceManager}});var k5=tA();Object.defineProperty(ye,"NetworkPlugin",{enumerable:!0,get:function(){return k5.NetworkPlugin}});Object.defineProperty(ye,"GasCostPlugin",{enumerable:!0,get:function(){return k5.GasCostPlugin}});Object.defineProperty(ye,"EnsPlugin",{enumerable:!0,get:function(){return k5.EnsPlugin}});Object.defineProperty(ye,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return k5.FeeDataNetworkPlugin}});Object.defineProperty(ye,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return k5.FetchUrlFeeDataNetworkPlugin}});var Im=G1();Object.defineProperty(ye,"Block",{enumerable:!0,get:function(){return Im.Block}});Object.defineProperty(ye,"FeeData",{enumerable:!0,get:function(){return Im.FeeData}});Object.defineProperty(ye,"Log",{enumerable:!0,get:function(){return Im.Log}});Object.defineProperty(ye,"TransactionReceipt",{enumerable:!0,get:function(){return Im.TransactionReceipt}});Object.defineProperty(ye,"TransactionResponse",{enumerable:!0,get:function(){return Im.TransactionResponse}});Object.defineProperty(ye,"copyRequest",{enumerable:!0,get:function(){return Im.copyRequest}});var _5e=mM();Object.defineProperty(ye,"FallbackProvider",{enumerable:!0,get:function(){return _5e.FallbackProvider}});var EM=pc();Object.defineProperty(ye,"JsonRpcApiProvider",{enumerable:!0,get:function(){return EM.JsonRpcApiProvider}});Object.defineProperty(ye,"JsonRpcProvider",{enumerable:!0,get:function(){return EM.JsonRpcProvider}});Object.defineProperty(ye,"JsonRpcSigner",{enumerable:!0,get:function(){return EM.JsonRpcSigner}});var A5e=AX();Object.defineProperty(ye,"BrowserProvider",{enumerable:!0,get:function(){return A5e.BrowserProvider}});var E5e=eM();Object.defineProperty(ye,"AlchemyProvider",{enumerable:!0,get:function(){return E5e.AlchemyProvider}});var S5e=Xj();Object.defineProperty(ye,"AnkrProvider",{enumerable:!0,get:function(){return S5e.AnkrProvider}});var T5e=nM();Object.defineProperty(ye,"CloudflareProvider",{enumerable:!0,get:function(){return T5e.CloudflareProvider}});var O5e=tM();Object.defineProperty(ye,"ChainstackProvider",{enumerable:!0,get:function(){return O5e.ChainstackProvider}});var kX=iM();Object.defineProperty(ye,"EtherscanProvider",{enumerable:!0,get:function(){return kX.EtherscanProvider}});Object.defineProperty(ye,"EtherscanPlugin",{enumerable:!0,get:function(){return kX.EtherscanPlugin}});var NX=cM();Object.defineProperty(ye,"InfuraProvider",{enumerable:!0,get:function(){return NX.InfuraProvider}});Object.defineProperty(ye,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return NX.InfuraWebSocketProvider}});var B5e=EX();Object.defineProperty(ye,"PocketProvider",{enumerable:!0,get:function(){return B5e.PocketProvider}});var k5e=fM();Object.defineProperty(ye,"QuickNodeProvider",{enumerable:!0,get:function(){return k5e.QuickNodeProvider}});var N5e=SX();Object.defineProperty(ye,"IpcSocketProvider",{enumerable:!0,get:function(){return N5e.IpcSocketProvider}});var I5e=IA();Object.defineProperty(ye,"SocketProvider",{enumerable:!0,get:function(){return I5e.SocketProvider}});var R5e=jA();Object.defineProperty(ye,"WebSocketProvider",{enumerable:!0,get:function(){return R5e.WebSocketProvider}});var JA=IA();Object.defineProperty(ye,"SocketSubscriber",{enumerable:!0,get:function(){return JA.SocketSubscriber}});Object.defineProperty(ye,"SocketBlockSubscriber",{enumerable:!0,get:function(){return JA.SocketBlockSubscriber}});Object.defineProperty(ye,"SocketPendingSubscriber",{enumerable:!0,get:function(){return JA.SocketPendingSubscriber}});Object.defineProperty(ye,"SocketEventSubscriber",{enumerable:!0,get:function(){return JA.SocketEventSubscriber}})});var YA=R(QA=>{"use strict";b();p();Object.defineProperty(QA,"__esModule",{value:!0});QA.BaseWallet=void 0;var SM=Ks(),TM=Wf(),IX=ZA(),RX=Ma(),Rm=ke(),jm,BM=class extends IX.AbstractSigner{constructor(t,n){super(n);N(this,"address");I(this,jm,void 0);(0,Rm.assertArgument)(t&&typeof t.sign=="function","invalid private key","privateKey","[ REDACTED ]"),_(this,jm,t);let s=(0,RX.computeAddress)(this.signingKey.publicKey);(0,Rm.defineProperties)(this,{address:s})}get signingKey(){return l(this,jm)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new BM(l(this,jm),t)}async signTransaction(t){t=(0,IX.copyRequest)(t);let{to:n,from:s}=await(0,Rm.resolveProperties)({to:t.to?(0,SM.resolveAddress)(t.to,this.provider):void 0,from:t.from?(0,SM.resolveAddress)(t.from,this.provider):void 0});n!=null&&(t.to=n),s!=null&&(t.from=s),t.from!=null&&((0,Rm.assertArgument)((0,SM.getAddress)(t.from)===this.address,"transaction from address mismatch","tx.from",t.from),delete t.from);let i=RX.Transaction.from(t);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(t){return this.signMessageSync(t)}signMessageSync(t){return this.signingKey.sign((0,TM.hashMessage)(t)).serialized}async signTypedData(t,n,s){let i=await TM.TypedDataEncoder.resolveNames(t,n,s,async a=>{(0,Rm.assert)(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:a}});let o=await this.provider.resolveName(a);return(0,Rm.assert)(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:a}),o});return this.signingKey.sign(TM.TypedDataEncoder.hash(i.domain,n,i.value)).serialized}},OM=BM;jm=new WeakMap;QA.BaseWallet=OM});var kM=R(Mm=>{"use strict";b();p();Object.defineProperty(Mm,"__esModule",{value:!0});Mm.decodeOwl=Mm.decode=void 0;var j5e=ke(),XA=" !#$%&'()*+,-./<=>?@[]^_`{|}~",M5e=/^[a-z]*$/i;function jX(r,e){let t=97;return r.reduce((n,s)=>(s===e?t++:s.match(M5e)?n.push(String.fromCharCode(t)+s):(t=97,n.push(s)),n),[])}function MX(r,e){for(let s=XA.length-1;s>=0;s--)r=r.split(XA[s]).join(e.substring(2*s,2*s+2));let t=[],n=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,i,a,o)=>{if(a)for(let c=parseInt(a);c>=0;c--)t.push(";");else t.push(i.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return jX(jX(t,";"),":")}Mm.decode=MX;function C5e(r){return(0,j5e.assertArgument)(r[0]==="0","unsupported auwl data","data",r),MX(r.substring(1+2*XA.length),r.substring(1,1+2*XA.length))}Mm.decodeOwl=C5e});var IM=R(eE=>{"use strict";b();p();Object.defineProperty(eE,"__esModule",{value:!0});eE.Wordlist=void 0;var L5e=ke(),NM=class{constructor(e){N(this,"locale");(0,L5e.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}};eE.Wordlist=NM});var rE=R(tE=>{"use strict";b();p();Object.defineProperty(tE,"__esModule",{value:!0});tE.WordlistOwl=void 0;var U5e=Wf(),F5e=ke(),q5e=kM(),D5e=IM(),Cm,N5,gg,I5,jM,RM=class extends D5e.Wordlist{constructor(t,n,s){super(t);I(this,I5);I(this,Cm,void 0);I(this,N5,void 0);I(this,gg,void 0);_(this,Cm,n),_(this,N5,s),_(this,gg,null)}get _data(){return l(this,Cm)}_decodeWords(){return(0,q5e.decodeOwl)(l(this,Cm))}getWord(t){let n=$(this,I5,jM).call(this);return(0,F5e.assertArgument)(t>=0&&t<n.length,`invalid word index: ${t}`,"index",t),n[t]}getWordIndex(t){return $(this,I5,jM).call(this).indexOf(t)}};Cm=new WeakMap,N5=new WeakMap,gg=new WeakMap,I5=new WeakSet,jM=function(){if(l(this,gg)==null){let t=this._decodeWords();if((0,U5e.id)(t.join(`
`)+`
`)!==l(this,N5))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);_(this,gg,t)}return l(this,gg)};tE.WordlistOwl=RM});var j5=R(nE=>{"use strict";b();p();Object.defineProperty(nE,"__esModule",{value:!0});nE.LangEn=void 0;var H5e=rE(),K5e="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",G5e="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60",MM=null,R5=class extends H5e.WordlistOwl{constructor(){super("en",K5e,G5e)}static wordlist(){return MM==null&&(MM=new R5),MM}};nE.LangEn=R5});var iE=R(sE=>{"use strict";b();p();Object.defineProperty(sE,"__esModule",{value:!0});sE.Mnemonic=void 0;var FM=si(),fa=ke(),qM=j5();function CX(r){return(1<<r)-1<<8-r&255}function V5e(r){return(1<<r)-1&255}function CM(r,e){(0,fa.assertNormalize)("NFKD"),e==null&&(e=qM.LangEn.wordlist());let t=e.split(r);(0,fa.assertArgument)(t.length%3===0&&t.length>=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");let n=new Uint8Array(Math.ceil(11*t.length/8)),s=0;for(let u=0;u<t.length;u++){let f=e.getWordIndex(t[u].normalize("NFKD"));(0,fa.assertArgument)(f>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let d=0;d<11;d++)f&1<<10-d&&(n[s>>3]|=1<<7-s%8),s++}let i=32*t.length/3,a=t.length/3,o=CX(a),c=(0,fa.getBytes)((0,FM.sha256)(n.slice(0,i/8)))[0]&o;return(0,fa.assertArgument)(c===(n[n.length-1]&o),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,fa.hexlify)(n.slice(0,i/8))}function LM(r,e){(0,fa.assertArgument)(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=qM.LangEn.wordlist());let t=[0],n=11;for(let a=0;a<r.length;a++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=r[a],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=r[a]>>8-n,t.push(r[a]&V5e(8-n)),n+=3);let s=r.length/4,i=parseInt((0,FM.sha256)(r).substring(2,4),16)&CX(s);return t[t.length-1]<<=s,t[t.length-1]|=i>>8-s,e.join(t.map(a=>e.getWord(a)))}var UM={},Lm=class{constructor(e,t,n,s,i){N(this,"phrase");N(this,"password");N(this,"wordlist");N(this,"entropy");s==null&&(s=""),i==null&&(i=qM.LangEn.wordlist()),(0,fa.assertPrivate)(e,UM,"Mnemonic"),(0,fa.defineProperties)(this,{phrase:n,password:s,wordlist:i,entropy:t})}computeSeed(){let e=(0,fa.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,FM.pbkdf2)((0,fa.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,n){let s=CM(e,n);return e=LM((0,fa.getBytes)(s),n),new Lm(UM,s,e,t,n)}static fromEntropy(e,t,n){let s=(0,fa.getBytes)(e,"entropy"),i=LM(s,n);return new Lm(UM,(0,fa.hexlify)(s),i,t,n)}static entropyToPhrase(e,t){let n=(0,fa.getBytes)(e,"entropy");return LM(n,t)}static phraseToEntropy(e,t){return CM(e,t)}static isValidMnemonic(e,t){try{return CM(e,t),!0}catch{}return!1}};sE.Mnemonic=Lm});var KM=R(Th=>{"use strict";b();p();var vi=Th&&Th.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},DM=Th&&Th.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},oE,yc,a0;Object.defineProperty(Th,"__esModule",{value:!0});Th.AES=void 0;var z5e={16:10,24:12,32:14},W5e=[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],xc=[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],aE=[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],$5e=[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],J5e=[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],Z5e=[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],Q5e=[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],Y5e=[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],X5e=[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],e4e=[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],t4e=[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],r4e=[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],n4e=[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],s4e=[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],i4e=[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 HM(r){let e=[];for(let t=0;t<r.length;t+=4)e.push(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]);return e}var M5=class{get key(){return vi(this,oE,"f").slice()}constructor(e){if(oE.set(this,void 0),yc.set(this,void 0),a0.set(this,void 0),!(this instanceof M5))throw Error("AES must be instanitated with `new`");DM(this,oE,new Uint8Array(e),"f");let t=z5e[this.key.length];if(t==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");DM(this,a0,[],"f"),DM(this,yc,[],"f");for(let f=0;f<=t;f++)vi(this,a0,"f").push([0,0,0,0]),vi(this,yc,"f").push([0,0,0,0]);let n=(t+1)*4,s=this.key.length/4,i=HM(this.key),a;for(let f=0;f<s;f++)a=f>>2,vi(this,a0,"f")[a][f%4]=i[f],vi(this,yc,"f")[t-a][f%4]=i[f];let o=0,c=s,u;for(;c<n;){if(u=i[s-1],i[0]^=xc[u>>16&255]<<24^xc[u>>8&255]<<16^xc[u&255]<<8^xc[u>>24&255]^W5e[o]<<24,o+=1,s!=8)for(let h=1;h<s;h++)i[h]^=i[h-1];else{for(let h=1;h<s/2;h++)i[h]^=i[h-1];u=i[s/2-1],i[s/2]^=xc[u&255]^xc[u>>8&255]<<8^xc[u>>16&255]<<16^xc[u>>24&255]<<24;for(let h=s/2+1;h<s;h++)i[h]^=i[h-1]}let f=0,d,g;for(;f<s&&c<n;)d=c>>2,g=c%4,vi(this,a0,"f")[d][g]=i[f],vi(this,yc,"f")[t-d][g]=i[f++],c++}for(let f=1;f<t;f++)for(let d=0;d<4;d++)u=vi(this,yc,"f")[f][d],vi(this,yc,"f")[f][d]=r4e[u>>24&255]^n4e[u>>16&255]^s4e[u>>8&255]^i4e[u&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");let t=vi(this,a0,"f").length-1,n=[0,0,0,0],s=HM(e);for(let o=0;o<4;o++)s[o]^=vi(this,a0,"f")[0][o];for(let o=1;o<t;o++){for(let c=0;c<4;c++)n[c]=$5e[s[c]>>24&255]^J5e[s[(c+1)%4]>>16&255]^Z5e[s[(c+2)%4]>>8&255]^Q5e[s[(c+3)%4]&255]^vi(this,a0,"f")[o][c];s=n.slice()}let i=new Uint8Array(16),a=0;for(let o=0;o<4;o++)a=vi(this,a0,"f")[t][o],i[4*o]=(xc[s[o]>>24&255]^a>>24)&255,i[4*o+1]=(xc[s[(o+1)%4]>>16&255]^a>>16)&255,i[4*o+2]=(xc[s[(o+2)%4]>>8&255]^a>>8)&255,i[4*o+3]=(xc[s[(o+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");let t=vi(this,yc,"f").length-1,n=[0,0,0,0],s=HM(e);for(let o=0;o<4;o++)s[o]^=vi(this,yc,"f")[0][o];for(let o=1;o<t;o++){for(let c=0;c<4;c++)n[c]=Y5e[s[c]>>24&255]^X5e[s[(c+3)%4]>>16&255]^e4e[s[(c+2)%4]>>8&255]^t4e[s[(c+1)%4]&255]^vi(this,yc,"f")[o][c];s=n.slice()}let i=new Uint8Array(16),a=0;for(let o=0;o<4;o++)a=vi(this,yc,"f")[t][o],i[4*o]=(aE[s[o]>>24&255]^a>>24)&255,i[4*o+1]=(aE[s[(o+3)%4]>>16&255]^a>>16)&255,i[4*o+2]=(aE[s[(o+2)%4]>>8&255]^a>>8)&255,i[4*o+3]=(aE[s[(o+1)%4]&255]^a)&255;return i}};Th.AES=M5;oE=new WeakMap,yc=new WeakMap,a0=new WeakMap});var xg=R(cE=>{"use strict";b();p();Object.defineProperty(cE,"__esModule",{value:!0});cE.ModeOfOperation=void 0;var a4e=KM(),GM=class{constructor(e,t,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new a4e.AES(t)},name:{enumerable:!0,value:e}})}};cE.ModeOfOperation=GM});var LX=R(Oh=>{"use strict";b();p();var uE=Oh&&Oh.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Um=Oh&&Oh.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},C5,Ad;Object.defineProperty(Oh,"__esModule",{value:!0});Oh.CBC=void 0;var o4e=xg(),L5=class extends o4e.ModeOfOperation{constructor(e,t){if(super("ECC",e,L5),C5.set(this,void 0),Ad.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");uE(this,C5,new Uint8Array(t),"f")}else uE(this,C5,new Uint8Array(16),"f");uE(this,Ad,this.iv,"f")}get iv(){return new Uint8Array(Um(this,C5,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let s=0;s<16;s++)Um(this,Ad,"f")[s]^=e[n+s];uE(this,Ad,this.aes.encrypt(Um(this,Ad,"f")),"f"),t.set(Um(this,Ad,"f"),n)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let s=this.aes.decrypt(e.subarray(n,n+16));for(let i=0;i<16;i++)t[n+i]=s[i]^Um(this,Ad,"f")[i],Um(this,Ad,"f")[i]=e[n+i]}return t}};Oh.CBC=L5;C5=new WeakMap,Ad=new WeakMap});var UX=R(Nh=>{"use strict";b();p();var VM=Nh&&Nh.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Bh=Nh&&Nh.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},fE,U5,kh,zM;Object.defineProperty(Nh,"__esModule",{value:!0});Nh.CFB=void 0;var c4e=xg(),F5=class extends c4e.ModeOfOperation{constructor(e,t,n=8){if(super("CFB",e,F5),fE.add(this),U5.set(this,void 0),kh.set(this,void 0),!Number.isInteger(n)||n%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:n}}),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");VM(this,U5,new Uint8Array(t),"f")}else VM(this,U5,new Uint8Array(16),"f");VM(this,kh,this.iv,"f")}get iv(){return new Uint8Array(Bh(this,U5,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(Bh(this,kh,"f"));for(let a=0;a<t;a++)n[s+a]^=i[a];Bh(this,fE,"m",zM).call(this,n.subarray(s))}return n}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(Bh(this,kh,"f"));for(let a=0;a<t;a++)n[s+a]^=i[a];Bh(this,fE,"m",zM).call(this,e.subarray(s))}return n}};Nh.CFB=F5;U5=new WeakMap,kh=new WeakMap,fE=new WeakSet,zM=function(e){let t=this.segmentSize/8;Bh(this,kh,"f").set(Bh(this,kh,"f").subarray(t)),Bh(this,kh,"f").set(e.subarray(0,t),16-t)}});var FX=R(Ih=>{"use strict";b();p();var Fm=Ih&&Ih.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},mc=Ih&&Ih.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},q5,yg,wc;Object.defineProperty(Ih,"__esModule",{value:!0});Ih.CTR=void 0;var u4e=xg(),D5=class extends u4e.ModeOfOperation{constructor(e,t){super("CTR",e,D5),q5.set(this,void 0),yg.set(this,void 0),wc.set(this,void 0),Fm(this,wc,new Uint8Array(16),"f"),mc(this,wc,"f").fill(0),Fm(this,q5,mc(this,wc,"f"),"f"),Fm(this,yg,16,"f"),t==null&&(t=1),typeof t=="number"?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(mc(this,wc,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)mc(this,wc,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");mc(this,wc,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(mc(this,wc,"f")[e]===255)mc(this,wc,"f")[e]=0;else{mc(this,wc,"f")[e]++;break}}encrypt(e){var t,n;let s=new Uint8Array(e);for(let i=0;i<s.length;i++)mc(this,yg,"f")===16&&(Fm(this,q5,this.aes.encrypt(mc(this,wc,"f")),"f"),Fm(this,yg,0,"f"),this.increment()),s[i]^=mc(this,q5,"f")[Fm(this,yg,(n=mc(this,yg,"f"),t=n++,n),"f"),t];return s}decrypt(e){return this.encrypt(e)}};Ih.CTR=D5;q5=new WeakMap,yg=new WeakMap,wc=new WeakMap});var qX=R(dE=>{"use strict";b();p();Object.defineProperty(dE,"__esModule",{value:!0});dE.ECB=void 0;var f4e=xg(),H5=class extends f4e.ModeOfOperation{constructor(e){super("ECB",e,H5)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.encrypt(e.subarray(n,n+16)),n);return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.decrypt(e.subarray(n,n+16)),n);return t}};dE.ECB=H5});var DX=R(Rh=>{"use strict";b();p();var mg=Rh&&Rh.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},K5=Rh&&Rh.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},G5,qm,wg;Object.defineProperty(Rh,"__esModule",{value:!0});Rh.OFB=void 0;var d4e=xg(),V5=class extends d4e.ModeOfOperation{constructor(e,t){if(super("OFB",e,V5),G5.set(this,void 0),qm.set(this,void 0),wg.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");mg(this,G5,new Uint8Array(t),"f")}else mg(this,G5,new Uint8Array(16),"f");mg(this,qm,this.iv,"f"),mg(this,wg,16,"f")}get iv(){return new Uint8Array(K5(this,G5,"f"))}encrypt(e){var t,n;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let s=new Uint8Array(e);for(let i=0;i<s.length;i++)K5(this,wg,"f")===16&&(mg(this,qm,this.aes.encrypt(K5(this,qm,"f")),"f"),mg(this,wg,0,"f")),s[i]^=K5(this,qm,"f")[mg(this,wg,(n=K5(this,wg,"f"),t=n++,n),"f"),t];return s}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}};Rh.OFB=V5;G5=new WeakMap,qm=new WeakMap,wg=new WeakMap});var HX=R(Dm=>{"use strict";b();p();Object.defineProperty(Dm,"__esModule",{value:!0});Dm.pkcs7Strip=Dm.pkcs7Pad=void 0;function l4e(r){let e=16-r.length%16,t=new Uint8Array(r.length+e);t.set(r);for(let n=r.length;n<t.length;n++)t[n]=e;return t}Dm.pkcs7Pad=l4e;function h4e(r){if(r.length<16)throw new TypeError("PKCS#7 invalid length");let e=r[r.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");let t=r.length-e;for(let n=0;n<e;n++)if(r[t+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(r.subarray(0,t))}Dm.pkcs7Strip=h4e});var WM=R(Es=>{"use strict";b();p();Object.defineProperty(Es,"__esModule",{value:!0});Es.pkcs7Strip=Es.pkcs7Pad=Es.OFB=Es.ECB=Es.CTR=Es.CFB=Es.CBC=Es.ModeOfOperation=Es.AES=void 0;var b4e=KM();Object.defineProperty(Es,"AES",{enumerable:!0,get:function(){return b4e.AES}});var p4e=xg();Object.defineProperty(Es,"ModeOfOperation",{enumerable:!0,get:function(){return p4e.ModeOfOperation}});var g4e=LX();Object.defineProperty(Es,"CBC",{enumerable:!0,get:function(){return g4e.CBC}});var x4e=UX();Object.defineProperty(Es,"CFB",{enumerable:!0,get:function(){return x4e.CFB}});var y4e=FX();Object.defineProperty(Es,"CTR",{enumerable:!0,get:function(){return y4e.CTR}});var m4e=qX();Object.defineProperty(Es,"ECB",{enumerable:!0,get:function(){return m4e.ECB}});var w4e=DX();Object.defineProperty(Es,"OFB",{enumerable:!0,get:function(){return w4e.OFB}});var KX=HX();Object.defineProperty(Es,"pkcs7Pad",{enumerable:!0,get:function(){return KX.pkcs7Pad}});Object.defineProperty(Es,"pkcs7Strip",{enumerable:!0,get:function(){return KX.pkcs7Strip}})});var $M=R(o0=>{"use strict";b();p();Object.defineProperty(o0,"__esModule",{value:!0});o0.spelunk=o0.getPassword=o0.zpad=o0.looseArrayify=void 0;var Hm=ke();function GX(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),(0,Hm.getBytesCopy)(r)}o0.looseArrayify=GX;function v4e(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}o0.zpad=v4e;function P4e(r){return typeof r=="string"?(0,Hm.toUtf8Bytes)(r,"NFKC"):(0,Hm.getBytesCopy)(r)}o0.getPassword=P4e;function _4e(r,e){let t=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,Hm.assertArgument)(t!=null,"invalid path","path",e);let n=t[1],s=t[3],i=t[4]==="!",a=r;for(let o of n.toLowerCase().split(".")){if(Array.isArray(a)){if(!o.match(/^[0-9]+$/))break;a=a[parseInt(o)]}else if(typeof a=="object"){let c=null;for(let u in a)if(u.toLowerCase()===o){c=a[u];break}a=c}else a=null;if(a==null)break}if((0,Hm.assertArgument)(!i||a!=null,"missing required value","path",n),s&&a!=null){if(s==="int"){if(typeof a=="string"&&a.match(/^-?[0-9]+$/))return parseInt(a);if(Number.isSafeInteger(a))return a}if(s==="number"&&typeof a=="string"&&a.match(/^-?[0-9.]*$/))return parseFloat(a);if(s==="data"&&typeof a=="string")return GX(a);if(s==="array"&&Array.isArray(a)||s===typeof a)return a;(0,Hm.assertArgument)(!1,`wrong type found for ${s} `,"path",n)}return a}o0.spelunk=_4e});var bE=R(vc=>{"use strict";b();p();Object.defineProperty(vc,"__esModule",{value:!0});vc.encryptKeystoreJson=vc.encryptKeystoreJsonSync=vc.decryptKeystoreJson=vc.decryptKeystoreJsonSync=vc.isKeystoreJson=void 0;var lE=WM(),A4e=Ks(),Pc=si(),E4e=Ma(),zt=ke(),kr=$M(),S4e=H9(),zX="m/44'/60'/0'/0/0";function T4e(r){try{let e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}vc.isKeystoreJson=T4e;function O4e(r,e,t){if((0,kr.spelunk)(r,"crypto.cipher:string")==="aes-128-ctr"){let s=(0,kr.spelunk)(r,"crypto.cipherparams.iv:data!"),i=new lE.CTR(e,s);return(0,zt.hexlify)(i.decrypt(t))}(0,zt.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function hE(r,e){let t=(0,zt.getBytes)(e),n=(0,kr.spelunk)(r,"crypto.ciphertext:data!"),s=(0,zt.hexlify)((0,Pc.keccak256)((0,zt.concat)([t.slice(16,32),n]))).substring(2);(0,zt.assertArgument)(s===(0,kr.spelunk)(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");let i=O4e(r,t.slice(0,16),n),a=(0,E4e.computeAddress)(i);if(r.address){let u=r.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),(0,zt.assertArgument)((0,A4e.getAddress)(u)===a,"keystore address/privateKey mismatch","address",r.address)}let o={address:a,privateKey:i};if((0,kr.spelunk)(r,"x-ethers.version:string")==="0.1"){let u=t.slice(32,64),f=(0,kr.spelunk)(r,"x-ethers.mnemonicCiphertext:data!"),d=(0,kr.spelunk)(r,"x-ethers.mnemonicCounter:data!"),g=new lE.CTR(u,d);o.mnemonic={path:(0,kr.spelunk)(r,"x-ethers.path:string")||zX,locale:(0,kr.spelunk)(r,"x-ethers.locale:string")||"en",entropy:(0,zt.hexlify)((0,zt.getBytes)(g.decrypt(f)))}}return o}function WX(r){let e=(0,kr.spelunk)(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){let t=(0,kr.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,kr.spelunk)(r,"crypto.kdfparams.n:int!"),s=(0,kr.spelunk)(r,"crypto.kdfparams.r:int!"),i=(0,kr.spelunk)(r,"crypto.kdfparams.p:int!");(0,zt.assertArgument)(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),(0,zt.assertArgument)(s>0&&i>0,"invalid kdf","kdf",e);let a=(0,kr.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,zt.assertArgument)(a===32,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:t,N:n,r:s,p:i,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){let t=(0,kr.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,kr.spelunk)(r,"crypto.kdfparams.prf:string!"),s=n.split("-").pop();(0,zt.assertArgument)(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",n);let i=(0,kr.spelunk)(r,"crypto.kdfparams.c:int!"),a=(0,kr.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,zt.assertArgument)(a===32,"invalid kdf.dklen","kdf.dklen",a),{name:"pbkdf2",salt:t,count:i,dkLen:a,algorithm:s}}}(0,zt.assertArgument)(!1,"unsupported key-derivation function","kdf",e)}function B4e(r,e){let t=JSON.parse(r),n=(0,kr.getPassword)(e),s=WX(t);if(s.name==="pbkdf2"){let{salt:d,count:g,dkLen:h,algorithm:m}=s,y=(0,Pc.pbkdf2)(n,d,g,h,m);return hE(t,y)}(0,zt.assert)(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});let{salt:i,N:a,r:o,p:c,dkLen:u}=s,f=(0,Pc.scryptSync)(n,i,a,o,c,u);return hE(t,f)}vc.decryptKeystoreJsonSync=B4e;function VX(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function k4e(r,e,t){let n=JSON.parse(r),s=(0,kr.getPassword)(e),i=WX(n);if(i.name==="pbkdf2"){t&&(t(0),await VX(0));let{salt:g,count:h,dkLen:m,algorithm:y}=i,S=(0,Pc.pbkdf2)(s,g,h,m,y);return t&&(t(1),await VX(0)),hE(n,S)}(0,zt.assert)(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});let{salt:a,N:o,r:c,p:u,dkLen:f}=i,d=await(0,Pc.scrypt)(s,a,o,c,u,f,t);return hE(n,d)}vc.decryptKeystoreJson=k4e;function $X(r){let e=r.salt!=null?(0,zt.getBytes)(r.salt,"options.salt"):(0,Pc.randomBytes)(32),t=1<<17,n=8,s=1;return r.scrypt&&(r.scrypt.N&&(t=r.scrypt.N),r.scrypt.r&&(n=r.scrypt.r),r.scrypt.p&&(s=r.scrypt.p)),(0,zt.assertArgument)(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,zt.assertArgument)(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,zt.assertArgument)(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:e,N:t,r:n,p:s}}function JX(r,e,t,n){let s=(0,zt.getBytes)(t.privateKey,"privateKey"),i=n.iv!=null?(0,zt.getBytes)(n.iv,"options.iv"):(0,Pc.randomBytes)(16);(0,zt.assertArgument)(i.length===16,"invalid options.iv length","options.iv",n.iv);let a=n.uuid!=null?(0,zt.getBytes)(n.uuid,"options.uuid"):(0,Pc.randomBytes)(16);(0,zt.assertArgument)(a.length===16,"invalid options.uuid length","options.uuid",n.iv);let o=r.slice(0,16),c=r.slice(16,32),u=new lE.CTR(o,i),f=(0,zt.getBytes)(u.encrypt(s)),d=(0,Pc.keccak256)((0,zt.concat)([c,f])),g={address:t.address.substring(2).toLowerCase(),id:(0,zt.uuidV4)(a),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,zt.hexlify)(i).substring(2)},ciphertext:(0,zt.hexlify)(f).substring(2),kdf:"scrypt",kdfparams:{salt:(0,zt.hexlify)(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:d.substring(2)}};if(t.mnemonic){let h=n.client!=null?n.client:`ethers/${S4e.version}`,m=t.mnemonic.path||zX,y=t.mnemonic.locale||"en",S=r.slice(32,64),T=(0,zt.getBytes)(t.mnemonic.entropy,"account.mnemonic.entropy"),H=(0,Pc.randomBytes)(16),C=new lE.CTR(S,H),J=(0,zt.getBytes)(C.encrypt(T)),z=new Date,Y="UTC--"+(z.getUTCFullYear()+"-"+(0,kr.zpad)(z.getUTCMonth()+1,2)+"-"+(0,kr.zpad)(z.getUTCDate(),2)+"T"+(0,kr.zpad)(z.getUTCHours(),2)+"-"+(0,kr.zpad)(z.getUTCMinutes(),2)+"-"+(0,kr.zpad)(z.getUTCSeconds(),2)+".0Z")+"--"+g.address;g["x-ethers"]={client:h,gethFilename:Y,path:m,locale:y,mnemonicCounter:(0,zt.hexlify)(H).substring(2),mnemonicCiphertext:(0,zt.hexlify)(J).substring(2),version:"0.1"}}return JSON.stringify(g)}function N4e(r,e,t){t==null&&(t={});let n=(0,kr.getPassword)(e),s=$X(t),i=(0,Pc.scryptSync)(n,s.salt,s.N,s.r,s.p,64);return JX((0,zt.getBytes)(i),s,r,t)}vc.encryptKeystoreJsonSync=N4e;async function I4e(r,e,t){t==null&&(t={});let n=(0,kr.getPassword)(e),s=$X(t),i=await(0,Pc.scrypt)(n,s.salt,s.N,s.r,s.p,64,t.progressCallback);return JX((0,zt.getBytes)(i),s,r,t)}vc.encryptKeystoreJson=I4e});var QM=R(da=>{"use strict";b();p();Object.defineProperty(da,"__esModule",{value:!0});da.getIndexedAccountPath=da.getAccountPath=da.HDNodeVoidWallet=da.HDNodeWallet=da.defaultPath=void 0;var vo=si(),R4e=ZA(),XX=Ma(),Je=ke(),ZX=j5(),j4e=YA(),QX=iE(),YX=bE();da.defaultPath="m/44'/60'/0'/0/0";var M4e=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),f0=2147483648,C4e=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),L4e="0123456789abcdef";function gE(r,e){let t="";for(;r;)t=L4e[r%16]+t,r=Math.trunc(r/16);for(;t.length<e*2;)t="0"+t;return"0x"+t}function JM(r){let e=(0,Je.getBytes)(r),t=(0,Je.dataSlice)((0,vo.sha256)((0,vo.sha256)(e)),0,4),n=(0,Je.concat)([e,t]);return(0,Je.encodeBase58)(n)}var u0={};function eee(r,e,t,n){let s=new Uint8Array(37);r&f0?((0,Je.assert)(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set((0,Je.getBytes)(n),1)):s.set((0,Je.getBytes)(t));for(let a=24;a>=0;a-=8)s[33+(a>>3)]=r>>24-a&255;let i=(0,Je.getBytes)((0,vo.computeHmac)("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function tee(r,e){let t=e.split("/");(0,Je.assertArgument)(t.length>0,"invalid path","path",e),t[0]==="m"&&((0,Je.assertArgument)(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),t.shift());let n=r;for(let s=0;s<t.length;s++){let i=t[s];if(i.match(/^[0-9]+'$/)){let a=parseInt(i.substring(0,i.length-1));(0,Je.assertArgument)(a<f0,"invalid path index",`path[${s}]`,i),n=n.deriveChild(f0+a)}else if(i.match(/^[0-9]+$/)){let a=parseInt(i);(0,Je.assertArgument)(a<f0,"invalid path index",`path[${s}]`,i),n=n.deriveChild(a)}else(0,Je.assertArgument)(!1,"invalid path component",`path[${s}]`,i)}return n}var W5,ZM,vg,z5,c0=class extends j4e.BaseWallet{constructor(t,n,s,i,a,o,c,u,f){super(n,f);I(this,W5);N(this,"publicKey");N(this,"fingerprint");N(this,"parentFingerprint");N(this,"mnemonic");N(this,"chainCode");N(this,"path");N(this,"index");N(this,"depth");(0,Je.assertPrivate)(t,u0,"HDNodeWallet"),(0,Je.defineProperties)(this,{publicKey:n.compressedPublicKey});let d=(0,Je.dataSlice)((0,vo.ripemd160)((0,vo.sha256)(this.publicKey)),0,4);(0,Je.defineProperties)(this,{parentFingerprint:s,fingerprint:d,chainCode:i,path:a,index:o,depth:c}),(0,Je.defineProperties)(this,{mnemonic:u})}connect(t){return new c0(u0,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}async encrypt(t,n){return await(0,YX.encryptKeystoreJson)($(this,W5,ZM).call(this),t,{progressCallback:n})}encryptSync(t){return(0,YX.encryptKeystoreJsonSync)($(this,W5,ZM).call(this),t)}get extendedKey(){return(0,Je.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),JM((0,Je.concat)(["0x0488ADE4",gE(this.depth,1),this.parentFingerprint,gE(this.index,4),this.chainCode,(0,Je.concat)(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new jh(u0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=(0,Je.getNumber)(t,"index");(0,Je.assertArgument)(n<=4294967295,"invalid index","index",n);let s=this.path;s&&(s+="/"+(n&~f0),n&f0&&(s+="'"));let{IR:i,IL:a}=eee(n,this.chainCode,this.publicKey,this.privateKey),o=new vo.SigningKey((0,Je.toBeHex)(((0,Je.toBigInt)(a)+BigInt(this.privateKey))%C4e,32));return new c0(u0,o,this.fingerprint,(0,Je.hexlify)(i),s,n,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return tee(this,t)}static fromExtendedKey(t){let n=(0,Je.toBeArray)((0,Je.decodeBase58)(t));(0,Je.assertArgument)(n.length===82||JM(n.slice(0,78))===t,"invalid extended key","extendedKey","[ REDACTED ]");let s=n[4],i=(0,Je.hexlify)(n.slice(5,9)),a=parseInt((0,Je.hexlify)(n.slice(9,13)).substring(2),16),o=(0,Je.hexlify)(n.slice(13,45)),c=n.slice(45,78);switch((0,Je.hexlify)(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":{let u=(0,Je.hexlify)(c);return new jh(u0,(0,XX.computeAddress)(u),u,i,o,null,a,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new c0(u0,new vo.SigningKey(c.slice(1)),i,o,null,a,s,null,null)}(0,Je.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t,n,s){var a;t==null&&(t=""),n==null&&(n=da.defaultPath),s==null&&(s=ZX.LangEn.wordlist());let i=QX.Mnemonic.fromEntropy((0,vo.randomBytes)(16),t,s);return $(a=c0,vg,z5).call(a,i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){var s;return n||(n=da.defaultPath),$(s=c0,vg,z5).call(s,t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,s,i){var o;n==null&&(n=""),s==null&&(s=da.defaultPath),i==null&&(i=ZX.LangEn.wordlist());let a=QX.Mnemonic.fromPhrase(t,n,i);return $(o=c0,vg,z5).call(o,a.computeSeed(),a).derivePath(s)}static fromSeed(t){var n;return $(n=c0,vg,z5).call(n,t,null)}},pE=c0;W5=new WeakSet,ZM=function(){let t={address:this.address,privateKey:this.privateKey},n=this.mnemonic;return this.path&&n&&n.wordlist.locale==="en"&&n.password===""&&(t.mnemonic={path:this.path,locale:"en",entropy:n.entropy}),t},vg=new WeakSet,z5=function(t,n){(0,Je.assertArgument)((0,Je.isBytesLike)(t),"invalid seed","seed","[REDACTED]");let s=(0,Je.getBytes)(t,"seed");(0,Je.assertArgument)(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");let i=(0,Je.getBytes)((0,vo.computeHmac)("sha512",M4e,s)),a=new vo.SigningKey((0,Je.hexlify)(i.slice(0,32)));return new c0(u0,a,"0x00000000",(0,Je.hexlify)(i.slice(32)),"m",0,0,n,null)},I(pE,vg);da.HDNodeWallet=pE;var jh=class extends R4e.VoidSigner{constructor(t,n,s,i,a,o,c,u,f){super(n,f);N(this,"publicKey");N(this,"fingerprint");N(this,"parentFingerprint");N(this,"chainCode");N(this,"path");N(this,"index");N(this,"depth");(0,Je.assertPrivate)(t,u0,"HDNodeVoidWallet"),(0,Je.defineProperties)(this,{publicKey:s});let d=(0,Je.dataSlice)((0,vo.ripemd160)((0,vo.sha256)(s)),0,4);(0,Je.defineProperties)(this,{publicKey:s,fingerprint:d,parentFingerprint:i,chainCode:a,path:o,index:c,depth:u})}connect(t){return new jh(u0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return(0,Je.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),JM((0,Je.concat)(["0x0488B21E",gE(this.depth,1),this.parentFingerprint,gE(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){let n=(0,Je.getNumber)(t,"index");(0,Je.assertArgument)(n<=4294967295,"invalid index","index",n);let s=this.path;s&&(s+="/"+(n&~f0),n&f0&&(s+="'"));let{IR:i,IL:a}=eee(n,this.chainCode,this.publicKey,null),o=vo.SigningKey.addPoints(a,this.publicKey,!0),c=(0,XX.computeAddress)(o);return new jh(u0,c,o,this.fingerprint,(0,Je.hexlify)(i),s,n,this.depth+1,this.provider)}derivePath(t){return tee(this,t)}};da.HDNodeVoidWallet=jh;function U4e(r){let e=(0,Je.getNumber)(r,"index");return(0,Je.assertArgument)(e>=0&&e<f0,"invalid account index","index",e),`m/44'/60'/${e}'/0/0`}da.getAccountPath=U4e;function F4e(r){let e=(0,Je.getNumber)(r,"index");return(0,Je.assertArgument)(e>=0&&e<f0,"invalid account index","index",e),`m/44'/60'/0'/0/${e}`}da.getIndexedAccountPath=F4e});var XM=R(Km=>{"use strict";b();p();Object.defineProperty(Km,"__esModule",{value:!0});Km.decryptCrowdsaleJson=Km.isCrowdsaleJson=void 0;var ree=WM(),q4e=Ks(),D4e=si(),H4e=Wf(),YM=ke(),xE=$M();function K4e(r){try{if(JSON.parse(r).encseed)return!0}catch{}return!1}Km.isCrowdsaleJson=K4e;function G4e(r,e){let t=JSON.parse(r),n=(0,xE.getPassword)(e),s=(0,q4e.getAddress)((0,xE.spelunk)(t,"ethaddr:string!")),i=(0,xE.looseArrayify)((0,xE.spelunk)(t,"encseed:string!"));(0,YM.assertArgument)(i&&i.length%16===0,"invalid encseed","json",r);let a=(0,YM.getBytes)((0,D4e.pbkdf2)(n,n,2e3,32,"sha256")).slice(0,16),o=i.slice(0,16),c=i.slice(16),u=new ree.CBC(a,o),f=(0,ree.pkcs7Strip)((0,YM.getBytes)(u.decrypt(c))),d="";for(let g=0;g<f.length;g++)d+=String.fromCharCode(f[g]);return{address:s,privateKey:(0,H4e.id)(d)}}Km.decryptCrowdsaleJson=G4e});var see=R(wE=>{"use strict";b();p();Object.defineProperty(wE,"__esModule",{value:!0});wE.Wallet=void 0;var V4e=si(),eC=ke(),z4e=YA(),tC=QM(),yE=XM(),Gm=bE(),W4e=iE();function nee(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}var $5,rC,Vm=class extends z4e.BaseWallet{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new V4e.SigningKey(e):e;super(n,t)}connect(e){return new Vm(this.signingKey,e)}async encrypt(e,t){let n={address:this.address,privateKey:this.privateKey};return await(0,Gm.encryptKeystoreJson)(n,e,{progressCallback:t})}encryptSync(e){let t={address:this.address,privateKey:this.privateKey};return(0,Gm.encryptKeystoreJsonSync)(t,e)}static async fromEncryptedJson(e,t,n){var i;let s=null;return(0,Gm.isKeystoreJson)(e)?s=await(0,Gm.decryptKeystoreJson)(e,t,n):(0,yE.isCrowdsaleJson)(e)&&(n&&(n(0),await nee(0)),s=(0,yE.decryptCrowdsaleJson)(e,t),n&&(n(1),await nee(0))),$(i=Vm,$5,rC).call(i,s)}static fromEncryptedJsonSync(e,t){var s;let n=null;return(0,Gm.isKeystoreJson)(e)?n=(0,Gm.decryptKeystoreJsonSync)(e,t):(0,yE.isCrowdsaleJson)(e)?n=(0,yE.decryptCrowdsaleJson)(e,t):(0,eC.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),$(s=Vm,$5,rC).call(s,n)}static createRandom(e){let t=tC.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){let n=tC.HDNodeWallet.fromPhrase(e);return t?n.connect(t):n}},mE=Vm;$5=new WeakSet,rC=function(e){if((0,eC.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){let n=W4e.Mnemonic.fromEntropy(e.mnemonic.entropy),s=tC.HDNodeWallet.fromMnemonic(n,e.mnemonic.path);if(s.address===e.address&&s.privateKey===e.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}let t=new Vm(e.privateKey);return(0,eC.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t},I(mE,$5);wE.Wallet=mE});var aee=R(gr=>{"use strict";b();p();Object.defineProperty(gr,"__esModule",{value:!0});gr.Wallet=gr.Mnemonic=gr.encryptKeystoreJsonSync=gr.encryptKeystoreJson=gr.decryptKeystoreJson=gr.decryptKeystoreJsonSync=gr.isKeystoreJson=gr.decryptCrowdsaleJson=gr.isCrowdsaleJson=gr.HDNodeVoidWallet=gr.HDNodeWallet=gr.getIndexedAccountPath=gr.getAccountPath=gr.defaultPath=gr.BaseWallet=void 0;var $4e=YA();Object.defineProperty(gr,"BaseWallet",{enumerable:!0,get:function(){return $4e.BaseWallet}});var J5=QM();Object.defineProperty(gr,"defaultPath",{enumerable:!0,get:function(){return J5.defaultPath}});Object.defineProperty(gr,"getAccountPath",{enumerable:!0,get:function(){return J5.getAccountPath}});Object.defineProperty(gr,"getIndexedAccountPath",{enumerable:!0,get:function(){return J5.getIndexedAccountPath}});Object.defineProperty(gr,"HDNodeWallet",{enumerable:!0,get:function(){return J5.HDNodeWallet}});Object.defineProperty(gr,"HDNodeVoidWallet",{enumerable:!0,get:function(){return J5.HDNodeVoidWallet}});var iee=XM();Object.defineProperty(gr,"isCrowdsaleJson",{enumerable:!0,get:function(){return iee.isCrowdsaleJson}});Object.defineProperty(gr,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return iee.decryptCrowdsaleJson}});var Z5=bE();Object.defineProperty(gr,"isKeystoreJson",{enumerable:!0,get:function(){return Z5.isKeystoreJson}});Object.defineProperty(gr,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Z5.decryptKeystoreJsonSync}});Object.defineProperty(gr,"decryptKeystoreJson",{enumerable:!0,get:function(){return Z5.decryptKeystoreJson}});Object.defineProperty(gr,"encryptKeystoreJson",{enumerable:!0,get:function(){return Z5.encryptKeystoreJson}});Object.defineProperty(gr,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Z5.encryptKeystoreJsonSync}});var J4e=iE();Object.defineProperty(gr,"Mnemonic",{enumerable:!0,get:function(){return J4e.Mnemonic}});var Z4e=see();Object.defineProperty(gr,"Wallet",{enumerable:!0,get:function(){return Z4e.Wallet}})});var oee=R(vE=>{"use strict";b();p();Object.defineProperty(vE,"__esModule",{value:!0});vE.decodeBits=void 0;var Q4e=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function Y4e(r,e){let t=(1<<r)-1,n=[],s=0,i=0,a=0;for(let o=0;o<e.length;o++)for(s=s<<6|Q4e.indexOf(e[o]),i+=6;i>=r;){let c=s>>i-r;s&=(1<<i-r)-1,i-=r,c===0?a+=t:(n.push(c+a),a=0)}return n}vE.decodeBits=Y4e});var cee=R(PE=>{"use strict";b();p();Object.defineProperty(PE,"__esModule",{value:!0});PE.decodeOwlA=void 0;var X4e=ke(),eve=oee(),tve=kM();function rve(r,e){let t=(0,tve.decodeOwl)(r).join(",");return e.split(/,/g).forEach(n=>{let s=n.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,X4e.assertArgument)(s!==null,"internal error parsing accents","accents",e);let i=0,a=(0,eve.decodeBits)(parseInt(s[3]),s[4]),o=parseInt(s[2]),c=new RegExp(`([${s[1]}])`,"g");t=t.replace(c,(u,f)=>(--a[i]===0&&(f=String.fromCharCode(f.charCodeAt(0),o),i++),f))}),t.split(",")}PE.decodeOwlA=rve});var uee=R(_E=>{"use strict";b();p();Object.defineProperty(_E,"__esModule",{value:!0});_E.WordlistOwlA=void 0;var nve=rE(),sve=cee(),Q5,nC=class extends nve.WordlistOwl{constructor(t,n,s,i){super(t,n,i);I(this,Q5,void 0);_(this,Q5,s)}get _accent(){return l(this,Q5)}_decodeWords(){return(0,sve.decodeOwlA)(this._data,this._accent)}};Q5=new WeakMap;_E.WordlistOwlA=nC});var fee=R(AE=>{"use strict";b();p();Object.defineProperty(AE,"__esModule",{value:!0});AE.wordlists=void 0;var ive=j5();AE.wordlists={en:ive.LangEn.wordlist()}});var dee=R(_c=>{"use strict";b();p();Object.defineProperty(_c,"__esModule",{value:!0});_c.wordlists=_c.WordlistOwlA=_c.WordlistOwl=_c.LangEn=_c.Wordlist=void 0;var ave=IM();Object.defineProperty(_c,"Wordlist",{enumerable:!0,get:function(){return ave.Wordlist}});var ove=j5();Object.defineProperty(_c,"LangEn",{enumerable:!0,get:function(){return ove.LangEn}});var cve=rE();Object.defineProperty(_c,"WordlistOwl",{enumerable:!0,get:function(){return cve.WordlistOwl}});var uve=uee();Object.defineProperty(_c,"WordlistOwlA",{enumerable:!0,get:function(){return uve.WordlistOwlA}});var fve=fee();Object.defineProperty(_c,"wordlists",{enumerable:!0,get:function(){return fve.wordlists}})});var sC=R(L=>{"use strict";b();p();Object.defineProperty(L,"__esModule",{value:!0});L.ripemd160=L.keccak256=L.randomBytes=L.computeHmac=L.UndecodedEventLog=L.EventLog=L.ContractUnknownEventPayload=L.ContractTransactionResponse=L.ContractTransactionReceipt=L.ContractEventPayload=L.ContractFactory=L.Contract=L.BaseContract=L.MessagePrefix=L.EtherSymbol=L.ZeroHash=L.N=L.MaxInt256=L.MinInt256=L.MaxUint256=L.WeiPerEther=L.ZeroAddress=L.resolveAddress=L.isAddress=L.isAddressable=L.getCreate2Address=L.getCreateAddress=L.getIcapAddress=L.getAddress=L.Typed=L.TransactionDescription=L.Result=L.LogDescription=L.Interface=L.Indexed=L.ErrorDescription=L.checkResultErrors=L.StructFragment=L.ParamType=L.NamedFragment=L.FunctionFragment=L.FallbackFragment=L.Fragment=L.EventFragment=L.ErrorFragment=L.ConstructorFragment=L.AbiCoder=L.encodeBytes32String=L.decodeBytes32String=L.version=void 0;L.EnsPlugin=L.Network=L.EnsResolver=L.WebSocketProvider=L.SocketProvider=L.IpcSocketProvider=L.QuickNodeProvider=L.PocketProvider=L.InfuraWebSocketProvider=L.InfuraProvider=L.EtherscanProvider=L.CloudflareProvider=L.ChainstackProvider=L.AnkrProvider=L.AlchemyProvider=L.BrowserProvider=L.JsonRpcSigner=L.JsonRpcProvider=L.JsonRpcApiProvider=L.FallbackProvider=L.AbstractProvider=L.VoidSigner=L.NonceManager=L.AbstractSigner=L.TransactionResponse=L.TransactionReceipt=L.Log=L.FeeData=L.Block=L.getDefaultProvider=L.verifyTypedData=L.TypedDataEncoder=L.solidityPackedSha256=L.solidityPackedKeccak256=L.solidityPacked=L.verifyMessage=L.hashMessage=L.dnsEncode=L.namehash=L.isValidName=L.ensNormalize=L.id=L.SigningKey=L.Signature=L.lock=L.scryptSync=L.scrypt=L.pbkdf2=L.sha512=L.sha256=void 0;L.getUint=L.getNumber=L.getBigInt=L.FixedNumber=L.FetchCancelSignal=L.FetchResponse=L.FetchRequest=L.EventPayload=L.isError=L.isCallException=L.makeError=L.assertPrivate=L.assertNormalize=L.assertArgumentCount=L.assertArgument=L.assert=L.resolveProperties=L.defineProperties=L.zeroPadValue=L.zeroPadBytes=L.stripZerosLeft=L.isBytesLike=L.isHexString=L.hexlify=L.getBytesCopy=L.getBytes=L.dataSlice=L.dataLength=L.concat=L.encodeBase64=L.decodeBase64=L.encodeBase58=L.decodeBase58=L.Transaction=L.recoverAddress=L.computeAddress=L.accessListify=L.showThrottleMessage=L.copyRequest=L.UnmanagedSubscriber=L.SocketSubscriber=L.SocketPendingSubscriber=L.SocketEventSubscriber=L.SocketBlockSubscriber=L.MulticoinProviderPlugin=L.NetworkPlugin=L.GasCostPlugin=L.FetchUrlFeeDataNetworkPlugin=L.FeeDataNetworkPlugin=L.EtherscanPlugin=void 0;L.wordlists=L.WordlistOwlA=L.WordlistOwl=L.LangEn=L.Wordlist=L.encryptKeystoreJsonSync=L.encryptKeystoreJson=L.decryptKeystoreJson=L.decryptKeystoreJsonSync=L.decryptCrowdsaleJson=L.isKeystoreJson=L.isCrowdsaleJson=L.getIndexedAccountPath=L.getAccountPath=L.defaultPath=L.Wallet=L.HDNodeVoidWallet=L.HDNodeWallet=L.BaseWallet=L.Mnemonic=L.uuidV4=L.encodeRlp=L.decodeRlp=L.Utf8ErrorFuncs=L.toUtf8String=L.toUtf8CodePoints=L.toUtf8Bytes=L.parseUnits=L.formatUnits=L.parseEther=L.formatEther=L.mask=L.toTwos=L.fromTwos=L.toQuantity=L.toNumber=L.toBeHex=L.toBigInt=L.toBeArray=void 0;var dve=H9();Object.defineProperty(L,"version",{enumerable:!0,get:function(){return dve.version}});var Ss=H1();Object.defineProperty(L,"decodeBytes32String",{enumerable:!0,get:function(){return Ss.decodeBytes32String}});Object.defineProperty(L,"encodeBytes32String",{enumerable:!0,get:function(){return Ss.encodeBytes32String}});Object.defineProperty(L,"AbiCoder",{enumerable:!0,get:function(){return Ss.AbiCoder}});Object.defineProperty(L,"ConstructorFragment",{enumerable:!0,get:function(){return Ss.ConstructorFragment}});Object.defineProperty(L,"ErrorFragment",{enumerable:!0,get:function(){return Ss.ErrorFragment}});Object.defineProperty(L,"EventFragment",{enumerable:!0,get:function(){return Ss.EventFragment}});Object.defineProperty(L,"Fragment",{enumerable:!0,get:function(){return Ss.Fragment}});Object.defineProperty(L,"FallbackFragment",{enumerable:!0,get:function(){return Ss.FallbackFragment}});Object.defineProperty(L,"FunctionFragment",{enumerable:!0,get:function(){return Ss.FunctionFragment}});Object.defineProperty(L,"NamedFragment",{enumerable:!0,get:function(){return Ss.NamedFragment}});Object.defineProperty(L,"ParamType",{enumerable:!0,get:function(){return Ss.ParamType}});Object.defineProperty(L,"StructFragment",{enumerable:!0,get:function(){return Ss.StructFragment}});Object.defineProperty(L,"checkResultErrors",{enumerable:!0,get:function(){return Ss.checkResultErrors}});Object.defineProperty(L,"ErrorDescription",{enumerable:!0,get:function(){return Ss.ErrorDescription}});Object.defineProperty(L,"Indexed",{enumerable:!0,get:function(){return Ss.Indexed}});Object.defineProperty(L,"Interface",{enumerable:!0,get:function(){return Ss.Interface}});Object.defineProperty(L,"LogDescription",{enumerable:!0,get:function(){return Ss.LogDescription}});Object.defineProperty(L,"Result",{enumerable:!0,get:function(){return Ss.Result}});Object.defineProperty(L,"TransactionDescription",{enumerable:!0,get:function(){return Ss.TransactionDescription}});Object.defineProperty(L,"Typed",{enumerable:!0,get:function(){return Ss.Typed}});var Pg=Ks();Object.defineProperty(L,"getAddress",{enumerable:!0,get:function(){return Pg.getAddress}});Object.defineProperty(L,"getIcapAddress",{enumerable:!0,get:function(){return Pg.getIcapAddress}});Object.defineProperty(L,"getCreateAddress",{enumerable:!0,get:function(){return Pg.getCreateAddress}});Object.defineProperty(L,"getCreate2Address",{enumerable:!0,get:function(){return Pg.getCreate2Address}});Object.defineProperty(L,"isAddressable",{enumerable:!0,get:function(){return Pg.isAddressable}});Object.defineProperty(L,"isAddress",{enumerable:!0,get:function(){return Pg.isAddress}});Object.defineProperty(L,"resolveAddress",{enumerable:!0,get:function(){return Pg.resolveAddress}});var Ed=a1();Object.defineProperty(L,"ZeroAddress",{enumerable:!0,get:function(){return Ed.ZeroAddress}});Object.defineProperty(L,"WeiPerEther",{enumerable:!0,get:function(){return Ed.WeiPerEther}});Object.defineProperty(L,"MaxUint256",{enumerable:!0,get:function(){return Ed.MaxUint256}});Object.defineProperty(L,"MinInt256",{enumerable:!0,get:function(){return Ed.MinInt256}});Object.defineProperty(L,"MaxInt256",{enumerable:!0,get:function(){return Ed.MaxInt256}});Object.defineProperty(L,"N",{enumerable:!0,get:function(){return Ed.N}});Object.defineProperty(L,"ZeroHash",{enumerable:!0,get:function(){return Ed.ZeroHash}});Object.defineProperty(L,"EtherSymbol",{enumerable:!0,get:function(){return Ed.EtherSymbol}});Object.defineProperty(L,"MessagePrefix",{enumerable:!0,get:function(){return Ed.MessagePrefix}});var Sd=X8();Object.defineProperty(L,"BaseContract",{enumerable:!0,get:function(){return Sd.BaseContract}});Object.defineProperty(L,"Contract",{enumerable:!0,get:function(){return Sd.Contract}});Object.defineProperty(L,"ContractFactory",{enumerable:!0,get:function(){return Sd.ContractFactory}});Object.defineProperty(L,"ContractEventPayload",{enumerable:!0,get:function(){return Sd.ContractEventPayload}});Object.defineProperty(L,"ContractTransactionReceipt",{enumerable:!0,get:function(){return Sd.ContractTransactionReceipt}});Object.defineProperty(L,"ContractTransactionResponse",{enumerable:!0,get:function(){return Sd.ContractTransactionResponse}});Object.defineProperty(L,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return Sd.ContractUnknownEventPayload}});Object.defineProperty(L,"EventLog",{enumerable:!0,get:function(){return Sd.EventLog}});Object.defineProperty(L,"UndecodedEventLog",{enumerable:!0,get:function(){return Sd.UndecodedEventLog}});var Ac=si();Object.defineProperty(L,"computeHmac",{enumerable:!0,get:function(){return Ac.computeHmac}});Object.defineProperty(L,"randomBytes",{enumerable:!0,get:function(){return Ac.randomBytes}});Object.defineProperty(L,"keccak256",{enumerable:!0,get:function(){return Ac.keccak256}});Object.defineProperty(L,"ripemd160",{enumerable:!0,get:function(){return Ac.ripemd160}});Object.defineProperty(L,"sha256",{enumerable:!0,get:function(){return Ac.sha256}});Object.defineProperty(L,"sha512",{enumerable:!0,get:function(){return Ac.sha512}});Object.defineProperty(L,"pbkdf2",{enumerable:!0,get:function(){return Ac.pbkdf2}});Object.defineProperty(L,"scrypt",{enumerable:!0,get:function(){return Ac.scrypt}});Object.defineProperty(L,"scryptSync",{enumerable:!0,get:function(){return Ac.scryptSync}});Object.defineProperty(L,"lock",{enumerable:!0,get:function(){return Ac.lock}});Object.defineProperty(L,"Signature",{enumerable:!0,get:function(){return Ac.Signature}});Object.defineProperty(L,"SigningKey",{enumerable:!0,get:function(){return Ac.SigningKey}});var Ec=Wf();Object.defineProperty(L,"id",{enumerable:!0,get:function(){return Ec.id}});Object.defineProperty(L,"ensNormalize",{enumerable:!0,get:function(){return Ec.ensNormalize}});Object.defineProperty(L,"isValidName",{enumerable:!0,get:function(){return Ec.isValidName}});Object.defineProperty(L,"namehash",{enumerable:!0,get:function(){return Ec.namehash}});Object.defineProperty(L,"dnsEncode",{enumerable:!0,get:function(){return Ec.dnsEncode}});Object.defineProperty(L,"hashMessage",{enumerable:!0,get:function(){return Ec.hashMessage}});Object.defineProperty(L,"verifyMessage",{enumerable:!0,get:function(){return Ec.verifyMessage}});Object.defineProperty(L,"solidityPacked",{enumerable:!0,get:function(){return Ec.solidityPacked}});Object.defineProperty(L,"solidityPackedKeccak256",{enumerable:!0,get:function(){return Ec.solidityPackedKeccak256}});Object.defineProperty(L,"solidityPackedSha256",{enumerable:!0,get:function(){return Ec.solidityPackedSha256}});Object.defineProperty(L,"TypedDataEncoder",{enumerable:!0,get:function(){return Ec.TypedDataEncoder}});Object.defineProperty(L,"verifyTypedData",{enumerable:!0,get:function(){return Ec.verifyTypedData}});var vt=ZA();Object.defineProperty(L,"getDefaultProvider",{enumerable:!0,get:function(){return vt.getDefaultProvider}});Object.defineProperty(L,"Block",{enumerable:!0,get:function(){return vt.Block}});Object.defineProperty(L,"FeeData",{enumerable:!0,get:function(){return vt.FeeData}});Object.defineProperty(L,"Log",{enumerable:!0,get:function(){return vt.Log}});Object.defineProperty(L,"TransactionReceipt",{enumerable:!0,get:function(){return vt.TransactionReceipt}});Object.defineProperty(L,"TransactionResponse",{enumerable:!0,get:function(){return vt.TransactionResponse}});Object.defineProperty(L,"AbstractSigner",{enumerable:!0,get:function(){return vt.AbstractSigner}});Object.defineProperty(L,"NonceManager",{enumerable:!0,get:function(){return vt.NonceManager}});Object.defineProperty(L,"VoidSigner",{enumerable:!0,get:function(){return vt.VoidSigner}});Object.defineProperty(L,"AbstractProvider",{enumerable:!0,get:function(){return vt.AbstractProvider}});Object.defineProperty(L,"FallbackProvider",{enumerable:!0,get:function(){return vt.FallbackProvider}});Object.defineProperty(L,"JsonRpcApiProvider",{enumerable:!0,get:function(){return vt.JsonRpcApiProvider}});Object.defineProperty(L,"JsonRpcProvider",{enumerable:!0,get:function(){return vt.JsonRpcProvider}});Object.defineProperty(L,"JsonRpcSigner",{enumerable:!0,get:function(){return vt.JsonRpcSigner}});Object.defineProperty(L,"BrowserProvider",{enumerable:!0,get:function(){return vt.BrowserProvider}});Object.defineProperty(L,"AlchemyProvider",{enumerable:!0,get:function(){return vt.AlchemyProvider}});Object.defineProperty(L,"AnkrProvider",{enumerable:!0,get:function(){return vt.AnkrProvider}});Object.defineProperty(L,"ChainstackProvider",{enumerable:!0,get:function(){return vt.ChainstackProvider}});Object.defineProperty(L,"CloudflareProvider",{enumerable:!0,get:function(){return vt.CloudflareProvider}});Object.defineProperty(L,"EtherscanProvider",{enumerable:!0,get:function(){return vt.EtherscanProvider}});Object.defineProperty(L,"InfuraProvider",{enumerable:!0,get:function(){return vt.InfuraProvider}});Object.defineProperty(L,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return vt.InfuraWebSocketProvider}});Object.defineProperty(L,"PocketProvider",{enumerable:!0,get:function(){return vt.PocketProvider}});Object.defineProperty(L,"QuickNodeProvider",{enumerable:!0,get:function(){return vt.QuickNodeProvider}});Object.defineProperty(L,"IpcSocketProvider",{enumerable:!0,get:function(){return vt.IpcSocketProvider}});Object.defineProperty(L,"SocketProvider",{enumerable:!0,get:function(){return vt.SocketProvider}});Object.defineProperty(L,"WebSocketProvider",{enumerable:!0,get:function(){return vt.WebSocketProvider}});Object.defineProperty(L,"EnsResolver",{enumerable:!0,get:function(){return vt.EnsResolver}});Object.defineProperty(L,"Network",{enumerable:!0,get:function(){return vt.Network}});Object.defineProperty(L,"EnsPlugin",{enumerable:!0,get:function(){return vt.EnsPlugin}});Object.defineProperty(L,"EtherscanPlugin",{enumerable:!0,get:function(){return vt.EtherscanPlugin}});Object.defineProperty(L,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return vt.FeeDataNetworkPlugin}});Object.defineProperty(L,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return vt.FetchUrlFeeDataNetworkPlugin}});Object.defineProperty(L,"GasCostPlugin",{enumerable:!0,get:function(){return vt.GasCostPlugin}});Object.defineProperty(L,"NetworkPlugin",{enumerable:!0,get:function(){return vt.NetworkPlugin}});Object.defineProperty(L,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return vt.MulticoinProviderPlugin}});Object.defineProperty(L,"SocketBlockSubscriber",{enumerable:!0,get:function(){return vt.SocketBlockSubscriber}});Object.defineProperty(L,"SocketEventSubscriber",{enumerable:!0,get:function(){return vt.SocketEventSubscriber}});Object.defineProperty(L,"SocketPendingSubscriber",{enumerable:!0,get:function(){return vt.SocketPendingSubscriber}});Object.defineProperty(L,"SocketSubscriber",{enumerable:!0,get:function(){return vt.SocketSubscriber}});Object.defineProperty(L,"UnmanagedSubscriber",{enumerable:!0,get:function(){return vt.UnmanagedSubscriber}});Object.defineProperty(L,"copyRequest",{enumerable:!0,get:function(){return vt.copyRequest}});Object.defineProperty(L,"showThrottleMessage",{enumerable:!0,get:function(){return vt.showThrottleMessage}});var EE=Ma();Object.defineProperty(L,"accessListify",{enumerable:!0,get:function(){return EE.accessListify}});Object.defineProperty(L,"computeAddress",{enumerable:!0,get:function(){return EE.computeAddress}});Object.defineProperty(L,"recoverAddress",{enumerable:!0,get:function(){return EE.recoverAddress}});Object.defineProperty(L,"Transaction",{enumerable:!0,get:function(){return EE.Transaction}});var Xe=ke();Object.defineProperty(L,"decodeBase58",{enumerable:!0,get:function(){return Xe.decodeBase58}});Object.defineProperty(L,"encodeBase58",{enumerable:!0,get:function(){return Xe.encodeBase58}});Object.defineProperty(L,"decodeBase64",{enumerable:!0,get:function(){return Xe.decodeBase64}});Object.defineProperty(L,"encodeBase64",{enumerable:!0,get:function(){return Xe.encodeBase64}});Object.defineProperty(L,"concat",{enumerable:!0,get:function(){return Xe.concat}});Object.defineProperty(L,"dataLength",{enumerable:!0,get:function(){return Xe.dataLength}});Object.defineProperty(L,"dataSlice",{enumerable:!0,get:function(){return Xe.dataSlice}});Object.defineProperty(L,"getBytes",{enumerable:!0,get:function(){return Xe.getBytes}});Object.defineProperty(L,"getBytesCopy",{enumerable:!0,get:function(){return Xe.getBytesCopy}});Object.defineProperty(L,"hexlify",{enumerable:!0,get:function(){return Xe.hexlify}});Object.defineProperty(L,"isHexString",{enumerable:!0,get:function(){return Xe.isHexString}});Object.defineProperty(L,"isBytesLike",{enumerable:!0,get:function(){return Xe.isBytesLike}});Object.defineProperty(L,"stripZerosLeft",{enumerable:!0,get:function(){return Xe.stripZerosLeft}});Object.defineProperty(L,"zeroPadBytes",{enumerable:!0,get:function(){return Xe.zeroPadBytes}});Object.defineProperty(L,"zeroPadValue",{enumerable:!0,get:function(){return Xe.zeroPadValue}});Object.defineProperty(L,"defineProperties",{enumerable:!0,get:function(){return Xe.defineProperties}});Object.defineProperty(L,"resolveProperties",{enumerable:!0,get:function(){return Xe.resolveProperties}});Object.defineProperty(L,"assert",{enumerable:!0,get:function(){return Xe.assert}});Object.defineProperty(L,"assertArgument",{enumerable:!0,get:function(){return Xe.assertArgument}});Object.defineProperty(L,"assertArgumentCount",{enumerable:!0,get:function(){return Xe.assertArgumentCount}});Object.defineProperty(L,"assertNormalize",{enumerable:!0,get:function(){return Xe.assertNormalize}});Object.defineProperty(L,"assertPrivate",{enumerable:!0,get:function(){return Xe.assertPrivate}});Object.defineProperty(L,"makeError",{enumerable:!0,get:function(){return Xe.makeError}});Object.defineProperty(L,"isCallException",{enumerable:!0,get:function(){return Xe.isCallException}});Object.defineProperty(L,"isError",{enumerable:!0,get:function(){return Xe.isError}});Object.defineProperty(L,"EventPayload",{enumerable:!0,get:function(){return Xe.EventPayload}});Object.defineProperty(L,"FetchRequest",{enumerable:!0,get:function(){return Xe.FetchRequest}});Object.defineProperty(L,"FetchResponse",{enumerable:!0,get:function(){return Xe.FetchResponse}});Object.defineProperty(L,"FetchCancelSignal",{enumerable:!0,get:function(){return Xe.FetchCancelSignal}});Object.defineProperty(L,"FixedNumber",{enumerable:!0,get:function(){return Xe.FixedNumber}});Object.defineProperty(L,"getBigInt",{enumerable:!0,get:function(){return Xe.getBigInt}});Object.defineProperty(L,"getNumber",{enumerable:!0,get:function(){return Xe.getNumber}});Object.defineProperty(L,"getUint",{enumerable:!0,get:function(){return Xe.getUint}});Object.defineProperty(L,"toBeArray",{enumerable:!0,get:function(){return Xe.toBeArray}});Object.defineProperty(L,"toBigInt",{enumerable:!0,get:function(){return Xe.toBigInt}});Object.defineProperty(L,"toBeHex",{enumerable:!0,get:function(){return Xe.toBeHex}});Object.defineProperty(L,"toNumber",{enumerable:!0,get:function(){return Xe.toNumber}});Object.defineProperty(L,"toQuantity",{enumerable:!0,get:function(){return Xe.toQuantity}});Object.defineProperty(L,"fromTwos",{enumerable:!0,get:function(){return Xe.fromTwos}});Object.defineProperty(L,"toTwos",{enumerable:!0,get:function(){return Xe.toTwos}});Object.defineProperty(L,"mask",{enumerable:!0,get:function(){return Xe.mask}});Object.defineProperty(L,"formatEther",{enumerable:!0,get:function(){return Xe.formatEther}});Object.defineProperty(L,"parseEther",{enumerable:!0,get:function(){return Xe.parseEther}});Object.defineProperty(L,"formatUnits",{enumerable:!0,get:function(){return Xe.formatUnits}});Object.defineProperty(L,"parseUnits",{enumerable:!0,get:function(){return Xe.parseUnits}});Object.defineProperty(L,"toUtf8Bytes",{enumerable:!0,get:function(){return Xe.toUtf8Bytes}});Object.defineProperty(L,"toUtf8CodePoints",{enumerable:!0,get:function(){return Xe.toUtf8CodePoints}});Object.defineProperty(L,"toUtf8String",{enumerable:!0,get:function(){return Xe.toUtf8String}});Object.defineProperty(L,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return Xe.Utf8ErrorFuncs}});Object.defineProperty(L,"decodeRlp",{enumerable:!0,get:function(){return Xe.decodeRlp}});Object.defineProperty(L,"encodeRlp",{enumerable:!0,get:function(){return Xe.encodeRlp}});Object.defineProperty(L,"uuidV4",{enumerable:!0,get:function(){return Xe.uuidV4}});var la=aee();Object.defineProperty(L,"Mnemonic",{enumerable:!0,get:function(){return la.Mnemonic}});Object.defineProperty(L,"BaseWallet",{enumerable:!0,get:function(){return la.BaseWallet}});Object.defineProperty(L,"HDNodeWallet",{enumerable:!0,get:function(){return la.HDNodeWallet}});Object.defineProperty(L,"HDNodeVoidWallet",{enumerable:!0,get:function(){return la.HDNodeVoidWallet}});Object.defineProperty(L,"Wallet",{enumerable:!0,get:function(){return la.Wallet}});Object.defineProperty(L,"defaultPath",{enumerable:!0,get:function(){return la.defaultPath}});Object.defineProperty(L,"getAccountPath",{enumerable:!0,get:function(){return la.getAccountPath}});Object.defineProperty(L,"getIndexedAccountPath",{enumerable:!0,get:function(){return la.getIndexedAccountPath}});Object.defineProperty(L,"isCrowdsaleJson",{enumerable:!0,get:function(){return la.isCrowdsaleJson}});Object.defineProperty(L,"isKeystoreJson",{enumerable:!0,get:function(){return la.isKeystoreJson}});Object.defineProperty(L,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return la.decryptCrowdsaleJson}});Object.defineProperty(L,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return la.decryptKeystoreJsonSync}});Object.defineProperty(L,"decryptKeystoreJson",{enumerable:!0,get:function(){return la.decryptKeystoreJson}});Object.defineProperty(L,"encryptKeystoreJson",{enumerable:!0,get:function(){return la.encryptKeystoreJson}});Object.defineProperty(L,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return la.encryptKeystoreJsonSync}});var Y5=dee();Object.defineProperty(L,"Wordlist",{enumerable:!0,get:function(){return Y5.Wordlist}});Object.defineProperty(L,"LangEn",{enumerable:!0,get:function(){return Y5.LangEn}});Object.defineProperty(L,"WordlistOwl",{enumerable:!0,get:function(){return Y5.WordlistOwl}});Object.defineProperty(L,"WordlistOwlA",{enumerable:!0,get:function(){return Y5.WordlistOwlA}});Object.defineProperty(L,"wordlists",{enumerable:!0,get:function(){return Y5.wordlists}})});var iC=R(X5=>{"use strict";b();p();Object.defineProperty(X5,"__esModule",{value:!0});X5.ethers=void 0;var lee=Hz(),lve=lee.__importStar(sC());X5.ethers=lve;lee.__exportStar(sC(),X5)});var hee=R(oC=>{"use strict";b();p();Object.defineProperty(oC,"__esModule",{value:!0});oC.getRpcTxObject=xve;var hve=mB(),aC=c7(),bve=iC(),SE=(iu(),ao(su)),pve=["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"],gve=["from","to","data","input"];function xve(r){let e={},t;return(0,SE.each)(pve,n=>{!(0,SE.has)(r,n)||(r[n]=="0x"?t=(0,aC.hexValue)("0x"):t=(0,aC.hexValue)(hve.BigNumber.from(r[n])),n=="gasLimit"?e.gas=t:e[n]=t)}),(0,SE.each)(gve,n=>{if(!(0,SE.has)(r,n))return;let s=(0,aC.hexlify)(r[n]);e[n]=s,(n==="to"||n==="from")&&r[n]==="0x"&&(e[n]="0x0000000000000000000000000000000000000000")}),r.accessList&&(e.accessList=(0,bve.accessListify)(r.accessList)),e}});var yee=R(Xn=>{"use strict";b();p();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.parseKaia=Xn.formatKaia=Xn.parseKaiaUnits=Xn.formatKaiaUnits=Xn.parseUnits=Xn.formatUnits=void 0;Xn.formatKlayUnits=zm;Xn.parseKlayUnits=Wm;Xn.formatKlay=gee;Xn.parseKlay=xee;Xn.fromPeb=yve;Xn.toPeb=mve;Xn.fromKei=wve;Xn.toKei=vve;var TE=jce(),cC=(iu(),ao(su)),bee={peb:0,kpeb:3,mpeb:6,ston:9,gpeb:9,uklay:12,mklay:15,klay:18,kklay:21,Mklay:24,gklay:27,tklay:30,kei:0,gkei:9,kaia:18};function pee(r){if((0,cC.isString)(r)){let e=r.toLowerCase();return e=="mklay"&&r[0]=="m"?15:e=="mklay"&&r[0]=="M"?24:e in bee?bee[e]:void 0}}function zm(r,e){let t=pee(e);return t?(0,TE.formatUnits)(r,t):((0,cC.isString)(e)&&(e=e.toLowerCase()),(0,TE.formatUnits)(r,e))}function Wm(r,e){let t=pee(e);return t?(0,TE.parseUnits)(r,t):((0,cC.isString)(e)&&(e=e.toLowerCase()),(0,TE.parseUnits)(r,e))}function gee(r){return zm(r,18)}function xee(r){return Wm(r,18)}function yve(r,e){return zm(r,e)}function mve(r,e){return Wm(r,e).toString()}Xn.formatUnits=zm;Xn.parseUnits=Wm;Xn.formatKaiaUnits=zm;Xn.parseKaiaUnits=Wm;Xn.formatKaia=gee;Xn.parseKaia=xee;function wve(r,e){return zm(r,e)}function vve(r,e){return Wm(r,e).toString()}});var Sc=R(Po=>{"use strict";b();p();var Pve=Po&&Po.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),_g=Po&&Po.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Pve(e,r,t)};Object.defineProperty(Po,"__esModule",{value:!0});_g(FN(),Po);_g(Gw(),Po);_g(DN(),Po);_g(dz(),Po);_g(bz(),Po);_g(hee(),Po);_g(yee(),Po)});var vee=R(es=>{"use strict";b();p();Object.defineProperty(es,"__esModule",{value:!0});es.FieldTypeSignatureTuples=es.FieldTypeBool=es.FieldTypeUint256=es.FieldTypeUint64=es.FieldTypeUint32=es.FieldTypeUint8=es.FieldTypeNumberBits=es.FieldTypeBytes=es.FieldTypeAddress=es.FieldError=void 0;var _ve=wB(),mee=mB(),wee=Sc(),Ave=(iu(),ao(su)),uC=class extends Error{constructor(e,t,n){let s=`Cannot assign value '${n}' to field '${t}' of type '${e.constructor.name}'`;super(s),this.name="FieldError"}};es.FieldError=uC;es.FieldTypeAddress=new class{canonicalize(r){return r==="0x"?"0x":(0,_ve.getAddress)(r)}emptyValue(){return"0x"}};es.FieldTypeBytes=new class{canonicalize(r){return wee.HexStr.from(r)}emptyValue(){return"0x"}};var Ag=class{constructor(e){e||(e=256),this.maxBits=e,this.maxBN=mee.BigNumber.from(2).pow(e)}canonicalize(e){e==="0x"&&(e=0);let t=mee.BigNumber.from(e);if(t.gte(this.maxBN))throw new Error(`Number exceeds ${this.maxBits} bits`);return t.isZero()?"0x":t.toHexString()}emptyValue(){return"0x"}};es.FieldTypeNumberBits=Ag;es.FieldTypeUint8=new Ag(8);es.FieldTypeUint32=new Ag(32);es.FieldTypeUint64=new Ag(64);es.FieldTypeUint256=new Ag(256);es.FieldTypeBool=new class{canonicalize(r){return r==="0x01"||r==="0x"?r:r?"0x01":"0x"}emptyValue(){return"0x"}};es.FieldTypeSignatureTuples=new class{canonicalize(r){return(0,Ave.map)(r,wee.getSignatureTuple)}emptyValue(){return[]}}});var dC=R(Ga=>{"use strict";b();p();Object.defineProperty(Ga,"__esModule",{value:!0});Ga.decodeObjectFromRLP=Ga.GetHexlifyRLP=Ga.convertKeysToRLP=Ga.getWeightedPublicKeyRLP=void 0;var Mh=(iu(),ao(su)),In=FN(),fC=DN(),Hi=Gw(),Eve=r=>{if((0,Mh.isArray)(r)&&r.length==2){let e=r;return[Hi.HexStr.fromNumber(e[0]),(0,fC.getCompressedPublicKey)(e[1])]}else if((0,Mh.has)(r,"weight")&&(0,Mh.has)(r,"key")){let e=r;return[Hi.HexStr.fromNumber(e.weight),(0,fC.getCompressedPublicKey)(e.key)]}else throw new Error("Malformed WeightedPublicKeys")};Ga.getWeightedPublicKeyRLP=Eve;var Sve=({key:r,keys:e,type:t,threshold:n})=>{if((0,Mh.isArray)(e))switch(Number(t)){case In.AccountKeyType.WeightedMultiSig:return Hi.RLP.encode([Hi.HexStr.from(n),(0,Mh.map)(e,s=>(0,Ga.getWeightedPublicKeyRLP)(s))]);case In.AccountKeyType.RoleBased:return Hi.RLP.encode((0,Mh.map)(e,({key:s,keys:i,type:a,threshold:o})=>(0,Ga.GetHexlifyRLP)(a,(0,Ga.convertKeysToRLP)({type:a,key:s,keys:i,threshold:o}))))}else switch(Number(t)){case In.AccountKeyType.Fail:return"0x03c0";case In.AccountKeyType.Legacy:return"0x01c0";case In.AccountKeyType.Nil:return"0x80";case In.AccountKeyType.Public:return Hi.RLP.encode((0,fC.getCompressedPublicKey)(r))}throw new Error("Invalid account key type")};Ga.convertKeysToRLP=Sve;var Tve=(r,e)=>{switch(r){case In.AccountKeyType.RoleBased:return Hi.HexStr.concat(Hi.HexStr.from(In.AccountKeyType.RoleBased),e);case In.AccountKeyType.WeightedMultiSig:return Hi.HexStr.concat(Hi.HexStr.from(In.AccountKeyType.WeightedMultiSig),e);case In.AccountKeyType.Public:return Hi.HexStr.concat(Hi.HexStr.from(In.AccountKeyType.Public),e)}return e};Ga.GetHexlifyRLP=Tve;var Ove=r=>{switch(Hi.HexStr.toNumber(r.substring(0,4))){case In.AccountKeyType.RoleBased:{let t=Hi.RLP.decode("0x"+r.substring(4));return{type:In.AccountKeyType.RoleBased,keys:(0,Mh.map)(t,n=>(0,Ga.decodeObjectFromRLP)(n))}}case In.AccountKeyType.WeightedMultiSig:{let[t,n]=Hi.RLP.decode("0x"+r.substring(4));return{type:In.AccountKeyType.WeightedMultiSig,threshold:Number(t),keys:(0,Mh.map)(n,([s,i])=>({weight:Number(s),key:i}))}}case In.AccountKeyType.Public:return{type:In.AccountKeyType.Public,key:Hi.RLP.decode("0x"+String(r).substring(4))};case In.AccountKeyType.Nil:return{type:In.AccountKeyType.Nil,key:"0x80"};case In.AccountKeyType.Legacy:return{type:In.AccountKeyType.Legacy,key:"0x03c0"};case In.AccountKeyType.Fail:return{type:In.AccountKeyType.Fail,key:"0x03c0"}}throw new Error("Parse Account Key from RLP errors: Invalid Account key type!")};Ga.decodeObjectFromRLP=Ove});var Pee=R(d0=>{"use strict";b();p();Object.defineProperty(d0,"__esModule",{value:!0});d0.FieldTypeAccountKey=d0.FieldTypeAccountKeyList=d0.FieldTypeWeightedPublicKeys=d0.FieldTypeCompressedPubKey=void 0;var e4=Sc(),Td=(iu(),ao(su)),lC=dC();d0.FieldTypeCompressedPubKey=new class{canonicalize(r){return r}emptyValue(){return"0x000000000000000000000000000000000000000000000000000000000000000000"}};d0.FieldTypeWeightedPublicKeys=new class{canonicalize(r){if(!(0,Td.isArray)(r))throw new Error("Malformed WeightedPublicKeys");return(0,Td.map)(r,e=>{if((0,Td.isArray)(e)&&e.length==2){let t=e;return{weight:t[0],key:(0,e4.getCompressedPublicKey)(t[1])}}return{weight:e.weight,key:(0,e4.getCompressedPublicKey)(e.key)}})}emptyValue(){return[]}};d0.FieldTypeAccountKeyList=new class{canonicalize(r){if(!(0,Td.isArray)(r))throw new Error("Malformed RoleBasedKeys");return(0,Td.map)(r,e=>{let t=(0,Td.cloneDeep)(e);if((0,Td.isString)(t)&&e4.HexStr.isHex(t)&&(t=(0,lC.decodeObjectFromRLP)(t)),typeof t=="object"&&(0,Td.has)(t,"type")&&(0,e4.isEmbeddableAccountKeyType)(Number(t.type)))return t;throw new Error(`AccountKeyType ${t?.type} cannot be inside an AccountKeyRoleBased`)})}emptyValue(){return[]}};d0.FieldTypeAccountKey=new class{canonicalize(r){if((0,Td.isString)(r)&&e4.HexStr.isHex(r))return r;{let e=(0,lC.convertKeysToRLP)(r);return(0,lC.GetHexlifyRLP)(r.type,e)}}emptyValue(){return"0x80"}}});var _ee=R(Jm=>{"use strict";b();p();Object.defineProperty(Jm,"__esModule",{value:!0});Jm.FieldSetFactory=Jm.FieldSet=void 0;var OE=(iu(),ao(su)),$m=Sc(),BE=class{constructor(){this.type=-1,this.typeName="",this.fieldTypes={},this.fields={},this.type=this._static.type,this.typeName=this._static.typeName,this.fieldTypes=this._static.fieldTypes}get _static(){return this.constructor}setFields(e){this.fields={},(0,OE.forOwn)(this.fieldTypes,(t,n)=>{if(e[n]===void 0){this.fields[n]=null;return}try{this.fields[n]=t.canonicalize(e[n])}catch(s){throw new Error(`Cannot set field '${n}' to '${JSON.stringify(e[n])}': ${s}`)}})}setFieldsFromArray(e,t){this.fields={};for(let n=0;n<t.length;n++){let s=e[n],i=this.fieldTypes[s];if(!i)throw new Error(`Unknown field '${s}' for '${this.typeName}' (type ${this.type})`);try{this.fields[s]=i.canonicalize(t[n])}catch(a){throw new Error(`Cannot set field '${s}' to '${JSON.stringify(t[n])}': ${a}`)}}}getField(e){let t=this.fields[e];if(t==null)throw new Error(`Missing field '${e}' for '${this.typeName}' (type ${this.type})`);return t}getFields(e){return(0,OE.map)(e,t=>this.getField(t))}toObject(){return this.fields}throwTypeError(e){throw new Error(`${e} for '${this.typeName}' (type ${$m.HexStr.fromNumber(this.type)})`)}};Jm.FieldSet=BE;BE.type=-1;var hC=class{constructor(e){this.registry={},this.requiredFields=e||[]}add(e){let t=e.type,n=e.fieldTypes;if(t===-1)throw new Error("Cannot register TypedFields: Missing type");if(this.registry[t])throw new Error(`Cannot register TypedFields: type ${t} already registered`);if(!n)throw new Error("Cannot register TypedFields: Missing fieldTypes");for(let s of this.requiredFields)if(!n[s])throw new Error(`Cannot register TypedFields: Missing required field '${s}'`);this.registry[t]=e}has(e){return $m.HexStr.isHex(e)?(0,OE.has)(this.registry,$m.HexStr.toNumber(e)):(0,OE.has)(this.registry,e)}lookup(e){if(!this.has(e))throw new Error(`Unsupported type '${$m.HexStr.fromNumber(e)}'`);return $m.HexStr.isHex(e)?this.registry[$m.HexStr.toNumber(e)]:this.registry[e]}fromObject(e){let t=this.lookup(e?.type),n=new t;return n.setFields(e),n}};Jm.FieldSetFactory=hC});var Bd=R(Od=>{"use strict";b();p();var Bve=Od&&Od.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),bC=Od&&Od.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Bve(e,r,t)};Object.defineProperty(Od,"__esModule",{value:!0});bC(vee(),Od);bC(Pee(),Od);bC(_ee(),Od)});var pC=R(Ki=>{"use strict";b();p();Object.defineProperty(Ki,"__esModule",{value:!0});Ki.AccountKeyRoleBased=Ki.AccountKeyWeightedMultiSig=Ki.AccountKeyFail=Ki.AccountKeyPublic=Ki.AccountKeyLegacy=Ki.AccountKeyNil=Ki.AccountKey=void 0;var Gu=Bd(),oi=Sc(),Tc=dC(),kd=class extends Gu.FieldSet{};Ki.AccountKey=kd;var Zm=class extends kd{toRLP(){return(0,Tc.convertKeysToRLP)({type:oi.AccountKeyType.Nil})}setFieldsFromRLP(e){e!=="0x80"&&this.throwTypeError(`Invalid RLP string '${e}'`),this.setFields({type:oi.AccountKeyType.Nil})}};Ki.AccountKeyNil=Zm;Zm.type=oi.AccountKeyType.Nil;Zm.typeName="AccountKeyNil";Zm.fieldTypes={type:Gu.FieldTypeUint8};var Qm=class extends kd{toRLP(){return(0,Tc.convertKeysToRLP)({type:oi.AccountKeyType.Legacy})}setFieldsFromRLP(e){e!=="0x01c0"&&this.throwTypeError(`Invalid RLP string '${e}'`),this.setFields({type:oi.AccountKeyType.Legacy})}};Ki.AccountKeyLegacy=Qm;Qm.type=oi.AccountKeyType.Legacy;Qm.typeName="AccountKeyLegacy";Qm.fieldTypes={type:Gu.FieldTypeUint8};var Ym=class extends kd{toRLP(){let e=(0,Tc.convertKeysToRLP)({key:this.getField("key"),type:oi.AccountKeyType.Public});return(0,Tc.GetHexlifyRLP)(oi.AccountKeyType.Public,e)}setFieldsFromRLP(e){let{type:t,key:n}=(0,Tc.decodeObjectFromRLP)(e);t!==this.type&&this.throwTypeError(`Invalid type '${t}`),this.setFields({type:t,key:n})}};Ki.AccountKeyPublic=Ym;Ym.type=oi.AccountKeyType.Public;Ym.typeName="AccountKeyPublic";Ym.fieldTypes={type:Gu.FieldTypeUint8,key:Gu.FieldTypeCompressedPubKey};var Xm=class extends kd{toRLP(){return(0,Tc.convertKeysToRLP)({type:oi.AccountKeyType.Fail})}setFieldsFromRLP(e){e!=="0x03c0"&&this.throwTypeError(`Invalid RLP string '${e}'`),this.setFields({type:oi.AccountKeyType.Fail})}};Ki.AccountKeyFail=Xm;Xm.type=oi.AccountKeyType.Fail;Xm.typeName="AccountKeyFail";Xm.fieldTypes={type:Gu.FieldTypeUint8};var e2=class extends kd{toRLP(){let[e,t]=this.getFields(["threshold","keys"]),n=(0,Tc.convertKeysToRLP)({threshold:e,keys:t,type:oi.AccountKeyType.WeightedMultiSig});return(0,Tc.GetHexlifyRLP)(oi.AccountKeyType.WeightedMultiSig,n)}setFieldsFromRLP(e){let{type:t,keys:n,threshold:s}=(0,Tc.decodeObjectFromRLP)(e);t!==this.type&&this.throwTypeError(`Invalid type '${t}`),this.setFields({type:t,threshold:s,keys:n})}};Ki.AccountKeyWeightedMultiSig=e2;e2.type=oi.AccountKeyType.WeightedMultiSig;e2.typeName="AccountKeyWeightedMultiSig";e2.fieldTypes={type:Gu.FieldTypeUint8,threshold:Gu.FieldTypeUint32,keys:Gu.FieldTypeWeightedPublicKeys};var t2=class extends kd{toRLP(){let e=this.getField("keys"),t=(0,Tc.convertKeysToRLP)({type:oi.AccountKeyType.RoleBased,keys:e});return(0,Tc.GetHexlifyRLP)(oi.AccountKeyType.RoleBased,t)}setFieldsFromRLP(e){let{type:t,keys:n}=(0,Tc.decodeObjectFromRLP)(e);t!==this.type&&this.throwTypeError(`Invalid type '${t}`),this.setFields({type:t,keys:n})}};Ki.AccountKeyRoleBased=t2;t2.type=oi.AccountKeyType.RoleBased;t2.typeName="AccountKeyRoleBased";t2.fieldTypes={type:Gu.FieldTypeUint8,keys:Gu.FieldTypeAccountKeyList}});var Aee=R(t4=>{"use strict";b();p();Object.defineProperty(t4,"__esModule",{value:!0});t4.AccountKeyFactory=void 0;t4.parseAccountKey=Nve;var kve=Bd(),Vu=Sc(),r2=pC(),Eg=class extends kve.FieldSetFactory{constructor(){let e=["type"];super(e),this.add(r2.AccountKeyNil),this.add(r2.AccountKeyLegacy),this.add(r2.AccountKeyPublic),this.add(r2.AccountKeyFail),this.add(r2.AccountKeyWeightedMultiSig),this.add(r2.AccountKeyRoleBased)}_fromObject(e){return e.type==Vu.AccountKeyType.WeightedMultiSig&&e.weightedPublicKeys&&(e.keys=e.weightedPublicKeys),super.fromObject(e)}static fromObject(e){return new Eg()._fromObject(e)}_fromRLP(e){if(e=="0x80")return this.fromObject({type:Vu.AccountKeyType.Nil});let t=(0,Vu.getTypePrefix)(e);if(!(0,Vu.isKlaytnAccountKeyType)(t))throw new Error("Not a Klaytn account key");let n=this.lookup(t),s=new n;return s.setFieldsFromRLP(e),s}static fromRLP(e){return new Eg()._fromRLP(e)}};t4.AccountKeyFactory=Eg;function Nve(r){let e=Eg.fromRLP(r),t=e.toObject();if(e.type==Vu.AccountKeyType.Nil||e.type==Vu.AccountKeyType.Legacy||e.type==Vu.AccountKeyType.Fail)return{type:e.type};if(e.type==Vu.AccountKeyType.Public)return{type:e.type,key:t.key};if(e.type==Vu.AccountKeyType.WeightedMultiSig)return{type:e.type,threshold:Vu.HexStr.toNumber(t.threshold),keys:e.getField("keys")};if(e.type==Vu.AccountKeyType.RoleBased)return{type:e.type,keys:e.getField("keys")};throw new Error(`Unknown AccountKeyType ${e.type}`)}});var See=R(Ch=>{"use strict";b();p();var Ive=Ch&&Ch.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Eee=Ch&&Ch.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ive(e,r,t)};Object.defineProperty(Ch,"__esModule",{value:!0});Eee(Aee(),Ch);Eee(pC(),Ch)});var r4=R(kE=>{"use strict";b();p();Object.defineProperty(kE,"__esModule",{value:!0});kE.KlaytnTx=void 0;var Rve=Bd(),zu=Sc(),gC=class extends Rve.FieldSet{sigFeePayerRLP(){(0,zu.isFeePayerSigTxType)(this.type)?this.throwTypeError("sigFeePayerRLP not implemented"):this.throwTypeError("sigFeePayerRLP not defined")}senderTxHashRLP(){if((0,zu.isFeePayerSigTxType)(this.type))this.throwTypeError("senderTxHashRLP not implemented");else return this.txHashRLP()}addSenderSig(e){var t;let n=(0,zu.getSignatureTuple)(e);(t=this.fields).txSignatures||(t.txSignatures=[]),this.fields.txSignatures.push(n)}addFeePayerSig(e){var t;let n=(0,zu.getSignatureTuple)(e);(t=this.fields).feePayerSignatures||(t.feePayerSignatures=[]),this.fields.feePayerSignatures.push(n)}encodeNestedRLP(e,t){let n=this.getFields(e),s=this.getFields(t);return zu.RLP.encode([zu.RLP.encode(n),...s,"0x","0x"])}encodeTypePrefixedRLP(e){let t=this.getFields(e);return zu.HexStr.concat(this.getField("type"),zu.RLP.encode(t))}decodeTypePrefixedRLP(e,t){let n=zu.HexStr.toNumber(e.substring(0,4));n!==this.type&&this.throwTypeError(`Invalid type '${n}`);let s="0x"+String(e).substring(4),i=["type",...t],a=[this.type,...zu.RLP.decode(s)];this.setFieldsFromArray(i,a)}decodeTypePrefixedVarlenRLP(e,...t){let n=zu.RLP.decode("0x"+e.substring(4)).length;for(let s=0;s<t.length;s++){let i=t[s];if(n==i.length){this.decodeTypePrefixedRLP(e,i);return}}this.throwTypeError(`Invalid RLP string '${e}'`)}};kE.KlaytnTx=gC});var xC=R(Va=>{"use strict";b();p();Object.defineProperty(Va,"__esModule",{value:!0});Va.TxTypeFeeDelegatedCancel=Va.TxTypeFeeDelegatedAccountUpdate=Va.TxTypeFeeDelegatedSmartContractExecution=Va.TxTypeFeeDelegatedSmartContractDeploy=Va.TxTypeFeeDelegatedValueTransferMemo=Va.TxTypeFeeDelegatedValueTransfer=void 0;var Me=Bd(),u2=Sc(),f2=r4(),n2=class extends f2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","txSignatures","feePayer","feePayerSignatures"])}};Va.TxTypeFeeDelegatedValueTransfer=n2;n2.type=u2.TxType.FeeDelegatedValueTransfer;n2.typeName="TxTypeFeeDelegatedValueTransfer";n2.fieldTypes={type:Me.FieldTypeUint8,nonce:Me.FieldTypeUint64,gasPrice:Me.FieldTypeUint256,gasLimit:Me.FieldTypeUint64,to:Me.FieldTypeAddress,value:Me.FieldTypeUint256,from:Me.FieldTypeAddress,chainId:Me.FieldTypeUint64,txSignatures:Me.FieldTypeSignatureTuples,feePayer:Me.FieldTypeAddress,feePayerSignatures:Me.FieldTypeSignatureTuples};var s2=class extends f2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}};Va.TxTypeFeeDelegatedValueTransferMemo=s2;s2.type=u2.TxType.FeeDelegatedValueTransferMemo;s2.typeName="TxTypeFeeDelegatedValueTransferMemo";s2.fieldTypes={type:Me.FieldTypeUint8,nonce:Me.FieldTypeUint64,gasPrice:Me.FieldTypeUint256,gasLimit:Me.FieldTypeUint64,to:Me.FieldTypeAddress,value:Me.FieldTypeUint256,from:Me.FieldTypeAddress,data:Me.FieldTypeBytes,chainId:Me.FieldTypeUint64,txSignatures:Me.FieldTypeSignatureTuples,feePayer:Me.FieldTypeAddress,feePayerSignatures:Me.FieldTypeSignatureTuples};var i2=class extends f2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures","feePayer","feePayerSignatures"])}};Va.TxTypeFeeDelegatedSmartContractDeploy=i2;i2.type=u2.TxType.FeeDelegatedSmartContractDeploy;i2.typeName="TxTypeFeeDelegatedSmartContractDeploy";i2.fieldTypes={type:Me.FieldTypeUint8,nonce:Me.FieldTypeUint64,gasPrice:Me.FieldTypeUint256,gasLimit:Me.FieldTypeUint64,to:Me.FieldTypeAddress,value:Me.FieldTypeUint256,from:Me.FieldTypeAddress,data:Me.FieldTypeBytes,humanReadable:Me.FieldTypeBool,codeFormat:Me.FieldTypeUint8,chainId:Me.FieldTypeUint64,txSignatures:Me.FieldTypeSignatureTuples,feePayer:Me.FieldTypeAddress,feePayerSignatures:Me.FieldTypeSignatureTuples};var a2=class extends f2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}};Va.TxTypeFeeDelegatedSmartContractExecution=a2;a2.type=u2.TxType.FeeDelegatedSmartContractExecution;a2.typeName="TxTypeFeeDelegatedSmartContractExecution";a2.fieldTypes={type:Me.FieldTypeUint8,nonce:Me.FieldTypeUint64,gasPrice:Me.FieldTypeUint256,gasLimit:Me.FieldTypeUint64,to:Me.FieldTypeAddress,value:Me.FieldTypeUint256,from:Me.FieldTypeAddress,data:Me.FieldTypeBytes,chainId:Me.FieldTypeUint64,txSignatures:Me.FieldTypeSignatureTuples,feePayer:Me.FieldTypeAddress,feePayerSignatures:Me.FieldTypeSignatureTuples};var o2=class extends f2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","key","txSignatures"],["nonce","gasPrice","gasLimit","from","key","txSignatures","feePayer","feePayerSignatures"])}};Va.TxTypeFeeDelegatedAccountUpdate=o2;o2.type=u2.TxType.FeeDelegatedAccountUpdate;o2.typeName="TxTypeFeeDelegatedAccountUpdate";o2.fieldTypes={type:Me.FieldTypeUint8,nonce:Me.FieldTypeUint64,gasPrice:Me.FieldTypeUint256,gasLimit:Me.FieldTypeUint64,from:Me.FieldTypeAddress,key:Me.FieldTypeAccountKey,chainId:Me.FieldTypeUint64,txSignatures:Me.FieldTypeSignatureTuples,feePayer:Me.FieldTypeAddress,feePayerSignatures:Me.FieldTypeSignatureTuples};var c2=class extends f2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","txSignatures"],["nonce","gasPrice","gasLimit","from","txSignatures","feePayer","feePayerSignatures"])}};Va.TxTypeFeeDelegatedCancel=c2;c2.type=u2.TxType.FeeDelegatedCancel;c2.typeName="TxTypeFeeDelegatedCancel";c2.fieldTypes={type:Me.FieldTypeUint8,nonce:Me.FieldTypeUint64,gasPrice:Me.FieldTypeUint256,gasLimit:Me.FieldTypeUint64,from:Me.FieldTypeAddress,chainId:Me.FieldTypeUint64,txSignatures:Me.FieldTypeSignatureTuples,feePayer:Me.FieldTypeAddress,feePayerSignatures:Me.FieldTypeSignatureTuples}});var yC=R(za=>{"use strict";b();p();Object.defineProperty(za,"__esModule",{value:!0});za.TxTypeCancel=za.TxTypeAccountUpdate=za.TxTypeSmartContractExecution=za.TxTypeSmartContractDeploy=za.TxTypeValueTransferMemo=za.TxTypeValueTransfer=void 0;var $e=Bd(),x2=Sc(),y2=r4(),d2=class extends y2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","txSignatures"])}};za.TxTypeValueTransfer=d2;d2.type=x2.TxType.ValueTransfer;d2.typeName="TxTypeValueTransfer";d2.fieldTypes={type:$e.FieldTypeUint8,nonce:$e.FieldTypeUint64,gasPrice:$e.FieldTypeUint256,gasLimit:$e.FieldTypeUint64,to:$e.FieldTypeAddress,value:$e.FieldTypeUint256,from:$e.FieldTypeAddress,chainId:$e.FieldTypeUint64,txSignatures:$e.FieldTypeSignatureTuples};var l2=class extends y2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}};za.TxTypeValueTransferMemo=l2;l2.type=x2.TxType.ValueTransferMemo;l2.typeName="TxTypeValueTransferMemo";l2.fieldTypes={type:$e.FieldTypeUint8,nonce:$e.FieldTypeUint64,gasPrice:$e.FieldTypeUint256,gasLimit:$e.FieldTypeUint64,to:$e.FieldTypeAddress,value:$e.FieldTypeUint256,from:$e.FieldTypeAddress,data:$e.FieldTypeBytes,chainId:$e.FieldTypeUint64,txSignatures:$e.FieldTypeSignatureTuples};var h2=class extends y2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"])}};za.TxTypeSmartContractDeploy=h2;h2.type=x2.TxType.SmartContractDeploy;h2.typeName="TxTypeSmartContractDeploy";h2.fieldTypes={type:$e.FieldTypeUint8,nonce:$e.FieldTypeUint64,gasPrice:$e.FieldTypeUint256,gasLimit:$e.FieldTypeUint64,to:$e.FieldTypeAddress,value:$e.FieldTypeUint256,from:$e.FieldTypeAddress,data:$e.FieldTypeBytes,humanReadable:$e.FieldTypeBool,codeFormat:$e.FieldTypeUint8,chainId:$e.FieldTypeUint64,txSignatures:$e.FieldTypeSignatureTuples};var b2=class extends y2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}};za.TxTypeSmartContractExecution=b2;b2.type=x2.TxType.SmartContractExecution;b2.typeName="TxTypeSmartContractExecution";b2.fieldTypes={type:$e.FieldTypeUint8,nonce:$e.FieldTypeUint64,gasPrice:$e.FieldTypeUint256,gasLimit:$e.FieldTypeUint64,to:$e.FieldTypeAddress,value:$e.FieldTypeUint256,from:$e.FieldTypeAddress,data:$e.FieldTypeBytes,chainId:$e.FieldTypeUint64,txSignatures:$e.FieldTypeSignatureTuples};var p2=class extends y2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","from","key","txSignatures"])}};za.TxTypeAccountUpdate=p2;p2.type=x2.TxType.AccountUpdate;p2.typeName="TxTypeAccountUpdate";p2.fieldTypes={type:$e.FieldTypeUint8,nonce:$e.FieldTypeUint64,gasPrice:$e.FieldTypeUint256,gasLimit:$e.FieldTypeUint64,from:$e.FieldTypeAddress,key:$e.FieldTypeAccountKey,chainId:$e.FieldTypeUint64,txSignatures:$e.FieldTypeSignatureTuples};var g2=class extends y2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","from","txSignatures"])}};za.TxTypeCancel=g2;g2.type=x2.TxType.Cancel;g2.typeName="TxTypeCancel";g2.fieldTypes={type:$e.FieldTypeUint8,nonce:$e.FieldTypeUint64,gasPrice:$e.FieldTypeUint256,gasLimit:$e.FieldTypeUint64,from:$e.FieldTypeAddress,chainId:$e.FieldTypeUint64,txSignatures:$e.FieldTypeSignatureTuples}});var mC=R(Wa=>{"use strict";b();p();Object.defineProperty(Wa,"__esModule",{value:!0});Wa.TxTypeFeeDelegatedCancelWithRatio=Wa.TxTypeFeeDelegatedAccountUpdateWithRatio=Wa.TxTypeFeeDelegatedSmartContractExecutionWithRatio=Wa.TxTypeFeeDelegatedSmartContractDeployWithRatio=Wa.TxTypeFeeDelegatedValueTransferMemoWithRatio=Wa.TxTypeFeeDelegatedValueTransferWithRatio=void 0;var Se=Bd(),E2=Sc(),S2=r4(),m2=class extends S2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}};Wa.TxTypeFeeDelegatedValueTransferWithRatio=m2;m2.type=E2.TxType.FeeDelegatedValueTransferWithRatio;m2.typeName="TxTypeFeeDelegatedValueTransferWithRatio";m2.fieldTypes={type:Se.FieldTypeUint8,nonce:Se.FieldTypeUint64,gasPrice:Se.FieldTypeUint256,gasLimit:Se.FieldTypeUint64,to:Se.FieldTypeAddress,value:Se.FieldTypeUint256,from:Se.FieldTypeAddress,feeRatio:Se.FieldTypeUint8,chainId:Se.FieldTypeUint64,txSignatures:Se.FieldTypeSignatureTuples,feePayer:Se.FieldTypeAddress,feePayerSignatures:Se.FieldTypeSignatureTuples};var w2=class extends S2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}};Wa.TxTypeFeeDelegatedValueTransferMemoWithRatio=w2;w2.type=E2.TxType.FeeDelegatedValueTransferMemoWithRatio;w2.typeName="TxTypeFeeDelegatedValueTransferMemoWithRatio";w2.fieldTypes={type:Se.FieldTypeUint8,nonce:Se.FieldTypeUint64,gasPrice:Se.FieldTypeUint256,gasLimit:Se.FieldTypeUint64,to:Se.FieldTypeAddress,value:Se.FieldTypeUint256,from:Se.FieldTypeAddress,data:Se.FieldTypeBytes,feeRatio:Se.FieldTypeUint8,chainId:Se.FieldTypeUint64,txSignatures:Se.FieldTypeSignatureTuples,feePayer:Se.FieldTypeAddress,feePayerSignatures:Se.FieldTypeSignatureTuples};var v2=class extends S2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures","feePayer","feePayerSignatures"])}};Wa.TxTypeFeeDelegatedSmartContractDeployWithRatio=v2;v2.type=E2.TxType.FeeDelegatedSmartContractDeployWithRatio;v2.typeName="TxTypeFeeDelegatedSmartContractDeployWithRatio";v2.fieldTypes={type:Se.FieldTypeUint8,nonce:Se.FieldTypeUint64,gasPrice:Se.FieldTypeUint256,gasLimit:Se.FieldTypeUint64,to:Se.FieldTypeAddress,value:Se.FieldTypeUint256,from:Se.FieldTypeAddress,data:Se.FieldTypeBytes,humanReadable:Se.FieldTypeBool,feeRatio:Se.FieldTypeUint8,codeFormat:Se.FieldTypeUint8,chainId:Se.FieldTypeUint64,txSignatures:Se.FieldTypeSignatureTuples,feePayer:Se.FieldTypeAddress,feePayerSignatures:Se.FieldTypeSignatureTuples};var P2=class extends S2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}};Wa.TxTypeFeeDelegatedSmartContractExecutionWithRatio=P2;P2.type=E2.TxType.FeeDelegatedSmartContractExecutionWithRatio;P2.typeName="TxTypeFeeDelegatedSmartContractExecutionWithRatio";P2.fieldTypes={type:Se.FieldTypeUint8,nonce:Se.FieldTypeUint64,gasPrice:Se.FieldTypeUint256,gasLimit:Se.FieldTypeUint64,to:Se.FieldTypeAddress,value:Se.FieldTypeUint256,from:Se.FieldTypeAddress,data:Se.FieldTypeBytes,feeRatio:Se.FieldTypeUint8,chainId:Se.FieldTypeUint64,txSignatures:Se.FieldTypeSignatureTuples,feePayer:Se.FieldTypeAddress,feePayerSignatures:Se.FieldTypeSignatureTuples};var _2=class extends S2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures","feePayer","feePayerSignatures"])}};Wa.TxTypeFeeDelegatedAccountUpdateWithRatio=_2;_2.type=E2.TxType.FeeDelegatedAccountUpdateWithRatio;_2.typeName="TxTypeFeeDelegatedAccountUpdateWithRatio";_2.fieldTypes={type:Se.FieldTypeUint8,nonce:Se.FieldTypeUint64,gasPrice:Se.FieldTypeUint256,gasLimit:Se.FieldTypeUint64,from:Se.FieldTypeAddress,key:Se.FieldTypeAccountKey,feeRatio:Se.FieldTypeUint8,chainId:Se.FieldTypeUint64,txSignatures:Se.FieldTypeSignatureTuples,feePayer:Se.FieldTypeAddress,feePayerSignatures:Se.FieldTypeSignatureTuples};var A2=class extends S2.KlaytnTx{sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}};Wa.TxTypeFeeDelegatedCancelWithRatio=A2;A2.type=E2.TxType.FeeDelegatedCancelWithRatio;A2.typeName="TxTypeFeeDelegatedCancelWithRatio";A2.fieldTypes={type:Se.FieldTypeUint8,nonce:Se.FieldTypeUint64,gasPrice:Se.FieldTypeUint256,gasLimit:Se.FieldTypeUint64,from:Se.FieldTypeAddress,feeRatio:Se.FieldTypeUint8,chainId:Se.FieldTypeUint64,txSignatures:Se.FieldTypeSignatureTuples,feePayer:Se.FieldTypeAddress,feePayerSignatures:Se.FieldTypeSignatureTuples}});var Oee=R(k2=>{"use strict";b();p();Object.defineProperty(k2,"__esModule",{value:!0});k2.KlaytnTxFactory=void 0;k2.parseTransaction=Lve;var Lh=c7(),jve=kce(),Mve=iC(),Cve=Bd(),ts=Sc(),Tee=(iu(),ao(su)),T2=xC(),O2=yC(),B2=mC(),wC=class extends Cve.FieldSetFactory{constructor(){let e=["type","chainId","txSignatures"];super(e),this.add(O2.TxTypeValueTransfer),this.add(O2.TxTypeValueTransferMemo),this.add(O2.TxTypeSmartContractDeploy),this.add(O2.TxTypeSmartContractExecution),this.add(O2.TxTypeAccountUpdate),this.add(O2.TxTypeCancel),this.add(T2.TxTypeFeeDelegatedValueTransfer),this.add(T2.TxTypeFeeDelegatedValueTransferMemo),this.add(T2.TxTypeFeeDelegatedSmartContractDeploy),this.add(T2.TxTypeFeeDelegatedSmartContractExecution),this.add(T2.TxTypeFeeDelegatedAccountUpdate),this.add(T2.TxTypeFeeDelegatedCancel),this.add(B2.TxTypeFeeDelegatedValueTransferWithRatio),this.add(B2.TxTypeFeeDelegatedValueTransferMemoWithRatio),this.add(B2.TxTypeFeeDelegatedSmartContractDeployWithRatio),this.add(B2.TxTypeFeeDelegatedSmartContractExecutionWithRatio),this.add(B2.TxTypeFeeDelegatedAccountUpdateWithRatio),this.add(B2.TxTypeFeeDelegatedCancelWithRatio)}fromObject(e){return e.input&&(e.data=e.input),(ts.HexStr.fromNumber(e.type)==ts.HexStr.fromNumber(ts.TxType.SmartContractDeploy)||ts.HexStr.fromNumber(e.type)==ts.HexStr.fromNumber(ts.TxType.FeeDelegatedSmartContractDeploy)||ts.HexStr.fromNumber(e.type)==ts.HexStr.fromNumber(ts.TxType.FeeDelegatedSmartContractDeployWithRatio))&&(e.to="0x"),super.fromObject(e)}fromRLP(e){let t=(0,ts.getTypePrefix)(e);if(!(0,ts.isKlaytnTxType)(t))throw new Error("Not a Klaytn raw transaction");let n=this.lookup(t),s=new n;return s.setFieldsFromRLP(e),s}};k2.KlaytnTxFactory=new wC;function Lve(r){let e=(0,ts.getTypePrefix)(r);if((0,ts.isKlaytnTxType)(e)){let t=k2.KlaytnTxFactory.fromRLP(r).toObject();try{let n={hash:(0,jve.keccak256)(r),to:t.to?ts.HexStr.toAddress(t.to):void 0,from:t.from?ts.HexStr.toAddress(t.from):void 0,nonce:ts.HexStr.toNumber(t.nonce),gasLimit:(0,Lh.hexValue)(t.gasLimit),gasPrice:(0,Lh.hexValue)(t.gasPrice),data:t.data??"0x",value:(0,Lh.hexValue)(t.value??0),chainId:t.chainId?ts.HexStr.toNumber(t.chainId):void 0,type:t.type?ts.HexStr.toNumber(t.type):null,accessList:t.accessList,key:t.key,humanReadable:t.humanReadable?ts.HexStr.toBoolean(t.humanReadable):void 0,codeFormat:t.codeFormat?ts.HexStr.toNumber(t.codeFormat):void 0,feePayer:t.feePayer?ts.HexStr.toAddress(t.feePayer):void 0,txSignatures:t.txSignatures,feePayerSignatures:t.feePayerSignatures,feeRatio:t.feeRatio?ts.HexStr.toNumber(t.feeRatio):void 0};return(0,Tee.forOwn)(n,(s,i)=>{s===void 0&&delete n[i]}),n}catch{return t}}else{let t=Mve.Transaction.from(r),n={from:t.from??void 0,to:t.to??void 0,nonce:t.nonce,data:t.data,r:t.signature?.r,s:t.signature?.s,v:t.signature?.v??void 0,hash:t.hash??void 0,accessList:t.accessList??void 0,chainId:Number(t.chainId),type:t?.type,gasLimit:(0,Lh.hexValue)(t.gasLimit),gasPrice:t.gasPrice?(0,Lh.hexValue)(t.gasPrice):void 0,value:(0,Lh.hexValue)(t.value),maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Lh.hexValue)(t.maxPriorityFeePerGas):void 0,maxFeePerGas:t.maxFeePerGas?(0,Lh.hexValue)(t.maxFeePerGas):void 0};return typeof n.v=="number"&&(n.v=n.v===27?0:1),(0,Tee.forOwn)(n,(s,i)=>{s===void 0&&delete n[i]}),n}}});var Bee=R(Wu=>{"use strict";b();p();var Uve=Wu&&Wu.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),n4=Wu&&Wu.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Uve(e,r,t)};Object.defineProperty(Wu,"__esModule",{value:!0});n4(Oee(),Wu);n4(yC(),Wu);n4(xC(),Wu);n4(mC(),Wu);n4(r4(),Wu)});var Sg=R(l0=>{"use strict";b();p();var Fve=l0&&l0.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),NE=l0&&l0.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Fve(e,r,t)};Object.defineProperty(l0,"__esModule",{value:!0});NE(See(),l0);NE(Bd(),l0);NE(Bee(),l0);NE(Sc(),l0)});var nte=R((Jze,jE)=>{b();p();var kee,Nee,Iee,Ree,jee,Mee,Cee,Lee,Uee,Fee,qee,Dee,Hee,IE,vC,Kee,Gee,Vee,N2,zee,Wee,$ee,Jee,Zee,Qee,Yee,Xee,ete,RE,tte,rte;(function(r){var e=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof jE=="object"&&typeof jE.exports=="object"?r(t(e,t(jE.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=s?s(i,a):a}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(s[a]=i[a])};kee=function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(s,i);function a(){this.constructor=s}s.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)},Nee=Object.assign||function(s){for(var i,a=1,o=arguments.length;a<o;a++){i=arguments[a];for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(s[c]=i[c])}return s},Iee=function(s,i){var a={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.indexOf(o)<0&&(a[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(s);c<o.length;c++)i.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(s,o[c])&&(a[o[c]]=s[o[c]]);return a},Ree=function(s,i,a,o){var c=arguments.length,u=c<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,a):o,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(s,i,a,o);else for(var d=s.length-1;d>=0;d--)(f=s[d])&&(u=(c<3?f(u):c>3?f(i,a,u):f(i,a))||u);return c>3&&u&&Object.defineProperty(i,a,u),u},jee=function(s,i){return function(a,o){i(a,o,s)}},Mee=function(s,i,a,o,c,u){function f(z){if(z!==void 0&&typeof z!="function")throw new TypeError("Function expected");return z}for(var d=o.kind,g=d==="getter"?"get":d==="setter"?"set":"value",h=!i&&s?o.static?s:s.prototype:null,m=i||(h?Object.getOwnPropertyDescriptor(h,o.name):{}),y,S=!1,T=a.length-1;T>=0;T--){var H={};for(var C in o)H[C]=C==="access"?{}:o[C];for(var C in o.access)H.access[C]=o.access[C];H.addInitializer=function(z){if(S)throw new TypeError("Cannot add initializers after decoration has completed");u.push(f(z||null))};var J=(0,a[T])(d==="accessor"?{get:m.get,set:m.set}:m[g],H);if(d==="accessor"){if(J===void 0)continue;if(J===null||typeof J!="object")throw new TypeError("Object expected");(y=f(J.get))&&(m.get=y),(y=f(J.set))&&(m.set=y),(y=f(J.init))&&c.unshift(y)}else(y=f(J))&&(d==="field"?c.unshift(y):m[g]=y)}h&&Object.defineProperty(h,o.name,m),S=!0},Cee=function(s,i,a){for(var o=arguments.length>2,c=0;c<i.length;c++)a=o?i[c].call(s,a):i[c].call(s);return o?a:void 0},Lee=function(s){return typeof s=="symbol"?s:"".concat(s)},Uee=function(s,i,a){return typeof i=="symbol"&&(i=i.description?"[".concat(i.description,"]"):""),Object.defineProperty(s,"name",{configurable:!0,value:a?"".concat(a," ",i):i})},Fee=function(s,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,i)},qee=function(s,i,a,o){function c(u){return u instanceof a?u:new a(function(f){f(u)})}return new(a||(a=Promise))(function(u,f){function d(m){try{h(o.next(m))}catch(y){f(y)}}function g(m){try{h(o.throw(m))}catch(y){f(y)}}function h(m){m.done?u(m.value):c(m.value).then(d,g)}h((o=o.apply(s,i||[])).next())})},Dee=function(s,i){var a={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,c,u,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=d(0),f.throw=d(1),f.return=d(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function d(h){return function(m){return g([h,m])}}function g(h){if(o)throw new TypeError("Generator is already executing.");for(;f&&(f=0,h[0]&&(a=0)),a;)try{if(o=1,c&&(u=h[0]&2?c.return:h[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,h[1])).done)return u;switch(c=0,u&&(h=[h[0]&2,u.value]),h[0]){case 0:case 1:u=h;break;case 4:return a.label++,{value:h[1],done:!1};case 5:a.label++,c=h[1],h=[0];continue;case 7:h=a.ops.pop(),a.trys.pop();continue;default:if(u=a.trys,!(u=u.length>0&&u[u.length-1])&&(h[0]===6||h[0]===2)){a=0;continue}if(h[0]===3&&(!u||h[1]>u[0]&&h[1]<u[3])){a.label=h[1];break}if(h[0]===6&&a.label<u[1]){a.label=u[1],u=h;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(h);break}u[2]&&a.ops.pop(),a.trys.pop();continue}h=i.call(s,a)}catch(m){h=[6,m],c=0}finally{o=u=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},Hee=function(s,i){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&RE(i,s,a)},RE=Object.create?function(s,i,a,o){o===void 0&&(o=a);var c=Object.getOwnPropertyDescriptor(i,a);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(s,o,c)}:function(s,i,a,o){o===void 0&&(o=a),s[o]=i[a]},IE=function(s){var i=typeof Symbol=="function"&&Symbol.iterator,a=i&&s[i],o=0;if(a)return a.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&o>=s.length&&(s=void 0),{value:s&&s[o++],done:!s}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},vC=function(s,i){var a=typeof Symbol=="function"&&s[Symbol.iterator];if(!a)return s;var o=a.call(s),c,u=[],f;try{for(;(i===void 0||i-- >0)&&!(c=o.next()).done;)u.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(a=o.return)&&a.call(o)}finally{if(f)throw f.error}}return u},Kee=function(){for(var s=[],i=0;i<arguments.length;i++)s=s.concat(vC(arguments[i]));return s},Gee=function(){for(var s=0,i=0,a=arguments.length;i<a;i++)s+=arguments[i].length;for(var o=Array(s),c=0,i=0;i<a;i++)for(var u=arguments[i],f=0,d=u.length;f<d;f++,c++)o[c]=u[f];return o},Vee=function(s,i,a){if(a||arguments.length===2)for(var o=0,c=i.length,u;o<c;o++)(u||!(o in i))&&(u||(u=Array.prototype.slice.call(i,0,o)),u[o]=i[o]);return s.concat(u||Array.prototype.slice.call(i))},N2=function(s){return this instanceof N2?(this.v=s,this):new N2(s)},zee=function(s,i,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a.apply(s,i||[]),c,u=[];return c=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),d("next"),d("throw"),d("return",f),c[Symbol.asyncIterator]=function(){return this},c;function f(T){return function(H){return Promise.resolve(H).then(T,y)}}function d(T,H){o[T]&&(c[T]=function(C){return new Promise(function(J,z){u.push([T,C,J,z])>1||g(T,C)})},H&&(c[T]=H(c[T])))}function g(T,H){try{h(o[T](H))}catch(C){S(u[0][3],C)}}function h(T){T.value instanceof N2?Promise.resolve(T.value.v).then(m,y):S(u[0][2],T)}function m(T){g("next",T)}function y(T){g("throw",T)}function S(T,H){T(H),u.shift(),u.length&&g(u[0][0],u[0][1])}},Wee=function(s){var i,a;return i={},o("next"),o("throw",function(c){throw c}),o("return"),i[Symbol.iterator]=function(){return this},i;function o(c,u){i[c]=s[c]?function(f){return(a=!a)?{value:N2(s[c](f)),done:!1}:u?u(f):f}:u}},$ee=function(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=s[Symbol.asyncIterator],a;return i?i.call(s):(s=typeof IE=="function"?IE(s):s[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(u){a[u]=s[u]&&function(f){return new Promise(function(d,g){f=s[u](f),c(d,g,f.done,f.value)})}}function c(u,f,d,g){Promise.resolve(g).then(function(h){u({value:h,done:d})},f)}},Jee=function(s,i){return Object.defineProperty?Object.defineProperty(s,"raw",{value:i}):s.raw=i,s};var t=Object.create?function(s,i){Object.defineProperty(s,"default",{enumerable:!0,value:i})}:function(s,i){s.default=i};Zee=function(s){if(s&&s.__esModule)return s;var i={};if(s!=null)for(var a in s)a!=="default"&&Object.prototype.hasOwnProperty.call(s,a)&&RE(i,s,a);return t(i,s),i},Qee=function(s){return s&&s.__esModule?s:{default:s}},Yee=function(s,i,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?s!==i||!o:!i.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(s):o?o.value:i.get(s)},Xee=function(s,i,a,o,c){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?s!==i||!c:!i.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?c.call(s,a):c?c.value=a:i.set(s,a),a},ete=function(s,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof s=="function"?i===s:s.has(i)},tte=function(s,i,a){if(i!=null){if(typeof i!="object"&&typeof i!="function")throw new TypeError("Object expected.");var o,c;if(a){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=i[Symbol.asyncDispose]}if(o===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=i[Symbol.dispose],a&&(c=o)}if(typeof o!="function")throw new TypeError("Object not disposable.");c&&(o=function(){try{c.call(this)}catch(u){return Promise.reject(u)}}),s.stack.push({value:i,dispose:o,async:a})}else a&&s.stack.push({async:!0});return i};var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,a){var o=new Error(a);return o.name="SuppressedError",o.error=s,o.suppressed=i,o};rte=function(s){function i(u){s.error=s.hasError?new n(u,s.error,"An error was suppressed during disposal."):u,s.hasError=!0}var a,o=0;function c(){for(;a=s.stack.pop();)try{if(!a.async&&o===1)return o=0,s.stack.push(a),Promise.resolve().then(c);if(a.dispose){var u=a.dispose.call(a.value);if(a.async)return o|=2,Promise.resolve(u).then(c,function(f){return i(f),c()})}else o|=1}catch(f){i(f)}if(o===1)return s.hasError?Promise.reject(s.error):Promise.resolve();if(s.hasError)throw s.error}return c()},r("__extends",kee),r("__assign",Nee),r("__rest",Iee),r("__decorate",Ree),r("__param",jee),r("__esDecorate",Mee),r("__runInitializers",Cee),r("__propKey",Lee),r("__setFunctionName",Uee),r("__metadata",Fee),r("__awaiter",qee),r("__generator",Dee),r("__exportStar",Hee),r("__createBinding",RE),r("__values",IE),r("__read",vC),r("__spread",Kee),r("__spreadArrays",Gee),r("__spreadArray",Vee),r("__await",N2),r("__asyncGenerator",zee),r("__asyncDelegator",Wee),r("__asyncValues",$ee),r("__makeTemplateObject",Jee),r("__importStar",Zee),r("__importDefault",Qee),r("__classPrivateFieldGet",Yee),r("__classPrivateFieldSet",Xee),r("__classPrivateFieldIn",ete),r("__addDisposableResource",tte),r("__disposeResources",rte)})});var CE=R(ME=>{"use strict";b();p();Object.defineProperty(ME,"__esModule",{value:!0});ME.version=void 0;ME.version="6.13.5"});var Uh=R(I2=>{"use strict";b();p();Object.defineProperty(I2,"__esModule",{value:!0});I2.defineProperties=I2.resolveProperties=void 0;function qve(r,e,t){let n=e.split("|").map(i=>i.trim());for(let i=0;i<n.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}let s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=r,s}async function Dve(r){let e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,s,i)=>(n[e[i]]=s,n),{})}I2.resolveProperties=Dve;function Hve(r,e,t){for(let n in e){let s=e[n],i=t?t[n]:null;i&&qve(s,i,n),Object.defineProperty(r,n,{enumerable:!0,value:s,writable:!1})}}I2.defineProperties=Hve});var $u=R(ci=>{"use strict";b();p();Object.defineProperty(ci,"__esModule",{value:!0});ci.assertPrivate=ci.assertNormalize=ci.assertArgumentCount=ci.assertArgument=ci.assert=ci.makeError=ci.isCallException=ci.isError=void 0;var Kve=CE(),ste=Uh();function R2(r){if(r==null)return"null";if(Array.isArray(r))return"[ "+r.map(R2).join(", ")+" ]";if(r instanceof Uint8Array){let e="0123456789abcdef",t="0x";for(let n=0;n<r.length;n++)t+=e[r[n]>>4],t+=e[r[n]&15];return t}if(typeof r=="object"&&typeof r.toJSON=="function")return R2(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"number":return r.toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{ "+e.map(t=>`${R2(t)}: ${R2(r[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function ite(r,e){return r&&r.code===e}ci.isError=ite;function Gve(r){return ite(r,"CALL_EXCEPTION")}ci.isCallException=Gve;function ate(r,e,t){let n=r;{let i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${R2(t)}`);for(let a in t){if(a==="shortMessage")continue;let o=t[a];i.push(a+"="+R2(o))}}i.push(`code=${e}`),i.push(`version=${Kve.version}`),i.length&&(r+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(r);break;default:s=new Error(r)}return(0,ste.defineProperties)(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&(0,ste.defineProperties)(s,{shortMessage:n}),s}ci.makeError=ate;function j2(r,e,t,n){if(!r)throw ate(e,t,n)}ci.assert=j2;function Vve(r,e,t,n){j2(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}ci.assertArgument=Vve;function zve(r,e,t){t==null&&(t=""),t&&(t=": "+t),j2(r>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),j2(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}ci.assertArgumentCount=zve;var Wve=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){let t=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(t!==n)throw new Error("broken")}r.push(e)}catch{}return r},[]);function $ve(r){j2(Wve.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}ci.assertNormalize=$ve;function Jve(r,e,t){if(t==null&&(t=""),r!==e){let n=t,s="new";t&&(n+=".",s+=" "+t),j2(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}ci.assertPrivate=Jve});var Oc=R(Rn=>{"use strict";b();p();Object.defineProperty(Rn,"__esModule",{value:!0});Rn.zeroPadBytes=Rn.zeroPadValue=Rn.stripZerosLeft=Rn.dataSlice=Rn.dataLength=Rn.concat=Rn.hexlify=Rn.isBytesLike=Rn.isHexString=Rn.getBytesCopy=Rn.getBytes=void 0;var PC=$u();function cte(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let n=new Uint8Array((r.length-2)/2),s=2;for(let i=0;i<n.length;i++)n[i]=parseInt(r.substring(s,s+2),16),s+=2;return n}(0,PC.assertArgument)(!1,"invalid BytesLike value",e||"value",r)}function s4(r,e){return cte(r,e,!1)}Rn.getBytes=s4;function Zve(r,e){return cte(r,e,!0)}Rn.getBytesCopy=Zve;function _C(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}Rn.isHexString=_C;function Qve(r){return _C(r,!0)||r instanceof Uint8Array}Rn.isBytesLike=Qve;var ote="0123456789abcdef";function i4(r){let e=s4(r),t="0x";for(let n=0;n<e.length;n++){let s=e[n];t+=ote[(s&240)>>4]+ote[s&15]}return t}Rn.hexlify=i4;function Yve(r){return"0x"+r.map(e=>i4(e).substring(2)).join("")}Rn.concat=Yve;function Xve(r){return _C(r,!0)?(r.length-2)/2:s4(r).length}Rn.dataLength=Xve;function e7e(r,e,t){let n=s4(r);return t!=null&&t>n.length&&(0,PC.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),i4(n.slice(e??0,t??n.length))}Rn.dataSlice=e7e;function t7e(r){let e=i4(r).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}Rn.stripZerosLeft=t7e;function ute(r,e,t){let n=s4(r);(0,PC.assert)(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});let s=new Uint8Array(e);return s.fill(0),t?s.set(n,e-n.length):s.set(n,0),i4(s)}function r7e(r,e){return ute(r,e,!0)}Rn.zeroPadValue=r7e;function n7e(r,e){return ute(r,e,!1)}Rn.zeroPadBytes=n7e});var C2=R(jn=>{"use strict";b();p();Object.defineProperty(jn,"__esModule",{value:!0});jn.toQuantity=jn.toBeArray=jn.toBeHex=jn.toNumber=jn.getNumber=jn.toBigInt=jn.getUint=jn.getBigInt=jn.mask=jn.toTwos=jn.fromTwos=void 0;var fte=Oc(),$a=$u(),LE=BigInt(0),Ju=BigInt(1),M2=9007199254740991;function s7e(r,e){let t=a4(r,"value"),n=BigInt(Tg(e,"width"));if((0,$a.assert)(t>>n===LE,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-Ju){let s=(Ju<<n)-Ju;return-((~t&s)+Ju)}return t}jn.fromTwos=s7e;function i7e(r,e){let t=UE(r,"value"),n=BigInt(Tg(e,"width")),s=Ju<<n-Ju;if(t<LE){t=-t,(0,$a.assert)(t<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});let i=(Ju<<n)-Ju;return(~t&i)+Ju}else(0,$a.assert)(t<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}jn.toTwos=i7e;function a7e(r,e){let t=a4(r,"value"),n=BigInt(Tg(e,"bits"));return t&(Ju<<n)-Ju}jn.mask=a7e;function UE(r,e){switch(typeof r){case"bigint":return r;case"number":return(0,$a.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,$a.assertArgument)(r>=-M2&&r<=M2,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){(0,$a.assertArgument)(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}(0,$a.assertArgument)(!1,"invalid BigNumberish value",e||"value",r)}jn.getBigInt=UE;function a4(r,e){let t=UE(r,e);return(0,$a.assert)(t>=LE,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}jn.getUint=a4;var dte="0123456789abcdef";function lte(r){if(r instanceof Uint8Array){let e="0x0";for(let t of r)e+=dte[t>>4],e+=dte[t&15];return BigInt(e)}return UE(r)}jn.toBigInt=lte;function Tg(r,e){switch(typeof r){case"bigint":return(0,$a.assertArgument)(r>=-M2&&r<=M2,"overflow",e||"value",r),Number(r);case"number":return(0,$a.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,$a.assertArgument)(r>=-M2&&r<=M2,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return Tg(BigInt(r),e)}catch(t){(0,$a.assertArgument)(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}(0,$a.assertArgument)(!1,"invalid numeric value",e||"value",r)}jn.getNumber=Tg;function o7e(r){return Tg(lte(r))}jn.toNumber=o7e;function c7e(r,e){let n=a4(r,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{let s=Tg(e,"width");for((0,$a.assert)(s*2>=n.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<s*2;)n="0"+n}return"0x"+n}jn.toBeHex=c7e;function hte(r){let e=a4(r,"value");if(e===LE)return new Uint8Array([]);let t=e.toString(16);t.length%2&&(t="0"+t);let n=new Uint8Array(t.length/2);for(let s=0;s<n.length;s++){let i=s*2;n[s]=parseInt(t.substring(i,i+2),16)}return n}jn.toBeArray=hte;function u7e(r){let e=(0,fte.hexlify)((0,fte.isBytesLike)(r)?r:hte(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}jn.toQuantity=u7e});var bte=R(L2=>{"use strict";b();p();Object.defineProperty(L2,"__esModule",{value:!0});L2.decodeBase58=L2.encodeBase58=void 0;var f7e=Oc(),d7e=$u(),l7e=C2(),qE="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",FE=null;function h7e(r){if(FE==null){FE={};for(let t=0;t<qE.length;t++)FE[qE[t]]=BigInt(t)}let e=FE[r];return(0,d7e.assertArgument)(e!=null,"invalid base58 value","letter",r),e}var b7e=BigInt(0),AC=BigInt(58);function p7e(r){let e=(0,f7e.getBytes)(r),t=(0,l7e.toBigInt)(e),n="";for(;t;)n=qE[Number(t%AC)]+n,t/=AC;for(let s=0;s<e.length&&!e[s];s++)n=qE[0]+n;return n}L2.encodeBase58=p7e;function g7e(r){let e=b7e;for(let t=0;t<r.length;t++)e*=AC,e+=h7e(r[t]);return e}L2.decodeBase58=g7e});var EC=R(U2=>{"use strict";b();p();Object.defineProperty(U2,"__esModule",{value:!0});U2.encodeBase64=U2.decodeBase64=void 0;var pte=Oc();function x7e(r){r=atob(r);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return(0,pte.getBytes)(e)}U2.decodeBase64=x7e;function y7e(r){let e=(0,pte.getBytes)(r),t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}U2.encodeBase64=y7e});var gte=R(DE=>{"use strict";b();p();Object.defineProperty(DE,"__esModule",{value:!0});DE.EventPayload=void 0;var m7e=Uh(),F2,SC=class{constructor(e,t,n){N(this,"filter");N(this,"emitter");I(this,F2,void 0);_(this,F2,t),(0,m7e.defineProperties)(this,{emitter:e,filter:n})}async removeListener(){l(this,F2)!=null&&await this.emitter.off(this.filter,l(this,F2))}};F2=new WeakMap;DE.EventPayload=SC});var HE=R(Zu=>{"use strict";b();p();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.toUtf8CodePoints=Zu.toUtf8String=Zu.toUtf8Bytes=Zu.Utf8ErrorFuncs=void 0;var w7e=Oc(),o4=$u();function v7e(r,e,t,n,s){(0,o4.assertArgument)(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function xte(r,e,t,n,s){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let i=0;for(let a=e+1;a<t.length&&t[a]>>6===2;a++)i++;return i}return r==="OVERRUN"?t.length-e-1:0}function P7e(r,e,t,n,s){return r==="OVERLONG"?((0,o4.assertArgument)(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),n.push(s),0):(n.push(65533),xte(r,e,t,n,s))}Zu.Utf8ErrorFuncs=Object.freeze({error:v7e,ignore:xte,replace:P7e});function yte(r,e){e==null&&(e=Zu.Utf8ErrorFuncs.error);let t=(0,w7e.getBytes)(r,"bytes"),n=[],s=0;for(;s<t.length;){let i=t[s++];if(i>>7===0){n.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,n):s+=e("BAD_PREFIX",s-1,t,n);continue}if(s-1+a>=t.length){s+=e("OVERRUN",s-1,t,n);continue}let c=i&(1<<8-a-1)-1;for(let u=0;u<a;u++){let f=t[s];if((f&192)!=128){s+=e("MISSING_CONTINUE",s,t,n),c=null;break}c=c<<6|f&63,s++}if(c!==null){if(c>1114111){s+=e("OUT_OF_RANGE",s-1-a,t,n,c);continue}if(c>=55296&&c<=57343){s+=e("UTF16_SURROGATE",s-1-a,t,n,c);continue}if(c<=o){s+=e("OVERLONG",s-1-a,t,n,c);continue}n.push(c)}}return n}function mte(r,e){(0,o4.assertArgument)(typeof r=="string","invalid string value","str",r),e!=null&&((0,o4.assertNormalize)(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){n++;let i=r.charCodeAt(n);(0,o4.assertArgument)(n<r.length&&(i&64512)===56320,"invalid surrogate pair","str",r);let a=65536+((s&1023)<<10)+(i&1023);t.push(a>>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}Zu.toUtf8Bytes=mte;function _7e(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function A7e(r,e){return _7e(yte(r,e))}Zu.toUtf8String=A7e;function E7e(r,e){return yte(mte(r,e))}Zu.toUtf8CodePoints=E7e});var vte=R(q2=>{"use strict";b();p();Object.defineProperty(q2,"__esModule",{value:!0});q2.getUrl=q2.createGetUrl=void 0;var c4=$u();function wte(r){async function e(t,n){(0,c4.assert)(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");let s=t.url.split(":")[0].toLowerCase();(0,c4.assert)(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),(0,c4.assert)(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null,a=new AbortController,o=setTimeout(()=>{i=(0,c4.makeError)("request timeout","TIMEOUT"),a.abort()},t.timeout);n&&n.addListener(()=>{i=(0,c4.makeError)("request cancelled","CANCELLED"),a.abort()});let c={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:a.signal},u;try{u=await fetch(t.url,c)}catch(h){throw clearTimeout(o),i||h}clearTimeout(o);let f={};u.headers.forEach((h,m)=>{f[m.toLowerCase()]=h});let d=await u.arrayBuffer(),g=d==null?null:new Uint8Array(d);return{statusCode:u.status,statusMessage:u.statusText,headers:f,body:g}}return e}q2.createGetUrl=wte;var S7e=wte({});async function T7e(r,e){return S7e(r,e)}q2.getUrl=T7e});var kte=R(Dh=>{"use strict";b();p();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.FetchResponse=Dh.FetchRequest=Dh.FetchCancelSignal=void 0;var Ate=EC(),Ete=Oc(),Bc=$u(),O7e=Uh(),D2=HE(),Ste=vte(),B7e=12,k7e=250,Pte=(0,Ste.createGetUrl)(),N7e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),I7e=new RegExp("^ipfs://(ipfs/)?(.*)$","i"),TC=!1;async function Tte(r,e){try{let t=r.match(N7e);if(!t)throw new Error("invalid data");return new Rd(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,Ate.decodeBase64)(t[3]):R7e(t[3]))}catch{return new Rd(599,"BAD REQUEST (invalid data: URI)",{},null,new W2(r))}}function Ote(r){async function e(t,n){try{let s=t.match(I7e);if(!s)throw new Error("invalid link");return new W2(`${r}${s[2]}`)}catch{return new Rd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new W2(t))}}return e}var KE={data:Tte,ipfs:Ote("https://gateway.ipfs.io/ipfs/")},Bte=new WeakMap,Og,Fh,VE=class{constructor(e){I(this,Og,void 0);I(this,Fh,void 0);_(this,Og,[]),_(this,Fh,!1),Bte.set(e,()=>{if(!l(this,Fh)){_(this,Fh,!0);for(let t of l(this,Og))setTimeout(()=>{t()},0);_(this,Og,[])}})}addListener(e){(0,Bc.assert)(!l(this,Fh),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),l(this,Og).push(e)}get cancelled(){return l(this,Fh)}checkSignal(){(0,Bc.assert)(!this.cancelled,"cancelled","CANCELLED",{})}};Og=new WeakMap,Fh=new WeakMap;Dh.FetchCancelSignal=VE;function GE(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}var H2,K2,Qu,Nd,G2,V2,ui,_o,Id,Bg,kg,Ng,h0,Yu,qh,Ig,u4,zE=class{constructor(e){I(this,Ig);I(this,H2,void 0);I(this,K2,void 0);I(this,Qu,void 0);I(this,Nd,void 0);I(this,G2,void 0);I(this,V2,void 0);I(this,ui,void 0);I(this,_o,void 0);I(this,Id,void 0);I(this,Bg,void 0);I(this,kg,void 0);I(this,Ng,void 0);I(this,h0,void 0);I(this,Yu,void 0);I(this,qh,void 0);_(this,V2,String(e)),_(this,H2,!1),_(this,K2,!0),_(this,Qu,{}),_(this,Nd,""),_(this,G2,3e5),_(this,Yu,{slotInterval:k7e,maxAttempts:B7e}),_(this,qh,null)}get url(){return l(this,V2)}set url(e){_(this,V2,String(e))}get body(){return l(this,ui)==null?null:new Uint8Array(l(this,ui))}set body(e){if(e==null)_(this,ui,void 0),_(this,_o,void 0);else if(typeof e=="string")_(this,ui,(0,D2.toUtf8Bytes)(e)),_(this,_o,"text/plain");else if(e instanceof Uint8Array)_(this,ui,e),_(this,_o,"application/octet-stream");else if(typeof e=="object")_(this,ui,(0,D2.toUtf8Bytes)(JSON.stringify(e))),_(this,_o,"application/json");else throw new Error("invalid body")}hasBody(){return l(this,ui)!=null}get method(){return l(this,Nd)?l(this,Nd):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),_(this,Nd,String(e).toUpperCase())}get headers(){let e=Object.assign({},l(this,Qu));return l(this,Id)&&(e.authorization=`Basic ${(0,Ate.encodeBase64)((0,D2.toUtf8Bytes)(l(this,Id)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&l(this,_o)&&(e["content-type"]=l(this,_o)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){l(this,Qu)[String(e).toLowerCase()]=String(t)}clearHeaders(){_(this,Qu,{})}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return l(this,Id)||null}setCredentials(e,t){(0,Bc.assertArgument)(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),_(this,Id,`${e}:${t}`)}get allowGzip(){return l(this,K2)}set allowGzip(e){_(this,K2,!!e)}get allowInsecureAuthentication(){return!!l(this,H2)}set allowInsecureAuthentication(e){_(this,H2,!!e)}get timeout(){return l(this,G2)}set timeout(e){(0,Bc.assertArgument)(e>=0,"timeout must be non-zero","timeout",e),_(this,G2,e)}get preflightFunc(){return l(this,Bg)||null}set preflightFunc(e){_(this,Bg,e)}get processFunc(){return l(this,kg)||null}set processFunc(e){_(this,kg,e)}get retryFunc(){return l(this,Ng)||null}set retryFunc(e){_(this,Ng,e)}get getUrlFunc(){return l(this,qh)||Pte}set getUrlFunc(e){_(this,qh,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${l(this,ui)?(0,Ete.hexlify)(l(this,ui)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(l(this,Yu).slotInterval=e.slotInterval),e.maxAttempts!=null&&(l(this,Yu).maxAttempts=e.maxAttempts)}send(){return(0,Bc.assert)(l(this,h0)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),_(this,h0,new VE(this)),$(this,Ig,u4).call(this,0,_te()+this.timeout,0,this,new Rd(0,"",{},null,this))}cancel(){(0,Bc.assert)(l(this,h0)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});let e=Bte.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){let t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();(0,Bc.assert)(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});let s=new zE(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,_(s,Qu,Object.assign({},l(this,Qu))),l(this,ui)&&_(s,ui,new Uint8Array(l(this,ui))),_(s,_o,l(this,_o)),s}clone(){let e=new zE(this.url);return _(e,Nd,l(this,Nd)),l(this,ui)&&_(e,ui,l(this,ui)),_(e,_o,l(this,_o)),_(e,Qu,Object.assign({},l(this,Qu))),_(e,Id,l(this,Id)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),_(e,Bg,l(this,Bg)),_(e,kg,l(this,kg)),_(e,Ng,l(this,Ng)),_(e,Yu,Object.assign({},l(this,Yu))),_(e,qh,l(this,qh)),e}static lockConfig(){TC=!0}static getGateway(e){return KE[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(TC)throw new Error("gateways locked");KE[e]=t}static registerGetUrl(e){if(TC)throw new Error("gateways locked");Pte=e}static createGetUrlFunc(e){return(0,Ste.createGetUrl)(e)}static createDataGateway(){return Tte}static createIpfsGatewayFunc(e){return Ote(e)}},W2=zE;H2=new WeakMap,K2=new WeakMap,Qu=new WeakMap,Nd=new WeakMap,G2=new WeakMap,V2=new WeakMap,ui=new WeakMap,_o=new WeakMap,Id=new WeakMap,Bg=new WeakMap,kg=new WeakMap,Ng=new WeakMap,h0=new WeakMap,Yu=new WeakMap,qh=new WeakMap,Ig=new WeakSet,u4=async function(e,t,n,s,i){var f,d,g;if(e>=l(this,Yu).maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,Bc.assert)(_te()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),n>0&&await j7e(n);let a=this.clone(),o=(a.url.split(":")[0]||"").toLowerCase();if(o in KE){let h=await KE[o](a.url,GE(l(s,h0)));if(h instanceof Rd){let m=h;if(this.processFunc){GE(l(s,h0));try{m=await this.processFunc(a,m)}catch(y){(y.throttle==null||typeof y.stall!="number")&&m.makeServerError("error in post-processing function",y).assertOk()}}return m}a=h}this.preflightFunc&&(a=await this.preflightFunc(a));let c=await this.getUrlFunc(a,GE(l(s,h0))),u=new Rd(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{let h=u.headers.location||"";return $(f=a.redirect(h),Ig,u4).call(f,e+1,t,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,u,e))){let h=u.headers["retry-after"],m=l(this,Yu).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(m=parseInt(h)),$(d=a.clone(),Ig,u4).call(d,e+1,t,m,s,u)}if(this.processFunc){GE(l(s,h0));try{u=await this.processFunc(a,u)}catch(h){(h.throttle==null||typeof h.stall!="number")&&u.makeServerError("error in post-processing function",h).assertOk();let m=l(this,Yu).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(m=h.stall),$(g=a.clone(),Ig,u4).call(g,e+1,t,m,s,u)}}return u};Dh.FetchRequest=W2;var f4,d4,l4,Ao,z2,Rg,OC=class{constructor(e,t,n,s,i){I(this,f4,void 0);I(this,d4,void 0);I(this,l4,void 0);I(this,Ao,void 0);I(this,z2,void 0);I(this,Rg,void 0);_(this,f4,e),_(this,d4,t),_(this,l4,Object.keys(n).reduce((a,o)=>(a[o.toLowerCase()]=String(n[o]),a),{})),_(this,Ao,s==null?null:new Uint8Array(s)),_(this,z2,i||null),_(this,Rg,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${l(this,Ao)?(0,Ete.hexlify)(l(this,Ao)):"null"}>`}get statusCode(){return l(this,f4)}get statusMessage(){return l(this,d4)}get headers(){return Object.assign({},l(this,l4))}get body(){return l(this,Ao)==null?null:new Uint8Array(l(this,Ao))}get bodyText(){try{return l(this,Ao)==null?"":(0,D2.toUtf8String)(l(this,Ao))}catch{(0,Bc.assert)(!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{(0,Bc.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);let s=new OC(599,n,this.headers,this.body,l(this,z2)||void 0);return _(s,Rg,{message:e,error:t}),s}throwThrottleError(e,t){t==null?t=-1:(0,Bc.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);let n=new Error(e||"throttling requests");throw(0,O7e.defineProperties)(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return l(this,Ao)!=null}get request(){return l(this,z2)}ok(){return l(this,Rg).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=l(this,Rg);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let s=null;try{l(this,Ao)&&(s=(0,D2.toUtf8String)(l(this,Ao)))}catch{}(0,Bc.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}},Rd=OC;f4=new WeakMap,d4=new WeakMap,l4=new WeakMap,Ao=new WeakMap,z2=new WeakMap,Rg=new WeakMap;Dh.FetchResponse=Rd;function _te(){return new Date().getTime()}function R7e(r){return(0,D2.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function j7e(r){return new Promise(e=>setTimeout(e,r))}});var MC=R(WE=>{"use strict";b();p();Object.defineProperty(WE,"__esModule",{value:!0});WE.FixedNumber=void 0;var M7e=Oc(),ba=$u(),Kh=C2(),C7e=Uh(),L7e=BigInt(-1),Xu=BigInt(0),J2=BigInt(1),U7e=BigInt(5),$2={},Z2="0000";for(;Z2.length<80;)Z2+=Z2;function jg(r){let e=Z2;for(;e.length<r;)e+=e;return BigInt("1"+e.substring(0,r))}function h4(r,e,t){let n=BigInt(e.width);if(e.signed){let s=J2<<n-J2;(0,ba.assert)(t==null||r>=-s&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r>Xu?r=(0,Kh.fromTwos)((0,Kh.mask)(r,n),n):r=-(0,Kh.fromTwos)((0,Kh.mask)(-r,n),n)}else{let s=J2<<n;(0,ba.assert)(t==null||r>=0&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r=(r%s+s)%s&s-J2}return r}function BC(r){typeof r=="number"&&(r=`fixed128x${r}`);let e=!0,t=128,n=18;if(typeof r=="string"){if(r!=="fixed")if(r==="ufixed")e=!1;else{let i=r.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,ba.assertArgument)(i,"invalid fixed format","format",r),e=i[1]!=="u",t=parseInt(i[2]),n=parseInt(i[3])}}else if(r){let i=r,a=(o,c,u)=>i[o]==null?u:((0,ba.assertArgument)(typeof i[o]===c,"invalid fixed format ("+o+" not "+c+")","format."+o,i[o]),i[o]);e=a("signed","boolean",e),t=a("width","number",t),n=a("decimals","number",n)}(0,ba.assertArgument)(t%8===0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,ba.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);let s=(e?"":"u")+"fixed"+String(t)+"x"+String(n);return{signed:e,width:t,decimals:n,name:s}}function F7e(r,e){let t="";r<Xu&&(t="-",r*=L7e);let n=r.toString();if(e===0)return t+n;for(;n.length<=e;)n=Z2+n;let s=n.length-e;for(n=n.substring(0,s)+"."+n.substring(s);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 t+n}var ef,Nr,ha,Md,Mg,tf,jd,b4,NC,p4,IC,g4,RC,x4,jC,Hh=class{constructor(e,t,n){I(this,Md);I(this,tf);I(this,b4);I(this,p4);I(this,g4);I(this,x4);N(this,"format");I(this,ef,void 0);I(this,Nr,void 0);I(this,ha,void 0);N(this,"_value");(0,ba.assertPrivate)(e,$2,"FixedNumber"),_(this,Nr,t),_(this,ef,n);let s=F7e(t,n.decimals);(0,C7e.defineProperties)(this,{format:n.name,_value:s}),_(this,ha,jg(n.decimals))}get signed(){return l(this,ef).signed}get width(){return l(this,ef).width}get decimals(){return l(this,ef).decimals}get value(){return l(this,Nr)}addUnsafe(e){return $(this,b4,NC).call(this,e)}add(e){return $(this,b4,NC).call(this,e,"add")}subUnsafe(e){return $(this,p4,IC).call(this,e)}sub(e){return $(this,p4,IC).call(this,e,"sub")}mulUnsafe(e){return $(this,g4,RC).call(this,e)}mul(e){return $(this,g4,RC).call(this,e,"mul")}mulSignal(e){$(this,Md,Mg).call(this,e);let t=l(this,Nr)*l(e,Nr);return(0,ba.assert)(t%l(this,ha)===Xu,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),$(this,tf,jd).call(this,t/l(this,ha),"mulSignal")}divUnsafe(e){return $(this,x4,jC).call(this,e)}div(e){return $(this,x4,jC).call(this,e,"div")}divSignal(e){(0,ba.assert)(l(e,Nr)!==Xu,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),$(this,Md,Mg).call(this,e);let t=l(this,Nr)*l(this,ha);return(0,ba.assert)(t%l(e,Nr)===Xu,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),$(this,tf,jd).call(this,t/l(e,Nr),"divSignal")}cmp(e){let t=this.value,n=e.value,s=this.decimals-e.decimals;return s>0?n*=jg(s):s<0&&(t*=jg(-s)),t<n?-1:t>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=l(this,Nr);return l(this,Nr)<Xu&&(e-=l(this,ha)-J2),e=l(this,Nr)/l(this,ha)*l(this,ha),$(this,tf,jd).call(this,e,"floor")}ceiling(){let e=l(this,Nr);return l(this,Nr)>Xu&&(e+=l(this,ha)-J2),e=l(this,Nr)/l(this,ha)*l(this,ha),$(this,tf,jd).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;let t=this.decimals-e,n=U7e*jg(t-1),s=this.value+n,i=jg(t);return s=s/i*i,h4(s,l(this,ef),"round"),new Hh($2,s,l(this,ef))}isZero(){return l(this,Nr)===Xu}isNegative(){return l(this,Nr)<Xu}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Hh.fromString(this.toString(),e)}static fromValue(e,t,n){let s=t==null?0:(0,Kh.getNumber)(t),i=BC(n),a=(0,Kh.getBigInt)(e,"value"),o=s-i.decimals;if(o>0){let c=jg(o);(0,ba.assert)(a%c===Xu,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),a/=c}else o<0&&(a*=jg(-o));return h4(a,i,"fromValue"),new Hh($2,a,i)}static fromString(e,t){let n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,ba.assertArgument)(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);let s=BC(t),i=n[2]||"0",a=n[3]||"";for(;a.length<s.decimals;)a+=Z2;(0,ba.assert)(a.substring(s.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),a=a.substring(0,s.decimals);let o=BigInt(n[1]+i+a);return h4(o,s,"fromString"),new Hh($2,o,s)}static fromBytes(e,t){let n=(0,Kh.toBigInt)((0,M7e.getBytes)(e,"value")),s=BC(t);return s.signed&&(n=(0,Kh.fromTwos)(n,s.width)),h4(n,s,"fromBytes"),new Hh($2,n,s)}},kC=Hh;ef=new WeakMap,Nr=new WeakMap,ha=new WeakMap,Md=new WeakSet,Mg=function(e){(0,ba.assertArgument)(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)},tf=new WeakSet,jd=function(e,t){return e=h4(e,l(this,ef),t),new Hh($2,e,l(this,ef))},b4=new WeakSet,NC=function(e,t){return $(this,Md,Mg).call(this,e),$(this,tf,jd).call(this,l(this,Nr)+l(e,Nr),t)},p4=new WeakSet,IC=function(e,t){return $(this,Md,Mg).call(this,e),$(this,tf,jd).call(this,l(this,Nr)-l(e,Nr),t)},g4=new WeakSet,RC=function(e,t){return $(this,Md,Mg).call(this,e),$(this,tf,jd).call(this,l(this,Nr)*l(e,Nr)/l(this,ha),t)},x4=new WeakSet,jC=function(e,t){return(0,ba.assert)(l(e,Nr)!==Xu,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),$(this,Md,Mg).call(this,e),$(this,tf,jd).call(this,l(this,Nr)*l(this,ha)/l(e,Nr),t)};WE.FixedNumber=kC});var Mte=R(JE=>{"use strict";b();p();Object.defineProperty(JE,"__esModule",{value:!0});JE.decodeRlp=void 0;var Nte=Oc(),$E=$u(),q7e=Oc();function D7e(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Ite(r,e,t){let n=0;for(let s=0;s<t;s++)n=n*256+r[e+s];return n}function Rte(r,e,t,n){let s=[];for(;t<e+1+n;){let i=jte(r,t);s.push(i.result),t+=i.consumed,(0,$E.assert)(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:s}}function jte(r,e){(0,$E.assert)(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});let t=n=>{(0,$E.assert)(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){let n=r[e]-247;t(e+1+n);let s=Ite(r,e+1,n);return t(e+1+n+s),Rte(r,e,e+1+n,n+s)}else if(r[e]>=192){let n=r[e]-192;return t(e+1+n),Rte(r,e,e+1,n)}else if(r[e]>=184){let n=r[e]-183;t(e+1+n);let s=Ite(r,e+1,n);t(e+1+n+s);let i=(0,Nte.hexlify)(r.slice(e+1+n,e+1+n+s));return{consumed:1+n+s,result:i}}else if(r[e]>=128){let n=r[e]-128;t(e+1+n);let s=(0,Nte.hexlify)(r.slice(e+1,e+1+n));return{consumed:1+n,result:s}}return{consumed:1,result:D7e(r[e])}}function H7e(r){let e=(0,q7e.getBytes)(r,"data"),t=jte(e,0);return(0,$E.assertArgument)(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}JE.decodeRlp=H7e});var Fte=R(ZE=>{"use strict";b();p();Object.defineProperty(ZE,"__esModule",{value:!0});ZE.encodeRlp=void 0;var K7e=Oc();function Cte(r){let e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function Ute(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(i){n=n.concat(Ute(i))}),n.length<=55)return n.unshift(192+n.length),n;let s=Cte(n.length);return s.unshift(247+s.length),s.concat(n)}let e=Array.prototype.slice.call((0,K7e.getBytes)(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let t=Cte(e.length);return t.unshift(183+t.length),t.concat(e)}var Lte="0123456789abcdef";function G7e(r){let e="0x";for(let t of Ute(r))e+=Lte[t>>4],e+=Lte[t&15];return e}ZE.encodeRlp=G7e});var Vte=R(b0=>{"use strict";b();p();Object.defineProperty(b0,"__esModule",{value:!0});b0.parseEther=b0.formatEther=b0.parseUnits=b0.formatUnits=void 0;var CC=$u(),qte=MC(),Dte=C2(),Hte=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Kte(r,e){let t=18;if(typeof e=="string"){let n=Hte.indexOf(e);(0,CC.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,Dte.getNumber)(e,"unit"));return qte.FixedNumber.fromValue(r,t,{decimals:t,width:512}).toString()}b0.formatUnits=Kte;function Gte(r,e){(0,CC.assertArgument)(typeof r=="string","value must be a string","value",r);let t=18;if(typeof e=="string"){let n=Hte.indexOf(e);(0,CC.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,Dte.getNumber)(e,"unit"));return qte.FixedNumber.fromString(r,{decimals:t,width:512}).value}b0.parseUnits=Gte;function V7e(r){return Kte(r,18)}b0.formatEther=V7e;function z7e(r){return Gte(r,18)}b0.parseEther=z7e});var Wte=R(QE=>{"use strict";b();p();Object.defineProperty(QE,"__esModule",{value:!0});QE.uuidV4=void 0;var zte=Oc();function W7e(r){let e=(0,zte.getBytes)(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=(0,zte.hexlify)(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}QE.uuidV4=W7e});var Ne=R(he=>{"use strict";b();p();Object.defineProperty(he,"__esModule",{value:!0});he.toUtf8String=he.toUtf8CodePoints=he.toUtf8Bytes=he.parseUnits=he.formatUnits=he.parseEther=he.formatEther=he.encodeRlp=he.decodeRlp=he.defineProperties=he.resolveProperties=he.toQuantity=he.toBeArray=he.toBeHex=he.toNumber=he.toBigInt=he.getUint=he.getNumber=he.getBigInt=he.mask=he.toTwos=he.fromTwos=he.FixedNumber=he.FetchCancelSignal=he.FetchResponse=he.FetchRequest=he.EventPayload=he.makeError=he.assertNormalize=he.assertPrivate=he.assertArgumentCount=he.assertArgument=he.assert=he.isError=he.isCallException=he.zeroPadBytes=he.zeroPadValue=he.stripZerosLeft=he.dataSlice=he.dataLength=he.concat=he.hexlify=he.isBytesLike=he.isHexString=he.getBytesCopy=he.getBytes=he.encodeBase64=he.decodeBase64=he.encodeBase58=he.decodeBase58=void 0;he.uuidV4=he.Utf8ErrorFuncs=void 0;var $te=bte();Object.defineProperty(he,"decodeBase58",{enumerable:!0,get:function(){return $te.decodeBase58}});Object.defineProperty(he,"encodeBase58",{enumerable:!0,get:function(){return $te.encodeBase58}});var Jte=EC();Object.defineProperty(he,"decodeBase64",{enumerable:!0,get:function(){return Jte.decodeBase64}});Object.defineProperty(he,"encodeBase64",{enumerable:!0,get:function(){return Jte.encodeBase64}});var rf=Oc();Object.defineProperty(he,"getBytes",{enumerable:!0,get:function(){return rf.getBytes}});Object.defineProperty(he,"getBytesCopy",{enumerable:!0,get:function(){return rf.getBytesCopy}});Object.defineProperty(he,"isHexString",{enumerable:!0,get:function(){return rf.isHexString}});Object.defineProperty(he,"isBytesLike",{enumerable:!0,get:function(){return rf.isBytesLike}});Object.defineProperty(he,"hexlify",{enumerable:!0,get:function(){return rf.hexlify}});Object.defineProperty(he,"concat",{enumerable:!0,get:function(){return rf.concat}});Object.defineProperty(he,"dataLength",{enumerable:!0,get:function(){return rf.dataLength}});Object.defineProperty(he,"dataSlice",{enumerable:!0,get:function(){return rf.dataSlice}});Object.defineProperty(he,"stripZerosLeft",{enumerable:!0,get:function(){return rf.stripZerosLeft}});Object.defineProperty(he,"zeroPadValue",{enumerable:!0,get:function(){return rf.zeroPadValue}});Object.defineProperty(he,"zeroPadBytes",{enumerable:!0,get:function(){return rf.zeroPadBytes}});var Gh=$u();Object.defineProperty(he,"isCallException",{enumerable:!0,get:function(){return Gh.isCallException}});Object.defineProperty(he,"isError",{enumerable:!0,get:function(){return Gh.isError}});Object.defineProperty(he,"assert",{enumerable:!0,get:function(){return Gh.assert}});Object.defineProperty(he,"assertArgument",{enumerable:!0,get:function(){return Gh.assertArgument}});Object.defineProperty(he,"assertArgumentCount",{enumerable:!0,get:function(){return Gh.assertArgumentCount}});Object.defineProperty(he,"assertPrivate",{enumerable:!0,get:function(){return Gh.assertPrivate}});Object.defineProperty(he,"assertNormalize",{enumerable:!0,get:function(){return Gh.assertNormalize}});Object.defineProperty(he,"makeError",{enumerable:!0,get:function(){return Gh.makeError}});var $7e=gte();Object.defineProperty(he,"EventPayload",{enumerable:!0,get:function(){return $7e.EventPayload}});var LC=kte();Object.defineProperty(he,"FetchRequest",{enumerable:!0,get:function(){return LC.FetchRequest}});Object.defineProperty(he,"FetchResponse",{enumerable:!0,get:function(){return LC.FetchResponse}});Object.defineProperty(he,"FetchCancelSignal",{enumerable:!0,get:function(){return LC.FetchCancelSignal}});var J7e=MC();Object.defineProperty(he,"FixedNumber",{enumerable:!0,get:function(){return J7e.FixedNumber}});var nf=C2();Object.defineProperty(he,"fromTwos",{enumerable:!0,get:function(){return nf.fromTwos}});Object.defineProperty(he,"toTwos",{enumerable:!0,get:function(){return nf.toTwos}});Object.defineProperty(he,"mask",{enumerable:!0,get:function(){return nf.mask}});Object.defineProperty(he,"getBigInt",{enumerable:!0,get:function(){return nf.getBigInt}});Object.defineProperty(he,"getNumber",{enumerable:!0,get:function(){return nf.getNumber}});Object.defineProperty(he,"getUint",{enumerable:!0,get:function(){return nf.getUint}});Object.defineProperty(he,"toBigInt",{enumerable:!0,get:function(){return nf.toBigInt}});Object.defineProperty(he,"toNumber",{enumerable:!0,get:function(){return nf.toNumber}});Object.defineProperty(he,"toBeHex",{enumerable:!0,get:function(){return nf.toBeHex}});Object.defineProperty(he,"toBeArray",{enumerable:!0,get:function(){return nf.toBeArray}});Object.defineProperty(he,"toQuantity",{enumerable:!0,get:function(){return nf.toQuantity}});var Zte=Uh();Object.defineProperty(he,"resolveProperties",{enumerable:!0,get:function(){return Zte.resolveProperties}});Object.defineProperty(he,"defineProperties",{enumerable:!0,get:function(){return Zte.defineProperties}});var Z7e=Mte();Object.defineProperty(he,"decodeRlp",{enumerable:!0,get:function(){return Z7e.decodeRlp}});var Q7e=Fte();Object.defineProperty(he,"encodeRlp",{enumerable:!0,get:function(){return Q7e.encodeRlp}});var YE=Vte();Object.defineProperty(he,"formatEther",{enumerable:!0,get:function(){return YE.formatEther}});Object.defineProperty(he,"parseEther",{enumerable:!0,get:function(){return YE.parseEther}});Object.defineProperty(he,"formatUnits",{enumerable:!0,get:function(){return YE.formatUnits}});Object.defineProperty(he,"parseUnits",{enumerable:!0,get:function(){return YE.parseUnits}});var XE=HE();Object.defineProperty(he,"toUtf8Bytes",{enumerable:!0,get:function(){return XE.toUtf8Bytes}});Object.defineProperty(he,"toUtf8CodePoints",{enumerable:!0,get:function(){return XE.toUtf8CodePoints}});Object.defineProperty(he,"toUtf8String",{enumerable:!0,get:function(){return XE.toUtf8String}});Object.defineProperty(he,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return XE.Utf8ErrorFuncs}});var Y7e=Wte();Object.defineProperty(he,"uuidV4",{enumerable:!0,get:function(){return Y7e.uuidV4}})});var kc=R(pn=>{"use strict";b();p();Object.defineProperty(pn,"__esModule",{value:!0});pn.Reader=pn.Writer=pn.Coder=pn.checkResultErrors=pn.Result=pn.WordSize=void 0;var rs=Ne();pn.WordSize=32;var UC=new Uint8Array(pn.WordSize),X7e=["then"],eS={},Xte=new WeakMap;function Cg(r){return Xte.get(r)}function Qte(r,e){Xte.set(r,e)}function y4(r,e){let t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function FC(r,e,t){return r.indexOf(null)>=0?e.map((n,s)=>n instanceof m4?FC(Cg(n),n,t):n):r.reduce((n,s,i)=>{let a=e.getValue(s);return s in n||(t&&a instanceof m4&&(a=FC(Cg(a),a,t)),n[s]=a),n},{})}var Y2,Q2=class extends Array{constructor(...t){let n=t[0],s=t[1],i=(t[2]||[]).slice(),a=!0;n!==eS&&(s=t,i=[],a=!1);super(s.length);I(this,Y2,void 0);s.forEach((u,f)=>{this[f]=u});let o=i.reduce((u,f)=>(typeof f=="string"&&u.set(f,(u.get(f)||0)+1),u),new Map);if(Qte(this,Object.freeze(s.map((u,f)=>{let d=i[f];return d!=null&&o.get(d)===1?d:null}))),_(this,Y2,[]),l(this,Y2)==null&&l(this,Y2),!a)return;Object.freeze(this);let c=new Proxy(this,{get:(u,f,d)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){let h=(0,rs.getNumber)(f,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");let m=u[h];return m instanceof Error&&y4(`index ${h}`,m),m}if(X7e.indexOf(f)>=0)return Reflect.get(u,f,d);let g=u[f];if(g instanceof Function)return function(...h){return g.apply(this===d?u:this,h)};if(!(f in u))return u.getValue.apply(this===d?u:this,[f])}return Reflect.get(u,f,d)}});return Qte(c,Cg(this)),c}toArray(t){let n=[];return this.forEach((s,i)=>{s instanceof Error&&y4(`index ${i}`,s),t&&s instanceof Q2&&(s=s.toArray(t)),n.push(s)}),n}toObject(t){let n=Cg(this);return n.reduce((s,i,a)=>((0,rs.assert)(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),FC(n,this,t)),{})}slice(t,n){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);let s=Cg(this),i=[],a=[];for(let o=t;o<n;o++)i.push(this[o]),a.push(s[o]);return new Q2(eS,i,a)}filter(t,n){let s=Cg(this),i=[],a=[];for(let o=0;o<this.length;o++){let c=this[o];c instanceof Error&&y4(`index ${o}`,c),t.call(n,c,o,this)&&(i.push(c),a.push(s[o]))}return new Q2(eS,i,a)}map(t,n){let s=[];for(let i=0;i<this.length;i++){let a=this[i];a instanceof Error&&y4(`index ${i}`,a),s.push(t.call(n,a,i,this))}return s}getValue(t){let n=Cg(this).indexOf(t);if(n===-1)return;let s=this[n];return s instanceof Error&&y4(`property ${JSON.stringify(t)}`,s.error),s}static fromItems(t,n){return new Q2(eS,t,n)}},m4=Q2;Y2=new WeakMap;pn.Result=m4;function e9e(r){let e=[],t=function(n,s){if(!!Array.isArray(s))for(let i in s){let a=n.slice();a.push(i);try{t(a,s[i])}catch(o){e.push({path:a,error:o})}}};return t([],r),e}pn.checkResultErrors=e9e;function Yte(r){let e=(0,rs.toBeArray)(r);return(0,rs.assert)(e.length<=pn.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:pn.WordSize,offset:e.length}),e.length!==pn.WordSize&&(e=(0,rs.getBytesCopy)((0,rs.concat)([UC.slice(e.length%pn.WordSize),e]))),e}var qC=class{constructor(e,t,n,s){N(this,"name");N(this,"type");N(this,"localName");N(this,"dynamic");(0,rs.defineProperties)(this,{name:e,type:t,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){(0,rs.assertArgument)(!1,e,this.localName,t)}};pn.Coder=qC;var Cd,Lg,X2,tS,DC=class{constructor(){I(this,X2);I(this,Cd,void 0);I(this,Lg,void 0);_(this,Cd,[]),_(this,Lg,0)}get data(){return(0,rs.concat)(l(this,Cd))}get length(){return l(this,Lg)}appendWriter(e){return $(this,X2,tS).call(this,(0,rs.getBytesCopy)(e.data))}writeBytes(e){let t=(0,rs.getBytesCopy)(e),n=t.length%pn.WordSize;return n&&(t=(0,rs.getBytesCopy)((0,rs.concat)([t,UC.slice(n)]))),$(this,X2,tS).call(this,t)}writeValue(e){return $(this,X2,tS).call(this,Yte(e))}writeUpdatableValue(){let e=l(this,Cd).length;return l(this,Cd).push(UC),_(this,Lg,l(this,Lg)+pn.WordSize),t=>{l(this,Cd)[e]=Yte(t)}}};Cd=new WeakMap,Lg=new WeakMap,X2=new WeakSet,tS=function(e){return l(this,Cd).push(e),_(this,Lg,l(this,Lg)+e.length),e.length};pn.Writer=DC;var Ja,Eo,Ug,Fg,Vh,w4,KC,rS,ere,GC=class{constructor(e,t,n){I(this,w4);I(this,rS);N(this,"allowLoose");I(this,Ja,void 0);I(this,Eo,void 0);I(this,Ug,void 0);I(this,Fg,void 0);I(this,Vh,void 0);(0,rs.defineProperties)(this,{allowLoose:!!t}),_(this,Ja,(0,rs.getBytesCopy)(e)),_(this,Ug,0),_(this,Fg,null),_(this,Vh,n??1024),_(this,Eo,0)}get data(){return(0,rs.hexlify)(l(this,Ja))}get dataLength(){return l(this,Ja).length}get consumed(){return l(this,Eo)}get bytes(){return new Uint8Array(l(this,Ja))}subReader(e){let t=new GC(l(this,Ja).slice(l(this,Eo)+e),this.allowLoose,l(this,Vh));return _(t,Fg,this),t}readBytes(e,t){let n=$(this,rS,ere).call(this,0,e,!!t);return $(this,w4,KC).call(this,e),_(this,Eo,l(this,Eo)+n.length),n.slice(0,e)}readValue(){return(0,rs.toBigInt)(this.readBytes(pn.WordSize))}readIndex(){return(0,rs.toNumber)(this.readBytes(pn.WordSize))}},HC=GC;Ja=new WeakMap,Eo=new WeakMap,Ug=new WeakMap,Fg=new WeakMap,Vh=new WeakMap,w4=new WeakSet,KC=function(e){var t;if(l(this,Fg))return $(t=l(this,Fg),w4,KC).call(t,e);_(this,Ug,l(this,Ug)+e),(0,rs.assert)(l(this,Vh)<1||l(this,Ug)<=l(this,Vh)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${l(this,Vh)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,rs.getBytesCopy)(l(this,Ja)),offset:l(this,Eo),length:e,info:{bytesRead:l(this,Ug),dataLength:this.dataLength}})},rS=new WeakSet,ere=function(e,t,n){let s=Math.ceil(t/pn.WordSize)*pn.WordSize;return l(this,Eo)+s>l(this,Ja).length&&(this.allowLoose&&n&&l(this,Eo)+t<=l(this,Ja).length?s=t:(0,rs.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,rs.getBytesCopy)(l(this,Ja)),length:l(this,Ja).length,offset:l(this,Eo)+s})),l(this,Ja).slice(l(this,Eo),l(this,Eo)+s)};pn.Reader=HC});var e3=R(pa=>{"use strict";b();p();Object.defineProperty(pa,"__esModule",{value:!0});pa.output=pa.exists=pa.hash=pa.bytes=pa.bool=pa.number=void 0;function nS(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}pa.number=nS;function tre(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}pa.bool=tre;function VC(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}pa.bytes=VC;function rre(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");nS(r.outputLen),nS(r.blockLen)}pa.hash=rre;function nre(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}pa.exists=nre;function sre(r,e){VC(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}pa.output=sre;var t9e={number:nS,bool:tre,bytes:VC,hash:rre,exists:nre,output:sre};pa.default=t9e});var ire=R(sS=>{"use strict";b();p();Object.defineProperty(sS,"__esModule",{value:!0});sS.crypto=void 0;sS.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var sf=R(Ft=>{"use strict";b();p();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.randomBytes=Ft.wrapXOFConstructorWithOpts=Ft.wrapConstructorWithOpts=Ft.wrapConstructor=Ft.checkOpts=Ft.Hash=Ft.concatBytes=Ft.toBytes=Ft.utf8ToBytes=Ft.asyncLoop=Ft.nextTick=Ft.hexToBytes=Ft.bytesToHex=Ft.isLE=Ft.rotr=Ft.createView=Ft.u32=Ft.u8=void 0;var zC=ire(),$C=r=>r instanceof Uint8Array,r9e=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Ft.u8=r9e;var n9e=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Ft.u32=n9e;var s9e=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Ft.createView=s9e;var i9e=(r,e)=>r<<32-e|r>>>e;Ft.rotr=i9e;Ft.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ft.isLE)throw new Error("Non little-endian hardware is not supported");var a9e=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function o9e(r){if(!$C(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=a9e[r[t]];return e}Ft.bytesToHex=o9e;function c9e(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");t[n]=a}return t}Ft.hexToBytes=c9e;var u9e=async()=>{};Ft.nextTick=u9e;async function f9e(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,Ft.nextTick)(),n+=i)}}Ft.asyncLoop=f9e;function are(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Ft.utf8ToBytes=are;function iS(r){if(typeof r=="string"&&(r=are(r)),!$C(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}Ft.toBytes=iS;function d9e(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!$C(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}Ft.concatBytes=d9e;var WC=class{clone(){return this._cloneInto()}};Ft.Hash=WC;var l9e={}.toString;function h9e(r,e){if(e!==void 0&&l9e.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}Ft.checkOpts=h9e;function b9e(r){let e=n=>r().update(iS(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}Ft.wrapConstructor=b9e;function p9e(r){let e=(n,s)=>r(s).update(iS(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Ft.wrapConstructorWithOpts=p9e;function g9e(r){let e=(n,s)=>r(s).update(iS(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Ft.wrapXOFConstructorWithOpts=g9e;function x9e(r=32){if(zC.crypto&&typeof zC.crypto.getRandomValues=="function")return zC.crypto.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}Ft.randomBytes=x9e});var oS=R(qg=>{"use strict";b();p();Object.defineProperty(qg,"__esModule",{value:!0});qg.hmac=qg.HMAC=void 0;var aS=e3(),ore=sf(),v4=class extends ore.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,aS.hash)(e);let n=(0,ore.toBytes)(t);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;let s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let a=0;a<i.length;a++)i[a]^=54;this.iHash.update(i),this.oHash=e.create();for(let a=0;a<i.length;a++)i[a]^=106;this.oHash.update(i),i.fill(0)}update(e){return(0,aS.exists)(this),this.iHash.update(e),this}digestInto(e){(0,aS.exists)(this),(0,aS.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:n,finished:s,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};qg.HMAC=v4;var y9e=(r,e,t)=>new v4(r,e).update(t).digest();qg.hmac=y9e;qg.hmac.create=(r,e)=>new v4(r,e)});var JC=R(r3=>{"use strict";b();p();Object.defineProperty(r3,"__esModule",{value:!0});r3.pbkdf2Async=r3.pbkdf2=void 0;var cS=e3(),m9e=oS(),t3=sf();function cre(r,e,t,n){(0,cS.hash)(r);let s=(0,t3.checkOpts)({dkLen:32,asyncTick:10},n),{c:i,dkLen:a,asyncTick:o}=s;if((0,cS.number)(i),(0,cS.number)(a),(0,cS.number)(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=(0,t3.toBytes)(e),u=(0,t3.toBytes)(t),f=new Uint8Array(a),d=m9e.hmac.create(r,c),g=d._cloneInto().update(u);return{c:i,dkLen:a,asyncTick:o,DK:f,PRF:d,PRFSalt:g}}function ure(r,e,t,n,s){return r.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),t}function w9e(r,e,t,n){let{c:s,dkLen:i,DK:a,PRF:o,PRFSalt:c}=cre(r,e,t,n),u,f=new Uint8Array(4),d=(0,t3.createView)(f),g=new Uint8Array(o.outputLen);for(let h=1,m=0;m<i;h++,m+=o.outputLen){let y=a.subarray(m,m+o.outputLen);d.setInt32(0,h,!1),(u=c._cloneInto(u)).update(f).digestInto(g),y.set(g.subarray(0,y.length));for(let S=1;S<s;S++){o._cloneInto(u).update(g).digestInto(g);for(let T=0;T<y.length;T++)y[T]^=g[T]}}return ure(o,c,a,u,g)}r3.pbkdf2=w9e;async function v9e(r,e,t,n){let{c:s,dkLen:i,asyncTick:a,DK:o,PRF:c,PRFSalt:u}=cre(r,e,t,n),f,d=new Uint8Array(4),g=(0,t3.createView)(d),h=new Uint8Array(c.outputLen);for(let m=1,y=0;y<i;m++,y+=c.outputLen){let S=o.subarray(y,y+c.outputLen);g.setInt32(0,m,!1),(f=u._cloneInto(f)).update(d).digestInto(h),S.set(h.subarray(0,S.length)),await(0,t3.asyncLoop)(s-1,a,()=>{c._cloneInto(f).update(h).digestInto(h);for(let T=0;T<S.length;T++)S[T]^=h[T]})}return ure(c,u,o,f,h)}r3.pbkdf2Async=v9e});var fS=R(uS=>{"use strict";b();p();Object.defineProperty(uS,"__esModule",{value:!0});uS.SHA2=void 0;var ZC=e3(),P4=sf();function P9e(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),a=Number(t>>s&i),o=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,a,n),r.setUint32(e+u,o,n)}var QC=class extends P4.Hash{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,P4.createView)(this.buffer)}update(e){(0,ZC.exists)(this);let{view:t,buffer:n,blockLen:s}=this;e=(0,P4.toBytes)(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(s-this.pos,i-a);if(o===s){let c=(0,P4.createView)(e);for(;s<=i-a;a+=s)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,ZC.exists)(this),(0,ZC.output)(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let d=a;d<s;d++)t[d]=0;P9e(n,s-8,BigInt(this.length*8),i),this.process(n,0);let o=(0,P4.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)o.setUint32(4*d,f[d],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:a,pos:o}=this;return e.length=s,e.pos=o,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(n),e}};uS.SHA2=QC});var lS=R(n3=>{"use strict";b();p();Object.defineProperty(n3,"__esModule",{value:!0});n3.sha224=n3.sha256=void 0;var _9e=fS(),Nc=sf(),A9e=(r,e,t)=>r&e^~r&t,E9e=(r,e,t)=>r&e^r&t^e&t,S9e=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]),zh=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Wh=new Uint32Array(64),dS=class extends _9e.SHA2{constructor(){super(64,32,8,!1),this.A=zh[0]|0,this.B=zh[1]|0,this.C=zh[2]|0,this.D=zh[3]|0,this.E=zh[4]|0,this.F=zh[5]|0,this.G=zh[6]|0,this.H=zh[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:a,G:o,H:c}=this;return[e,t,n,s,i,a,o,c]}set(e,t,n,s,i,a,o,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,t){for(let d=0;d<16;d++,t+=4)Wh[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=Wh[d-15],h=Wh[d-2],m=(0,Nc.rotr)(g,7)^(0,Nc.rotr)(g,18)^g>>>3,y=(0,Nc.rotr)(h,17)^(0,Nc.rotr)(h,19)^h>>>10;Wh[d]=y+Wh[d-7]+m+Wh[d-16]|0}let{A:n,B:s,C:i,D:a,E:o,F:c,G:u,H:f}=this;for(let d=0;d<64;d++){let g=(0,Nc.rotr)(o,6)^(0,Nc.rotr)(o,11)^(0,Nc.rotr)(o,25),h=f+g+A9e(o,c,u)+S9e[d]+Wh[d]|0,y=((0,Nc.rotr)(n,2)^(0,Nc.rotr)(n,13)^(0,Nc.rotr)(n,22))+E9e(n,s,i)|0;f=u,u=c,c=o,o=a+h|0,a=i,i=s,s=n,n=h+y|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+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,s,i,a,o,c,u,f)}roundClean(){Wh.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},YC=class extends dS{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};n3.sha256=(0,Nc.wrapConstructor)(()=>new dS);n3.sha224=(0,Nc.wrapConstructor)(()=>new YC)});var tL=R(ut=>{"use strict";b();p();Object.defineProperty(ut,"__esModule",{value:!0});ut.add5L=ut.add5H=ut.add4H=ut.add4L=ut.add3H=ut.add3L=ut.add=ut.rotlBL=ut.rotlBH=ut.rotlSL=ut.rotlSH=ut.rotr32L=ut.rotr32H=ut.rotrBL=ut.rotrBH=ut.rotrSL=ut.rotrSH=ut.shrSL=ut.shrSH=ut.toBig=ut.split=ut.fromBig=void 0;var hS=BigInt(2**32-1),XC=BigInt(32);function eL(r,e=!1){return e?{h:Number(r&hS),l:Number(r>>XC&hS)}:{h:Number(r>>XC&hS)|0,l:Number(r&hS)|0}}ut.fromBig=eL;function fre(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:a}=eL(r[s],e);[t[s],n[s]]=[i,a]}return[t,n]}ut.split=fre;var dre=(r,e)=>BigInt(r>>>0)<<XC|BigInt(e>>>0);ut.toBig=dre;var lre=(r,e,t)=>r>>>t;ut.shrSH=lre;var hre=(r,e,t)=>r<<32-t|e>>>t;ut.shrSL=hre;var bre=(r,e,t)=>r>>>t|e<<32-t;ut.rotrSH=bre;var pre=(r,e,t)=>r<<32-t|e>>>t;ut.rotrSL=pre;var gre=(r,e,t)=>r<<64-t|e>>>t-32;ut.rotrBH=gre;var xre=(r,e,t)=>r>>>t-32|e<<64-t;ut.rotrBL=xre;var yre=(r,e)=>e;ut.rotr32H=yre;var mre=(r,e)=>r;ut.rotr32L=mre;var wre=(r,e,t)=>r<<t|e>>>32-t;ut.rotlSH=wre;var vre=(r,e,t)=>e<<t|r>>>32-t;ut.rotlSL=vre;var Pre=(r,e,t)=>e<<t-32|r>>>64-t;ut.rotlBH=Pre;var _re=(r,e,t)=>r<<t-32|e>>>64-t;ut.rotlBL=_re;function Are(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}ut.add=Are;var Ere=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);ut.add3L=Ere;var Sre=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;ut.add3H=Sre;var Tre=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);ut.add4L=Tre;var Ore=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;ut.add4H=Ore;var Bre=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);ut.add5L=Bre;var kre=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;ut.add5H=kre;var T9e={fromBig:eL,split:fre,toBig:dre,shrSH:lre,shrSL:hre,rotrSH:bre,rotrSL:pre,rotrBH:gre,rotrBL:xre,rotr32H:yre,rotr32L:mre,rotlSH:wre,rotlSL:vre,rotlBH:Pre,rotlBL:_re,add:Are,add3L:Ere,add3H:Sre,add4L:Tre,add4H:Ore,add5H:kre,add5L:Bre};ut.default=T9e});var Nre=R(Ic=>{"use strict";b();p();Object.defineProperty(Ic,"__esModule",{value:!0});Ic.sha384=Ic.sha512_256=Ic.sha512_224=Ic.sha512=Ic.SHA512=void 0;var O9e=fS(),qt=tL(),bS=sf(),[B9e,k9e]=(()=>qt.default.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(r=>BigInt(r))))(),$h=new Uint32Array(80),Jh=new Uint32Array(80),Dg=class extends O9e.SHA2{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(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:a,Dh:o,Dl:c,Eh:u,El:f,Fh:d,Fl:g,Gh:h,Gl:m,Hh:y,Hl:S}=this;return[e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S]}set(e,t,n,s,i,a,o,c,u,f,d,g,h,m,y,S){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=d|0,this.Fl=g|0,this.Gh=h|0,this.Gl=m|0,this.Hh=y|0,this.Hl=S|0}process(e,t){for(let C=0;C<16;C++,t+=4)$h[C]=e.getUint32(t),Jh[C]=e.getUint32(t+=4);for(let C=16;C<80;C++){let J=$h[C-15]|0,z=Jh[C-15]|0,W=qt.default.rotrSH(J,z,1)^qt.default.rotrSH(J,z,8)^qt.default.shrSH(J,z,7),Y=qt.default.rotrSL(J,z,1)^qt.default.rotrSL(J,z,8)^qt.default.shrSL(J,z,7),Z=$h[C-2]|0,se=Jh[C-2]|0,q=qt.default.rotrSH(Z,se,19)^qt.default.rotrBH(Z,se,61)^qt.default.shrSH(Z,se,6),x=qt.default.rotrSL(Z,se,19)^qt.default.rotrBL(Z,se,61)^qt.default.shrSL(Z,se,6),O=qt.default.add4L(Y,x,Jh[C-7],Jh[C-16]),B=qt.default.add4H(O,W,q,$h[C-7],$h[C-16]);$h[C]=B|0,Jh[C]=O|0}let{Ah:n,Al:s,Bh:i,Bl:a,Ch:o,Cl:c,Dh:u,Dl:f,Eh:d,El:g,Fh:h,Fl:m,Gh:y,Gl:S,Hh:T,Hl:H}=this;for(let C=0;C<80;C++){let J=qt.default.rotrSH(d,g,14)^qt.default.rotrSH(d,g,18)^qt.default.rotrBH(d,g,41),z=qt.default.rotrSL(d,g,14)^qt.default.rotrSL(d,g,18)^qt.default.rotrBL(d,g,41),W=d&h^~d&y,Y=g&m^~g&S,Z=qt.default.add5L(H,z,Y,k9e[C],Jh[C]),se=qt.default.add5H(Z,T,J,W,B9e[C],$h[C]),q=Z|0,x=qt.default.rotrSH(n,s,28)^qt.default.rotrBH(n,s,34)^qt.default.rotrBH(n,s,39),O=qt.default.rotrSL(n,s,28)^qt.default.rotrBL(n,s,34)^qt.default.rotrBL(n,s,39),B=n&i^n&o^i&o,A=s&a^s&c^a&c;T=y|0,H=S|0,y=h|0,S=m|0,h=d|0,m=g|0,{h:d,l:g}=qt.default.add(u|0,f|0,se|0,q|0),u=o|0,f=c|0,o=i|0,c=a|0,i=n|0,a=s|0;let E=qt.default.add3L(q,O,A);n=qt.default.add3H(E,se,x,B),s=E|0}({h:n,l:s}=qt.default.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:a}=qt.default.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:c}=qt.default.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:u,l:f}=qt.default.add(this.Dh|0,this.Dl|0,u|0,f|0),{h:d,l:g}=qt.default.add(this.Eh|0,this.El|0,d|0,g|0),{h,l:m}=qt.default.add(this.Fh|0,this.Fl|0,h|0,m|0),{h:y,l:S}=qt.default.add(this.Gh|0,this.Gl|0,y|0,S|0),{h:T,l:H}=qt.default.add(this.Hh|0,this.Hl|0,T|0,H|0),this.set(n,s,i,a,o,c,u,f,d,g,h,m,y,S,T,H)}roundClean(){$h.fill(0),Jh.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)}};Ic.SHA512=Dg;var rL=class extends Dg{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},nL=class extends Dg{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},sL=class extends Dg{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};Ic.sha512=(0,bS.wrapConstructor)(()=>new Dg);Ic.sha512_224=(0,bS.wrapConstructor)(()=>new rL);Ic.sha512_256=(0,bS.wrapConstructor)(()=>new nL);Ic.sha384=(0,bS.wrapConstructor)(()=>new sL)});var A4=R(p0=>{"use strict";b();p();Object.defineProperty(p0,"__esModule",{value:!0});p0.randomBytes=p0.pbkdf2Sync=p0.createHmac=p0.createHash=void 0;var N9e=oS(),I9e=JC(),iL=lS(),aL=Nre(),_4=Ne();function R9e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}var Ire=R9e(),Rre=Ire.crypto||Ire.msCrypto;function j9e(r){switch(r){case"sha256":return iL.sha256.create();case"sha512":return aL.sha512.create()}(0,_4.assertArgument)(!1,"invalid hashing algorithm name","algorithm",r)}p0.createHash=j9e;function M9e(r,e){let t={sha256:iL.sha256,sha512:aL.sha512}[r];return(0,_4.assertArgument)(t!=null,"invalid hmac algorithm","algorithm",r),N9e.hmac.create(t,e)}p0.createHmac=M9e;function C9e(r,e,t,n,s){let i={sha256:iL.sha256,sha512:aL.sha512}[s];return(0,_4.assertArgument)(i!=null,"invalid pbkdf2 algorithm","algorithm",s),(0,I9e.pbkdf2)(i,r,e,{c:t,dkLen:n})}p0.pbkdf2Sync=C9e;function L9e(r){(0,_4.assert)(Rre!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,_4.assertArgument)(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);let e=new Uint8Array(r);return Rre.getRandomValues(e),e}p0.randomBytes=L9e});var Lre=R(pS=>{"use strict";b();p();Object.defineProperty(pS,"__esModule",{value:!0});pS.computeHmac=void 0;var U9e=A4(),oL=Ne(),jre=!1,Mre=function(r,e,t){return(0,U9e.createHmac)(r,e).update(t).digest()},Cre=Mre;function E4(r,e,t){let n=(0,oL.getBytes)(e,"key"),s=(0,oL.getBytes)(t,"data");return(0,oL.hexlify)(Cre(r,n,s))}pS.computeHmac=E4;E4._=Mre;E4.lock=function(){jre=!0};E4.register=function(r){if(jre)throw new Error("computeHmac is locked");Cre=r};Object.freeze(E4)});var Vre=R(Qr=>{"use strict";b();p();Object.defineProperty(Qr,"__esModule",{value:!0});Qr.shake256=Qr.shake128=Qr.keccak_512=Qr.keccak_384=Qr.keccak_256=Qr.keccak_224=Qr.sha3_512=Qr.sha3_384=Qr.sha3_256=Qr.sha3_224=Qr.Keccak=Qr.keccakP=void 0;var s3=e3(),O4=tL(),T4=sf(),[qre,Dre,Hre]=[[],[],[]],F9e=BigInt(0),S4=BigInt(1),q9e=BigInt(2),D9e=BigInt(7),H9e=BigInt(256),K9e=BigInt(113);for(let r=0,e=S4,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],qre.push(2*(5*n+t)),Dre.push((r+1)*(r+2)/2%64);let s=F9e;for(let i=0;i<7;i++)e=(e<<S4^(e>>D9e)*K9e)%H9e,e&q9e&&(s^=S4<<(S4<<BigInt(i))-S4);Hre.push(s)}var[G9e,V9e]=(0,O4.split)(Hre,!0),Ure=(r,e,t)=>t>32?(0,O4.rotlBH)(r,e,t):(0,O4.rotlSH)(r,e,t),Fre=(r,e,t)=>t>32?(0,O4.rotlBL)(r,e,t):(0,O4.rotlSL)(r,e,t);function Kre(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)t[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){let o=(a+8)%10,c=(a+2)%10,u=t[c],f=t[c+1],d=Ure(u,f,1)^t[o],g=Fre(u,f,1)^t[o+1];for(let h=0;h<50;h+=10)r[a+h]^=d,r[a+h+1]^=g}let s=r[2],i=r[3];for(let a=0;a<24;a++){let o=Dre[a],c=Ure(s,i,o),u=Fre(s,i,o),f=qre[a];s=r[f],i=r[f+1],r[f]=c,r[f+1]=u}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=r[a+o];for(let o=0;o<10;o++)r[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}r[0]^=G9e[n],r[1]^=V9e[n]}t.fill(0)}Qr.keccakP=Kre;var Hg=class extends T4.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,s3.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,T4.u32)(this.state)}keccak(){Kre(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,s3.exists)(this);let{blockLen:t,state:n}=this;e=(0,T4.toBytes)(e);let s=e.length;for(let i=0;i<s;){let a=Math.min(t-this.pos,s-i);for(let o=0;o<a;o++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,s3.exists)(this,!1),(0,s3.bytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,s3.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,s3.output)(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){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:a}=this;return e||(e=new Hg(t,n,s,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}};Qr.Keccak=Hg;var Zh=(r,e,t)=>(0,T4.wrapConstructor)(()=>new Hg(e,r,t));Qr.sha3_224=Zh(6,144,224/8);Qr.sha3_256=Zh(6,136,256/8);Qr.sha3_384=Zh(6,104,384/8);Qr.sha3_512=Zh(6,72,512/8);Qr.keccak_224=Zh(1,144,224/8);Qr.keccak_256=Zh(1,136,256/8);Qr.keccak_384=Zh(1,104,384/8);Qr.keccak_512=Zh(1,72,512/8);var Gre=(r,e,t)=>(0,T4.wrapXOFConstructorWithOpts)((n={})=>new Hg(e,r,n.dkLen===void 0?t:n.dkLen,!0));Qr.shake128=Gre(31,168,128/8);Qr.shake256=Gre(31,136,256/8)});var Zre=R(gS=>{"use strict";b();p();Object.defineProperty(gS,"__esModule",{value:!0});gS.keccak256=void 0;var z9e=Vre(),zre=Ne(),Wre=!1,$re=function(r){return(0,z9e.keccak_256)(r)},Jre=$re;function B4(r){let e=(0,zre.getBytes)(r,"data");return(0,zre.hexlify)(Jre(e))}gS.keccak256=B4;B4._=$re;B4.lock=function(){Wre=!0};B4.register=function(r){if(Wre)throw new TypeError("keccak256 is locked");Jre=r};Object.freeze(B4)});var ene=R(i3=>{"use strict";b();p();Object.defineProperty(i3,"__esModule",{value:!0});i3.ripemd160=i3.RIPEMD160=void 0;var W9e=fS(),$9e=sf(),J9e=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Yre=Uint8Array.from({length:16},(r,e)=>e),Z9e=Yre.map(r=>(9*r+5)%16),cL=[Yre],uL=[Z9e];for(let r=0;r<4;r++)for(let e of[cL,uL])e.push(e[r].map(t=>J9e[t]));var Xre=[[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(r=>new Uint8Array(r)),Q9e=cL.map((r,e)=>r.map(t=>Xre[e][t])),Y9e=uL.map((r,e)=>r.map(t=>Xre[e][t])),X9e=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),ePe=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),xS=(r,e)=>r<<e|r>>>32-e;function Qre(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}var yS=new Uint32Array(16),mS=class extends W9e.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:s,h4:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=s|0,this.h4=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)yS[h]=e.getUint32(t,!0);let n=this.h0|0,s=n,i=this.h1|0,a=i,o=this.h2|0,c=o,u=this.h3|0,f=u,d=this.h4|0,g=d;for(let h=0;h<5;h++){let m=4-h,y=X9e[h],S=ePe[h],T=cL[h],H=uL[h],C=Q9e[h],J=Y9e[h];for(let z=0;z<16;z++){let W=xS(n+Qre(h,i,o,u)+yS[T[z]]+y,C[z])+d|0;n=d,d=u,u=xS(o,10)|0,o=i,i=W}for(let z=0;z<16;z++){let W=xS(s+Qre(m,a,c,f)+yS[H[z]]+S,J[z])+g|0;s=g,g=f,f=xS(c,10)|0,c=a,a=W}}this.set(this.h1+o+f|0,this.h2+u+g|0,this.h3+d+s|0,this.h4+n+a|0,this.h0+i+c|0)}roundClean(){yS.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};i3.RIPEMD160=mS;i3.ripemd160=(0,$9e.wrapConstructor)(()=>new mS)});var ine=R(wS=>{"use strict";b();p();Object.defineProperty(wS,"__esModule",{value:!0});wS.ripemd160=void 0;var tPe=ene(),tne=Ne(),rne=!1,nne=function(r){return(0,tPe.ripemd160)(r)},sne=nne;function k4(r){let e=(0,tne.getBytes)(r,"data");return(0,tne.hexlify)(sne(e))}wS.ripemd160=k4;k4._=nne;k4.lock=function(){rne=!0};k4.register=function(r){if(rne)throw new TypeError("ripemd160 is locked");sne=r};Object.freeze(k4)});var une=R(vS=>{"use strict";b();p();Object.defineProperty(vS,"__esModule",{value:!0});vS.pbkdf2=void 0;var rPe=A4(),fL=Ne(),ane=!1,one=function(r,e,t,n,s){return(0,rPe.pbkdf2Sync)(r,e,t,n,s)},cne=one;function N4(r,e,t,n,s){let i=(0,fL.getBytes)(r,"password"),a=(0,fL.getBytes)(e,"salt");return(0,fL.hexlify)(cne(i,a,t,n,s))}vS.pbkdf2=N4;N4._=one;N4.lock=function(){ane=!0};N4.register=function(r){if(ane)throw new Error("pbkdf2 is locked");cne=r};Object.freeze(N4)});var hne=R(PS=>{"use strict";b();p();Object.defineProperty(PS,"__esModule",{value:!0});PS.randomBytes=void 0;var nPe=A4(),fne=!1,dne=function(r){return new Uint8Array((0,nPe.randomBytes)(r))},lne=dne;function I4(r){return lne(r)}PS.randomBytes=I4;I4._=dne;I4.lock=function(){fne=!0};I4.register=function(r){if(fne)throw new Error("randomBytes is locked");lne=r};Object.freeze(I4)});var mne=R(u3=>{"use strict";b();p();Object.defineProperty(u3,"__esModule",{value:!0});u3.scryptAsync=u3.scrypt=void 0;var a3=e3(),pne=lS(),gne=JC(),o3=sf(),xr=(r,e)=>r<<e|r>>>32-e;function bne(r,e,t,n,s,i){let a=r[e++]^t[n++],o=r[e++]^t[n++],c=r[e++]^t[n++],u=r[e++]^t[n++],f=r[e++]^t[n++],d=r[e++]^t[n++],g=r[e++]^t[n++],h=r[e++]^t[n++],m=r[e++]^t[n++],y=r[e++]^t[n++],S=r[e++]^t[n++],T=r[e++]^t[n++],H=r[e++]^t[n++],C=r[e++]^t[n++],J=r[e++]^t[n++],z=r[e++]^t[n++],W=a,Y=o,Z=c,se=u,q=f,x=d,O=g,B=h,A=m,E=y,j=S,G=T,M=H,P=C,K=J,re=z;for(let ie=0;ie<8;ie+=2)q^=xr(W+M|0,7),A^=xr(q+W|0,9),M^=xr(A+q|0,13),W^=xr(M+A|0,18),E^=xr(x+Y|0,7),P^=xr(E+x|0,9),Y^=xr(P+E|0,13),x^=xr(Y+P|0,18),K^=xr(j+O|0,7),Z^=xr(K+j|0,9),O^=xr(Z+K|0,13),j^=xr(O+Z|0,18),se^=xr(re+G|0,7),B^=xr(se+re|0,9),G^=xr(B+se|0,13),re^=xr(G+B|0,18),Y^=xr(W+se|0,7),Z^=xr(Y+W|0,9),se^=xr(Z+Y|0,13),W^=xr(se+Z|0,18),O^=xr(x+q|0,7),B^=xr(O+x|0,9),q^=xr(B+O|0,13),x^=xr(q+B|0,18),G^=xr(j+E|0,7),A^=xr(G+j|0,9),E^=xr(A+G|0,13),j^=xr(E+A|0,18),M^=xr(re+K|0,7),P^=xr(M+re|0,9),K^=xr(P+M|0,13),re^=xr(K+P|0,18);s[i++]=a+W|0,s[i++]=o+Y|0,s[i++]=c+Z|0,s[i++]=u+se|0,s[i++]=f+q|0,s[i++]=d+x|0,s[i++]=g+O|0,s[i++]=h+B|0,s[i++]=m+A|0,s[i++]=y+E|0,s[i++]=S+j|0,s[i++]=T+G|0,s[i++]=H+M|0,s[i++]=C+P|0,s[i++]=J+K|0,s[i++]=z+re|0}function c3(r,e,t,n,s){let i=n+0,a=n+16*s;for(let o=0;o<16;o++)t[a+o]=r[e+(2*s-1)*16+o];for(let o=0;o<s;o++,i+=16,e+=16)bne(t,a,r,e,t,i),o>0&&(a+=16),bne(t,i,r,e+=16,t,a)}function xne(r,e,t){let n=(0,o3.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:s,r:i,p:a,dkLen:o,asyncTick:c,maxmem:u,onProgress:f}=n;if((0,a3.number)(s),(0,a3.number)(i),(0,a3.number)(a),(0,a3.number)(o),(0,a3.number)(c),(0,a3.number)(u),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");let d=128*i,g=d/4;if(s<=1||(s&s-1)!==0||s>=2**(d/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/d)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");let h=d*(s+a);if(h>u)throw new Error(`Scrypt: parameters too large, ${h} (128 * r * (N + p)) > ${u} (maxmem)`);let m=(0,gne.pbkdf2)(pne.sha256,r,e,{c:1,dkLen:d*a}),y=(0,o3.u32)(m),S=(0,o3.u32)(new Uint8Array(d*s)),T=(0,o3.u32)(new Uint8Array(d)),H=()=>{};if(f){let C=2*s*a,J=Math.max(Math.floor(C/1e4),1),z=0;H=()=>{z++,f&&(!(z%J)||z===C)&&f(z/C)}}return{N:s,r:i,p:a,dkLen:o,blockSize32:g,V:S,B32:y,B:m,tmp:T,blockMixCb:H,asyncTick:c}}function yne(r,e,t,n,s){let i=(0,gne.pbkdf2)(pne.sha256,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),s.fill(0),i}function sPe(r,e,t){let{N:n,r:s,p:i,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:d,blockMixCb:g}=xne(r,e,t);for(let h=0;h<i;h++){let m=o*h;for(let y=0;y<o;y++)c[y]=u[m+y];for(let y=0,S=0;y<n-1;y++)c3(c,S,c,S+=o,s),g();c3(c,(n-1)*o,u,m,s),g();for(let y=0;y<n;y++){let S=u[m+o-16]%n;for(let T=0;T<o;T++)d[T]=u[m+T]^c[S*o+T];c3(d,0,u,m,s),g()}}return yne(r,a,f,c,d)}u3.scrypt=sPe;async function iPe(r,e,t){let{N:n,r:s,p:i,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:d,blockMixCb:g,asyncTick:h}=xne(r,e,t);for(let m=0;m<i;m++){let y=o*m;for(let T=0;T<o;T++)c[T]=u[y+T];let S=0;await(0,o3.asyncLoop)(n-1,h,()=>{c3(c,S,c,S+=o,s),g()}),c3(c,(n-1)*o,u,y,s),g(),await(0,o3.asyncLoop)(n,h,()=>{let T=u[y+o-16]%n;for(let H=0;H<o;H++)d[H]=u[y+H]^c[T*o+H];c3(d,0,u,y,s),g()})}return yne(r,a,f,c,d)}u3.scryptAsync=iPe});var Tne=R(d3=>{"use strict";b();p();Object.defineProperty(d3,"__esModule",{value:!0});d3.scryptSync=d3.scrypt=void 0;var wne=mne(),f3=Ne(),vne=!1,Pne=!1,_ne=async function(r,e,t,n,s,i,a){return await(0,wne.scryptAsync)(r,e,{N:t,r:n,p:s,dkLen:i,onProgress:a})},Ane=function(r,e,t,n,s,i){return(0,wne.scrypt)(r,e,{N:t,r:n,p:s,dkLen:i})},Ene=_ne,Sne=Ane;async function R4(r,e,t,n,s,i,a){let o=(0,f3.getBytes)(r,"passwd"),c=(0,f3.getBytes)(e,"salt");return(0,f3.hexlify)(await Ene(o,c,t,n,s,i,a))}d3.scrypt=R4;R4._=_ne;R4.lock=function(){Pne=!0};R4.register=function(r){if(Pne)throw new Error("scrypt is locked");Ene=r};Object.freeze(R4);function j4(r,e,t,n,s,i){let a=(0,f3.getBytes)(r,"passwd"),o=(0,f3.getBytes)(e,"salt");return(0,f3.hexlify)(Sne(a,o,t,n,s,i))}d3.scryptSync=j4;j4._=Ane;j4.lock=function(){vne=!0};j4.register=function(r){if(vne)throw new Error("scryptSync is locked");Sne=r};Object.freeze(j4)});var Mne=R(l3=>{"use strict";b();p();Object.defineProperty(l3,"__esModule",{value:!0});l3.sha512=l3.sha256=void 0;var One=A4(),_S=Ne(),Bne=function(r){return(0,One.createHash)("sha256").update(r).digest()},kne=function(r){return(0,One.createHash)("sha512").update(r).digest()},Nne=Bne,Ine=kne,Rne=!1,jne=!1;function h3(r){let e=(0,_S.getBytes)(r,"data");return(0,_S.hexlify)(Nne(e))}l3.sha256=h3;h3._=Bne;h3.lock=function(){Rne=!0};h3.register=function(r){if(Rne)throw new Error("sha256 is locked");Nne=r};Object.freeze(h3);function AS(r){let e=(0,_S.getBytes)(r,"data");return(0,_S.hexlify)(Ine(e))}l3.sha512=AS;AS._=kne;AS.lock=function(){jne=!0};AS.register=function(r){if(jne)throw new Error("sha512 is locked");Ine=r};Object.freeze(h3)});var Kg=R(Dt=>{"use strict";b();p();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.validateObject=Dt.createHmacDrbg=Dt.bitMask=Dt.bitSet=Dt.bitGet=Dt.bitLen=Dt.utf8ToBytes=Dt.equalBytes=Dt.concatBytes=Dt.ensureBytes=Dt.numberToVarBytesBE=Dt.numberToBytesLE=Dt.numberToBytesBE=Dt.bytesToNumberLE=Dt.bytesToNumberBE=Dt.hexToBytes=Dt.hexToNumber=Dt.numberToHexUnpadded=Dt.bytesToHex=void 0;var Lne=BigInt(0),ES=BigInt(1),aPe=BigInt(2),SS=r=>r instanceof Uint8Array,oPe=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function lL(r){if(!SS(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=oPe[r[t]];return e}Dt.bytesToHex=lL;function Une(r){let e=r.toString(16);return e.length&1?`0${e}`:e}Dt.numberToHexUnpadded=Une;function hL(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}Dt.hexToNumber=hL;function TS(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");t[n]=a}return t}Dt.hexToBytes=TS;function cPe(r){return hL(lL(r))}Dt.bytesToNumberBE=cPe;function uPe(r){if(!SS(r))throw new Error("Uint8Array expected");return hL(lL(Uint8Array.from(r).reverse()))}Dt.bytesToNumberLE=uPe;function Fne(r,e){return TS(r.toString(16).padStart(e*2,"0"))}Dt.numberToBytesBE=Fne;function fPe(r,e){return Fne(r,e).reverse()}Dt.numberToBytesLE=fPe;function dPe(r){return TS(Une(r))}Dt.numberToVarBytesBE=dPe;function lPe(r,e,t){let n;if(typeof e=="string")try{n=TS(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(SS(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}Dt.ensureBytes=lPe;function qne(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!SS(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}Dt.concatBytes=qne;function hPe(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}Dt.equalBytes=hPe;function bPe(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Dt.utf8ToBytes=bPe;function pPe(r){let e;for(e=0;r>Lne;r>>=ES,e+=1);return e}Dt.bitLen=pPe;function gPe(r,e){return r>>BigInt(e)&ES}Dt.bitGet=gPe;var xPe=(r,e,t)=>r|(t?ES:Lne)<<BigInt(e);Dt.bitSet=xPe;var yPe=r=>(aPe<<BigInt(r-1))-ES;Dt.bitMask=yPe;var dL=r=>new Uint8Array(r),Cne=r=>Uint8Array.from(r);function mPe(r,e,t){if(typeof r!="number"||r<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 t!="function")throw new Error("hmacFn must be a function");let n=dL(r),s=dL(r),i=0,a=()=>{n.fill(1),s.fill(0),i=0},o=(...d)=>t(s,n,...d),c=(d=dL())=>{s=o(Cne([0]),d),n=o(),d.length!==0&&(s=o(Cne([1]),d),n=o())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,g=[];for(;d<e;){n=o();let h=n.slice();g.push(h),d+=n.length}return qne(...g)};return(d,g)=>{a(),c(d);let h;for(;!(h=g(u()));)c();return a(),h}}Dt.createHmacDrbg=mPe;var wPe={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function vPe(r,e,t={}){let n=(s,i,a)=>{let o=wPe[i];if(typeof o!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(a&&c===void 0)&&!o(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}Dt.validateObject=vPe});var M4=R(Bt=>{"use strict";b();p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.mapHashToField=Bt.getMinHashLength=Bt.getFieldBytesLength=Bt.hashToPrivateScalar=Bt.FpSqrtEven=Bt.FpSqrtOdd=Bt.Field=Bt.nLength=Bt.FpIsSquare=Bt.FpDiv=Bt.FpInvertBatch=Bt.FpPow=Bt.validateField=Bt.isNegativeLE=Bt.FpSqrt=Bt.tonelliShanks=Bt.invert=Bt.pow2=Bt.pow=Bt.mod=void 0;var To=Kg(),Gs=BigInt(0),Mr=BigInt(1),Qh=BigInt(2),PPe=BigInt(3),bL=BigInt(4),Dne=BigInt(5),Hne=BigInt(8),_Pe=BigInt(9),APe=BigInt(16);function So(r,e){let t=r%e;return t>=Gs?t:e+t}Bt.mod=So;function Kne(r,e,t){if(t<=Gs||e<Gs)throw new Error("Expected power/modulo > 0");if(t===Mr)return Gs;let n=Mr;for(;e>Gs;)e&Mr&&(n=n*r%t),r=r*r%t,e>>=Mr;return n}Bt.pow=Kne;function EPe(r,e,t){let n=r;for(;e-- >Gs;)n*=n,n%=t;return n}Bt.pow2=EPe;function OS(r,e){if(r===Gs||e<=Gs)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=So(r,e),n=e,s=Gs,i=Mr,a=Mr,o=Gs;for(;t!==Gs;){let u=n/t,f=n%t,d=s-a*u,g=i-o*u;n=t,t=f,s=a,i=o,a=d,o=g}if(n!==Mr)throw new Error("invert: does not exist");return So(s,e)}Bt.invert=OS;function Gne(r){let e=(r-Mr)/Qh,t,n,s;for(t=r-Mr,n=0;t%Qh===Gs;t/=Qh,n++);for(s=Qh;s<r&&Kne(s,e,r)!==r-Mr;s++);if(n===1){let a=(r+Mr)/bL;return function(c,u){let f=c.pow(u,a);if(!c.eql(c.sqr(f),u))throw new Error("Cannot find square root");return f}}let i=(t+Mr)/Qh;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,s),t),d=o.pow(c,i),g=o.pow(c,t);for(;!o.eql(g,o.ONE);){if(o.eql(g,o.ZERO))return o.ZERO;let h=1;for(let y=o.sqr(g);h<u&&!o.eql(y,o.ONE);h++)y=o.sqr(y);let m=o.pow(f,Mr<<BigInt(u-h-1));f=o.sqr(m),d=o.mul(d,m),g=o.mul(g,f),u=h}return d}}Bt.tonelliShanks=Gne;function Vne(r){if(r%bL===PPe){let e=(r+Mr)/bL;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%Hne===Dne){let e=(r-Dne)/Hne;return function(n,s){let i=n.mul(s,Qh),a=n.pow(i,e),o=n.mul(s,a),c=n.mul(n.mul(o,Qh),a),u=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%APe,Gne(r)}Bt.FpSqrt=Vne;var SPe=(r,e)=>(So(r,e)&Mr)===Mr;Bt.isNegativeLE=SPe;var TPe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function OPe(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=TPe.reduce((n,s)=>(n[s]="function",n),e);return(0,To.validateObject)(r,t)}Bt.validateField=OPe;function zne(r,e,t){if(t<Gs)throw new Error("Expected power > 0");if(t===Gs)return r.ONE;if(t===Mr)return e;let n=r.ONE,s=e;for(;t>Gs;)t&Mr&&(n=r.mul(n,s)),s=r.sqr(s),t>>=Mr;return n}Bt.FpPow=zne;function Wne(r,e){let t=new Array(e.length),n=e.reduce((i,a,o)=>r.is0(a)?i:(t[o]=i,r.mul(i,a)),r.ONE),s=r.inv(n);return e.reduceRight((i,a,o)=>r.is0(a)?i:(t[o]=r.mul(i,t[o]),r.mul(i,a)),s),t}Bt.FpInvertBatch=Wne;function BPe(r,e,t){return r.mul(e,typeof t=="bigint"?OS(t,r.ORDER):r.inv(t))}Bt.FpDiv=BPe;function kPe(r){let e=(r.ORDER-Mr)/Qh;return t=>{let n=r.pow(t,e);return r.eql(n,r.ZERO)||r.eql(n,r.ONE)}}Bt.FpIsSquare=kPe;function pL(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}Bt.nLength=pL;function NPe(r,e,t=!1,n={}){if(r<=Gs)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=pL(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=Vne(r),o=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:(0,To.bitMask)(s),ZERO:Gs,ONE:Mr,create:c=>So(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Gs<=c&&c<r},is0:c=>c===Gs,isOdd:c=>(c&Mr)===Mr,neg:c=>So(-c,r),eql:(c,u)=>c===u,sqr:c=>So(c*c,r),add:(c,u)=>So(c+u,r),sub:(c,u)=>So(c-u,r),mul:(c,u)=>So(c*u,r),pow:(c,u)=>zne(o,c,u),div:(c,u)=>So(c*OS(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>OS(c,r),sqrt:n.sqrt||(c=>a(o,c)),invertBatch:c=>Wne(o,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>t?(0,To.numberToBytesLE)(c,i):(0,To.numberToBytesBE)(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?(0,To.bytesToNumberLE)(c):(0,To.bytesToNumberBE)(c)}});return Object.freeze(o)}Bt.Field=NPe;function IPe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?t:r.neg(t)}Bt.FpSqrtOdd=IPe;function RPe(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}Bt.FpSqrtEven=RPe;function jPe(r,e,t=!1){r=(0,To.ensureBytes)("privateHash",r);let n=r.length,s=pL(e).nByteLength+8;if(s<24||n<s||n>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${n}`);let i=t?(0,To.bytesToNumberLE)(r):(0,To.bytesToNumberBE)(r);return So(i,e-Mr)+Mr}Bt.hashToPrivateScalar=jPe;function gL(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}Bt.getFieldBytesLength=gL;function $ne(r){let e=gL(r);return e+Math.ceil(e/2)}Bt.getMinHashLength=$ne;function MPe(r,e,t=!1){let n=r.length,s=gL(e),i=$ne(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let a=t?(0,To.bytesToNumberBE)(r):(0,To.bytesToNumberLE)(r),o=So(a,e-Mr)+Mr;return t?(0,To.numberToBytesLE)(o,s):(0,To.numberToBytesBE)(o,s)}Bt.mapHashToField=MPe});var Zne=R(b3=>{"use strict";b();p();Object.defineProperty(b3,"__esModule",{value:!0});b3.validateBasic=b3.wNAF=void 0;var Jne=M4(),CPe=Kg(),LPe=BigInt(0),xL=BigInt(1);function UPe(r,e){let t=(s,i)=>{let a=i.negate();return s?a:i},n=s=>{let i=Math.ceil(e/s)+1,a=2**(s-1);return{windows:i,windowSize:a}};return{constTimeNegate:t,unsafeLadder(s,i){let a=r.ZERO,o=s;for(;i>LPe;)i&xL&&(a=a.add(o)),o=o.double(),i>>=xL;return a},precomputeWindow(s,i){let{windows:a,windowSize:o}=n(i),c=[],u=s,f=u;for(let d=0;d<a;d++){f=u,c.push(f);for(let g=1;g<o;g++)f=f.add(u),c.push(f);u=f.double()}return c},wNAF(s,i,a){let{windows:o,windowSize:c}=n(s),u=r.ZERO,f=r.BASE,d=BigInt(2**s-1),g=2**s,h=BigInt(s);for(let m=0;m<o;m++){let y=m*c,S=Number(a&d);a>>=h,S>c&&(S-=g,a+=xL);let T=y,H=y+Math.abs(S)-1,C=m%2!==0,J=S<0;S===0?f=f.add(t(C,i[T])):u=u.add(t(J,i[H]))}return{p:u,f}},wNAFCached(s,i,a,o){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,o(u))),this.wNAF(c,u,a)}}}b3.wNAF=UPe;function FPe(r){return(0,Jne.validateField)(r.Fp),(0,CPe.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,Jne.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}b3.validateBasic=FPe});var mL=R(zs=>{"use strict";b();p();Object.defineProperty(zs,"__esModule",{value:!0});zs.mapToCurveSimpleSWU=zs.SWUFpSqrtRatio=zs.weierstrass=zs.weierstrassPoints=zs.DER=void 0;var p3=M4(),Vs=Kg(),g0=Kg(),yL=Zne();function qPe(r){let e=(0,yL.validateBasic)(r);Vs.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:DPe,hexToBytes:HPe}=Vs;zs.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=zs.DER;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)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:DPe(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=zs.DER,t=typeof r=="string"?HPe(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=zs.DER._parseInt(t.subarray(2)),{d:a,l:o}=zs.DER._parseInt(i);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let f=u.toString(16);return f.length&1?`0${f}`:f},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,a=s.length/2,o=t(i),c=t(a);return`30${t(a+i+4)}02${c}${s}02${o}${n}`}};var af=BigInt(0),ns=BigInt(1),Yh=BigInt(2),BS=BigInt(3),Qne=BigInt(4);function Yne(r){let e=qPe(r),{Fp:t}=e,n=e.toBytes||((m,y,S)=>{let T=y.toAffine();return Vs.concatBytes(Uint8Array.from([4]),t.toBytes(T.x),t.toBytes(T.y))}),s=e.fromBytes||(m=>{let y=m.subarray(1),S=t.fromBytes(y.subarray(0,t.BYTES)),T=t.fromBytes(y.subarray(t.BYTES,2*t.BYTES));return{x:S,y:T}});function i(m){let{a:y,b:S}=e,T=t.sqr(m),H=t.mul(T,m);return t.add(t.add(H,t.mul(m,y)),S)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function a(m){return typeof m=="bigint"&&af<m&&m<e.n}function o(m){if(!a(m))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(m){let{allowedPrivateKeyLengths:y,nByteLength:S,wrapPrivateKey:T,n:H}=e;if(y&&typeof m!="bigint"){if(m instanceof Uint8Array&&(m=Vs.bytesToHex(m)),typeof m!="string"||!y.includes(m.length))throw new Error("Invalid key");m=m.padStart(S*2,"0")}let C;try{C=typeof m=="bigint"?m:Vs.bytesToNumberBE((0,g0.ensureBytes)("private key",m,S))}catch{throw new Error(`private key must be ${S} bytes, hex or bigint, not ${typeof m}`)}return T&&(C=p3.mod(C,H)),o(C),C}let u=new Map;function f(m){if(!(m instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(y,S,T){if(this.px=y,this.py=S,this.pz=T,y==null||!t.isValid(y))throw new Error("x required");if(S==null||!t.isValid(S))throw new Error("y required");if(T==null||!t.isValid(T))throw new Error("z required")}static fromAffine(y){let{x:S,y:T}=y||{};if(!y||!t.isValid(S)||!t.isValid(T))throw new Error("invalid affine point");if(y instanceof d)throw new Error("projective point not allowed");let H=C=>t.eql(C,t.ZERO);return H(S)&&H(T)?d.ZERO:new d(S,T,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){let S=t.invertBatch(y.map(T=>T.pz));return y.map((T,H)=>T.toAffine(S[H])).map(d.fromAffine)}static fromHex(y){let S=d.fromAffine(s((0,g0.ensureBytes)("pointHex",y)));return S.assertValidity(),S}static fromPrivateKey(y){return d.BASE.multiply(c(y))}_setWindowSize(y){this._WINDOW_SIZE=y,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:y,y:S}=this.toAffine();if(!t.isValid(y)||!t.isValid(S))throw new Error("bad point: x or y not FE");let T=t.sqr(S),H=i(y);if(!t.eql(T,H))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y}=this.toAffine();if(t.isOdd)return!t.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(y){f(y);let{px:S,py:T,pz:H}=this,{px:C,py:J,pz:z}=y,W=t.eql(t.mul(S,z),t.mul(C,H)),Y=t.eql(t.mul(T,z),t.mul(J,H));return W&&Y}negate(){return new d(this.px,t.neg(this.py),this.pz)}double(){let{a:y,b:S}=e,T=t.mul(S,BS),{px:H,py:C,pz:J}=this,z=t.ZERO,W=t.ZERO,Y=t.ZERO,Z=t.mul(H,H),se=t.mul(C,C),q=t.mul(J,J),x=t.mul(H,C);return x=t.add(x,x),Y=t.mul(H,J),Y=t.add(Y,Y),z=t.mul(y,Y),W=t.mul(T,q),W=t.add(z,W),z=t.sub(se,W),W=t.add(se,W),W=t.mul(z,W),z=t.mul(x,z),Y=t.mul(T,Y),q=t.mul(y,q),x=t.sub(Z,q),x=t.mul(y,x),x=t.add(x,Y),Y=t.add(Z,Z),Z=t.add(Y,Z),Z=t.add(Z,q),Z=t.mul(Z,x),W=t.add(W,Z),q=t.mul(C,J),q=t.add(q,q),Z=t.mul(q,x),z=t.sub(z,Z),Y=t.mul(q,se),Y=t.add(Y,Y),Y=t.add(Y,Y),new d(z,W,Y)}add(y){f(y);let{px:S,py:T,pz:H}=this,{px:C,py:J,pz:z}=y,W=t.ZERO,Y=t.ZERO,Z=t.ZERO,se=e.a,q=t.mul(e.b,BS),x=t.mul(S,C),O=t.mul(T,J),B=t.mul(H,z),A=t.add(S,T),E=t.add(C,J);A=t.mul(A,E),E=t.add(x,O),A=t.sub(A,E),E=t.add(S,H);let j=t.add(C,z);return E=t.mul(E,j),j=t.add(x,B),E=t.sub(E,j),j=t.add(T,H),W=t.add(J,z),j=t.mul(j,W),W=t.add(O,B),j=t.sub(j,W),Z=t.mul(se,E),W=t.mul(q,B),Z=t.add(W,Z),W=t.sub(O,Z),Z=t.add(O,Z),Y=t.mul(W,Z),O=t.add(x,x),O=t.add(O,x),B=t.mul(se,B),E=t.mul(q,E),O=t.add(O,B),B=t.sub(x,B),B=t.mul(se,B),E=t.add(E,B),x=t.mul(O,E),Y=t.add(Y,x),x=t.mul(j,E),W=t.mul(A,W),W=t.sub(W,x),x=t.mul(A,O),Z=t.mul(j,Z),Z=t.add(Z,x),new d(W,Y,Z)}subtract(y){return this.add(y.negate())}is0(){return this.equals(d.ZERO)}wNAF(y){return h.wNAFCached(this,u,y,S=>{let T=t.invertBatch(S.map(H=>H.pz));return S.map((H,C)=>H.toAffine(T[C])).map(d.fromAffine)})}multiplyUnsafe(y){let S=d.ZERO;if(y===af)return S;if(o(y),y===ns)return this;let{endo:T}=e;if(!T)return h.unsafeLadder(this,y);let{k1neg:H,k1:C,k2neg:J,k2:z}=T.splitScalar(y),W=S,Y=S,Z=this;for(;C>af||z>af;)C&ns&&(W=W.add(Z)),z&ns&&(Y=Y.add(Z)),Z=Z.double(),C>>=ns,z>>=ns;return H&&(W=W.negate()),J&&(Y=Y.negate()),Y=new d(t.mul(Y.px,T.beta),Y.py,Y.pz),W.add(Y)}multiply(y){o(y);let S=y,T,H,{endo:C}=e;if(C){let{k1neg:J,k1:z,k2neg:W,k2:Y}=C.splitScalar(S),{p:Z,f:se}=this.wNAF(z),{p:q,f:x}=this.wNAF(Y);Z=h.constTimeNegate(J,Z),q=h.constTimeNegate(W,q),q=new d(t.mul(q.px,C.beta),q.py,q.pz),T=Z.add(q),H=se.add(x)}else{let{p:J,f:z}=this.wNAF(S);T=J,H=z}return d.normalizeZ([T,H])[0]}multiplyAndAddUnsafe(y,S,T){let H=d.BASE,C=(z,W)=>W===af||W===ns||!z.equals(H)?z.multiplyUnsafe(W):z.multiply(W),J=C(this,S).add(C(y,T));return J.is0()?void 0:J}toAffine(y){let{px:S,py:T,pz:H}=this,C=this.is0();y==null&&(y=C?t.ONE:t.inv(H));let J=t.mul(S,y),z=t.mul(T,y),W=t.mul(H,y);if(C)return{x:t.ZERO,y:t.ZERO};if(!t.eql(W,t.ONE))throw new Error("invZ was invalid");return{x:J,y:z}}isTorsionFree(){let{h:y,isTorsionFree:S}=e;if(y===ns)return!0;if(S)return S(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:y,clearCofactor:S}=e;return y===ns?this:S?S(d,this):this.multiplyUnsafe(e.h)}toRawBytes(y=!0){return this.assertValidity(),n(d,this,y)}toHex(y=!0){return Vs.bytesToHex(this.toRawBytes(y))}}d.BASE=new d(e.Gx,e.Gy,t.ONE),d.ZERO=new d(t.ZERO,t.ONE,t.ZERO);let g=e.nBitLength,h=(0,yL.wNAF)(d,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:a}}zs.weierstrassPoints=Yne;function KPe(r){let e=(0,yL.validateBasic)(r);return Vs.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function GPe(r){let e=KPe(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function a(E){return af<E&&E<t.ORDER}function o(E){return p3.mod(E,n)}function c(E){return p3.invert(E,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:d,isWithinCurveOrder:g}=Yne({...e,toBytes(E,j,G){let M=j.toAffine(),P=t.toBytes(M.x),K=Vs.concatBytes;return G?K(Uint8Array.from([j.hasEvenY()?2:3]),P):K(Uint8Array.from([4]),P,t.toBytes(M.y))},fromBytes(E){let j=E.length,G=E[0],M=E.subarray(1);if(j===s&&(G===2||G===3)){let P=Vs.bytesToNumberBE(M);if(!a(P))throw new Error("Point is not on curve");let K=d(P),re=t.sqrt(K),ie=(re&ns)===ns;return(G&1)===1!==ie&&(re=t.neg(re)),{x:P,y:re}}else if(j===i&&G===4){let P=t.fromBytes(M.subarray(0,t.BYTES)),K=t.fromBytes(M.subarray(t.BYTES,2*t.BYTES));return{x:P,y:K}}else throw new Error(`Point of length ${j} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=E=>Vs.bytesToHex(Vs.numberToBytesBE(E,e.nByteLength));function m(E){let j=n>>ns;return E>j}function y(E){return m(E)?o(-E):E}let S=(E,j,G)=>Vs.bytesToNumberBE(E.slice(j,G));class T{constructor(j,G,M){this.r=j,this.s=G,this.recovery=M,this.assertValidity()}static fromCompact(j){let G=e.nByteLength;return j=(0,g0.ensureBytes)("compactSignature",j,G*2),new T(S(j,0,G),S(j,G,2*G))}static fromDER(j){let{r:G,s:M}=zs.DER.toSig((0,g0.ensureBytes)("DER",j));return new T(G,M)}assertValidity(){if(!g(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!g(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(j){return new T(this.r,this.s,j)}recoverPublicKey(j){let{r:G,s:M,recovery:P}=this,K=Y((0,g0.ensureBytes)("msgHash",j));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");let re=P===2||P===3?G+e.n:G;if(re>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let ie=(P&1)===0?"02":"03",ce=u.fromHex(ie+h(re)),oe=c(re),we=o(-K*oe),He=o(M*oe),yt=u.BASE.multiplyAndAddUnsafe(ce,we,He);if(!yt)throw new Error("point at infinify");return yt.assertValidity(),yt}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Vs.hexToBytes(this.toDERHex())}toDERHex(){return zs.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Vs.hexToBytes(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let H={isValidPrivateKey(E){try{return f(E),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let E=p3.getMinHashLength(e.n);return p3.mapHashToField(e.randomBytes(E),e.n)},precompute(E=8,j=u.BASE){return j._setWindowSize(E),j.multiply(BigInt(3)),j}};function C(E,j=!0){return u.fromPrivateKey(E).toRawBytes(j)}function J(E){let j=E instanceof Uint8Array,G=typeof E=="string",M=(j||G)&&E.length;return j?M===s||M===i:G?M===2*s||M===2*i:E instanceof u}function z(E,j,G=!0){if(J(E))throw new Error("first arg must be private key");if(!J(j))throw new Error("second arg must be public key");return u.fromHex(j).multiply(f(E)).toRawBytes(G)}let W=e.bits2int||function(E){let j=Vs.bytesToNumberBE(E),G=E.length*8-e.nBitLength;return G>0?j>>BigInt(G):j},Y=e.bits2int_modN||function(E){return o(W(E))},Z=Vs.bitMask(e.nBitLength);function se(E){if(typeof E!="bigint")throw new Error("bigint expected");if(!(af<=E&&E<Z))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Vs.numberToBytesBE(E,e.nByteLength)}function q(E,j,G=x){if(["recovered","canonical"].some(Qe=>Qe in G))throw new Error("sign() legacy options not supported");let{hash:M,randomBytes:P}=e,{lowS:K,prehash:re,extraEntropy:ie}=G;K==null&&(K=!0),E=(0,g0.ensureBytes)("msgHash",E),re&&(E=(0,g0.ensureBytes)("prehashed msgHash",M(E)));let ce=Y(E),oe=f(j),we=[se(oe),se(ce)];if(ie!=null){let Qe=ie===!0?P(t.BYTES):ie;we.push((0,g0.ensureBytes)("extraEntropy",Qe))}let He=Vs.concatBytes(...we),yt=ce;function mt(Qe){let Cr=W(Qe);if(!g(Cr))return;let sr=c(Cr),We=u.BASE.multiply(Cr).toAffine(),rn=o(We.x);if(rn===af)return;let $t=o(sr*o(yt+rn*oe));if($t===af)return;let vr=(We.x===rn?0:2)|Number(We.y&ns),_a=$t;return K&&m($t)&&(_a=y($t),vr^=1),new T(rn,_a,vr)}return{seed:He,k2sig:mt}}let x={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};function B(E,j,G=x){let{seed:M,k2sig:P}=q(E,j,G),K=e;return Vs.createHmacDrbg(K.hash.outputLen,K.nByteLength,K.hmac)(M,P)}u.BASE._setWindowSize(8);function A(E,j,G,M=O){let P=E;if(j=(0,g0.ensureBytes)("msgHash",j),G=(0,g0.ensureBytes)("publicKey",G),"strict"in M)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:re}=M,ie,ce;try{if(typeof P=="string"||P instanceof Uint8Array)try{ie=T.fromDER(P)}catch(We){if(!(We instanceof zs.DER.Err))throw We;ie=T.fromCompact(P)}else if(typeof P=="object"&&typeof P.r=="bigint"&&typeof P.s=="bigint"){let{r:We,s:rn}=P;ie=new T(We,rn)}else throw new Error("PARSE");ce=u.fromHex(G)}catch(We){if(We.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&ie.hasHighS())return!1;re&&(j=e.hash(j));let{r:oe,s:we}=ie,He=Y(j),yt=c(we),mt=o(He*yt),Qe=o(oe*yt),Cr=u.BASE.multiplyAndAddUnsafe(ce,mt,Qe)?.toAffine();return Cr?o(Cr.x)===oe:!1}return{CURVE:e,getPublicKey:C,getSharedSecret:z,sign:B,verify:A,ProjectivePoint:u,Signature:T,utils:H}}zs.weierstrass=GPe;function Xne(r,e){let t=r.ORDER,n=af;for(let m=t-ns;m%Yh===af;m/=Yh)n+=ns;let s=n,i=Yh<<s-ns-ns,a=i*Yh,o=(t-ns)/a,c=(o-ns)/Yh,u=a-ns,f=i,d=r.pow(e,o),g=r.pow(e,(o+ns)/Yh),h=(m,y)=>{let S=d,T=r.pow(y,u),H=r.sqr(T);H=r.mul(H,y);let C=r.mul(m,H);C=r.pow(C,c),C=r.mul(C,T),T=r.mul(C,y),H=r.mul(C,m);let J=r.mul(H,T);C=r.pow(J,f);let z=r.eql(C,r.ONE);T=r.mul(H,g),C=r.mul(J,S),H=r.cmov(T,H,z),J=r.cmov(C,J,z);for(let W=s;W>ns;W--){let Y=W-Yh;Y=Yh<<Y-ns;let Z=r.pow(J,Y),se=r.eql(Z,r.ONE);T=r.mul(H,S),S=r.mul(S,S),Z=r.mul(J,S),H=r.cmov(T,H,se),J=r.cmov(Z,J,se)}return{isValid:z,value:H}};if(r.ORDER%Qne===BS){let m=(r.ORDER-BS)/Qne,y=r.sqrt(r.neg(e));h=(S,T)=>{let H=r.sqr(T),C=r.mul(S,T);H=r.mul(H,C);let J=r.pow(H,m);J=r.mul(J,C);let z=r.mul(J,y),W=r.mul(r.sqr(J),T),Y=r.eql(W,S),Z=r.cmov(z,J,Y);return{isValid:Y,value:Z}}}return h}zs.SWUFpSqrtRatio=Xne;function VPe(r,e){if(p3.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let t=Xne(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,i,a,o,c,u,f,d;s=r.sqr(n),s=r.mul(s,e.Z),i=r.sqr(s),i=r.add(i,s),a=r.add(i,r.ONE),a=r.mul(a,e.B),o=r.cmov(e.Z,r.neg(i),!r.eql(i,r.ZERO)),o=r.mul(o,e.A),i=r.sqr(a),u=r.sqr(o),c=r.mul(u,e.A),i=r.add(i,c),i=r.mul(i,a),u=r.mul(u,o),c=r.mul(u,e.B),i=r.add(i,c),f=r.mul(s,a);let{isValid:g,value:h}=t(i,u);d=r.mul(s,n),d=r.mul(d,h),f=r.cmov(f,a,g),d=r.cmov(d,h,g);let m=r.isOdd(n)===r.isOdd(d);return d=r.cmov(r.neg(d),d,m),f=r.div(f,o),{x:f,y:d}}}zs.mapToCurveSimpleSWU=VPe});var rse=R(Rc=>{"use strict";b();p();Object.defineProperty(Rc,"__esModule",{value:!0});Rc.createHasher=Rc.isogenyMap=Rc.hash_to_field=Rc.expand_message_xof=Rc.expand_message_xmd=void 0;var zPe=M4(),of=Kg();function WPe(r){if(r instanceof Uint8Array)return r;if(typeof r=="string")return(0,of.utf8ToBytes)(r);throw new Error("DST must be Uint8Array or string")}var $Pe=of.bytesToNumberBE;function Xh(r,e){if(r<0||r>=1<<8*e)throw new Error(`bad I2OSP call: value=${r} length=${e}`);let t=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)t[n]=r&255,r>>>=8;return new Uint8Array(t)}function JPe(r,e){let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}function C4(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected")}function vL(r){if(!Number.isSafeInteger(r))throw new Error("number expected")}function ese(r,e,t,n){C4(r),C4(e),vL(t),e.length>255&&(e=n((0,of.concatBytes)((0,of.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:s,blockLen:i}=n,a=Math.ceil(t/s);if(a>255)throw new Error("Invalid xmd length");let o=(0,of.concatBytes)(e,Xh(e.length,1)),c=Xh(0,i),u=Xh(t,2),f=new Array(a),d=n((0,of.concatBytes)(c,r,u,Xh(0,1),o));f[0]=n((0,of.concatBytes)(d,Xh(1,1),o));for(let h=1;h<=a;h++){let m=[JPe(d,f[h-1]),Xh(h+1,1),o];f[h]=n((0,of.concatBytes)(...m))}return(0,of.concatBytes)(...f).slice(0,t)}Rc.expand_message_xmd=ese;function tse(r,e,t,n,s){if(C4(r),C4(e),vL(t),e.length>255){let i=Math.ceil(2*n/8);e=s.create({dkLen:i}).update((0,of.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(t>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:t}).update(r).update(Xh(t,2)).update(e).update(Xh(e.length,1)).digest()}Rc.expand_message_xof=tse;function wL(r,e,t){(0,of.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:s,m:i,hash:a,expand:o,DST:c}=t;C4(r),vL(e);let u=WPe(c),f=n.toString(2).length,d=Math.ceil((f+s)/8),g=e*i*d,h;if(o==="xmd")h=ese(r,u,g,a);else if(o==="xof")h=tse(r,u,g,s,a);else if(o==="_internal_pass")h=r;else throw new Error('expand must be "xmd" or "xof"');let m=new Array(e);for(let y=0;y<e;y++){let S=new Array(i);for(let T=0;T<i;T++){let H=d*(T+y*i),C=h.subarray(H,H+d);S[T]=(0,zPe.mod)($Pe(C),n)}m[y]=S}return m}Rc.hash_to_field=wL;function ZPe(r,e){let t=e.map(n=>Array.from(n).reverse());return(n,s)=>{let[i,a,o,c]=t.map(u=>u.reduce((f,d)=>r.add(r.mul(f,n),d)));return n=r.div(i,a),s=r.mul(s,r.div(o,c)),{x:n,y:s}}}Rc.isogenyMap=ZPe;function QPe(r,e,t){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,s){let i=wL(n,2,{...t,DST:t.DST,...s}),a=r.fromAffine(e(i[0])),o=r.fromAffine(e(i[1])),c=a.add(o).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,s){let i=wL(n,1,{...t,DST:t.encodeDST,...s}),a=r.fromAffine(e(i[0])).clearCofactor();return a.assertValidity(),a}}}Rc.createHasher=QPe});var ise=R(g3=>{"use strict";b();p();Object.defineProperty(g3,"__esModule",{value:!0});g3.createCurve=g3.getHash=void 0;var YPe=oS(),nse=sf(),XPe=mL();function sse(r){return{hash:r,hmac:(e,...t)=>(0,YPe.hmac)(r,e,(0,nse.concatBytes)(...t)),randomBytes:nse.randomBytes}}g3.getHash=sse;function e_e(r,e){let t=n=>(0,XPe.weierstrass)({...r,...sse(n)});return Object.freeze({...t(e),create:t})}g3.createCurve=e_e});var gse=R(Za=>{"use strict";b();p();Object.defineProperty(Za,"__esModule",{value:!0});Za.encodeToCurve=Za.hashToCurve=Za.schnorr=Za.secp256k1=void 0;var kS=lS(),t_e=sf(),fi=M4(),r_e=mL(),Gi=Kg(),cse=rse(),n_e=ise(),jS=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),NS=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),use=BigInt(1),IS=BigInt(2),ase=(r,e)=>(r+e/IS)/e;function fse(r){let e=jS,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),u=r*r*r%e,f=u*u*r%e,d=(0,fi.pow2)(f,t,e)*f%e,g=(0,fi.pow2)(d,t,e)*f%e,h=(0,fi.pow2)(g,IS,e)*u%e,m=(0,fi.pow2)(h,s,e)*h%e,y=(0,fi.pow2)(m,i,e)*m%e,S=(0,fi.pow2)(y,o,e)*y%e,T=(0,fi.pow2)(S,c,e)*S%e,H=(0,fi.pow2)(T,o,e)*y%e,C=(0,fi.pow2)(H,t,e)*f%e,J=(0,fi.pow2)(C,a,e)*m%e,z=(0,fi.pow2)(J,n,e)*u%e,W=(0,fi.pow2)(z,IS,e);if(!eb.eql(eb.sqr(W),r))throw new Error("Cannot find square root");return W}var eb=(0,fi.Field)(jS,void 0,void 0,{sqrt:fse});Za.secp256k1=(0,n_e.createCurve)({a:BigInt(0),b:BigInt(7),Fp:eb,n:NS,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=NS,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-use*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,a=BigInt("0x100000000000000000000000000000000"),o=ase(i*r,e),c=ase(-n*r,e),u=(0,fi.mod)(r-o*t-c*s,e),f=(0,fi.mod)(-o*n-c*i,e),d=u>a,g=f>a;if(d&&(u=e-u),g&&(f=e-f),u>a||f>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:d,k1:u,k2neg:g,k2:f}}}},kS.sha256);var MS=BigInt(0),dse=r=>typeof r=="bigint"&&MS<r&&r<jS,s_e=r=>typeof r=="bigint"&&MS<r&&r<NS,ose={};function RS(r,...e){let t=ose[r];if(t===void 0){let n=(0,kS.sha256)(Uint8Array.from(r,s=>s.charCodeAt(0)));t=(0,Gi.concatBytes)(n,n),ose[r]=t}return(0,kS.sha256)((0,Gi.concatBytes)(t,...e))}var EL=r=>r.toRawBytes(!0).slice(1),_L=r=>(0,Gi.numberToBytesBE)(r,32),PL=r=>(0,fi.mod)(r,jS),L4=r=>(0,fi.mod)(r,NS),SL=Za.secp256k1.ProjectivePoint,i_e=(r,e,t)=>SL.BASE.multiplyAndAddUnsafe(r,e,t);function AL(r){let e=Za.secp256k1.utils.normPrivateKeyToScalar(r),t=SL.fromPrivateKey(e);return{scalar:t.hasEvenY()?e:L4(-e),bytes:EL(t)}}function lse(r){if(!dse(r))throw new Error("bad x: need 0 < x < p");let e=PL(r*r),t=PL(e*r+BigInt(7)),n=fse(t);n%IS!==MS&&(n=PL(-n));let s=new SL(r,n,use);return s.assertValidity(),s}function hse(...r){return L4((0,Gi.bytesToNumberBE)(RS("BIP0340/challenge",...r)))}function a_e(r){return AL(r).bytes}function o_e(r,e,t=(0,t_e.randomBytes)(32)){let n=(0,Gi.ensureBytes)("message",r),{bytes:s,scalar:i}=AL(e),a=(0,Gi.ensureBytes)("auxRand",t,32),o=_L(i^(0,Gi.bytesToNumberBE)(RS("BIP0340/aux",a))),c=RS("BIP0340/nonce",o,s,n),u=L4((0,Gi.bytesToNumberBE)(c));if(u===MS)throw new Error("sign failed: k is zero");let{bytes:f,scalar:d}=AL(u),g=hse(f,s,n),h=new Uint8Array(64);if(h.set(f,0),h.set(_L(L4(d+g*i)),32),!bse(h,n,s))throw new Error("sign: Invalid signature produced");return h}function bse(r,e,t){let n=(0,Gi.ensureBytes)("signature",r,64),s=(0,Gi.ensureBytes)("message",e),i=(0,Gi.ensureBytes)("publicKey",t,32);try{let a=lse((0,Gi.bytesToNumberBE)(i)),o=(0,Gi.bytesToNumberBE)(n.subarray(0,32));if(!dse(o))return!1;let c=(0,Gi.bytesToNumberBE)(n.subarray(32,64));if(!s_e(c))return!1;let u=hse(_L(o),EL(a),s),f=i_e(a,c,L4(-u));return!(!f||!f.hasEvenY()||f.toAffine().x!==o)}catch{return!1}}Za.schnorr=(()=>({getPublicKey:a_e,sign:o_e,verify:bse,utils:{randomPrivateKey:Za.secp256k1.utils.randomPrivateKey,lift_x:lse,pointToBytes:EL,numberToBytesBE:Gi.numberToBytesBE,bytesToNumberBE:Gi.bytesToNumberBE,taggedHash:RS,mod:fi.mod}}))();var c_e=(()=>(0,cse.isogenyMap)(eb,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(r=>r.map(e=>BigInt(e)))))(),u_e=(()=>(0,r_e.mapToCurveSimpleSWU)(eb,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:eb.create(BigInt("-11"))}))(),pse=(()=>(0,cse.createHasher)(Za.secp256k1.ProjectivePoint,r=>{let{x:e,y:t}=u_e(eb.create(r[0]));return c_e(e,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:eb.ORDER,m:1,k:128,expand:"xmd",hash:kS.sha256}))();Za.hashToCurve=(()=>pse.hashToCurve)();Za.encodeToCurve=(()=>pse.encodeToCurve)()});var TL=R(CS=>{"use strict";b();p();Object.defineProperty(CS,"__esModule",{value:!0});CS.ZeroAddress=void 0;CS.ZeroAddress="0x0000000000000000000000000000000000000000"});var xse=R(LS=>{"use strict";b();p();Object.defineProperty(LS,"__esModule",{value:!0});LS.ZeroHash=void 0;LS.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"});var yse=R(jc=>{"use strict";b();p();Object.defineProperty(jc,"__esModule",{value:!0});jc.MaxInt256=jc.MinInt256=jc.MaxUint256=jc.WeiPerEther=jc.N=void 0;jc.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");jc.WeiPerEther=BigInt("1000000000000000000");jc.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");jc.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);jc.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")});var mse=R(x3=>{"use strict";b();p();Object.defineProperty(x3,"__esModule",{value:!0});x3.MessagePrefix=x3.EtherSymbol=void 0;x3.EtherSymbol="\u039E";x3.MessagePrefix=`Ethereum Signed Message:
`});var y3=R(Ts=>{"use strict";b();p();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.MessagePrefix=Ts.EtherSymbol=Ts.MaxInt256=Ts.MinInt256=Ts.MaxUint256=Ts.WeiPerEther=Ts.N=Ts.ZeroHash=Ts.ZeroAddress=void 0;var f_e=TL();Object.defineProperty(Ts,"ZeroAddress",{enumerable:!0,get:function(){return f_e.ZeroAddress}});var d_e=xse();Object.defineProperty(Ts,"ZeroHash",{enumerable:!0,get:function(){return d_e.ZeroHash}});var U4=yse();Object.defineProperty(Ts,"N",{enumerable:!0,get:function(){return U4.N}});Object.defineProperty(Ts,"WeiPerEther",{enumerable:!0,get:function(){return U4.WeiPerEther}});Object.defineProperty(Ts,"MaxUint256",{enumerable:!0,get:function(){return U4.MaxUint256}});Object.defineProperty(Ts,"MinInt256",{enumerable:!0,get:function(){return U4.MinInt256}});Object.defineProperty(Ts,"MaxInt256",{enumerable:!0,get:function(){return U4.MaxInt256}});var wse=mse();Object.defineProperty(Ts,"EtherSymbol",{enumerable:!0,get:function(){return wse.EtherSymbol}});Object.defineProperty(Ts,"MessagePrefix",{enumerable:!0,get:function(){return wse.MessagePrefix}})});var BL=R(FS=>{"use strict";b();p();Object.defineProperty(FS,"__esModule",{value:!0});FS.Signature=void 0;var vse=y3(),Xt=Ne(),Pse=BigInt(0),_se=BigInt(1),Ase=BigInt(2),Ese=BigInt(27),Sse=BigInt(28),US=BigInt(35),m3={};function Tse(r){return(0,Xt.zeroPadValue)((0,Xt.toBeArray)(r),32)}var w3,v3,P3,Gg,cf=class{constructor(e,t,n,s){I(this,w3,void 0);I(this,v3,void 0);I(this,P3,void 0);I(this,Gg,void 0);(0,Xt.assertPrivate)(e,m3,"Signature"),_(this,w3,t),_(this,v3,n),_(this,P3,s),_(this,Gg,null)}get r(){return l(this,w3)}set r(e){(0,Xt.assertArgument)((0,Xt.dataLength)(e)===32,"invalid r","value",e),_(this,w3,(0,Xt.hexlify)(e))}get s(){return l(this,v3)}set s(e){(0,Xt.assertArgument)((0,Xt.dataLength)(e)===32,"invalid s","value",e);let t=(0,Xt.hexlify)(e);(0,Xt.assertArgument)(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),_(this,v3,t)}get v(){return l(this,P3)}set v(e){let t=(0,Xt.getNumber)(e,"value");(0,Xt.assertArgument)(t===27||t===28,"invalid v","v",e),_(this,P3,t)}get networkV(){return l(this,Gg)}get legacyChainId(){let e=this.networkV;return e==null?null:cf.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=(0,Xt.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,Xt.hexlify)(e)}get compactSerialized(){return(0,Xt.concat)([this.r,this.yParityAndS])}get serialized(){return(0,Xt.concat)([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(){let e=new cf(m3,this.r,this.s,this.v);return this.networkV&&_(e,Gg,this.networkV),e}toJSON(){let e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){let t=(0,Xt.getBigInt)(e,"v");return t==Ese||t==Sse?Pse:((0,Xt.assertArgument)(t>=US,"invalid EIP-155 v","v",e),(t-US)/Ase)}static getChainIdV(e,t){return(0,Xt.getBigInt)(e)*Ase+BigInt(35+t-27)}static getNormalizedV(e){let t=(0,Xt.getBigInt)(e);return t===Pse||t===Ese?27:t===_se||t===Sse?28:((0,Xt.assertArgument)(t>=US,"invalid v","v",e),t&_se?27:28)}static from(e){function t(u,f){(0,Xt.assertArgument)(u,f,"signature",e)}if(e==null)return new cf(m3,vse.ZeroHash,vse.ZeroHash,27);if(typeof e=="string"){let u=(0,Xt.getBytes)(e,"signature");if(u.length===64){let f=(0,Xt.hexlify)(u.slice(0,32)),d=u.slice(32,64),g=d[0]&128?28:27;return d[0]&=127,new cf(m3,f,(0,Xt.hexlify)(d),g)}if(u.length===65){let f=(0,Xt.hexlify)(u.slice(0,32)),d=u.slice(32,64);t((d[0]&128)===0,"non-canonical s");let g=cf.getNormalizedV(u[64]);return new cf(m3,f,(0,Xt.hexlify)(d),g)}t(!1,"invalid raw signature length")}if(e instanceof cf)return e.clone();let n=e.r;t(n!=null,"missing r");let s=Tse(n),i=function(u,f){if(u!=null)return Tse(u);if(f!=null){t((0,Xt.isHexString)(f,32),"invalid yParityAndS");let d=(0,Xt.getBytes)(f);return d[0]&=127,(0,Xt.hexlify)(d)}t(!1,"missing s")}(e.s,e.yParityAndS);t(((0,Xt.getBytes)(i)[0]&128)==0,"non-canonical s");let{networkV:a,v:o}=function(u,f,d){if(u!=null){let g=(0,Xt.getBigInt)(u);return{networkV:g>=US?g:void 0,v:cf.getNormalizedV(g)}}if(f!=null)return t((0,Xt.isHexString)(f,32),"invalid yParityAndS"),{v:(0,Xt.getBytes)(f)[0]&128?28:27};if(d!=null){switch((0,Xt.getNumber)(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new cf(m3,s,i,o);return a&&_(c,Gg,a),t(e.yParity==null||(0,Xt.getNumber)(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}},OL=cf;w3=new WeakMap,v3=new WeakMap,P3=new WeakMap,Gg=new WeakMap;FS.Signature=OL});var Bse=R(qS=>{"use strict";b();p();Object.defineProperty(qS,"__esModule",{value:!0});qS.SigningKey=void 0;var Vg=gse(),us=Ne(),Ose=BL(),Ld,zg=class{constructor(e){I(this,Ld,void 0);(0,us.assertArgument)((0,us.dataLength)(e)===32,"invalid private key","privateKey","[REDACTED]"),_(this,Ld,(0,us.hexlify)(e))}get privateKey(){return l(this,Ld)}get publicKey(){return zg.computePublicKey(l(this,Ld))}get compressedPublicKey(){return zg.computePublicKey(l(this,Ld),!0)}sign(e){(0,us.assertArgument)((0,us.dataLength)(e)===32,"invalid digest length","digest",e);let t=Vg.secp256k1.sign((0,us.getBytesCopy)(e),(0,us.getBytesCopy)(l(this,Ld)),{lowS:!0});return Ose.Signature.from({r:(0,us.toBeHex)(t.r,32),s:(0,us.toBeHex)(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){let t=zg.computePublicKey(e);return(0,us.hexlify)(Vg.secp256k1.getSharedSecret((0,us.getBytesCopy)(l(this,Ld)),(0,us.getBytes)(t),!1))}static computePublicKey(e,t){let n=(0,us.getBytes)(e,"key");if(n.length===32){let i=Vg.secp256k1.getPublicKey(n,!!t);return(0,us.hexlify)(i)}if(n.length===64){let i=new Uint8Array(65);i[0]=4,i.set(n,1),n=i}let s=Vg.secp256k1.ProjectivePoint.fromHex(n);return(0,us.hexlify)(s.toRawBytes(t))}static recoverPublicKey(e,t){(0,us.assertArgument)((0,us.dataLength)(e)===32,"invalid digest length","digest",e);let n=Ose.Signature.from(t),s=Vg.secp256k1.Signature.fromCompact((0,us.getBytesCopy)((0,us.concat)([n.r,n.s])));s=s.addRecoveryBit(n.yParity);let i=s.recoverPublicKey((0,us.getBytesCopy)(e));return(0,us.assertArgument)(i!=null,"invalid signautre for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){let s=Vg.secp256k1.ProjectivePoint.fromHex(zg.computePublicKey(e).substring(2)),i=Vg.secp256k1.ProjectivePoint.fromHex(zg.computePublicKey(t).substring(2));return"0x"+s.add(i).toHex(!!n)}},kL=zg;Ld=new WeakMap;qS.SigningKey=kL});var di=R(Yr=>{"use strict";b();p();Object.defineProperty(Yr,"__esModule",{value:!0});Yr.lock=Yr.Signature=Yr.SigningKey=Yr.scryptSync=Yr.scrypt=Yr.pbkdf2=Yr.sha512=Yr.sha256=Yr.ripemd160=Yr.keccak256=Yr.randomBytes=Yr.computeHmac=void 0;var kse=Lre();Object.defineProperty(Yr,"computeHmac",{enumerable:!0,get:function(){return kse.computeHmac}});var Nse=Zre();Object.defineProperty(Yr,"keccak256",{enumerable:!0,get:function(){return Nse.keccak256}});var Ise=ine();Object.defineProperty(Yr,"ripemd160",{enumerable:!0,get:function(){return Ise.ripemd160}});var Rse=une();Object.defineProperty(Yr,"pbkdf2",{enumerable:!0,get:function(){return Rse.pbkdf2}});var NL=hne();Object.defineProperty(Yr,"randomBytes",{enumerable:!0,get:function(){return NL.randomBytes}});var DS=Tne();Object.defineProperty(Yr,"scrypt",{enumerable:!0,get:function(){return DS.scrypt}});Object.defineProperty(Yr,"scryptSync",{enumerable:!0,get:function(){return DS.scryptSync}});var HS=Mne();Object.defineProperty(Yr,"sha256",{enumerable:!0,get:function(){return HS.sha256}});Object.defineProperty(Yr,"sha512",{enumerable:!0,get:function(){return HS.sha512}});var l_e=Bse();Object.defineProperty(Yr,"SigningKey",{enumerable:!0,get:function(){return l_e.SigningKey}});var h_e=BL();Object.defineProperty(Yr,"Signature",{enumerable:!0,get:function(){return h_e.Signature}});function b_e(){kse.computeHmac.lock(),Nse.keccak256.lock(),Rse.pbkdf2.lock(),NL.randomBytes.lock(),Ise.ripemd160.lock(),DS.scrypt.lock(),DS.scryptSync.lock(),HS.sha256.lock(),HS.sha512.lock(),NL.randomBytes.lock()}Yr.lock=b_e});var KS=R(_3=>{"use strict";b();p();Object.defineProperty(_3,"__esModule",{value:!0});_3.getIcapAddress=_3.getAddress=void 0;var p_e=di(),F4=Ne(),g_e=BigInt(0),x_e=BigInt(36);function jse(r){r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);let n=(0,F4.getBytes)((0,p_e.keccak256)(t));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(n[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}var IL={};for(let r=0;r<10;r++)IL[String(r)]=String(r);for(let r=0;r<26;r++)IL[String.fromCharCode(65+r)]=String(10+r);var Mse=15;function Cse(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>IL[n]).join("");for(;e.length>=Mse;){let n=e.substring(0,Mse);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}var y_e=function(){let r={};for(let e=0;e<36;e++){let t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r}();function m_e(r){r=r.toLowerCase();let e=g_e;for(let t=0;t<r.length;t++)e=e*x_e+y_e[r[t]];return e}function Lse(r){if((0,F4.assertArgument)(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);let e=jse(r);return(0,F4.assertArgument)(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,F4.assertArgument)(r.substring(2,4)===Cse(r),"bad icap checksum","address",r);let e=m_e(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return jse("0x"+e)}(0,F4.assertArgument)(!1,"invalid address","address",r)}_3.getAddress=Lse;function w_e(r){let e=BigInt(Lse(r)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+Cse("XE00"+e)+e}_3.getIcapAddress=w_e});var Fse=R(A3=>{"use strict";b();p();Object.defineProperty(A3,"__esModule",{value:!0});A3.getCreate2Address=A3.getCreateAddress=void 0;var Use=di(),Ud=Ne(),GS=KS();function v_e(r){let e=(0,GS.getAddress)(r.from),n=(0,Ud.getBigInt)(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,(0,GS.getAddress)((0,Ud.dataSlice)((0,Use.keccak256)((0,Ud.encodeRlp)([e,n])),12))}A3.getCreateAddress=v_e;function P_e(r,e,t){let n=(0,GS.getAddress)(r),s=(0,Ud.getBytes)(e,"salt"),i=(0,Ud.getBytes)(t,"initCodeHash");return(0,Ud.assertArgument)(s.length===32,"salt must be 32 bytes","salt",e),(0,Ud.assertArgument)(i.length===32,"initCodeHash must be 32 bytes","initCodeHash",t),(0,GS.getAddress)((0,Ud.dataSlice)((0,Use.keccak256)((0,Ud.concat)(["0xff",n,s,i])),12))}A3.getCreate2Address=P_e});var Dse=R(tb=>{"use strict";b();p();Object.defineProperty(tb,"__esModule",{value:!0});tb.resolveAddress=tb.isAddress=tb.isAddressable=void 0;var VS=Ne(),jL=KS();function qse(r){return r&&typeof r.getAddress=="function"}tb.isAddressable=qse;function __e(r){try{return(0,jL.getAddress)(r),!0}catch{}return!1}tb.isAddress=__e;async function RL(r,e){let t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&((0,VS.assert)(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),(0,VS.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),(0,jL.getAddress)(t)}function A_e(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?(0,jL.getAddress)(r):((0,VS.assert)(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),RL(r,e.resolveName(r)));if(qse(r))return RL(r,r.getAddress());if(r&&typeof r.then=="function")return RL(r,r);(0,VS.assertArgument)(!1,"unsupported addressable value","target",r)}tb.resolveAddress=A_e});var Ws=R(Vi=>{"use strict";b();p();Object.defineProperty(Vi,"__esModule",{value:!0});Vi.resolveAddress=Vi.isAddress=Vi.isAddressable=Vi.getCreate2Address=Vi.getCreateAddress=Vi.getIcapAddress=Vi.getAddress=void 0;var Hse=KS();Object.defineProperty(Vi,"getAddress",{enumerable:!0,get:function(){return Hse.getAddress}});Object.defineProperty(Vi,"getIcapAddress",{enumerable:!0,get:function(){return Hse.getIcapAddress}});var Kse=Fse();Object.defineProperty(Vi,"getCreateAddress",{enumerable:!0,get:function(){return Kse.getCreateAddress}});Object.defineProperty(Vi,"getCreate2Address",{enumerable:!0,get:function(){return Kse.getCreate2Address}});var ML=Dse();Object.defineProperty(Vi,"isAddressable",{enumerable:!0,get:function(){return ML.isAddressable}});Object.defineProperty(Vi,"isAddress",{enumerable:!0,get:function(){return ML.isAddress}});Object.defineProperty(Vi,"resolveAddress",{enumerable:!0,get:function(){return ML.resolveAddress}})});var x0=R(zS=>{"use strict";b();p();Object.defineProperty(zS,"__esModule",{value:!0});zS.Typed=void 0;var Gse=Ne(),uf={};function Fe(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new q4(uf,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function yr(r,e){return new q4(uf,`bytes${e||""}`,r,{size:e})}var Vse=Symbol.for("_ethers_typed"),Wg,ff=class{constructor(e,t,n,s){N(this,"type");N(this,"value");I(this,Wg,void 0);N(this,"_typedSymbol");s==null&&(s=null),(0,Gse.assertPrivate)(uf,e,"Typed"),(0,Gse.defineProperties)(this,{_typedSymbol:Vse,type:t,value:n}),_(this,Wg,s),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 l(this,Wg)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return l(this,Wg)===!0?-1:l(this,Wg)===!1?this.value.length:null}static from(e,t){return new ff(uf,e,t)}static uint8(e){return Fe(e,8)}static uint16(e){return Fe(e,16)}static uint24(e){return Fe(e,24)}static uint32(e){return Fe(e,32)}static uint40(e){return Fe(e,40)}static uint48(e){return Fe(e,48)}static uint56(e){return Fe(e,56)}static uint64(e){return Fe(e,64)}static uint72(e){return Fe(e,72)}static uint80(e){return Fe(e,80)}static uint88(e){return Fe(e,88)}static uint96(e){return Fe(e,96)}static uint104(e){return Fe(e,104)}static uint112(e){return Fe(e,112)}static uint120(e){return Fe(e,120)}static uint128(e){return Fe(e,128)}static uint136(e){return Fe(e,136)}static uint144(e){return Fe(e,144)}static uint152(e){return Fe(e,152)}static uint160(e){return Fe(e,160)}static uint168(e){return Fe(e,168)}static uint176(e){return Fe(e,176)}static uint184(e){return Fe(e,184)}static uint192(e){return Fe(e,192)}static uint200(e){return Fe(e,200)}static uint208(e){return Fe(e,208)}static uint216(e){return Fe(e,216)}static uint224(e){return Fe(e,224)}static uint232(e){return Fe(e,232)}static uint240(e){return Fe(e,240)}static uint248(e){return Fe(e,248)}static uint256(e){return Fe(e,256)}static uint(e){return Fe(e,256)}static int8(e){return Fe(e,-8)}static int16(e){return Fe(e,-16)}static int24(e){return Fe(e,-24)}static int32(e){return Fe(e,-32)}static int40(e){return Fe(e,-40)}static int48(e){return Fe(e,-48)}static int56(e){return Fe(e,-56)}static int64(e){return Fe(e,-64)}static int72(e){return Fe(e,-72)}static int80(e){return Fe(e,-80)}static int88(e){return Fe(e,-88)}static int96(e){return Fe(e,-96)}static int104(e){return Fe(e,-104)}static int112(e){return Fe(e,-112)}static int120(e){return Fe(e,-120)}static int128(e){return Fe(e,-128)}static int136(e){return Fe(e,-136)}static int144(e){return Fe(e,-144)}static int152(e){return Fe(e,-152)}static int160(e){return Fe(e,-160)}static int168(e){return Fe(e,-168)}static int176(e){return Fe(e,-176)}static int184(e){return Fe(e,-184)}static int192(e){return Fe(e,-192)}static int200(e){return Fe(e,-200)}static int208(e){return Fe(e,-208)}static int216(e){return Fe(e,-216)}static int224(e){return Fe(e,-224)}static int232(e){return Fe(e,-232)}static int240(e){return Fe(e,-240)}static int248(e){return Fe(e,-248)}static int256(e){return Fe(e,-256)}static int(e){return Fe(e,-256)}static bytes1(e){return yr(e,1)}static bytes2(e){return yr(e,2)}static bytes3(e){return yr(e,3)}static bytes4(e){return yr(e,4)}static bytes5(e){return yr(e,5)}static bytes6(e){return yr(e,6)}static bytes7(e){return yr(e,7)}static bytes8(e){return yr(e,8)}static bytes9(e){return yr(e,9)}static bytes10(e){return yr(e,10)}static bytes11(e){return yr(e,11)}static bytes12(e){return yr(e,12)}static bytes13(e){return yr(e,13)}static bytes14(e){return yr(e,14)}static bytes15(e){return yr(e,15)}static bytes16(e){return yr(e,16)}static bytes17(e){return yr(e,17)}static bytes18(e){return yr(e,18)}static bytes19(e){return yr(e,19)}static bytes20(e){return yr(e,20)}static bytes21(e){return yr(e,21)}static bytes22(e){return yr(e,22)}static bytes23(e){return yr(e,23)}static bytes24(e){return yr(e,24)}static bytes25(e){return yr(e,25)}static bytes26(e){return yr(e,26)}static bytes27(e){return yr(e,27)}static bytes28(e){return yr(e,28)}static bytes29(e){return yr(e,29)}static bytes30(e){return yr(e,30)}static bytes31(e){return yr(e,31)}static bytes32(e){return yr(e,32)}static address(e){return new ff(uf,"address",e)}static bool(e){return new ff(uf,"bool",!!e)}static bytes(e){return new ff(uf,"bytes",e)}static string(e){return new ff(uf,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new ff(uf,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===Vse}static dereference(e,t){if(ff.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}},q4=ff;Wg=new WeakMap;zS.Typed=q4});var Wse=R(WS=>{"use strict";b();p();Object.defineProperty(WS,"__esModule",{value:!0});WS.AddressCoder=void 0;var zse=Ws(),E_e=C2(),S_e=x0(),T_e=kc(),CL=class extends T_e.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=S_e.Typed.dereference(t,"string");try{n=(0,zse.getAddress)(n)}catch(s){return this._throwError(s.message,t)}return e.writeValue(n)}decode(e){return(0,zse.getAddress)((0,E_e.toBeHex)(e.readValue(),20))}};WS.AddressCoder=CL});var $se=R($S=>{"use strict";b();p();Object.defineProperty($S,"__esModule",{value:!0});$S.AnonymousCoder=void 0;var O_e=kc(),LL=class extends O_e.Coder{constructor(t){super(t.name,t.type,"_",t.dynamic);N(this,"coder");this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,n){return this.coder.encode(t,n)}decode(t){return this.coder.decode(t)}};$S.AnonymousCoder=LL});var FL=R(rb=>{"use strict";b();p();Object.defineProperty(rb,"__esModule",{value:!0});rb.ArrayCoder=rb.unpack=rb.pack=void 0;var Fd=Ne(),B_e=x0(),E3=kc(),k_e=$se();function Jse(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(u=>{let f=u.localName;return(0,Fd.assert)(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),(0,Fd.assert)(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),c[f]=!0,t[f]})}else(0,Fd.assertArgument)(!1,"invalid tuple value","tuple",t);(0,Fd.assertArgument)(e.length===n.length,"types/value length mismatch","tuple",t);let s=new E3.Writer,i=new E3.Writer,a=[];e.forEach((c,u)=>{let f=n[u];if(c.dynamic){let d=i.length;c.encode(i,f);let g=s.writeUpdatableValue();a.push(h=>{g(h+d)})}else c.encode(s,f)}),a.forEach(c=>{c(s.length)});let o=r.appendWriter(s);return o+=r.appendWriter(i),o}rb.pack=Jse;function Zse(r,e){let t=[],n=[],s=r.subReader(0);return e.forEach(i=>{let a=null;if(i.dynamic){let o=r.readIndex(),c=s.subReader(o);try{a=i.decode(c)}catch(u){if((0,Fd.isError)(u,"BUFFER_OVERRUN"))throw u;a=u,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(r)}catch(o){if((0,Fd.isError)(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");t.push(a),n.push(i.localName||null)}),E3.Result.fromItems(t,n)}rb.unpack=Zse;var UL=class extends E3.Coder{constructor(t,n,s){let i=t.type+"["+(n>=0?n:"")+"]",a=n===-1||t.dynamic;super("array",i,s,a);N(this,"coder");N(this,"length");(0,Fd.defineProperties)(this,{coder:t,length:n})}defaultValue(){let t=this.coder.defaultValue(),n=[];for(let s=0;s<this.length;s++)n.push(t);return n}encode(t,n){let s=B_e.Typed.dereference(n,"array");Array.isArray(s)||this._throwError("expected array value",s);let i=this.length;i===-1&&(i=s.length,t.writeValue(s.length)),(0,Fd.assertArgumentCount)(s.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<s.length;o++)a.push(this.coder);return Jse(t,a,s)}decode(t){let n=this.length;n===-1&&(n=t.readIndex(),(0,Fd.assert)(n*E3.WordSize<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:n*E3.WordSize,length:t.dataLength}));let s=[];for(let i=0;i<n;i++)s.push(new k_e.AnonymousCoder(this.coder));return Zse(t,s)}};rb.ArrayCoder=UL});var Qse=R(JS=>{"use strict";b();p();Object.defineProperty(JS,"__esModule",{value:!0});JS.BooleanCoder=void 0;var N_e=x0(),I_e=kc(),qL=class extends I_e.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){let n=N_e.Typed.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}};JS.BooleanCoder=qL});var HL=R(S3=>{"use strict";b();p();Object.defineProperty(S3,"__esModule",{value:!0});S3.BytesCoder=S3.DynamicBytesCoder=void 0;var Yse=Ne(),R_e=kc(),ZS=class extends R_e.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,Yse.getBytesCopy)(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}};S3.DynamicBytesCoder=ZS;var DL=class extends ZS{constructor(e){super("bytes",e)}decode(e){return(0,Yse.hexlify)(super.decode(e))}};S3.BytesCoder=DL});var Xse=R(QS=>{"use strict";b();p();Object.defineProperty(QS,"__esModule",{value:!0});QS.FixedBytesCoder=void 0;var KL=Ne(),j_e=x0(),M_e=kc(),GL=class extends M_e.Coder{constructor(t,n){let s="bytes"+String(t);super(s,s,n,!1);N(this,"size");(0,KL.defineProperties)(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,n){let s=(0,KL.getBytesCopy)(j_e.Typed.dereference(n,this.type));return s.length!==this.size&&this._throwError("incorrect data length",n),t.writeBytes(s)}decode(t){return(0,KL.hexlify)(t.readBytes(this.size))}};QS.FixedBytesCoder=GL});var eie=R(YS=>{"use strict";b();p();Object.defineProperty(YS,"__esModule",{value:!0});YS.NullCoder=void 0;var C_e=kc(),L_e=new Uint8Array([]),VL=class extends C_e.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(L_e)}decode(e){return e.readBytes(0),null}};YS.NullCoder=VL});var tie=R(XS=>{"use strict";b();p();Object.defineProperty(XS,"__esModule",{value:!0});XS.NumberCoder=void 0;var nb=Ne(),U_e=x0(),zL=kc(),F_e=BigInt(0),q_e=BigInt(1),D_e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),WL=class extends zL.Coder{constructor(t,n,s){let i=(n?"int":"uint")+t*8;super(i,i,s,!1);N(this,"size");N(this,"signed");(0,nb.defineProperties)(this,{size:t,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,n){let s=(0,nb.getBigInt)(U_e.Typed.dereference(n,this.type)),i=(0,nb.mask)(D_e,zL.WordSize*8);if(this.signed){let a=(0,nb.mask)(i,this.size*8-1);(s>a||s<-(a+q_e))&&this._throwError("value out-of-bounds",n),s=(0,nb.toTwos)(s,8*zL.WordSize)}else(s<F_e||s>(0,nb.mask)(i,this.size*8))&&this._throwError("value out-of-bounds",n);return t.writeValue(s)}decode(t){let n=(0,nb.mask)(t.readValue(),this.size*8);return this.signed&&(n=(0,nb.fromTwos)(n,this.size*8)),n}};XS.NumberCoder=WL});var nie=R(eT=>{"use strict";b();p();Object.defineProperty(eT,"__esModule",{value:!0});eT.StringCoder=void 0;var rie=HE(),H_e=x0(),K_e=HL(),$L=class extends K_e.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,rie.toUtf8Bytes)(H_e.Typed.dereference(t,"string")))}decode(e){return(0,rie.toUtf8String)(super.decode(e))}};eT.StringCoder=$L});var iie=R(tT=>{"use strict";b();p();Object.defineProperty(tT,"__esModule",{value:!0});tT.TupleCoder=void 0;var G_e=Uh(),V_e=x0(),z_e=kc(),sie=FL(),JL=class extends z_e.Coder{constructor(t,n){let s=!1,i=[];t.forEach(o=>{o.dynamic&&(s=!0),i.push(o.type)});let a="tuple("+i.join(",")+")";super("tuple",a,n,s);N(this,"coders");(0,G_e.defineProperties)(this,{coders:Object.freeze(t.slice())})}defaultValue(){let t=[];this.coders.forEach(s=>{t.push(s.defaultValue())});let n=this.coders.reduce((s,i)=>{let a=i.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});return this.coders.forEach((s,i)=>{let a=s.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,n){let s=V_e.Typed.dereference(n,"tuple");return(0,sie.pack)(t,this.coders,s)}decode(t){return(0,sie.unpack)(t,this.coders)}};tT.TupleCoder=JL});var ZL=R(rT=>{"use strict";b();p();Object.defineProperty(rT,"__esModule",{value:!0});rT.id=void 0;var W_e=di(),$_e=Ne();function J_e(r){return(0,W_e.keccak256)((0,$_e.toUtf8Bytes)(r))}rT.id=J_e});var fie=R(y0=>{"use strict";b();p();Object.defineProperty(y0,"__esModule",{value:!0});y0.dnsEncode=y0.namehash=y0.isValidName=y0.ensNormalize=void 0;var aie=di(),Mc=Ne(),Z_e=RR(),cie=new Uint8Array(32);cie.fill(0);function oie(r){return(0,Mc.assertArgument)(r.length!==0,"invalid ENS name; empty component","comp",r),r}function QL(r){let e=(0,Mc.toUtf8Bytes)(uie(r)),t=[];if(r.length===0)return t;let n=0;for(let s=0;s<e.length;s++)e[s]===46&&(t.push(oie(e.slice(n,s))),n=s+1);return(0,Mc.assertArgument)(n<e.length,"invalid ENS name; empty component","name",r),t.push(oie(e.slice(n))),t}function uie(r){try{if(r.length===0)throw new Error("empty label");return(0,Z_e.ens_normalize)(r)}catch(e){(0,Mc.assertArgument)(!1,`invalid ENS name (${e.message})`,"name",r)}}y0.ensNormalize=uie;function Q_e(r){try{return QL(r).length!==0}catch{}return!1}y0.isValidName=Q_e;function Y_e(r){(0,Mc.assertArgument)(typeof r=="string","invalid ENS name; not a string","name",r),(0,Mc.assertArgument)(r.length,"invalid ENS name (empty label)","name",r);let e=cie,t=QL(r);for(;t.length;)e=(0,aie.keccak256)((0,Mc.concat)([e,(0,aie.keccak256)(t.pop())]));return(0,Mc.hexlify)(e)}y0.namehash=Y_e;function X_e(r,e){let t=e??63;return(0,Mc.assertArgument)(t<=255,"DNS encoded label cannot exceed 255","length",t),(0,Mc.hexlify)((0,Mc.concat)(QL(r).map(n=>{(0,Mc.assertArgument)(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);let s=new Uint8Array(n.length+1);return s.set(n,1),s[0]=s.length-1,s})))+"00"}y0.dnsEncode=X_e});var XL=R(nT=>{"use strict";b();p();Object.defineProperty(nT,"__esModule",{value:!0});nT.accessListify=void 0;var eAe=Ws(),D4=Ne();function YL(r,e){return{address:(0,eAe.getAddress)(r),storageKeys:e.map((t,n)=>((0,D4.assertArgument)((0,D4.isHexString)(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function tAe(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?((0,D4.assertArgument)(t.length===2,"invalid slot set",`value[${n}]`,t),YL(t[0],t[1])):((0,D4.assertArgument)(t!=null&&typeof t=="object","invalid address-slot set","value",r),YL(t.address,t.storageKeys)));(0,D4.assertArgument)(r!=null&&typeof r=="object","invalid access list","value",r);let e=Object.keys(r).map(t=>{let n=r[t].reduce((s,i)=>(s[i]=!0,s),{});return YL(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}nT.accessListify=tAe});var tU=R(T3=>{"use strict";b();p();Object.defineProperty(T3,"__esModule",{value:!0});T3.recoverAddress=T3.computeAddress=void 0;var rAe=Ws(),eU=di();function die(r){let e;return typeof r=="string"?e=eU.SigningKey.computePublicKey(r,!1):e=r.publicKey,(0,rAe.getAddress)((0,eU.keccak256)("0x"+e.substring(4)).substring(26))}T3.computeAddress=die;function nAe(r,e){return die(eU.SigningKey.recoverPublicKey(r,e))}T3.recoverAddress=nAe});var pie=R(aT=>{"use strict";b();p();Object.defineProperty(aT,"__esModule",{value:!0});aT.Transaction=void 0;var hie=Ws(),bie=TL(),Hd=di(),ge=Ne(),sU=XL(),sAe=tU(),li=BigInt(0),iAe=BigInt(2),aAe=BigInt(27),oAe=BigInt(28),cAe=BigInt(35),uAe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),rU=4096*32;function lie(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,Hd.sha256)(e).substring(4),"0x"+t}function iT(r){return r==="0x"?null:(0,hie.getAddress)(r)}function iU(r,e){try{return(0,sU.accessListify)(r)}catch(t){(0,ge.assertArgument)(!1,t.message,e,r)}}function H4(r,e){return r==="0x"?0:(0,ge.getNumber)(r,e)}function fs(r,e){if(r==="0x")return li;let t=(0,ge.getBigInt)(r,e);return(0,ge.assertArgument)(t<=uAe,"value exceeds uint size",e,t),t}function gn(r,e){let t=(0,ge.getBigInt)(r,"value"),n=(0,ge.toBeArray)(t);return(0,ge.assertArgument)(n.length<=32,"value too large",`tx.${e}`,t),n}function aU(r){return(0,sU.accessListify)(r).map(e=>[e.address,e.storageKeys])}function fAe(r,e){(0,ge.assertArgument)(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)(0,ge.assertArgument)((0,ge.isHexString)(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function dAe(r){let e=(0,ge.decodeRlp)(r);(0,ge.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);let t={type:0,nonce:H4(e[0],"nonce"),gasPrice:fs(e[1],"gasPrice"),gasLimit:fs(e[2],"gasLimit"),to:iT(e[3]),value:fs(e[4],"value"),data:(0,ge.hexlify)(e[5]),chainId:li};if(e.length===6)return t;let n=fs(e[6],"v"),s=fs(e[7],"r"),i=fs(e[8],"s");if(s===li&&i===li)t.chainId=n;else{let a=(n-cAe)/iAe;a<li&&(a=li),t.chainId=a,(0,ge.assertArgument)(a!==li||n===aAe||n===oAe,"non-canonical legacy v","v",e[6]),t.signature=Hd.Signature.from({r:(0,ge.zeroPadValue)(e[7],32),s:(0,ge.zeroPadValue)(e[8],32),v:n})}return t}function lAe(r,e){let t=[gn(r.nonce,"nonce"),gn(r.gasPrice||0,"gasPrice"),gn(r.gasLimit,"gasLimit"),r.to||"0x",gn(r.value,"value"),r.data],n=li;if(r.chainId!=li)n=(0,ge.getBigInt)(r.chainId,"tx.chainId"),(0,ge.assertArgument)(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){let i=r.signature.legacyChainId;i!=null&&(n=i)}if(!e)return n!==li&&(t.push((0,ge.toBeArray)(n)),t.push("0x"),t.push("0x")),(0,ge.encodeRlp)(t);let s=BigInt(27+e.yParity);return n!==li?s=Hd.Signature.getChainIdV(n,e.v):BigInt(e.v)!==s&&(0,ge.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",e),t.push((0,ge.toBeArray)(s)),t.push((0,ge.toBeArray)(e.r)),t.push((0,ge.toBeArray)(e.s)),(0,ge.encodeRlp)(t)}function oU(r,e){let t;try{if(t=H4(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{(0,ge.assertArgument)(!1,"invalid yParity","yParity",e[0])}let n=(0,ge.zeroPadValue)(e[1],32),s=(0,ge.zeroPadValue)(e[2],32),i=Hd.Signature.from({r:n,s,yParity:t});r.signature=i}function hAe(r){let e=(0,ge.decodeRlp)((0,ge.getBytes)(r).slice(1));(0,ge.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",(0,ge.hexlify)(r));let t={type:2,chainId:fs(e[0],"chainId"),nonce:H4(e[1],"nonce"),maxPriorityFeePerGas:fs(e[2],"maxPriorityFeePerGas"),maxFeePerGas:fs(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:fs(e[4],"gasLimit"),to:iT(e[5]),value:fs(e[6],"value"),data:(0,ge.hexlify)(e[7]),accessList:iU(e[8],"accessList")};return e.length===9||oU(t,e.slice(9)),t}function bAe(r,e){let t=[gn(r.chainId,"chainId"),gn(r.nonce,"nonce"),gn(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gn(r.maxFeePerGas||0,"maxFeePerGas"),gn(r.gasLimit,"gasLimit"),r.to||"0x",gn(r.value,"value"),r.data,aU(r.accessList||[])];return e&&(t.push(gn(e.yParity,"yParity")),t.push((0,ge.toBeArray)(e.r)),t.push((0,ge.toBeArray)(e.s))),(0,ge.concat)(["0x02",(0,ge.encodeRlp)(t)])}function pAe(r){let e=(0,ge.decodeRlp)((0,ge.getBytes)(r).slice(1));(0,ge.assertArgument)(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",(0,ge.hexlify)(r));let t={type:1,chainId:fs(e[0],"chainId"),nonce:H4(e[1],"nonce"),gasPrice:fs(e[2],"gasPrice"),gasLimit:fs(e[3],"gasLimit"),to:iT(e[4]),value:fs(e[5],"value"),data:(0,ge.hexlify)(e[6]),accessList:iU(e[7],"accessList")};return e.length===8||oU(t,e.slice(8)),t}function gAe(r,e){let t=[gn(r.chainId,"chainId"),gn(r.nonce,"nonce"),gn(r.gasPrice||0,"gasPrice"),gn(r.gasLimit,"gasLimit"),r.to||"0x",gn(r.value,"value"),r.data,aU(r.accessList||[])];return e&&(t.push(gn(e.yParity,"recoveryParam")),t.push((0,ge.toBeArray)(e.r)),t.push((0,ge.toBeArray)(e.s))),(0,ge.concat)(["0x01",(0,ge.encodeRlp)(t)])}function xAe(r){let e=(0,ge.decodeRlp)((0,ge.getBytes)(r).slice(1)),t="3",n=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";let i=e[1],a=e[2],o=e[3];(0,ge.assertArgument)(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),(0,ge.assertArgument)(Array.isArray(a),"invalid network format: commitments not an array","fields[2]",a),(0,ge.assertArgument)(Array.isArray(o),"invalid network format: proofs not an array","fields[3]",o),(0,ge.assertArgument)(i.length===a.length,"invalid network format: blobs/commitments length mismatch","fields",e),(0,ge.assertArgument)(i.length===o.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:i[c],commitment:a[c],proof:o[c]});e=e[0]}(0,ge.assertArgument)(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",(0,ge.hexlify)(r));let s={type:3,chainId:fs(e[0],"chainId"),nonce:H4(e[1],"nonce"),maxPriorityFeePerGas:fs(e[2],"maxPriorityFeePerGas"),maxFeePerGas:fs(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:fs(e[4],"gasLimit"),to:iT(e[5]),value:fs(e[6],"value"),data:(0,ge.hexlify)(e[7]),accessList:iU(e[8],"accessList"),maxFeePerBlobGas:fs(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(s.blobs=n),(0,ge.assertArgument)(s.to!=null,`invalid address for transaction type: ${t}`,"data",r),(0,ge.assertArgument)(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let i=0;i<s.blobVersionedHashes.length;i++)(0,ge.assertArgument)((0,ge.isHexString)(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",r);return e.length===11||oU(s,e.slice(11)),s}function yAe(r,e,t){let n=[gn(r.chainId,"chainId"),gn(r.nonce,"nonce"),gn(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),gn(r.maxFeePerGas||0,"maxFeePerGas"),gn(r.gasLimit,"gasLimit"),r.to||bie.ZeroAddress,gn(r.value,"value"),r.data,aU(r.accessList||[]),gn(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),fAe(r.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(gn(e.yParity,"yParity")),n.push((0,ge.toBeArray)(e.r)),n.push((0,ge.toBeArray)(e.s)),t)?(0,ge.concat)(["0x03",(0,ge.encodeRlp)([n,t.map(s=>s.data),t.map(s=>s.commitment),t.map(s=>s.proof)])]):(0,ge.concat)(["0x03",(0,ge.encodeRlp)(n)])}var m0,O3,B3,k3,N3,I3,R3,j3,M3,C3,L3,U3,$g,sb,Dd,ib,F3,sT,qd=class{constructor(){I(this,F3);I(this,m0,void 0);I(this,O3,void 0);I(this,B3,void 0);I(this,k3,void 0);I(this,N3,void 0);I(this,I3,void 0);I(this,R3,void 0);I(this,j3,void 0);I(this,M3,void 0);I(this,C3,void 0);I(this,L3,void 0);I(this,U3,void 0);I(this,$g,void 0);I(this,sb,void 0);I(this,Dd,void 0);I(this,ib,void 0);_(this,m0,null),_(this,O3,null),_(this,k3,0),_(this,N3,li),_(this,I3,null),_(this,R3,null),_(this,j3,null),_(this,B3,"0x"),_(this,M3,li),_(this,C3,li),_(this,L3,null),_(this,U3,null),_(this,$g,null),_(this,sb,null),_(this,ib,null),_(this,Dd,null)}get type(){return l(this,m0)}set type(e){switch(e){case null:_(this,m0,null);break;case 0:case"legacy":_(this,m0,0);break;case 1:case"berlin":case"eip-2930":_(this,m0,1);break;case 2:case"london":case"eip-1559":_(this,m0,2);break;case 3:case"cancun":case"eip-4844":_(this,m0,3);break;default:(0,ge.assertArgument)(!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";case 3:return"eip-4844"}return null}get to(){let e=l(this,O3);return e==null&&this.type===3?bie.ZeroAddress:e}set to(e){_(this,O3,e==null?null:(0,hie.getAddress)(e))}get nonce(){return l(this,k3)}set nonce(e){_(this,k3,(0,ge.getNumber)(e,"value"))}get gasLimit(){return l(this,N3)}set gasLimit(e){_(this,N3,(0,ge.getBigInt)(e))}get gasPrice(){let e=l(this,I3);return e==null&&(this.type===0||this.type===1)?li:e}set gasPrice(e){_(this,I3,e==null?null:(0,ge.getBigInt)(e,"gasPrice"))}get maxPriorityFeePerGas(){let e=l(this,R3);return e??(this.type===2||this.type===3?li:null)}set maxPriorityFeePerGas(e){_(this,R3,e==null?null:(0,ge.getBigInt)(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){let e=l(this,j3);return e??(this.type===2||this.type===3?li:null)}set maxFeePerGas(e){_(this,j3,e==null?null:(0,ge.getBigInt)(e,"maxFeePerGas"))}get data(){return l(this,B3)}set data(e){_(this,B3,(0,ge.hexlify)(e))}get value(){return l(this,M3)}set value(e){_(this,M3,(0,ge.getBigInt)(e,"value"))}get chainId(){return l(this,C3)}set chainId(e){_(this,C3,(0,ge.getBigInt)(e))}get signature(){return l(this,L3)||null}set signature(e){_(this,L3,e==null?null:Hd.Signature.from(e))}get accessList(){let e=l(this,U3)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){_(this,U3,e==null?null:(0,sU.accessListify)(e))}get maxFeePerBlobGas(){let e=l(this,$g);return e==null&&this.type===3?li:e}set maxFeePerBlobGas(e){_(this,$g,e==null?null:(0,ge.getBigInt)(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=l(this,sb);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){(0,ge.assertArgument)(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)(0,ge.assertArgument)((0,ge.isHexString)(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}_(this,sb,e)}get blobs(){return l(this,ib)==null?null:l(this,ib).map(e=>Object.assign({},e))}set blobs(e){if(e==null){_(this,ib,null);return}let t=[],n=[];for(let s=0;s<e.length;s++){let i=e[s];if((0,ge.isBytesLike)(i)){(0,ge.assert)(l(this,Dd),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let a=(0,ge.getBytes)(i);if((0,ge.assertArgument)(a.length<=rU,"blob is too large",`blobs[${s}]`,i),a.length!==rU){let u=new Uint8Array(rU);u.set(a),a=u}let o=l(this,Dd).blobToKzgCommitment(a),c=(0,ge.hexlify)(l(this,Dd).computeBlobKzgProof(a,o));t.push({data:(0,ge.hexlify)(a),commitment:(0,ge.hexlify)(o),proof:c}),n.push(lie(1,o))}else{let a=(0,ge.hexlify)(i.commitment);t.push({data:(0,ge.hexlify)(i.data),commitment:a,proof:(0,ge.hexlify)(i.proof)}),n.push(lie(1,a))}}_(this,ib,t),_(this,sb,n)}get kzg(){return l(this,Dd)}set kzg(e){_(this,Dd,e)}get hash(){return this.signature==null?null:(0,Hd.keccak256)($(this,F3,sT).call(this,!0,!1))}get unsignedHash(){return(0,Hd.keccak256)(this.unsignedSerialized)}get from(){return this.signature==null?null:(0,sAe.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Hd.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return $(this,F3,sT).call(this,!0,!0)}get unsignedSerialized(){return $(this,F3,sT).call(this,!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,s=l(this,$g)!=null||l(this,sb);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&(0,ge.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,ge.assert)(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,ge.assert)(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});let i=[];return this.type!=null?i.push(this.type):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return qd.from(this)}toJSON(){let e=t=>t==null?null:t.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 qd;if(typeof e=="string"){let n=(0,ge.getBytes)(e);if(n[0]>=127)return qd.from(dAe(n));switch(n[0]){case 1:return qd.from(pAe(n));case 2:return qd.from(hAe(n));case 3:return qd.from(xAe(n))}(0,ge.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}let t=new qd;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=Hd.Signature.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&((0,ge.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),(0,ge.assertArgument)(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&((0,ge.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),(0,ge.assertArgument)(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}},nU=qd;m0=new WeakMap,O3=new WeakMap,B3=new WeakMap,k3=new WeakMap,N3=new WeakMap,I3=new WeakMap,R3=new WeakMap,j3=new WeakMap,M3=new WeakMap,C3=new WeakMap,L3=new WeakMap,U3=new WeakMap,$g=new WeakMap,sb=new WeakMap,Dd=new WeakMap,ib=new WeakMap,F3=new WeakSet,sT=function(e,t){(0,ge.assert)(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});let n=e?this.signature:null;switch(this.inferType()){case 0:return lAe(this,n);case 1:return gAe(this,n);case 2:return bAe(this,n);case 3:return yAe(this,n,t?this.blobs:null)}(0,ge.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};aT.Transaction=nU});var Qa=R(w0=>{"use strict";b();p();Object.defineProperty(w0,"__esModule",{value:!0});w0.Transaction=w0.recoverAddress=w0.computeAddress=w0.accessListify=void 0;var mAe=XL();Object.defineProperty(w0,"accessListify",{enumerable:!0,get:function(){return mAe.accessListify}});var gie=tU();Object.defineProperty(w0,"computeAddress",{enumerable:!0,get:function(){return gie.computeAddress}});Object.defineProperty(w0,"recoverAddress",{enumerable:!0,get:function(){return gie.recoverAddress}});var wAe=pie();Object.defineProperty(w0,"Transaction",{enumerable:!0,get:function(){return wAe.Transaction}})});var yie=R(q3=>{"use strict";b();p();Object.defineProperty(q3,"__esModule",{value:!0});q3.verifyMessage=q3.hashMessage=void 0;var vAe=di(),PAe=y3(),_Ae=Qa(),oT=Ne();function xie(r){return typeof r=="string"&&(r=(0,oT.toUtf8Bytes)(r)),(0,vAe.keccak256)((0,oT.concat)([(0,oT.toUtf8Bytes)(PAe.MessagePrefix),(0,oT.toUtf8Bytes)(String(r.length)),r]))}q3.hashMessage=xie;function AAe(r,e){let t=xie(r);return(0,_Ae.recoverAddress)(t,e)}q3.verifyMessage=AAe});var vie=R(ab=>{"use strict";b();p();Object.defineProperty(ab,"__esModule",{value:!0});ab.solidityPackedSha256=ab.solidityPackedKeccak256=ab.solidityPacked=void 0;var EAe=Ws(),mie=di(),xn=Ne(),SAe=new RegExp("^bytes([0-9]+)$"),TAe=new RegExp("^(u?int)([0-9]*)$"),OAe=new RegExp("^(.*)\\[([0-9]*)\\]$");function wie(r,e,t){switch(r){case"address":return t?(0,xn.getBytes)((0,xn.zeroPadValue)(e,32)):(0,xn.getBytes)((0,EAe.getAddress)(e));case"string":return(0,xn.toUtf8Bytes)(e);case"bytes":return(0,xn.getBytes)(e);case"bool":return e=e?"0x01":"0x00",t?(0,xn.getBytes)((0,xn.zeroPadValue)(e,32)):(0,xn.getBytes)(e)}let n=r.match(TAe);if(n){let s=n[1]==="int",i=parseInt(n[2]||"256");return(0,xn.assertArgument)((!n[2]||n[2]===String(i))&&i%8===0&&i!==0&&i<=256,"invalid number type","type",r),t&&(i=256),s&&(e=(0,xn.toTwos)(e,i)),(0,xn.getBytes)((0,xn.zeroPadValue)((0,xn.toBeArray)(e),i/8))}if(n=r.match(SAe),n){let s=parseInt(n[1]);return(0,xn.assertArgument)(String(s)===n[1]&&s!==0&&s<=32,"invalid bytes type","type",r),(0,xn.assertArgument)((0,xn.dataLength)(e)===s,`invalid value for ${r}`,"value",e),t?(0,xn.getBytes)((0,xn.zeroPadBytes)(e,32)):e}if(n=r.match(OAe),n&&Array.isArray(e)){let s=n[1],i=parseInt(n[2]||String(e.length));(0,xn.assertArgument)(i===e.length,`invalid array length for ${r}`,"value",e);let a=[];return e.forEach(function(o){a.push(wie(s,o,!0))}),(0,xn.getBytes)((0,xn.concat)(a))}(0,xn.assertArgument)(!1,"invalid type","type",r)}function cU(r,e){(0,xn.assertArgument)(r.length===e.length,"wrong number of values; expected ${ types.length }","values",e);let t=[];return r.forEach(function(n,s){t.push(wie(n,e[s]))}),(0,xn.hexlify)((0,xn.concat)(t))}ab.solidityPacked=cU;function BAe(r,e){return(0,mie.keccak256)(cU(r,e))}ab.solidityPackedKeccak256=BAe;function kAe(r,e){return(0,mie.sha256)(cU(r,e))}ab.solidityPackedSha256=kAe});var Nie=R(K3=>{"use strict";b();p();Object.defineProperty(K3,"__esModule",{value:!0});K3.verifyTypedData=K3.TypedDataEncoder=void 0;var Eie=Ws(),D3=di(),NAe=Qa(),ft=Ne(),Sie=ZL(),Tie=new Uint8Array(32);Tie.fill(0);var IAe=BigInt(-1),Oie=BigInt(0),Bie=BigInt(1),RAe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jAe(r){let e=(0,ft.getBytes)(r),t=e.length%32;return t?(0,ft.concat)([e,Tie.slice(t)]):(0,ft.hexlify)(e)}var MAe=(0,ft.toBeHex)(Bie,32),CAe=(0,ft.toBeHex)(Oie,32),Pie={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},uU=["name","version","chainId","verifyingContract","salt"];function _ie(r){return function(e){return(0,ft.assertArgument)(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}var LAe={name:_ie("name"),version:_ie("version"),chainId:function(r){let e=(0,ft.getBigInt)(r,"domain.chainId");return(0,ft.assertArgument)(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):(0,ft.toQuantity)(e)},verifyingContract:function(r){try{return(0,Eie.getAddress)(r).toLowerCase()}catch{}(0,ft.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){let e=(0,ft.getBytes)(r,"domain.salt");return(0,ft.assertArgument)(e.length===32,'invalid domain value "salt"',"domain.salt",r),(0,ft.hexlify)(e)}};function fU(r){{let e=r.match(/^(u?)int(\d+)$/);if(e){let t=e[1]==="",n=parseInt(e[2]);(0,ft.assertArgument)(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);let s=(0,ft.mask)(RAe,t?n-1:n),i=t?(s+Bie)*IAe:Oie;return function(a){let o=(0,ft.getBigInt)(a,"value");return(0,ft.assertArgument)(o>=i&&o<=s,`value out-of-bounds for ${r}`,"value",o),(0,ft.toBeHex)(t?(0,ft.toTwos)(o,256):o,32)}}}{let e=r.match(/^bytes(\d+)$/);if(e){let t=parseInt(e[1]);return(0,ft.assertArgument)(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){let s=(0,ft.getBytes)(n);return(0,ft.assertArgument)(s.length===t,`invalid length for ${r}`,"value",n),jAe(n)}}}switch(r){case"address":return function(e){return(0,ft.zeroPadValue)((0,Eie.getAddress)(e),32)};case"bool":return function(e){return e?MAe:CAe};case"bytes":return function(e){return(0,D3.keccak256)(e)};case"string":return function(e){return(0,Sie.id)(e)}}return null}function Aie(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function cT(r){let e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}var K4,Kd,H3,fT,kie,Cc=class{constructor(e){I(this,fT);N(this,"primaryType");I(this,K4,void 0);I(this,Kd,void 0);I(this,H3,void 0);_(this,Kd,new Map),_(this,H3,new Map);let t=new Map,n=new Map,s=new Map,i={};Object.keys(e).forEach(c=>{i[c]=e[c].map(({name:u,type:f})=>{let{base:d,index:g}=cT(f);return d==="int"&&!e.int&&(d="int256"),d==="uint"&&!e.uint&&(d="uint256"),{name:u,type:d+(g||"")}}),t.set(c,new Set),n.set(c,[]),s.set(c,new Set)}),_(this,K4,JSON.stringify(i));for(let c in i){let u=new Set;for(let f of i[c]){(0,ft.assertArgument)(!u.has(f.name),`duplicate variable name ${JSON.stringify(f.name)} in ${JSON.stringify(c)}`,"types",e),u.add(f.name);let d=cT(f.type).base;(0,ft.assertArgument)(d!==c,`circular type reference to ${JSON.stringify(d)}`,"types",e),!fU(d)&&((0,ft.assertArgument)(n.has(d),`unknown type ${JSON.stringify(d)}`,"types",e),n.get(d).push(c),t.get(c).add(d))}}let a=Array.from(n.keys()).filter(c=>n.get(c).length===0);(0,ft.assertArgument)(a.length!==0,"missing primary type","types",e),(0,ft.assertArgument)(a.length===1,`ambiguous primary types or unused types: ${a.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),(0,ft.defineProperties)(this,{primaryType:a[0]});function o(c,u){(0,ft.assertArgument)(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),u.add(c);for(let f of t.get(c))if(!!n.has(f)){o(f,u);for(let d of u)s.get(d).add(f)}u.delete(c)}o(this.primaryType,new Set);for(let[c,u]of s){let f=Array.from(u);f.sort(),l(this,Kd).set(c,Aie(c,i[c])+f.map(d=>Aie(d,i[d])).join(""))}}get types(){return JSON.parse(l(this,K4))}getEncoder(e){let t=l(this,H3).get(e);return t||(t=$(this,fT,kie).call(this,e),l(this,H3).set(e,t)),t}encodeType(e){let t=l(this,Kd).get(e);return(0,ft.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,D3.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(fU(e))return n(e,t);let s=cT(e).array;if(s)return(0,ft.assertArgument)(s.count===-1||s.count===t.length,`array length mismatch; expected length ${s.count}`,"value",t),t.map(a=>this._visit(s.prefix,a,n));let i=this.types[e];if(i)return i.reduce((a,{name:o,type:c})=>(a[o]=this._visit(c,t[o],n),a),{});(0,ft.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Cc(e)}static getPrimaryType(e){return Cc.from(e).primaryType}static hashStruct(e,t,n){return Cc.from(t).hashStruct(e,n)}static hashDomain(e){let t=[];for(let n in e){if(e[n]==null)continue;let s=Pie[n];(0,ft.assertArgument)(s,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:s})}return t.sort((n,s)=>uU.indexOf(n.name)-uU.indexOf(s.name)),Cc.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return(0,ft.concat)(["0x1901",Cc.hashDomain(e),Cc.from(t).hash(n)])}static hash(e,t,n){return(0,D3.keccak256)(Cc.encode(e,t,n))}static async resolveNames(e,t,n,s){e=Object.assign({},e);for(let o in e)e[o]==null&&delete e[o];let i={};e.verifyingContract&&!(0,ft.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let a=Cc.from(t);a.visit(n,(o,c)=>(o==="address"&&!(0,ft.isHexString)(c,20)&&(i[c]="0x"),c));for(let o in i)i[o]=await s(o);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=a.visit(n,(o,c)=>o==="address"&&i[c]?i[c]:c),{domain:e,value:n}}static getPayload(e,t,n){Cc.hashDomain(e);let s={},i=[];uU.forEach(c=>{let u=e[c];u!=null&&(s[c]=LAe[c](u),i.push({name:c,type:Pie[c]}))});let a=Cc.from(t);t=a.types;let o=Object.assign({},t);return(0,ft.assertArgument)(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=i,a.encode(n),{types:o,domain:s,primaryType:a.primaryType,message:a.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return(0,ft.hexlify)((0,ft.getBytes)(u));if(c.match(/^u?int/))return(0,ft.getBigInt)(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return(0,ft.assertArgument)(typeof u=="string","invalid string","value",u),u}(0,ft.assertArgument)(!1,"unsupported type","type",c)})}}},uT=Cc;K4=new WeakMap,Kd=new WeakMap,H3=new WeakMap,fT=new WeakSet,kie=function(e){{let s=fU(e);if(s)return s}let t=cT(e).array;if(t){let s=t.prefix,i=this.getEncoder(s);return a=>{(0,ft.assertArgument)(t.count===-1||t.count===a.length,`array length mismatch; expected length ${t.count}`,"value",a);let o=a.map(i);return l(this,Kd).has(s)&&(o=o.map(D3.keccak256)),(0,D3.keccak256)((0,ft.concat)(o))}}let n=this.types[e];if(n){let s=(0,Sie.id)(l(this,Kd).get(e));return i=>{let a=n.map(({name:o,type:c})=>{let u=this.getEncoder(c)(i[o]);return l(this,Kd).has(c)?(0,D3.keccak256)(u):u});return a.unshift(s),(0,ft.concat)(a)}}(0,ft.assertArgument)(!1,`unknown type: ${e}`,"type",e)};K3.TypedDataEncoder=uT;function UAe(r,e,t,n){return(0,NAe.recoverAddress)(uT.hash(r,e,t),n)}K3.verifyTypedData=UAe});var v0=R(Xr=>{"use strict";b();p();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.verifyTypedData=Xr.TypedDataEncoder=Xr.solidityPackedSha256=Xr.solidityPackedKeccak256=Xr.solidityPacked=Xr.verifyMessage=Xr.hashMessage=Xr.dnsEncode=Xr.namehash=Xr.isValidName=Xr.ensNormalize=Xr.id=void 0;var FAe=ZL();Object.defineProperty(Xr,"id",{enumerable:!0,get:function(){return FAe.id}});var dT=fie();Object.defineProperty(Xr,"ensNormalize",{enumerable:!0,get:function(){return dT.ensNormalize}});Object.defineProperty(Xr,"isValidName",{enumerable:!0,get:function(){return dT.isValidName}});Object.defineProperty(Xr,"namehash",{enumerable:!0,get:function(){return dT.namehash}});Object.defineProperty(Xr,"dnsEncode",{enumerable:!0,get:function(){return dT.dnsEncode}});var Iie=yie();Object.defineProperty(Xr,"hashMessage",{enumerable:!0,get:function(){return Iie.hashMessage}});Object.defineProperty(Xr,"verifyMessage",{enumerable:!0,get:function(){return Iie.verifyMessage}});var dU=vie();Object.defineProperty(Xr,"solidityPacked",{enumerable:!0,get:function(){return dU.solidityPacked}});Object.defineProperty(Xr,"solidityPackedKeccak256",{enumerable:!0,get:function(){return dU.solidityPackedKeccak256}});Object.defineProperty(Xr,"solidityPackedSha256",{enumerable:!0,get:function(){return dU.solidityPackedSha256}});var Rie=Nie();Object.defineProperty(Xr,"TypedDataEncoder",{enumerable:!0,get:function(){return Rie.TypedDataEncoder}});Object.defineProperty(Xr,"verifyTypedData",{enumerable:!0,get:function(){return Rie.verifyTypedData}})});var pT=R(Os=>{"use strict";b();p();Object.defineProperty(Os,"__esModule",{value:!0});Os.StructFragment=Os.FunctionFragment=Os.FallbackFragment=Os.ConstructorFragment=Os.EventFragment=Os.ErrorFragment=Os.NamedFragment=Os.Fragment=Os.ParamType=void 0;var mr=Ne(),hU=v0();function ga(r){let e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}var qAe="external public payable override",DAe=ga(qAe.split(" ")),Kie="constant external internal payable private public pure view override",HAe=ga(Kie.split(" ")),Gie="constructor error event fallback function receive struct",Vie=ga(Gie.split(" ")),zie="calldata memory storage payable indexed",KAe=ga(zie.split(" ")),GAe="tuple returns",VAe=[Gie,zie,GAe,Kie].join(" "),zAe=ga(VAe.split(" ")),WAe={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},$Ae=new RegExp("^(\\s*)"),JAe=new RegExp("^([0-9]+)"),ZAe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Wie=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),$ie=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),Pi,df,V4,lU,hT=class{constructor(e){I(this,V4);I(this,Pi,void 0);I(this,df,void 0);_(this,Pi,0),_(this,df,e.slice())}get offset(){return l(this,Pi)}get length(){return l(this,df).length-l(this,Pi)}clone(){return new hT(l(this,df))}reset(){_(this,Pi,0)}popKeyword(e){let t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){let t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=$(this,V4,lU).call(this,l(this,Pi)+1,e.match+1);return _(this,Pi,e.match+1),t}popParams(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=[];for(;l(this,Pi)<e.match-1;){let n=this.peek().linkNext;t.push($(this,V4,lU).call(this,l(this,Pi)+1,n)),_(this,Pi,n)}return _(this,Pi,e.match+1),t}peek(){if(l(this,Pi)>=l(this,df).length)throw new Error("out-of-bounds");return l(this,df)[l(this,Pi)]}peekKeyword(e){let t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;let t=this.peek();return t.type===e?t.text:null}pop(){let e=this.peek();return $s(this,Pi)._++,e}toString(){let e=[];for(let t=l(this,Pi);t<l(this,df).length;t++){let n=l(this,df)[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}},bf=hT;Pi=new WeakMap,df=new WeakMap,V4=new WeakSet,lU=function(e=0,t=0){return new hT(l(this,df).slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};function ob(r){let e=[],t=a=>{let o=i<r.length?JSON.stringify(r[i]):"$EOI";throw new Error(`invalid token ${o} at ${i}: ${a}`)},n=[],s=[],i=0;for(;i<r.length;){let a=r.substring(i),o=a.match($Ae);o&&(i+=o[1].length,a=r.substring(i));let c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(c);let u=WAe[a[0]]||"";if(u){if(c.type=u,c.text=a[0],i++,u==="OPEN_PAREN")n.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.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"){let d=e.pop().text;f=d+f,e[e.length-1].value=(0,mr.getNumber)(d)}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=a.match(ZAe),o){if(c.text=o[1],i+=c.text.length,zAe.has(c.text)){c.type="KEYWORD";continue}if(c.text.match($ie)){c.type="TYPE";continue}c.type="ID";continue}if(o=a.match(JAe),o){c.text=o[1],c.type="NUMBER",i+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new bf(e.map(a=>Object.freeze(a)))}function jie(r,e){let t=[];for(let n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function bT(r,e){if(e.peekKeyword(Vie)){let t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function Vd(r,e){let t=new Set;for(;;){let n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function Jie(r){let e=Vd(r,HAe);return jie(e,ga("constant payable nonpayable".split(" "))),jie(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 Gd(r,e){return r.popParams().map(t=>Ya.from(t,e))}function Zie(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return(0,mr.getBigInt)(r.pop().text);throw new Error("invalid gas")}return null}function Jg(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}var QAe=new RegExp(/^(.*)\[([0-9]*)\]$/);function Mie(r){let e=r.match($ie);if((0,mr.assertArgument)(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){let t=parseInt(e[2]);(0,mr.assertArgument)(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){let t=parseInt(e[3]);(0,mr.assertArgument)(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}var qn={},Xa=Symbol.for("_ethers_internal"),Cie="_ParamTypeInternal",Lie="_ErrorInternal",Uie="_EventInternal",Fie="_ConstructorInternal",qie="_FallbackInternal",Die="_FunctionInternal",Hie="_StructInternal",G3,lT,Lc=class{constructor(e,t,n,s,i,a,o,c){I(this,G3);N(this,"name");N(this,"type");N(this,"baseType");N(this,"indexed");N(this,"components");N(this,"arrayLength");N(this,"arrayChildren");if((0,mr.assertPrivate)(e,qn,"ParamType"),Object.defineProperty(this,Xa,{value:Cie}),a&&(a=Object.freeze(a.slice())),s==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");(0,mr.defineProperties)(this,{name:t,type:n,baseType:s,indexed:i,components:a,arrayLength:o,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){let n=this.name||"";if(this.isArray()){let i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}let s={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){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");let n=this;return e.map(s=>n.arrayChildren.walk(s,t))}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");let n=this;return e.map((s,i)=>n.components[i].walk(s,t))}return t(this.type,e)}async walkAsync(e,t){let n=[],s=[e];return $(this,G3,lT).call(this,n,e,t,i=>{s[0]=i}),n.length&&await Promise.all(n),s[0]}static from(e,t){if(Lc.isParamType(e))return e;if(typeof e=="string")try{return Lc.from(ob(e),t)}catch{(0,mr.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof bf){let o="",c="",u=null;Vd(e,ga(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(y=>Lc.from(y)),o=`tuple(${u.map(y=>y.format()).join(",")})`):(o=Mie(e.popType("TYPE")),c=o);let f=null,d=null;for(;e.length&&e.peekType("BRACKET");){let y=e.pop();f=new Lc(qn,"",o,c,null,u,d,f),d=y.value,o+=y.text,c="array",u=null}let g=null;if(Vd(e,KAe).has("indexed")){if(!t)throw new Error("");g=!0}let m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Lc(qn,m,o,c,g,u,d,f)}let n=e.name;(0,mr.assertArgument)(!n||typeof n=="string"&&n.match(Wie),"invalid name","obj.name",n);let s=e.indexed;s!=null&&((0,mr.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,a=i.match(QAe);if(a){let o=parseInt(a[2]||"-1"),c=Lc.from({type:a[1],components:e.components});return new Lc(qn,n||"",i,"array",s,null,o,c)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){let o=e.components!=null?e.components.map(u=>Lc.from(u)):null;return new Lc(qn,n||"",i,"tuple",s,o,null,null)}return i=Mie(e.type),new Lc(qn,n||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[Xa]===Cie}},Ya=Lc;G3=new WeakSet,lT=function(e,t,n,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let a=this.arrayChildren,o=t.slice();o.forEach((c,u)=>{var f;$(f=a,G3,lT).call(f,e,c,n,d=>{o[u]=d})}),s(o);return}if(this.isTuple()){let a=this.components,o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,u)=>{var f;$(f=a[u],G3,lT).call(f,e,c,n,d=>{o[u]=d})}),s(o);return}let i=n(this.type,t);i.then?e.push(async function(){s(await i)}()):s(i)};Os.ParamType=Ya;var zd=class{constructor(e,t,n){N(this,"type");N(this,"inputs");(0,mr.assertPrivate)(e,qn,"Fragment"),n=Object.freeze(n.slice()),(0,mr.defineProperties)(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{zd.from(JSON.parse(e))}catch{}return zd.from(ob(e))}if(e instanceof bf)switch(e.peekKeyword(Vie)){case"constructor":return hf.from(e);case"error":return lf.from(e);case"event":return Fc.from(e);case"fallback":case"receive":return Uc.from(e);case"function":return qc.from(e);case"struct":return P0.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return hf.from(e);case"error":return lf.from(e);case"event":return Fc.from(e);case"fallback":case"receive":return Uc.from(e);case"function":return qc.from(e);case"struct":return P0.from(e)}(0,mr.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,mr.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return hf.isFragment(e)}static isError(e){return lf.isFragment(e)}static isEvent(e){return Fc.isFragment(e)}static isFunction(e){return qc.isFragment(e)}static isStruct(e){return P0.isFragment(e)}};Os.Fragment=zd;var Zg=class extends zd{constructor(t,n,s,i){super(t,n,i);N(this,"name");(0,mr.assertArgument)(typeof s=="string"&&s.match(Wie),"invalid identifier","name",s),i=Object.freeze(i.slice()),(0,mr.defineProperties)(this,{name:s})}};Os.NamedFragment=Zg;function G4(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}var lf=class extends Zg{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,Xa,{value:Lie})}get selector(){return(0,hU.id)(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)))});let t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+G4(e,this.inputs)),t.join(" ")}static from(e){if(lf.isFragment(e))return e;if(typeof e=="string")return lf.from(ob(e));if(e instanceof bf){let t=bT("error",e),n=Gd(e);return Jg(e),new lf(qn,t,n)}return new lf(qn,e.name,e.inputs?e.inputs.map(Ya.from):[])}static isFragment(e){return e&&e[Xa]===Lie}};Os.ErrorFragment=lf;var Fc=class extends Zg{constructor(t,n,s,i){super(t,"event",n,s);N(this,"anonymous");Object.defineProperty(this,Xa,{value:Uie}),(0,mr.defineProperties)(this,{anonymous:i})}get topicHash(){return(0,hU.id)(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(t)))});let n=[];return t!=="sighash"&&n.push("event"),n.push(this.name+G4(t,this.inputs)),t!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(t,n){return n=(n||[]).map(i=>Ya.from(i)),new Fc(qn,t,n,!1).topicHash}static from(t){if(Fc.isFragment(t))return t;if(typeof t=="string")try{return Fc.from(ob(t))}catch{(0,mr.assertArgument)(!1,"invalid event fragment","obj",t)}else if(t instanceof bf){let n=bT("event",t),s=Gd(t,!0),i=!!Vd(t,ga(["anonymous"])).has("anonymous");return Jg(t),new Fc(qn,n,s,i)}return new Fc(qn,t.name,t.inputs?t.inputs.map(n=>Ya.from(n,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[Xa]===Uie}};Os.EventFragment=Fc;var hf=class extends zd{constructor(t,n,s,i,a){super(t,n,s);N(this,"payable");N(this,"gas");Object.defineProperty(this,Xa,{value:Fie}),(0,mr.defineProperties)(this,{payable:i,gas:a})}format(t){if((0,mr.assert)(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="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(s=>JSON.parse(s.format(t)))});let n=[`constructor${G4(t,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(t){if(hf.isFragment(t))return t;if(typeof t=="string")try{return hf.from(ob(t))}catch{(0,mr.assertArgument)(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof bf){Vd(t,ga(["constructor"]));let n=Gd(t),s=!!Vd(t,DAe).has("payable"),i=Zie(t);return Jg(t),new hf(qn,"constructor",n,s,i)}return new hf(qn,"constructor",t.inputs?t.inputs.map(Ya.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[Xa]===Fie}};Os.ConstructorFragment=hf;var Uc=class extends zd{constructor(t,n,s){super(t,"fallback",n);N(this,"payable");Object.defineProperty(this,Xa,{value:qie}),(0,mr.defineProperties)(this,{payable:s})}format(t){let n=this.inputs.length===0?"receive":"fallback";if(t==="json"){let s=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:s})}return`${n}()${this.payable?" payable":""}`}static from(t){if(Uc.isFragment(t))return t;if(typeof t=="string")try{return Uc.from(ob(t))}catch{(0,mr.assertArgument)(!1,"invalid fallback fragment","obj",t)}else if(t instanceof bf){let n=t.toString(),s=t.peekKeyword(ga(["fallback","receive"]));if((0,mr.assertArgument)(s,"type must be fallback or receive","obj",n),t.popKeyword(ga(["fallback","receive"]))==="receive"){let c=Gd(t);return(0,mr.assertArgument)(c.length===0,"receive cannot have arguments","obj.inputs",c),Vd(t,ga(["payable"])),Jg(t),new Uc(qn,[],!0)}let a=Gd(t);a.length?(0,mr.assertArgument)(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(c=>c.format("minimal")).join(", ")):a=[Ya.from("bytes")];let o=Jie(t);if((0,mr.assertArgument)(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),Vd(t,ga(["returns"])).has("returns")){let c=Gd(t);(0,mr.assertArgument)(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return Jg(t),new Uc(qn,a,o==="payable")}if(t.type==="receive")return new Uc(qn,[],!0);if(t.type==="fallback"){let n=[Ya.from("bytes")],s=t.stateMutability==="payable";return new Uc(qn,n,s)}(0,mr.assertArgument)(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[Xa]===qie}};Os.FallbackFragment=Uc;var qc=class extends Zg{constructor(t,n,s,i,a,o){super(t,"function",n,i);N(this,"constant");N(this,"outputs");N(this,"stateMutability");N(this,"payable");N(this,"gas");Object.defineProperty(this,Xa,{value:Die}),a=Object.freeze(a.slice());let c=s==="view"||s==="pure",u=s==="payable";(0,mr.defineProperties)(this,{constant:c,gas:o,outputs:a,payable:u,stateMutability:s})}get selector(){return(0,hU.id)(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="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(s=>JSON.parse(s.format(t))),outputs:this.outputs.map(s=>JSON.parse(s.format(t)))});let n=[];return t!=="sighash"&&n.push("function"),n.push(this.name+G4(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(G4(t,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(t,n){return n=(n||[]).map(i=>Ya.from(i)),new qc(qn,t,"view",n,[],null).selector}static from(t){if(qc.isFragment(t))return t;if(typeof t=="string")try{return qc.from(ob(t))}catch{(0,mr.assertArgument)(!1,"invalid function fragment","obj",t)}else if(t instanceof bf){let s=bT("function",t),i=Gd(t),a=Jie(t),o=[];Vd(t,ga(["returns"])).has("returns")&&(o=Gd(t));let c=Zie(t);return Jg(t),new qc(qn,s,a,i,o,c)}let n=t.stateMutability;return n==null&&(n="payable",typeof t.constant=="boolean"?(n="view",t.constant||(n="payable",typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(n="nonpayable")),new qc(qn,t.name,n,t.inputs?t.inputs.map(Ya.from):[],t.outputs?t.outputs.map(Ya.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[Xa]===Die}};Os.FunctionFragment=qc;var P0=class extends Zg{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,Xa,{value:Hie})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return P0.from(ob(e))}catch{(0,mr.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof bf){let t=bT("struct",e),n=Gd(e);return Jg(e),new P0(qn,t,n)}return new P0(qn,e.name,e.inputs?e.inputs.map(Ya.from):[])}static isFragment(e){return e&&e[Xa]===Hie}};Os.StructFragment=P0});var xU=R(yT=>{"use strict";b();p();Object.defineProperty(yT,"__esModule",{value:!0});yT.AbiCoder=void 0;var z4=Ne(),Qie=kc(),YAe=Wse(),XAe=FL(),eEe=Qse(),tEe=HL(),rEe=Xse(),nEe=eie(),sEe=tie(),iEe=nie(),gT=iie(),bU=pT(),Yie=Ws(),W4=Ne(),pf=new Map;pf.set(0,"GENERIC_PANIC");pf.set(1,"ASSERT_FALSE");pf.set(17,"OVERFLOW");pf.set(18,"DIVIDE_BY_ZERO");pf.set(33,"ENUM_RANGE_ERROR");pf.set(34,"BAD_STORAGE_DATA");pf.set(49,"STACK_UNDERFLOW");pf.set(50,"ARRAY_RANGE_ERROR");pf.set(65,"OUT_OF_MEMORY");pf.set(81,"UNINITIALIZED_FUNCTION_CALL");var aEe=new RegExp(/^bytes([0-9]*)$/),oEe=new RegExp(/^(u?int)([0-9]*)$/),pU=null,Xie=1024;function cEe(r,e,t,n){let s="missing revert data",i=null,a=null,o=null;if(t){s="execution reverted";let u=(0,W4.getBytes)(t);if(t=(0,W4.hexlify)(t),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if((0,W4.hexlify)(u.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],u.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if((0,W4.hexlify)(u.slice(0,4))==="0x4e487b71")try{let f=Number(n.decode(["uint256"],u.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[f]},i=`Panic due to ${pf.get(f)||"UNKNOWN"}(${f})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}let c={to:e.to?(0,Yie.getAddress)(e.to):null,data:e.data||"0x"};return e.from&&(c.from=(0,Yie.getAddress)(e.from)),(0,W4.makeError)(s,"CALL_EXCEPTION",{action:r,data:t,reason:i,transaction:c,invocation:a,revert:o})}var cb,V3,xT=class{constructor(){I(this,cb)}getDefaultValue(e){let t=e.map(s=>$(this,cb,V3).call(this,bU.ParamType.from(s)));return new gT.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,z4.assertArgumentCount)(t.length,e.length,"types/values length mismatch");let n=e.map(a=>$(this,cb,V3).call(this,bU.ParamType.from(a))),s=new gT.TupleCoder(n,"_"),i=new Qie.Writer;return s.encode(i,t),i.data}decode(e,t,n){let s=e.map(a=>$(this,cb,V3).call(this,bU.ParamType.from(a)));return new gT.TupleCoder(s,"_").decode(new Qie.Reader(t,n,Xie))}static _setDefaultMaxInflation(e){(0,z4.assertArgument)(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),Xie=e}static defaultAbiCoder(){return pU==null&&(pU=new xT),pU}static getBuiltinCallException(e,t,n){return cEe(e,t,n,xT.defaultAbiCoder())}},gU=xT;cb=new WeakSet,V3=function(e){if(e.isArray())return new XAe.ArrayCoder($(this,cb,V3).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new gT.TupleCoder(e.components.map(n=>$(this,cb,V3).call(this,n)),e.name);switch(e.baseType){case"address":return new YAe.AddressCoder(e.name);case"bool":return new eEe.BooleanCoder(e.name);case"string":return new iEe.StringCoder(e.name);case"bytes":return new tEe.BytesCoder(e.name);case"":return new nEe.NullCoder(e.name)}let t=e.type.match(oEe);if(t){let n=parseInt(t[2]||"256");return(0,z4.assertArgument)(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new sEe.NumberCoder(n/8,t[1]==="int",e.name)}if(t=e.type.match(aEe),t){let n=parseInt(t[1]);return(0,z4.assertArgument)(n!==0&&n<=32,"invalid bytes length","param",e),new rEe.FixedBytesCoder(n,e.name)}(0,z4.assertArgument)(!1,"invalid type","type",e.type)};yT.AbiCoder=gU});var eae=R(z3=>{"use strict";b();p();Object.defineProperty(z3,"__esModule",{value:!0});z3.decodeBytes32String=z3.encodeBytes32String=void 0;var mT=Ne();function uEe(r){let e=(0,mT.toUtf8Bytes)(r);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,mT.zeroPadBytes)(e,32)}z3.encodeBytes32String=uEe;function fEe(r){let e=(0,mT.getBytes)(r,"bytes");if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let t=31;for(;e[t-1]===0;)t--;return(0,mT.toUtf8String)(e.slice(0,t))}z3.decodeBytes32String=fEe});var aae=R(Wi=>{"use strict";b();p();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.Interface=Wi.Indexed=Wi.ErrorDescription=Wi.TransactionDescription=Wi.LogDescription=Wi.Result=Wi.checkResultErrors=void 0;var tae=di(),rae=v0(),Ve=Ne(),nae=xU(),wU=kc();Object.defineProperty(Wi,"checkResultErrors",{enumerable:!0,get:function(){return wU.checkResultErrors}});Object.defineProperty(Wi,"Result",{enumerable:!0,get:function(){return wU.Result}});var gf=pT(),yU=x0(),PT=class{constructor(e,t,n){N(this,"fragment");N(this,"name");N(this,"signature");N(this,"topic");N(this,"args");let s=e.name,i=e.format();(0,Ve.defineProperties)(this,{fragment:e,name:s,signature:i,topic:t,args:n})}};Wi.LogDescription=PT;var _T=class{constructor(e,t,n,s){N(this,"fragment");N(this,"name");N(this,"args");N(this,"signature");N(this,"selector");N(this,"value");let i=e.name,a=e.format();(0,Ve.defineProperties)(this,{fragment:e,name:i,args:n,signature:a,selector:t,value:s})}};Wi.TransactionDescription=_T;var AT=class{constructor(e,t,n){N(this,"fragment");N(this,"name");N(this,"args");N(this,"signature");N(this,"selector");let s=e.name,i=e.format();(0,Ve.defineProperties)(this,{fragment:e,name:s,args:n,signature:i,selector:t})}};Wi.ErrorDescription=AT;var $4=class{constructor(e){N(this,"hash");N(this,"_isIndexed");(0,Ve.defineProperties)(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};Wi.Indexed=$4;var sae={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"},iae={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&sae[r.toString()]&&(e=sae[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}},_0,A0,E0,zi,W3,wT,$3,vT,Qg=class{constructor(e){I(this,W3);I(this,$3);N(this,"fragments");N(this,"deploy");N(this,"fallback");N(this,"receive");I(this,_0,void 0);I(this,A0,void 0);I(this,E0,void 0);I(this,zi,void 0);let t=[];typeof e=="string"?t=JSON.parse(e):t=e,_(this,E0,new Map),_(this,_0,new Map),_(this,A0,new Map);let n=[];for(let a of t)try{n.push(gf.Fragment.from(a))}catch(o){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,o.message)}(0,Ve.defineProperties)(this,{fragments:Object.freeze(n)});let s=null,i=!1;_(this,zi,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let c;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}(0,Ve.defineProperties)(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:((0,Ve.assertArgument)(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${o}]`,a),s=a,i=s.payable);return;case"function":c=l(this,E0);break;case"event":c=l(this,A0);break;case"error":c=l(this,_0);break;default:return}let u=a.format();c.has(u)||c.set(u,a)}),this.deploy||(0,Ve.defineProperties)(this,{deploy:gf.ConstructorFragment.from("constructor()")}),(0,Ve.defineProperties)(this,{fallback:s,receive:i})}format(e){let t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){let e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return nae.AbiCoder.defaultAbiCoder()}getFunctionName(e){let t=$(this,W3,wT).call(this,e,null,!1);return(0,Ve.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!$(this,W3,wT).call(this,e,null,!1)}getFunction(e,t){return $(this,W3,wT).call(this,e,t||null,!0)}forEachFunction(e){let t=Array.from(l(this,E0).keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(l(this,E0).get(s),n)}}getEventName(e){let t=$(this,$3,vT).call(this,e,null,!1);return(0,Ve.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!$(this,$3,vT).call(this,e,null,!1)}getEvent(e,t){return $(this,$3,vT).call(this,e,t||null,!0)}forEachEvent(e){let t=Array.from(l(this,A0).keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(l(this,A0).get(s),n)}}getError(e,t){if((0,Ve.isHexString)(e)){let s=e.toLowerCase();if(iae[s])return gf.ErrorFragment.from(iae[s].signature);for(let i of l(this,_0).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){let s=[];for(let[i,a]of l(this,_0))i.split("(")[0]===e&&s.push(a);if(s.length===0)return e==="Error"?gf.ErrorFragment.from("error Error(string)"):e==="Panic"?gf.ErrorFragment.from("error Panic(uint256)"):null;if(s.length>1){let i=s.map(a=>JSON.stringify(a.format())).join(", ");(0,Ve.assertArgument)(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=gf.ErrorFragment.from(e).format(),e==="Error(string)")return gf.ErrorFragment.from("error Error(string)");if(e==="Panic(uint256)")return gf.ErrorFragment.from("error Panic(uint256)");let n=l(this,_0).get(e);return n||null}forEachError(e){let t=Array.from(l(this,_0).keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(l(this,_0).get(s),n)}}_decodeParams(e,t){return l(this,zi).decode(e,t)}_encodeParams(e,t){return l(this,zi).encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,Ve.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,Ve.assertArgument)((0,Ve.dataSlice)(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,Ve.dataSlice)(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,Ve.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,Ve.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Ve.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Ve.assertArgument)((0,Ve.dataSlice)(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,Ve.dataSlice)(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Ve.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Ve.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){let i=this.getFunction(e);(0,Ve.assertArgument)(i,"unknown function","fragment",e),e=i}let n="invalid length for result data",s=(0,Ve.getBytesCopy)(t);if(s.length%32===0)try{return l(this,zi).decode(e.outputs,s)}catch{n="could not decode result data"}(0,Ve.assert)(!1,n,"BAD_DATA",{value:(0,Ve.hexlify)(s),info:{method:e.name,signature:e.format()}})}makeError(e,t){let n=(0,Ve.getBytes)(e,"data"),s=nae.AbiCoder.getBuiltinCallException("call",t,n),i="execution reverted (unknown custom error)";if(s.message.startsWith(i)){let o=(0,Ve.hexlify)(n.slice(0,4)),c=this.getError(o);if(c)try{let u=l(this,zi).decode(c.inputs,n.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}let a=this.parseTransaction(t);return a&&(s.invocation={method:a.name,signature:a.signature,args:a.args}),s}encodeFunctionResult(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Ve.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Ve.hexlify)(l(this,zi).encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){let i=this.getEvent(e);(0,Ve.assertArgument)(i,"unknown event","eventFragment",e),e=i}(0,Ve.assert)(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});let n=[];e.anonymous||n.push(e.topicHash);let s=(i,a)=>i.type==="string"?(0,rae.id)(a):i.type==="bytes"?(0,tae.keccak256)((0,Ve.hexlify)(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=(0,Ve.toBeHex)(a):i.type.match(/^bytes/)?a=(0,Ve.zeroPadBytes)(a,32):i.type==="address"&&l(this,zi).encode(["address"],[a]),(0,Ve.zeroPadValue)((0,Ve.hexlify)(a),32));for(t.forEach((i,a)=>{let o=e.inputs[a];if(!o.indexed){(0,Ve.assertArgument)(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?(0,Ve.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?n.push(i.map(c=>s(o,c))):n.push(s(o,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){let a=this.getEvent(e);(0,Ve.assertArgument)(a,"unknown event","eventFragment",e),e=a}let n=[],s=[],i=[];return e.anonymous||n.push(e.topicHash),(0,Ve.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{let c=t[o];if(a.indexed)if(a.type==="string")n.push((0,rae.id)(c));else if(a.type==="bytes")n.push((0,tae.keccak256)(c));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(l(this,zi).encode([a.type],[c]))}else s.push(a),i.push(c)}),{data:l(this,zi).encode(s,i),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){let h=this.getEvent(e);(0,Ve.assertArgument)(h,"unknown event","eventFragment",e),e=h}if(n!=null&&!e.anonymous){let h=e.topicHash;(0,Ve.assertArgument)((0,Ve.isHexString)(n[0],32)&&n[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}let s=[],i=[],a=[];e.inputs.forEach((h,m)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(gf.ParamType.from({type:"bytes32",name:h.name})),a.push(!0)):(s.push(h),a.push(!1)):(i.push(h),a.push(!1))});let o=n!=null?l(this,zi).decode(s,(0,Ve.concat)(n)):null,c=l(this,zi).decode(i,t,!0),u=[],f=[],d=0,g=0;return e.inputs.forEach((h,m)=>{let y=null;if(h.indexed)if(o==null)y=new $4(null);else if(a[m])y=new $4(o[g++]);else try{y=o[g++]}catch(S){y=S}else try{y=c[d++]}catch(S){y=S}u.push(y),f.push(h.name||null)}),wU.Result.fromItems(u,f)}parseTransaction(e){let t=(0,Ve.getBytes)(e.data,"tx.data"),n=(0,Ve.getBigInt)(e.value!=null?e.value:0,"tx.value"),s=this.getFunction((0,Ve.hexlify)(t.slice(0,4)));if(!s)return null;let i=l(this,zi).decode(s.inputs,t.slice(4));return new _T(s,s.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new PT(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){let t=(0,Ve.hexlify)(e),n=this.getError((0,Ve.dataSlice)(t,0,4));if(!n)return null;let s=l(this,zi).decode(n.inputs,(0,Ve.dataSlice)(t,4));return new AT(n,n.selector,s)}static from(e){return e instanceof Qg?e:typeof e=="string"?new Qg(JSON.parse(e)):typeof e.formatJson=="function"?new Qg(e.formatJson()):typeof e.format=="function"?new Qg(e.format("json")):new Qg(e)}},mU=Qg;_0=new WeakMap,A0=new WeakMap,E0=new WeakMap,zi=new WeakMap,W3=new WeakSet,wT=function(e,t,n){if((0,Ve.isHexString)(e)){let i=e.toLowerCase();for(let a of l(this,E0).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){let i=[];for(let[a,o]of l(this,E0))a.split("(")[0]===e&&i.push(o);if(t){let a=t.length>0?t[t.length-1]:null,o=t.length,c=!0;yU.Typed.isTyped(a)&&a.type==="overrides"&&(c=!1,o--);for(let u=i.length-1;u>=0;u--){let f=i[u].inputs.length;f!==o&&(!c||f!==o-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){let f=i[u].inputs;for(let d=0;d<t.length;d++)if(!!yU.Typed.isTyped(t[d])){if(d>=f.length){if(t[d].type==="overrides")continue;i.splice(u,1);break}if(t[d].type!==f[d].baseType){i.splice(u,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){let a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){let a=i.map(o=>JSON.stringify(o.format())).join(", ");(0,Ve.assertArgument)(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return i[0]}let s=l(this,E0).get(gf.FunctionFragment.from(e).format());return s||null},$3=new WeakSet,vT=function(e,t,n){if((0,Ve.isHexString)(e)){let i=e.toLowerCase();for(let a of l(this,A0).values())if(i===a.topicHash)return a;return null}if(e.indexOf("(")===-1){let i=[];for(let[a,o]of l(this,A0))a.split("(")[0]===e&&i.push(o);if(t){for(let a=i.length-1;a>=0;a--)i[a].inputs.length<t.length&&i.splice(a,1);for(let a=i.length-1;a>=0;a--){let o=i[a].inputs;for(let c=0;c<t.length;c++)if(!!yU.Typed.isTyped(t[c])&&t[c].type!==o[c].baseType){i.splice(a,1);break}}}if(i.length===0)return null;if(i.length>1&&n){let a=i.map(o=>JSON.stringify(o.format())).join(", ");(0,Ve.assertArgument)(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return i[0]}let s=l(this,A0).get(gf.EventFragment.from(e).format());return s||null};Wi.Interface=mU});var J3=R(kt=>{"use strict";b();p();Object.defineProperty(kt,"__esModule",{value:!0});kt.Typed=kt.Result=kt.TransactionDescription=kt.LogDescription=kt.ErrorDescription=kt.Interface=kt.Indexed=kt.checkResultErrors=kt.StructFragment=kt.ParamType=kt.NamedFragment=kt.FunctionFragment=kt.Fragment=kt.FallbackFragment=kt.EventFragment=kt.ErrorFragment=kt.ConstructorFragment=kt.encodeBytes32String=kt.decodeBytes32String=kt.AbiCoder=void 0;var dEe=xU();Object.defineProperty(kt,"AbiCoder",{enumerable:!0,get:function(){return dEe.AbiCoder}});var oae=eae();Object.defineProperty(kt,"decodeBytes32String",{enumerable:!0,get:function(){return oae.decodeBytes32String}});Object.defineProperty(kt,"encodeBytes32String",{enumerable:!0,get:function(){return oae.encodeBytes32String}});var Wd=pT();Object.defineProperty(kt,"ConstructorFragment",{enumerable:!0,get:function(){return Wd.ConstructorFragment}});Object.defineProperty(kt,"ErrorFragment",{enumerable:!0,get:function(){return Wd.ErrorFragment}});Object.defineProperty(kt,"EventFragment",{enumerable:!0,get:function(){return Wd.EventFragment}});Object.defineProperty(kt,"FallbackFragment",{enumerable:!0,get:function(){return Wd.FallbackFragment}});Object.defineProperty(kt,"Fragment",{enumerable:!0,get:function(){return Wd.Fragment}});Object.defineProperty(kt,"FunctionFragment",{enumerable:!0,get:function(){return Wd.FunctionFragment}});Object.defineProperty(kt,"NamedFragment",{enumerable:!0,get:function(){return Wd.NamedFragment}});Object.defineProperty(kt,"ParamType",{enumerable:!0,get:function(){return Wd.ParamType}});Object.defineProperty(kt,"StructFragment",{enumerable:!0,get:function(){return Wd.StructFragment}});var Yg=aae();Object.defineProperty(kt,"checkResultErrors",{enumerable:!0,get:function(){return Yg.checkResultErrors}});Object.defineProperty(kt,"Indexed",{enumerable:!0,get:function(){return Yg.Indexed}});Object.defineProperty(kt,"Interface",{enumerable:!0,get:function(){return Yg.Interface}});Object.defineProperty(kt,"ErrorDescription",{enumerable:!0,get:function(){return Yg.ErrorDescription}});Object.defineProperty(kt,"LogDescription",{enumerable:!0,get:function(){return Yg.LogDescription}});Object.defineProperty(kt,"TransactionDescription",{enumerable:!0,get:function(){return Yg.TransactionDescription}});Object.defineProperty(kt,"Result",{enumerable:!0,get:function(){return Yg.Result}});var lEe=x0();Object.defineProperty(kt,"Typed",{enumerable:!0,get:function(){return lEe.Typed}})});var Q3=R(eo=>{"use strict";b();p();Object.defineProperty(eo,"__esModule",{value:!0});eo.TransactionResponse=eo.TransactionReceipt=eo.Log=eo.Block=eo.copyRequest=eo.FeeData=void 0;var yn=Ne(),hEe=Qa(),cae=BigInt(0);function Z3(r){return r??null}function ds(r){return r==null?null:r.toString()}var vU=class{constructor(e,t,n){N(this,"gasPrice");N(this,"maxFeePerGas");N(this,"maxPriorityFeePerGas");(0,yn.defineProperties)(this,{gasPrice:Z3(e),maxFeePerGas:Z3(t),maxPriorityFeePerGas:Z3(n)})}toJSON(){let{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:ds(e),maxFeePerGas:ds(t),maxPriorityFeePerGas:ds(n)}}};eo.FeeData=vU;function bEe(r){let e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=(0,yn.hexlify)(r.data));let t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let s of t)!(s in r)||r[s]==null||(e[s]=(0,yn.getBigInt)(r[s],`request.${s}`));let n="type,nonce".split(/,/);for(let s of n)!(s in r)||r[s]==null||(e[s]=(0,yn.getNumber)(r[s],`request.${s}`));return r.accessList&&(e.accessList=(0,hEe.accessListify)(r.accessList)),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(s=>(0,yn.isBytesLike)(s)?(0,yn.hexlify)(s):Object.assign({},s))),e}eo.copyRequest=bEe;var $d,PU=class{constructor(e,t){N(this,"provider");N(this,"number");N(this,"hash");N(this,"timestamp");N(this,"parentHash");N(this,"parentBeaconBlockRoot");N(this,"nonce");N(this,"difficulty");N(this,"gasLimit");N(this,"gasUsed");N(this,"stateRoot");N(this,"receiptsRoot");N(this,"blobGasUsed");N(this,"excessBlobGas");N(this,"miner");N(this,"prevRandao");N(this,"extraData");N(this,"baseFeePerGas");I(this,$d,void 0);_(this,$d,e.transactions.map(n=>typeof n!="string"?new ST(n,t):n)),(0,yn.defineProperties)(this,{provider:t,hash:Z3(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Z3(e.prevRandao),extraData:e.extraData,baseFeePerGas:Z3(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return l(this,$d).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){let e=l(this,$d).slice();return e.length===0?[]:((0,yn.assert)(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){let{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:s,gasUsed:i,hash:a,miner:o,prevRandao:c,nonce:u,number:f,parentHash:d,parentBeaconBlockRoot:g,stateRoot:h,receiptsRoot:m,timestamp:y,transactions:S}=this;return{_type:"Block",baseFeePerGas:ds(e),difficulty:ds(t),extraData:n,gasLimit:ds(s),gasUsed:ds(i),blobGasUsed:ds(this.blobGasUsed),excessBlobGas:ds(this.excessBlobGas),hash:a,miner:o,prevRandao:c,nonce:u,number:f,parentHash:d,timestamp:y,parentBeaconBlockRoot:g,stateRoot:h,receiptsRoot:m,transactions:S}}[Symbol.iterator](){let e=0,t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return l(this,$d).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=l(this,$d)[e];else{let n=e.toLowerCase();for(let s of l(this,$d))if(typeof s=="string"){if(s!==n)continue;t=s;break}else{if(s.hash!==n)continue;t=s;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){let t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(let n of t)if(n.hash===e)return n;(0,yn.assertArgument)(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return pEe(this)}};$d=new WeakMap;eo.Block=PU;var ET=class{constructor(e,t){N(this,"provider");N(this,"transactionHash");N(this,"blockHash");N(this,"blockNumber");N(this,"removed");N(this,"address");N(this,"data");N(this,"topics");N(this,"index");N(this,"transactionIndex");this.provider=t;let n=Object.freeze(e.topics.slice());(0,yn.defineProperties)(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(){let{address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:u}}async getBlock(){let e=await this.provider.getBlock(this.blockHash);return(0,yn.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){let e=await this.provider.getTransaction(this.transactionHash);return(0,yn.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){let e=await this.provider.getTransactionReceipt(this.transactionHash);return(0,yn.assert)(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return gEe(this)}};eo.Log=ET;var J4,_U=class{constructor(e,t){N(this,"provider");N(this,"to");N(this,"from");N(this,"contractAddress");N(this,"hash");N(this,"index");N(this,"blockHash");N(this,"blockNumber");N(this,"logsBloom");N(this,"gasUsed");N(this,"blobGasUsed");N(this,"cumulativeGasUsed");N(this,"gasPrice");N(this,"blobGasPrice");N(this,"type");N(this,"status");N(this,"root");I(this,J4,void 0);_(this,J4,Object.freeze(e.logs.map(s=>new ET(s,t))));let n=cae;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),(0,yn.defineProperties)(this,{provider:t,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,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return l(this,J4)}toJSON(){let{to:e,from:t,contractAddress:n,hash:s,index:i,blockHash:a,blockNumber:o,logsBloom:c,logs:u,status:f,root:d}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:ds(this.cumulativeGasUsed),from:t,gasPrice:ds(this.gasPrice),blobGasUsed:ds(this.blobGasUsed),blobGasPrice:ds(this.blobGasPrice),gasUsed:ds(this.gasUsed),hash:s,index:i,logs:u,logsBloom:c,root:d,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(){let e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){let 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 fae(this)}reorderedEvent(e){return(0,yn.assert)(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),uae(this,e)}};J4=new WeakMap;eo.TransactionReceipt=_U;var ub,AU=class{constructor(e,t){N(this,"provider");N(this,"blockNumber");N(this,"blockHash");N(this,"index");N(this,"hash");N(this,"type");N(this,"to");N(this,"from");N(this,"nonce");N(this,"gasLimit");N(this,"gasPrice");N(this,"maxPriorityFeePerGas");N(this,"maxFeePerGas");N(this,"maxFeePerBlobGas");N(this,"data");N(this,"value");N(this,"chainId");N(this,"signature");N(this,"accessList");N(this,"blobVersionedHashes");I(this,ub,void 0);this.provider=t,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.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,_(this,ub,-1)}toJSON(){let{blockNumber:e,blockHash:t,index:n,hash:s,type:i,to:a,from:o,nonce:c,data:u,signature:f,accessList:d,blobVersionedHashes:g}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:e,blockHash:t,blobVersionedHashes:g,chainId:ds(this.chainId),data:u,from:o,gasLimit:ds(this.gasLimit),gasPrice:ds(this.gasPrice),hash:s,maxFeePerGas:ds(this.maxFeePerGas),maxPriorityFeePerGas:ds(this.maxPriorityFeePerGas),maxFeePerBlobGas:ds(this.maxFeePerBlobGas),nonce:c,signature:f,to:a,index:n,type:i,value:ds(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){let n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;let t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:t,blockNumber:n}=await(0,yn.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){let n=e??1,s=t??0,i=l(this,ub),a=-1,o=i===-1,c=async()=>{if(o)return null;let{blockNumber:g,nonce:h}=await(0,yn.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=g;return}if(o)return null;let m=await this.getTransaction();if(!(m&&m.blockNumber!=null))for(a===-1&&(a=i-3,a<l(this,ub)&&(a=l(this,ub)));a<=g;){if(o)return null;let y=await this.provider.getBlock(a,!0);if(y==null)return;for(let S of y)if(S===this.hash)return;for(let S=0;S<y.length;S++){let T=await y.getTransaction(S);if(T.from===this.from&&T.nonce===this.nonce){if(o)return null;let H=await this.provider.getTransactionReceipt(T.hash);if(H==null||g-H.blockNumber+1<n)return;let C="replaced";T.data===this.data&&T.to===this.to&&T.value===this.value?C="repriced":T.data==="0x"&&T.from===T.to&&T.value===cae&&(C="cancelled"),(0,yn.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:C==="replaced"||C==="cancelled",reason:C,replacement:T.replaceableTransaction(i),hash:T.hash,receipt:H})}}a++}},u=g=>{if(g==null||g.status!==0)return g;(0,yn.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:g.to,from:g.from,data:""},receipt:g})},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((g,h)=>{let m=[],y=()=>{m.forEach(T=>T())};if(m.push(()=>{o=!0}),s>0){let T=setTimeout(()=>{y(),h((0,yn.makeError)("wait for transaction timeout","TIMEOUT"))},s);m.push(()=>{clearTimeout(T)})}let S=async T=>{if(await T.confirmations()>=n){y();try{g(u(T))}catch(H){h(H)}}};if(m.push(()=>{this.provider.off(this.hash,S)}),this.provider.on(this.hash,S),i>=0){let T=async()=>{try{await c()}catch(H){if((0,yn.isError)(H,"TRANSACTION_REPLACED")){y(),h(H);return}}o||this.provider.once("block",T)};m.push(()=>{this.provider.off("block",T)}),this.provider.once("block",T)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return(0,yn.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),fae(this)}reorderedEvent(e){return(0,yn.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,yn.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),uae(this,e)}replaceableTransaction(e){(0,yn.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);let t=new AU(this,this.provider);return _(t,ub,e),t}},ST=AU;ub=new WeakMap;eo.TransactionResponse=ST;function pEe(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function uae(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function fae(r){return{orphan:"drop-transaction",tx:r}}function gEe(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}});var TU=R(to=>{"use strict";b();p();Object.defineProperty(to,"__esModule",{value:!0});to.ContractEventPayload=to.ContractUnknownEventPayload=to.ContractTransactionResponse=to.ContractTransactionReceipt=to.UndecodedEventLog=to.EventLog=void 0;var kT=Q3(),Z4=Ne(),Q4=class extends kT.Log{constructor(t,n,s){super(t,t.provider);N(this,"interface");N(this,"fragment");N(this,"args");let i=n.decodeEventLog(s,t.data,t.topics);(0,Z4.defineProperties)(this,{args:i,fragment:s,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};to.EventLog=Q4;var TT=class extends kT.Log{constructor(t,n){super(t,t.provider);N(this,"error");(0,Z4.defineProperties)(this,{error:n})}};to.UndecodedEventLog=TT;var Y3,OT=class extends kT.TransactionReceipt{constructor(t,n,s){super(s,n);I(this,Y3,void 0);_(this,Y3,t)}get logs(){return super.logs.map(t=>{let n=t.topics.length?l(this,Y3).getEvent(t.topics[0]):null;if(n)try{return new Q4(t,l(this,Y3),n)}catch(s){return new TT(t,s)}return t})}};Y3=new WeakMap;to.ContractTransactionReceipt=OT;var Y4,EU=class extends kT.TransactionResponse{constructor(t,n,s){super(s,n);I(this,Y4,void 0);_(this,Y4,t)}async wait(t,n){let s=await super.wait(t,n);return s==null?null:new OT(l(this,Y4),this.provider,s)}};Y4=new WeakMap;to.ContractTransactionResponse=EU;var BT=class extends Z4.EventPayload{constructor(t,n,s,i){super(t,n,s);N(this,"log");(0,Z4.defineProperties)(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}};to.ContractUnknownEventPayload=BT;var SU=class extends BT{constructor(e,t,n,s,i){super(e,t,n,new Q4(i,e.interface,s));let a=e.interface.decodeEventLog(s,this.log.data,this.log.topics);(0,Z4.defineProperties)(this,{args:a,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};to.ContractEventPayload=SU});var MU=R(S0=>{"use strict";b();p();Object.defineProperty(S0,"__esModule",{value:!0});S0.Contract=S0.BaseContract=S0.resolveArgs=S0.copyOverrides=void 0;var IU=J3(),X3=Ws(),hae=Q3(),Pt=Ne(),ex=TU(),dae=BigInt(0);function bae(r){return r&&typeof r.call=="function"}function pae(r){return r&&typeof r.estimateGas=="function"}function jT(r){return r&&typeof r.resolveName=="function"}function gae(r){return r&&typeof r.sendTransaction=="function"}function xae(r){if(r!=null){if(jT(r))return r;if(r.provider)return r.provider}}var tv,OU=class{constructor(e,t,n){I(this,tv,void 0);N(this,"fragment");if((0,Pt.defineProperties)(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");let s=tx(e.runner,"resolveName"),i=jT(s)?s:null;_(this,tv,async function(){let a=await Promise.all(t.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(f,d)=>f==="address"?Array.isArray(d)?Promise.all(d.map(g=>(0,X3.resolveAddress)(g,i))):(0,X3.resolveAddress)(d,i):d)));return e.interface.encodeFilterTopics(t,a)}())}getTopicFilter(){return l(this,tv)}};tv=new WeakMap;function tx(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function Xg(r){return r==null?null:r.provider||null}async function RU(r,e){let t=IU.Typed.dereference(r,"overrides");(0,Pt.assertArgument)(typeof t=="object","invalid overrides parameter","overrides",r);let n=(0,hae.copyRequest)(t);return(0,Pt.assertArgument)(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),(0,Pt.assertArgument)(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}S0.copyOverrides=RU;async function yae(r,e,t){let n=tx(r,"resolveName"),s=jT(n)?n:null;return await Promise.all(e.map((i,a)=>i.walkAsync(t[a],(o,c)=>(c=IU.Typed.dereference(c,o),o==="address"?(0,X3.resolveAddress)(c,s):c))))}S0.resolveArgs=yae;function xEe(r){let e=async function(a){let o=await RU(a,["data"]);o.to=await r.getAddress(),o.from&&(o.from=await(0,X3.resolveAddress)(o.from,xae(r.runner)));let c=r.interface,u=(0,Pt.getBigInt)(o.value||dae,"overrides.value")===dae,f=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!u&&(0,Pt.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),(0,Pt.assertArgument)(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data);let d=c.receive||c.fallback&&c.fallback.payable;return(0,Pt.assertArgument)(d||u,"cannot send value to non-payable fallback","overrides.value",o.value),(0,Pt.assertArgument)(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){let o=tx(r.runner,"call");(0,Pt.assert)(bae(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await e(a);try{return await o.call(c)}catch(u){throw(0,Pt.isCallException)(u)&&u.data?r.interface.makeError(u.data,c):u}},n=async function(a){let o=r.runner;(0,Pt.assert)(gae(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await o.sendTransaction(await e(a)),u=Xg(r.runner);return new ex.ContractTransactionResponse(r.interface,u,c)},s=async function(a){let o=tx(r.runner,"estimateGas");return(0,Pt.assert)(pae(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},i=async a=>await n(a);return(0,Pt.defineProperties)(i,{_contract:r,estimateGas:s,populateTransaction:e,send:n,staticCall:t}),i}function yEe(r,e){let t=function(...u){let f=r.interface.getFunction(e,u);return(0,Pt.assert)(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){let f=t(...u),d={};if(f.inputs.length+1===u.length&&(d=await RU(u.pop()),d.from&&(d.from=await(0,X3.resolveAddress)(d.from,xae(r.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let g=await yae(r.runner,f.inputs,u);return Object.assign({},d,await(0,Pt.resolveProperties)({to:r.getAddress(),data:r.interface.encodeFunctionData(f,g)}))},s=async function(...u){let f=await o(...u);return f.length===1?f[0]:f},i=async function(...u){let f=r.runner;(0,Pt.assert)(gae(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let d=await f.sendTransaction(await n(...u)),g=Xg(r.runner);return new ex.ContractTransactionResponse(r.interface,g,d)},a=async function(...u){let f=tx(r.runner,"estimateGas");return(0,Pt.assert)(pae(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},o=async function(...u){let f=tx(r.runner,"call");(0,Pt.assert)(bae(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let d=await n(...u),g="0x";try{g=await f.call(d)}catch(m){throw(0,Pt.isCallException)(m)&&m.data?r.interface.makeError(m.data,d):m}let h=t(...u);return r.interface.decodeFunctionResult(h,g)},c=async(...u)=>t(...u).constant?await s(...u):await i(...u);return(0,Pt.defineProperties)(c,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:a,populateTransaction:n,send:i,staticCall:s,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let u=r.interface.getFunction(e);return(0,Pt.assert)(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function mEe(r,e){let t=function(...s){let i=r.interface.getEvent(e,s);return(0,Pt.assert)(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},n=function(...s){return new OU(r,t(...s),s)};return(0,Pt.defineProperties)(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{let s=r.interface.getEvent(e);return(0,Pt.assert)(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),n}var IT=Symbol.for("_ethersInternal_contract"),mae=new WeakMap;function wEe(r,e){mae.set(r[IT],e)}function Oo(r){return mae.get(r[IT])}function vEe(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function jU(r,e){let t,n=null;if(Array.isArray(e)){let i=function(a){if((0,Pt.isHexString)(a,32))return a;let o=r.interface.getEvent(a);return(0,Pt.assertArgument)(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else e==="*"?t=[null]:typeof e=="string"?(0,Pt.isHexString)(e,32)?t=[e]:(n=r.interface.getEvent(e),(0,Pt.assertArgument)(n,"unknown fragment","event",e),t=[n.topicHash]):vEe(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):(0,Pt.assertArgument)(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){let a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});let s=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:s,topics:t}}async function X4(r,e){let{subs:t}=Oo(r);return t.get((await jU(r,e)).tag)||null}async function lae(r,e,t){let n=Xg(r.runner);(0,Pt.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});let{fragment:s,tag:i,topics:a}=await jU(r,t),{addr:o,subs:c}=Oo(r),u=c.get(i);if(!u){let d={address:o||r,topics:a},g=S=>{let T=s;if(T==null)try{T=r.interface.getEvent(S.topics[0])}catch{}if(T){let H=T,C=s?r.interface.decodeEventLog(s,S.data,S.topics):[];kU(r,t,C,J=>new ex.ContractEventPayload(r,J,t,H,S))}else kU(r,t,[],H=>new ex.ContractUnknownEventPayload(r,H,t,S))},h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(n.on(d,g))},stop:async()=>{if(h.length==0)return;let S=h;h=[],await Promise.all(S),n.off(d,g)}},c.set(i,u)}return u}var BU=Promise.resolve();async function PEe(r,e,t,n){await BU;let s=await X4(r,e);if(!s)return!1;let i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:a,once:o})=>{let c=Array.from(t);n&&c.push(n(o?null:a));try{a.call(r,...c)}catch{}return!o}),s.listeners.length===0&&(s.stop(),Oo(r).subs.delete(s.tag)),i>0}async function kU(r,e,t,n){try{await BU}catch{}let s=PEe(r,e,t,n);return BU=s,await s}var NT=["then"],AEe,ev=class{constructor(e,t,n,s){N(this,"target");N(this,"interface");N(this,"runner");N(this,"filters");N(this,AEe);N(this,"fallback");(0,Pt.assertArgument)(typeof e=="string"||(0,X3.isAddressable)(e),"invalid value for Contract target","target",e),n==null&&(n=null);let i=IU.Interface.from(t);(0,Pt.defineProperties)(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,IT,{value:{}});let a,o=null,c=null;if(s){let d=Xg(n);c=new ex.ContractTransactionResponse(this.interface,d,s)}let u=new Map;if(typeof e=="string")if((0,Pt.isHexString)(e))o=e,a=Promise.resolve(e);else{let d=tx(n,"resolveName");if(!jT(d))throw(0,Pt.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=d.resolveName(e).then(g=>{if(g==null)throw(0,Pt.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Oo(this).addr=g,g})}else a=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return Oo(this).addr=d,d});wEe(this,{addrPromise:a,addr:o,deployTx:c,subs:u});let f=new Proxy({},{get:(d,g,h)=>{if(typeof g=="symbol"||NT.indexOf(g)>=0)return Reflect.get(d,g,h);try{return this.getEvent(g)}catch(m){if(!(0,Pt.isError)(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(d,g)=>NT.indexOf(g)>=0?Reflect.has(d,g):Reflect.has(d,g)||this.interface.hasEvent(String(g))});return(0,Pt.defineProperties)(this,{filters:f}),(0,Pt.defineProperties)(this,{fallback:i.receive||i.fallback?xEe(this):null}),new Proxy(this,{get:(d,g,h)=>{if(typeof g=="symbol"||g in d||NT.indexOf(g)>=0)return Reflect.get(d,g,h);try{return d.getFunction(g)}catch(m){if(!(0,Pt.isError)(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(d,g)=>typeof g=="symbol"||g in d||NT.indexOf(g)>=0?Reflect.has(d,g):d.interface.hasFunction(g)})}connect(e){return new ev(this.target,this.interface,e)}attach(e){return new ev(e,this.interface,this.runner)}async getAddress(){return await Oo(this).addrPromise}async getDeployedCode(){let e=Xg(this.runner);(0,Pt.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){let e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;let n=Xg(this.runner);return(0,Pt.assert)(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{let a=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);n.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return Oo(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),yEe(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),mEe(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");let{addr:s,addrPromise:i}=Oo(this),a=s||await i,{fragment:o,topics:c}=await jU(this,e),u={address:a,topics:c,fromBlock:t,toBlock:n},f=Xg(this.runner);return(0,Pt.assert)(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(d=>{let g=o;if(g==null)try{g=this.interface.getEvent(d.topics[0])}catch{}if(g)try{return new ex.EventLog(d,this.interface,g)}catch(h){return new ex.UndecodedEventLog(d,h)}return new hae.Log(d,f)})}async on(e,t){let n=await lae(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){let n=await lae(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await kU(this,e,t,null)}async listenerCount(e){if(e){let s=await X4(this,e);return s?s.listeners.length:0}let{subs:t}=Oo(this),n=0;for(let{listeners:s}of t.values())n+=s.length;return n}async listeners(e){if(e){let s=await X4(this,e);return s?s.listeners.map(({listener:i})=>i):[]}let{subs:t}=Oo(this),n=[];for(let{listeners:s}of t.values())n=n.concat(s.map(({listener:i})=>i));return n}async off(e,t){let n=await X4(this,e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(t==null||n.listeners.length===0)&&(n.stop(),Oo(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){let t=await X4(this,e);if(!t)return this;t.stop(),Oo(this).subs.delete(t.tag)}else{let{subs:t}=Oo(this);for(let{tag:n,stop:s}of t.values())s(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends ev{constructor(s,i=null){super(s,e,i)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}},RT=ev;AEe=IT;S0.BaseContract=RT;function _Ee(){return RT}var NU=class extends _Ee(){};S0.Contract=NU});var wae=R(CT=>{"use strict";b();p();Object.defineProperty(CT,"__esModule",{value:!0});CT.ContractFactory=void 0;var EEe=J3(),SEe=Ws(),fb=Ne(),MT=MU(),rv=class{constructor(e,t,n){N(this,"interface");N(this,"bytecode");N(this,"runner");let s=EEe.Interface.from(e);t instanceof Uint8Array||(typeof t=="object"&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,fb.hexlify)((0,fb.getBytes)(t)),(0,fb.defineProperties)(this,{bytecode:t,interface:s,runner:n||null})}attach(e){return new MT.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={},n=this.interface.deploy;if(n.inputs.length+1===e.length&&(t=await(0,MT.copyOverrides)(e.pop())),n.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");let s=await(0,MT.resolveArgs)(this.runner,n.inputs,e),i=(0,fb.concat)([this.bytecode,this.interface.encodeDeploy(s)]);return Object.assign({},t,{data:i})}async deploy(...e){let t=await this.getDeployTransaction(...e);(0,fb.assert)(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let n=await this.runner.sendTransaction(t),s=(0,SEe.getCreateAddress)(n);return new MT.BaseContract(s,this.interface,this.runner,n)}connect(e){return new rv(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,fb.assertArgument)(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));let n=e.abi,s="";return e.bytecode?s=e.bytecode:e.evm&&e.evm.bytecode&&(s=e.evm.bytecode),new this(n,s,t)}};CT.ContractFactory=rv});var nv=R(Bs=>{"use strict";b();p();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.UndecodedEventLog=Bs.EventLog=Bs.ContractTransactionResponse=Bs.ContractTransactionReceipt=Bs.ContractUnknownEventPayload=Bs.ContractEventPayload=Bs.ContractFactory=Bs.Contract=Bs.BaseContract=void 0;var vae=MU();Object.defineProperty(Bs,"BaseContract",{enumerable:!0,get:function(){return vae.BaseContract}});Object.defineProperty(Bs,"Contract",{enumerable:!0,get:function(){return vae.Contract}});var TEe=wae();Object.defineProperty(Bs,"ContractFactory",{enumerable:!0,get:function(){return TEe.ContractFactory}});var e6=TU();Object.defineProperty(Bs,"ContractEventPayload",{enumerable:!0,get:function(){return e6.ContractEventPayload}});Object.defineProperty(Bs,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return e6.ContractUnknownEventPayload}});Object.defineProperty(Bs,"ContractTransactionReceipt",{enumerable:!0,get:function(){return e6.ContractTransactionReceipt}});Object.defineProperty(Bs,"ContractTransactionResponse",{enumerable:!0,get:function(){return e6.ContractTransactionResponse}});Object.defineProperty(Bs,"EventLog",{enumerable:!0,get:function(){return e6.EventLog}});Object.defineProperty(Bs,"UndecodedEventLog",{enumerable:!0,get:function(){return e6.UndecodedEventLog}})});var qU=R(hb=>{"use strict";b();p();Object.defineProperty(hb,"__esModule",{value:!0});hb.EnsResolver=hb.BasicMulticoinProviderPlugin=hb.MulticoinProviderPlugin=void 0;var OEe=Ws(),Pae=y3(),CU=nv(),LU=v0(),xa=Ne();function UU(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):(0,xa.assertArgument)(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}var iv=class{constructor(e){N(this,"name");(0,xa.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}};hb.MulticoinProviderPlugin=iv;var BEe="org.ethers.plugins.provider.BasicMulticoin",FU=class extends iv{constructor(){super(BEe)}};hb.BasicMulticoinProviderPlugin=FU;var Aae=new RegExp("^(ipfs)://(.*)$","i"),_ae=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Aae,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],db,rx,lb,t6,UT,Eae,sv=class{constructor(e,t,n){I(this,lb);N(this,"provider");N(this,"address");N(this,"name");I(this,db,void 0);I(this,rx,void 0);(0,xa.defineProperties)(this,{provider:e,address:t,name:n}),_(this,db,null),_(this,rx,new CU.Contract(t,["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 l(this,db)==null&&_(this,db,(async()=>{try{return await l(this,rx).supportsInterface("0x9061b923")}catch(e){if((0,xa.isError)(e,"CALL_EXCEPTION"))return!1;throw _(this,db,null),e}})()),await l(this,db)}async getAddress(e){if(e==null&&(e=60),e===60)try{let i=await $(this,lb,t6).call(this,"addr(bytes32)");return i==null||i===Pae.ZeroAddress?null:i}catch(i){if((0,xa.isError)(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648,a=await $(this,lb,t6).call(this,"addr(bytes32,uint)",[i]);if((0,xa.isHexString)(a,20))return(0,OEe.getAddress)(a)}let t=null;for(let i of this.provider.plugins)if(i instanceof iv&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;let n=await $(this,lb,t6).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;let s=await t.decodeAddress(e,n);if(s!=null)return s;(0,xa.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){let t=await $(this,lb,t6).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){let e=await $(this,lb,t6).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;let t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){let s=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${s}://${(0,xa.encodeBase58)("0x"+t[2])}`}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;(0,xa.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){let e=[{type:"name",value:this.name}];try{let t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<_ae.length;n++){let s=t.match(_ae[n]);if(s==null)continue;let i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{let a=UU(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:a}),{linkage:e,url:a}}case"erc721":case"erc1155":{let a=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});let o=await this.getAddress();if(o==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};let c=(s[2]||"").split("/");if(c.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};let u=c[1],f=new CU.Contract(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(i==="erc721"){let y=await f.ownerOf(u);if(o!==y)return e.push({type:"!owner",value:y}),{url:null,linkage:e};e.push({type:"owner",value:y})}else if(i==="erc1155"){let y=await f.balanceOf(o,u);if(!y)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:y.toString()})}let d=await f[a](u);if(d==null||d==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:d}),i==="erc1155"&&(d=d.replace("{id}",(0,xa.toBeHex)(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=UU(d)),e.push({type:"metadata-url",value:d});let g={},h=await new xa.FetchRequest(d).send();h.assertOk();try{g=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{let T=h.body;return T&&e.push({type:"!metadata",value:(0,xa.hexlify)(T)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!g)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(g)});let m=g.image;if(typeof m!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!m.match(/^(https:\/\/|data:)/i)){if(m.match(Aae)==null)return e.push({type:"!imageUrl-ipfs",value:m}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:m}),m=UU(m)}return e.push({type:"url",value:m}),{linkage:e,url:m}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){let t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return(0,xa.assert)(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async fromName(e,t){var s;let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;let i=await $(s=sv,UT,Eae).call(s,e,n);if(i!=null){let a=new sv(e,i,t);return n!==t&&!await a.supportsWildcard()?null:a}n=n.split(".").slice(1).join(".")}}},LT=sv;db=new WeakMap,rx=new WeakMap,lb=new WeakSet,t6=async function(e,t){t=(t||[]).slice();let n=l(this,rx).interface;t.unshift((0,LU.namehash)(this.name));let s=null;await this.supportsWildcard()&&(s=n.getFunction(e),(0,xa.assert)(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,LU.dnsEncode)(this.name,255),n.encodeFunctionData(s,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{let i=await l(this,rx)[e](...t);return s?n.decodeFunctionResult(s,i)[0]:i}catch(i){if(!(0,xa.isError)(i,"CALL_EXCEPTION"))throw i}return null},UT=new WeakSet,Eae=async function(e,t){let n=await sv.getEnsAddress(e);try{let i=await new CU.Contract(n,["function resolver(bytes32) view returns (address)"],e).resolver((0,LU.namehash)(t),{enableCcipRead:!0});return i===Pae.ZeroAddress?null:i}catch(s){throw s}return null},I(LT,UT);hb.EnsResolver=LT});var Nae=R(en=>{"use strict";b();p();Object.defineProperty(en,"__esModule",{value:!0});en.formatTransactionResponse=en.formatTransactionReceipt=en.formatReceiptLog=en.formatBlock=en.formatLog=en.formatUint256=en.formatHash=en.formatData=en.formatBoolean=en.object=en.arrayOf=en.allowNull=void 0;var T0=Ws(),Sae=di(),kEe=Qa(),xt=Ne(),Tae=BigInt(0);function nr(r,e){return function(t){return t==null?e:r(t)}}en.allowNull=nr;function av(r,e){return t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))}}en.arrayOf=av;function r6(r,e){return t=>{let n={};for(let s in r){let i=s;if(e&&s in e&&!(i in t)){for(let a of e[s])if(a in t){i=a;break}}try{let a=r[s](t[i]);a!==void 0&&(n[s]=a)}catch(a){let o=a instanceof Error?a.message:"not-an-error";(0,xt.assert)(!1,`invalid value for value.${s} (${o})`,"BAD_DATA",{value:t})}}return n}}en.object=r6;function Oae(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}(0,xt.assertArgument)(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}en.formatBoolean=Oae;function nx(r){return(0,xt.assertArgument)((0,xt.isHexString)(r,!0),"invalid data","value",r),r}en.formatData=nx;function hi(r){return(0,xt.assertArgument)((0,xt.isHexString)(r,32),"invalid hash","value",r),r}en.formatHash=hi;function NEe(r){if(!(0,xt.isHexString)(r))throw new Error("invalid uint256");return(0,xt.zeroPadValue)(r,32)}en.formatUint256=NEe;var IEe=r6({address:T0.getAddress,blockHash:hi,blockNumber:xt.getNumber,data:nx,index:xt.getNumber,removed:nr(Oae,!1),topics:av(hi),transactionHash:hi,transactionIndex:xt.getNumber},{index:["logIndex"]});function REe(r){return IEe(r)}en.formatLog=REe;var jEe=r6({hash:nr(hi),parentHash:hi,parentBeaconBlockRoot:nr(hi,null),number:xt.getNumber,timestamp:xt.getNumber,nonce:nr(nx),difficulty:xt.getBigInt,gasLimit:xt.getBigInt,gasUsed:xt.getBigInt,stateRoot:nr(hi,null),receiptsRoot:nr(hi,null),blobGasUsed:nr(xt.getBigInt,null),excessBlobGas:nr(xt.getBigInt,null),miner:nr(T0.getAddress),prevRandao:nr(hi,null),extraData:nx,baseFeePerGas:nr(xt.getBigInt)},{prevRandao:["mixHash"]});function MEe(r){let e=jEe(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:kae(t)),e}en.formatBlock=MEe;var CEe=r6({transactionIndex:xt.getNumber,blockNumber:xt.getNumber,transactionHash:hi,address:T0.getAddress,topics:av(hi),data:nx,index:xt.getNumber,blockHash:hi},{index:["logIndex"]});function Bae(r){return CEe(r)}en.formatReceiptLog=Bae;var LEe=r6({to:nr(T0.getAddress,null),from:nr(T0.getAddress,null),contractAddress:nr(T0.getAddress,null),index:xt.getNumber,root:nr(xt.hexlify),gasUsed:xt.getBigInt,blobGasUsed:nr(xt.getBigInt,null),logsBloom:nr(nx),blockHash:hi,hash:hi,logs:av(Bae),blockNumber:xt.getNumber,cumulativeGasUsed:xt.getBigInt,effectiveGasPrice:nr(xt.getBigInt),blobGasPrice:nr(xt.getBigInt,null),status:nr(xt.getNumber),type:nr(xt.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function UEe(r){return LEe(r)}en.formatTransactionReceipt=UEe;function kae(r){r.to&&(0,xt.getBigInt)(r.to)===Tae&&(r.to="0x0000000000000000000000000000000000000000");let e=r6({hash:hi,index:nr(xt.getNumber,void 0),type:t=>t==="0x"||t==null?0:(0,xt.getNumber)(t),accessList:nr(kEe.accessListify,null),blobVersionedHashes:nr(av(hi,!0),null),blockHash:nr(hi,null),blockNumber:nr(xt.getNumber,null),transactionIndex:nr(xt.getNumber,null),from:T0.getAddress,gasPrice:nr(xt.getBigInt),maxPriorityFeePerGas:nr(xt.getBigInt),maxFeePerGas:nr(xt.getBigInt),maxFeePerBlobGas:nr(xt.getBigInt,null),gasLimit:xt.getBigInt,to:nr(T0.getAddress,null),value:xt.getBigInt,nonce:xt.getNumber,data:nx,creates:nr(T0.getAddress,null),chainId:nr(xt.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=(0,T0.getCreateAddress)(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=Sae.Signature.from(r.signature):e.signature=Sae.Signature.from(r),e.chainId==null){let t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&(0,xt.getBigInt)(e.blockHash)===Tae&&(e.blockHash=null),e}en.formatTransactionResponse=kae});var FT=R(Dc=>{"use strict";b();p();Object.defineProperty(Dc,"__esModule",{value:!0});Dc.FetchUrlFeeDataNetworkPlugin=Dc.FeeDataNetworkPlugin=Dc.EnsPlugin=Dc.GasCostPlugin=Dc.NetworkPlugin=void 0;var KU=Uh(),FEe=Ne(),qEe="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",Jd=class{constructor(e){N(this,"name");(0,KU.defineProperties)(this,{name:e})}clone(){return new Jd(this.name)}};Dc.NetworkPlugin=Jd;var ov=class extends Jd{constructor(t,n){t==null&&(t=0);super(`org.ethers.network.plugins.GasCost#${t||0}`);N(this,"effectiveBlock");N(this,"txBase");N(this,"txCreate");N(this,"txDataZero");N(this,"txDataNonzero");N(this,"txAccessListStorageKey");N(this,"txAccessListAddress");let s={effectiveBlock:t};function i(a,o){let c=(n||{})[a];c==null&&(c=o),(0,FEe.assertArgument)(typeof c=="number",`invalud value for ${a}`,"costs",n),s[a]=c}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),(0,KU.defineProperties)(this,s)}clone(){return new ov(this.effectiveBlock,this)}};Dc.GasCostPlugin=ov;var cv=class extends Jd{constructor(t,n){super("org.ethers.plugins.network.Ens");N(this,"address");N(this,"targetNetwork");(0,KU.defineProperties)(this,{address:t||qEe,targetNetwork:n??1})}clone(){return new cv(this.address,this.targetNetwork)}};Dc.EnsPlugin=cv;var sx,GU=class extends Jd{constructor(t){super("org.ethers.plugins.network.FeeData");I(this,sx,void 0);_(this,sx,t)}get feeDataFunc(){return l(this,sx)}async getFeeData(t){return await l(this,sx).call(this,t)}clone(){return new GU(l(this,sx))}},DU=GU;sx=new WeakMap;Dc.FeeDataNetworkPlugin=DU;var uv,fv,HU=class extends Jd{constructor(t,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");I(this,uv,void 0);I(this,fv,void 0);_(this,uv,t),_(this,fv,n)}get url(){return l(this,uv)}get processFunc(){return l(this,fv)}clone(){return this}};uv=new WeakMap,fv=new WeakMap;Dc.FetchUrlFeeDataNetworkPlugin=HU});var ro=R(qT=>{"use strict";b();p();Object.defineProperty(qT,"__esModule",{value:!0});qT.Network=void 0;var DEe=Qa(),O0=Ne(),dv=FT(),VU=new Map,s6,i6,bb,n6=class{constructor(e,t){I(this,s6,void 0);I(this,i6,void 0);I(this,bb,void 0);_(this,s6,e),_(this,i6,(0,O0.getBigInt)(t)),_(this,bb,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return l(this,s6)}set name(e){_(this,s6,e)}get chainId(){return l(this,i6)}set chainId(e){_(this,i6,(0,O0.getBigInt)(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===(0,O0.getBigInt)(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===(0,O0.getBigInt)(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===(0,O0.getBigInt)(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(l(this,bb).values())}attachPlugin(e){if(l(this,bb).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return l(this,bb).set(e.name,e.clone()),this}getPlugin(e){return l(this,bb).get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){let e=new n6(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){let t=this.getPlugin("org.ethers.plugins.network.GasCost")||new dv.GasCostPlugin,n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){let s=(0,DEe.accessListify)(e.accessList);for(let i in s)n+=t.txAccessListAddress+t.txAccessListStorageKey*s[i].storageKeys.length}return n}static from(e){if(HEe(),e==null)return n6.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){let t=VU.get(e);if(t)return t();if(typeof e=="bigint")return new n6("unknown",e);(0,O0.assertArgument)(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){(0,O0.assertArgument)(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);let t=new n6(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new dv.EnsPlugin(e.ensAddress,e.ensNetwork)),t}(0,O0.assertArgument)(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));let n=VU.get(e);n&&(0,O0.assertArgument)(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),VU.set(e,t)}},ix=n6;s6=new WeakMap,i6=new WeakMap,bb=new WeakMap;qT.Network=ix;function Iae(r,e){let t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);let n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let s=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||s++,n[1]=s.toString()}return BigInt(n[0]+n[1])}function Rae(r){return new dv.FetchUrlFeeDataNetworkPlugin(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let s;try{let[i,a]=await Promise.all([n.send(),e()]);s=i;let o=s.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:Iae(o.maxFee,9),maxPriorityFeePerGas:Iae(o.maxPriorityFee,9)}}catch(i){(0,O0.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:s,error:i})}})}var jae=!1;function HEe(){if(jae)return;jae=!0;function r(e,t,n){let s=function(){let i=new ix(e,t);return n.ensNetwork!=null&&i.attachPlugin(new dv.EnsPlugin(null,n.ensNetwork)),i.attachPlugin(new dv.GasCostPlugin),(n.plugins||[]).forEach(a=>{i.attachPlugin(a)}),i};ix.register(e,s),ix.register(t,s),n.altNames&&n.altNames.forEach(i=>{ix.register(i,s)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[Rae("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Rae("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}});var VT=R($i=>{"use strict";b();p();Object.defineProperty($i,"__esModule",{value:!0});$i.PollingEventSubscriber=$i.PollingTransactionSubscriber=$i.PollingOrphanSubscriber=$i.PollingBlockTagSubscriber=$i.OnBlockSubscriber=$i.PollingBlockSubscriber=$i.getPollingSubscriber=void 0;var Mae=Ne();function zU(r){return JSON.parse(JSON.stringify(r))}function KEe(r,e){if(e==="block")return new HT(r);if((0,Mae.isHexString)(e,32))return new KT(r,e);(0,Mae.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:e}})}$i.getPollingSubscriber=KEe;var Zd,Hc,pb,B0,a6,DT,HT=class{constructor(e){I(this,a6);I(this,Zd,void 0);I(this,Hc,void 0);I(this,pb,void 0);I(this,B0,void 0);_(this,Zd,e),_(this,Hc,null),_(this,pb,4e3),_(this,B0,-2)}get pollingInterval(){return l(this,pb)}set pollingInterval(e){_(this,pb,e)}start(){l(this,Hc)||(_(this,Hc,l(this,Zd)._setTimeout($(this,a6,DT).bind(this),l(this,pb))),$(this,a6,DT).call(this))}stop(){!l(this,Hc)||(l(this,Zd)._clearTimeout(l(this,Hc)),_(this,Hc,null))}pause(e){this.stop(),e&&_(this,B0,-2)}resume(){this.start()}};Zd=new WeakMap,Hc=new WeakMap,pb=new WeakMap,B0=new WeakMap,a6=new WeakSet,DT=async function(){try{let e=await l(this,Zd).getBlockNumber();if(l(this,B0)===-2){_(this,B0,e);return}if(e!==l(this,B0)){for(let t=l(this,B0)+1;t<=e;t++){if(l(this,Hc)==null)return;await l(this,Zd).emit("block",t)}_(this,B0,e)}}catch{}l(this,Hc)!=null&&_(this,Hc,l(this,Zd)._setTimeout($(this,a6,DT).bind(this),l(this,pb)))};$i.PollingBlockSubscriber=HT;var ax,ox,gb,d6=class{constructor(e){I(this,ax,void 0);I(this,ox,void 0);I(this,gb,void 0);_(this,ax,e),_(this,gb,!1),_(this,ox,t=>{this._poll(t,l(this,ax))})}async _poll(e,t){throw new Error("sub-classes must override this")}start(){l(this,gb)||(_(this,gb,!0),l(this,ox).call(this,-2),l(this,ax).on("block",l(this,ox)))}stop(){!l(this,gb)||(_(this,gb,!1),l(this,ax).off("block",l(this,ox)))}pause(e){this.stop()}resume(){this.start()}};ax=new WeakMap,ox=new WeakMap,gb=new WeakMap;$i.OnBlockSubscriber=d6;var o6,Qd,WU=class extends d6{constructor(t,n){super(t);I(this,o6,void 0);I(this,Qd,void 0);_(this,o6,n),_(this,Qd,-2)}pause(t){t&&_(this,Qd,-2),super.pause(t)}async _poll(t,n){let s=await n.getBlock(l(this,o6));s!=null&&(l(this,Qd)===-2?_(this,Qd,s.number):s.number>l(this,Qd)&&(n.emit(l(this,o6),s.number),_(this,Qd,s.number)))}};o6=new WeakMap,Qd=new WeakMap;$i.PollingBlockTagSubscriber=WU;var lv,$U=class extends d6{constructor(t,n){super(t);I(this,lv,void 0);_(this,lv,zU(n))}async _poll(t,n){throw new Error("@TODO")}};lv=new WeakMap;$i.PollingOrphanSubscriber=$U;var c6,KT=class extends d6{constructor(t,n){super(t);I(this,c6,void 0);_(this,c6,n)}async _poll(t,n){let s=await n.getTransactionReceipt(l(this,c6));s&&n.emit(l(this,c6),s)}};c6=new WeakMap;$i.PollingTransactionSubscriber=KT;var Yd,u6,f6,xb,Kc,GT,Cae,JU=class{constructor(e,t){I(this,GT);I(this,Yd,void 0);I(this,u6,void 0);I(this,f6,void 0);I(this,xb,void 0);I(this,Kc,void 0);_(this,Yd,e),_(this,u6,zU(t)),_(this,f6,$(this,GT,Cae).bind(this)),_(this,xb,!1),_(this,Kc,-2)}start(){l(this,xb)||(_(this,xb,!0),l(this,Kc)===-2&&l(this,Yd).getBlockNumber().then(e=>{_(this,Kc,e)}),l(this,Yd).on("block",l(this,f6)))}stop(){!l(this,xb)||(_(this,xb,!1),l(this,Yd).off("block",l(this,f6)))}pause(e){this.stop(),e&&_(this,Kc,-2)}resume(){this.start()}};Yd=new WeakMap,u6=new WeakMap,f6=new WeakMap,xb=new WeakMap,Kc=new WeakMap,GT=new WeakSet,Cae=async function(e){if(l(this,Kc)===-2)return;let t=zU(l(this,u6));t.fromBlock=l(this,Kc)+1,t.toBlock=e;let n=await l(this,Yd).getLogs(t);if(n.length===0){l(this,Kc)<e-60&&_(this,Kc,e-60);return}for(let s of n)l(this,Yd).emit(l(this,u6),s),_(this,Kc,s.blockNumber)};$i.PollingEventSubscriber=JU});var x6=R(g6=>{"use strict";b();p();Object.defineProperty(g6,"__esModule",{value:!0});g6.AbstractProvider=g6.UnmanagedSubscriber=void 0;var bv=Ws(),GEe=y3(),Lae=nv(),VEe=v0(),zEe=Qa(),Pe=Ne(),Uae=qU(),zT=Nae(),WEe=ro(),yb=Q3(),hv=VT(),$Ee=BigInt(2),JEe=10;function WT(r){return r&&typeof r.then=="function"}function $T(r,e){return r+":"+JSON.stringify(e,(t,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)){let s=Object.keys(n);return s.sort(),s.reduce((i,a)=>(i[a]=n[a],i),{})}return n})}var ZT=class{constructor(e){N(this,"name");(0,Pe.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};g6.UnmanagedSubscriber=ZT;function ZEe(r){return JSON.parse(JSON.stringify(r))}function YU(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function ZU(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if((0,Pe.isHexString)(r,32)){let t=r.toLowerCase();return{type:"transaction",tag:$T("tx",{hash:t}),hash:t}}if(r.orphan){let t=r;return{type:"orphan",tag:$T("orphan",t),filter:ZEe(t)}}if(r.address||r.topics){let t=r,n={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?YU(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(t.address){let s=[],i=[],a=o=>{(0,Pe.isHexString)(o)?s.push(o):i.push((async()=>{s.push(await(0,bv.resolveAddress)(o,e))})())};Array.isArray(t.address)?t.address.forEach(a):a(t.address),i.length&&await Promise.all(i),n.address=YU(s.map(o=>o.toLowerCase()))}return{filter:n,tag:$T("event",n),type:"event"}}(0,Pe.assertArgument)(!1,"unknown ProviderEvent","event",r)}function QU(){return new Date().getTime()}var QEe={cacheTimeout:250,pollingInterval:4e3},Ji,mb,Zi,l6,ko,cx,wb,Xd,xv,Gc,h6,b6,ya,Bo,yv,eF,mv,tF,ux,pv,wv,rF,fx,gv,p6,JT,XU=class{constructor(e,t){I(this,ya);I(this,yv);I(this,mv);I(this,ux);I(this,wv);I(this,fx);I(this,p6);I(this,Ji,void 0);I(this,mb,void 0);I(this,Zi,void 0);I(this,l6,void 0);I(this,ko,void 0);I(this,cx,void 0);I(this,wb,void 0);I(this,Xd,void 0);I(this,xv,void 0);I(this,Gc,void 0);I(this,h6,void 0);I(this,b6,void 0);if(_(this,b6,Object.assign({},QEe,t||{})),e==="any")_(this,cx,!0),_(this,ko,null);else if(e){let n=WEe.Network.from(e);_(this,cx,!1),_(this,ko,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else _(this,cx,!1),_(this,ko,null);_(this,Xd,-1),_(this,wb,new Map),_(this,Ji,new Map),_(this,mb,new Map),_(this,Zi,null),_(this,l6,!1),_(this,xv,1),_(this,Gc,new Map),_(this,h6,!1)}get pollingInterval(){return l(this,b6).pollingInterval}get provider(){return this}get plugins(){return Array.from(l(this,mb).values())}attachPlugin(e){if(l(this,mb).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return l(this,mb).set(e.name,e.connect(this)),this}getPlugin(e){return l(this,mb).get(e)||null}get disableCcipRead(){return l(this,h6)}set disableCcipRead(e){_(this,h6,!!e)}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;let s=e.to.toLowerCase(),i=t.toLowerCase(),a=[];for(let o=0;o<n.length;o++){let c=n[o],u=c.replace("{sender}",s).replace("{data}",i),f=new Pe.FetchRequest(u);c.indexOf("{data}")===-1&&(f.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:f,index:o,urls:n});let d="unknown error",g;try{g=await f.send()}catch(h){a.push(h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:f,result:{error:h}});continue}try{let h=g.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:f,result:h}),h.data;h.message&&(d=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:f,result:h})}catch{}(0,Pe.assert)(g.statusCode<400||g.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:d}}),a.push(d)}(0,Pe.assert)(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,t){return new yb.Block((0,zT.formatBlock)(e),this)}_wrapLog(e,t){return new yb.Log((0,zT.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new yb.TransactionReceipt((0,zT.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new yb.TransactionResponse((0,zT.formatTransactionResponse)(e),this)}_detectNetwork(){(0,Pe.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,Pe.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){let e=(0,Pe.getNumber)(await $(this,ya,Bo).call(this,{method:"getBlockNumber"}),"%response");return l(this,Xd)>=0&&_(this,Xd,e),e}_getAddress(e){return(0,bv.resolveAddress)(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if((0,Pe.isHexString)(e))return(0,Pe.isHexString)(e,32)?e:(0,Pe.toQuantity)(e);if(typeof e=="bigint"&&(e=(0,Pe.getNumber)(e,"blockTag")),typeof e=="number")return e>=0?(0,Pe.toQuantity)(e):l(this,Xd)>=0?(0,Pe.toQuantity)(l(this,Xd)+e):this.getBlockNumber().then(t=>(0,Pe.toQuantity)(t+e));(0,Pe.assertArgument)(!1,"invalid blockTag","blockTag",e)}_getFilter(e){let t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?YU(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,s=(c,u,f)=>{let d;switch(c.length){case 0:break;case 1:d=c[0];break;default:c.sort(),d=c}if(n&&(u!=null||f!=null))throw new Error("invalid filter");let g={};return d&&(g.address=d),t.length&&(g.topics=t),u&&(g.fromBlock=u),f&&(g.toBlock=f),n&&(g.blockHash=n),g},i=[];if(e.address)if(Array.isArray(e.address))for(let c of e.address)i.push(this._getAddress(c));else i.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),i.filter(c=>typeof c!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(i),a,o]).then(c=>s(c[0],c[1],c[2])):s(i,a,o)}_getTransactionRequest(e){let t=(0,yb.copyRequest)(e),n=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;let i=(0,bv.resolveAddress)(t[s],this);WT(i)?n.push(async function(){t[s]=await i}()):t[s]=i}),t.blockTag!=null){let s=this._getBlockTag(t.blockTag);WT(s)?n.push(async function(){t.blockTag=await s}()):t.blockTag=s}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(l(this,ko)==null){let s=(async()=>{try{let i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw l(this,ko)===s&&_(this,ko,null),i}})();return _(this,ko,s),(await s).clone()}let e=l(this,ko),[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(l(this,cx)?(this.emit("network",n,t),l(this,ko)===e&&_(this,ko,Promise.resolve(n))):(0,Pe.assert)(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){let e=await this.getNetwork(),t=async()=>{let{_block:s,gasPrice:i,priorityFee:a}=await(0,Pe.resolveProperties)({_block:$(this,wv,rF).call(this,"latest",!1),gasPrice:(async()=>{try{let f=await $(this,ya,Bo).call(this,{method:"getGasPrice"});return(0,Pe.getBigInt)(f,"%response")}catch{}return null})(),priorityFee:(async()=>{try{let f=await $(this,ya,Bo).call(this,{method:"getPriorityFee"});return(0,Pe.getBigInt)(f,"%response")}catch{}return null})()}),o=null,c=null,u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(c=a??BigInt("1000000000"),o=u.baseFeePerGas*$Ee+c),new yb.FeeData(i,o,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){let s=new Pe.FetchRequest(n.url),i=await n.processFunc(t,this,s);return new yb.FeeData(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return WT(t)&&(t=await t),(0,Pe.getBigInt)(await $(this,ya,Bo).call(this,{method:"estimateGas",transaction:t}),"%response")}async call(e){let{tx:t,blockTag:n}=await(0,Pe.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await $(this,mv,tF).call(this,$(this,yv,eF).call(this,t,n,e.enableCcipRead?0:-1))}async getBalance(e,t){return(0,Pe.getBigInt)(await $(this,ux,pv).call(this,{method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,Pe.getNumber)(await $(this,ux,pv).call(this,{method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,Pe.hexlify)(await $(this,ux,pv).call(this,{method:"getCode"},e,t))}async getStorage(e,t,n){let s=(0,Pe.getBigInt)(t,"position");return(0,Pe.hexlify)(await $(this,ux,pv).call(this,{method:"getStorage",position:s},e,n))}async broadcastTransaction(e){let{blockNumber:t,hash:n,network:s}=await(0,Pe.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=zEe.Transaction.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(t)}async getBlock(e,t){let{network:n,params:s}=await(0,Pe.resolveProperties)({network:this.getNetwork(),params:$(this,wv,rF).call(this,e,!!t)});return s==null?null:this._wrapBlock(s,n)}async getTransaction(e){let{network:t,params:n}=await(0,Pe.resolveProperties)({network:this.getNetwork(),params:$(this,ya,Bo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){let{network:t,params:n}=await(0,Pe.resolveProperties)({network:this.getNetwork(),params:$(this,ya,Bo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){let s=await $(this,ya,Bo).call(this,{method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){let{result:t}=await(0,Pe.resolveProperties)({network:this.getNetwork(),result:$(this,ya,Bo).call(this,{method:"getTransactionResult",hash:e})});return t==null?null:(0,Pe.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);WT(t)&&(t=await t);let{network:n,params:s}=await(0,Pe.resolveProperties)({network:this.getNetwork(),params:$(this,ya,Bo).call(this,{method:"getLogs",filter:t})});return s.map(i=>this._wrapLog(i,n))}_getProvider(e){(0,Pe.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Uae.EnsResolver.fromName(this,e)}async getAvatar(e){let t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){let t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=(0,bv.getAddress)(e);let t=(0,VEe.namehash)(e.substring(2).toLowerCase()+".addr.reverse");try{let n=await Uae.EnsResolver.getEnsAddress(this),i=await new Lae.Contract(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===GEe.ZeroAddress)return null;let o=await new Lae.Contract(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(n){if((0,Pe.isError)(n,"BAD_DATA")&&n.value==="0x"||(0,Pe.isError)(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){let s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,a)=>{let o=null,c=async u=>{try{let f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=s){i(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),a((0,Pe.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){(0,Pe.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){let t=l(this,Gc).get(e);!t||(t.timer&&clearTimeout(t.timer),l(this,Gc).delete(e))}_setTimeout(e,t){t==null&&(t=0);let n=$s(this,xv)._++,s=()=>{l(this,Gc).delete(n),e()};if(this.paused)l(this,Gc).set(n,{timer:null,func:s,time:t});else{let i=setTimeout(s,t);l(this,Gc).set(n,{timer:i,func:s,time:QU()})}return n}_forEachSubscriber(e){for(let t of l(this,Ji).values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new ZT(e.type);case"block":{let t=new hv.PollingBlockSubscriber(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new hv.PollingBlockTagSubscriber(this,e.type);case"event":return new hv.PollingEventSubscriber(this,e.filter);case"transaction":return new hv.PollingTransactionSubscriber(this,e.hash);case"orphan":return new hv.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(let n of l(this,Ji).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),l(this,Zi)!=null&&t.pause(l(this,Zi));break}}async on(e,t){let n=await $(this,p6,JT).call(this,e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,l(this,Zi)!=null&&n.subscriber.pause(l(this,Zi))),this}async once(e,t){let n=await $(this,p6,JT).call(this,e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,l(this,Zi)!=null&&n.subscriber.pause(l(this,Zi))),this}async emit(e,...t){let n=await $(this,fx,gv).call(this,e,t);if(!n||n.listeners.length===0)return!1;let s=n.listeners.length;return n.listeners=n.listeners.filter(({listener:i,once:a})=>{let o=new Pe.EventPayload(this,a?null:i,e);try{i.call(this,...t,o)}catch{}return!a}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),l(this,Ji).delete(n.tag)),s>0}async listenerCount(e){if(e){let n=await $(this,fx,gv).call(this,e);return n?n.listeners.length:0}let t=0;for(let{listeners:n}of l(this,Ji).values())t+=n.length;return t}async listeners(e){if(e){let n=await $(this,fx,gv).call(this,e);return n?n.listeners.map(({listener:s})=>s):[]}let t=[];for(let{listeners:n}of l(this,Ji).values())t=t.concat(n.map(({listener:s})=>s));return t}async off(e,t){let n=await $(this,fx,gv).call(this,e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),l(this,Ji).delete(n.tag)),this}async removeAllListeners(e){if(e){let{tag:t,started:n,subscriber:s}=await $(this,p6,JT).call(this,e);n&&s.stop(),l(this,Ji).delete(t)}else for(let[t,{started:n,subscriber:s}]of l(this,Ji))n&&s.stop(),l(this,Ji).delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return l(this,l6)}destroy(){this.removeAllListeners();for(let e of l(this,Gc).keys())this._clearTimeout(e);_(this,l6,!0)}get paused(){return l(this,Zi)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(_(this,Xd,-1),l(this,Zi)!=null){if(l(this,Zi)==!!e)return;(0,Pe.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),_(this,Zi,!!e);for(let t of l(this,Gc).values())t.timer&&clearTimeout(t.timer),t.time=QU()-t.time}resume(){if(l(this,Zi)!=null){this._forEachSubscriber(e=>e.resume()),_(this,Zi,null);for(let e of l(this,Gc).values()){let t=e.time;t<0&&(t=0),e.time=QU(),setTimeout(e.func,t)}}}};Ji=new WeakMap,mb=new WeakMap,Zi=new WeakMap,l6=new WeakMap,ko=new WeakMap,cx=new WeakMap,wb=new WeakMap,Xd=new WeakMap,xv=new WeakMap,Gc=new WeakMap,h6=new WeakMap,b6=new WeakMap,ya=new WeakSet,Bo=async function(e){let t=l(this,b6).cacheTimeout;if(t<0)return await this._perform(e);let n=$T(e.method,e),s=l(this,wb).get(n);return s||(s=this._perform(e),l(this,wb).set(n,s),setTimeout(()=>{l(this,wb).get(n)===s&&l(this,wb).delete(n)},t)),await s},yv=new WeakSet,eF=async function(e,t,n){(0,Pe.assert)(n<JEe,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});let s=(0,yb.copyRequest)(e);try{return(0,Pe.hexlify)(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(i){if(!this.disableCcipRead&&(0,Pe.isCallException)(i)&&i.data&&n>=0&&t==="latest"&&s.to!=null&&(0,Pe.dataSlice)(i.data,0,4)==="0x556f1830"){let a=i.data,o=await(0,bv.resolveAddress)(s.to,this),c;try{c=rSe((0,Pe.dataSlice)(i.data,4))}catch(d){(0,Pe.assert)(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:a}})}(0,Pe.assert)(c.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});let u=await this.ccipReadFetch(s,c.calldata,c.urls);(0,Pe.assert)(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:c.errorArgs}});let f={to:o,data:(0,Pe.concat)([c.selector,tSe([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{let d=await $(this,yv,eF).call(this,f,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:d}),d}}throw i}},mv=new WeakSet,tF=async function(e){let{value:t}=await(0,Pe.resolveProperties)({network:this.getNetwork(),value:e});return t},ux=new WeakSet,pv=async function(e,t,n){let s=this._getAddress(t),i=this._getBlockTag(n);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await $(this,mv,tF).call(this,$(this,ya,Bo).call(this,Object.assign(e,{address:s,blockTag:i})))},wv=new WeakSet,rF=async function(e,t){if((0,Pe.isHexString)(e,32))return await $(this,ya,Bo).call(this,{method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await $(this,ya,Bo).call(this,{method:"getBlock",blockTag:n,includeTransactions:t})},fx=new WeakSet,gv=async function(e,t){let n=await ZU(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await ZU({orphan:"drop-log",log:t[0]},this)),l(this,Ji).get(n.tag)||null},p6=new WeakSet,JT=async function(e){let t=await ZU(e,this),n=t.tag,s=l(this,Ji).get(n);return s||(s={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},l(this,Ji).set(n,s)),s};g6.AbstractProvider=XU;function YEe(r,e){try{let t=nF(r,e);if(t)return(0,Pe.toUtf8String)(t)}catch{}return null}function nF(r,e){if(r==="0x")return null;try{let t=(0,Pe.getNumber)((0,Pe.dataSlice)(r,e,e+32)),n=(0,Pe.getNumber)((0,Pe.dataSlice)(r,t,t+32));return(0,Pe.dataSlice)(r,t+32,t+32+n)}catch{}return null}function Fae(r){let e=(0,Pe.toBeArray)(r);if(e.length>32)throw new Error("internal; should not happen");let t=new Uint8Array(32);return t.set(e,32-e.length),t}function XEe(r){if(r.length%32===0)return r;let e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}var eSe=new Uint8Array([]);function tSe(r){let e=[],t=0;for(let n=0;n<r.length;n++)e.push(eSe),t+=32;for(let n=0;n<r.length;n++){let s=(0,Pe.getBytes)(r[n]);e[n]=Fae(t),e.push(Fae(s.length)),e.push(XEe(s)),t+=32+Math.ceil(s.length/32)*32}return(0,Pe.concat)(e)}var qae="0x0000000000000000000000000000000000000000000000000000000000000000";function rSe(r){let e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,Pe.assert)((0,Pe.dataLength)(r)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});let t=(0,Pe.dataSlice)(r,0,32);(0,Pe.assert)((0,Pe.dataSlice)(t,0,12)===(0,Pe.dataSlice)(qae,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=(0,Pe.dataSlice)(t,12);try{let n=[],s=(0,Pe.getNumber)((0,Pe.dataSlice)(r,32,64)),i=(0,Pe.getNumber)((0,Pe.dataSlice)(r,s,s+32)),a=(0,Pe.dataSlice)(r,s+32);for(let o=0;o<i;o++){let c=YEe(a,o*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{(0,Pe.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{let n=nF(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{(0,Pe.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,Pe.assert)((0,Pe.dataSlice)(r,100,128)===(0,Pe.dataSlice)(qae,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=(0,Pe.dataSlice)(r,96,100);try{let n=nF(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{(0,Pe.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}});var XT=R(w6=>{"use strict";b();p();Object.defineProperty(w6,"__esModule",{value:!0});w6.VoidSigner=w6.AbstractSigner=void 0;var Dae=Ws(),nSe=Qa(),no=Ne(),sSe=Q3();function y6(r,e){if(r.provider)return r.provider;(0,no.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Hae(r,e){let t=(0,sSe.copyRequest)(e);if(t.to!=null&&(t.to=(0,Dae.resolveAddress)(t.to,r)),t.from!=null){let n=t.from;t.from=Promise.all([r.getAddress(),(0,Dae.resolveAddress)(n,r)]).then(([s,i])=>((0,no.assertArgument)(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else t.from=r.getAddress();return await(0,no.resolveProperties)(t)}var YT=class{constructor(e){N(this,"provider");(0,no.defineProperties)(this,{provider:e||null})}async getNonce(e){return y6(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Hae(this,e)}async populateTransaction(e){let t=y6(this,"populateTransaction"),n=await Hae(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));let s=await this.provider.getNetwork();if(n.chainId!=null){let a=(0,no.getBigInt)(n.chainId);(0,no.assertArgument)(a===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=s.chainId;let i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?(0,no.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&i&&(0,no.assertArgument)(!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){let a=await t.getFeeData();(0,no.assert)(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{let a=await t.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){let o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?((0,no.assert)(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):(0,no.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await(0,no.resolveProperties)(n)}async estimateGas(e){return y6(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return y6(this,"call").call(await this.populateCall(e))}async resolveName(e){return await y6(this,"resolveName").resolveName(e)}async sendTransaction(e){let t=y6(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;let s=nSe.Transaction.from(n);return await t.broadcastTransaction(await this.signTransaction(s))}};w6.AbstractSigner=YT;var m6,QT,iF=class extends YT{constructor(t,n){super(n);I(this,m6);N(this,"address");(0,no.defineProperties)(this,{address:t})}async getAddress(){return this.address}connect(t){return new iF(this.address,t)}async signTransaction(t){$(this,m6,QT).call(this,"transactions","signTransaction")}async signMessage(t){$(this,m6,QT).call(this,"messages","signMessage")}async signTypedData(t,n,s){$(this,m6,QT).call(this,"typed-data","signTypedData")}},sF=iF;m6=new WeakSet,QT=function(t,n){(0,no.assert)(!1,`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:n})};w6.VoidSigner=sF});var el=R(eO=>{"use strict";b();p();Object.defineProperty(eO,"__esModule",{value:!0});eO.showThrottleMessage=void 0;var Kae=new Set;function iSe(r){Kae.has(r)||(Kae.add(r),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${r} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}eO.showThrottleMessage=iSe});var Gae=R(Pb=>{"use strict";b();p();Object.defineProperty(Pb,"__esModule",{value:!0});Pb.FilterIdPendingSubscriber=Pb.FilterIdEventSubscriber=Pb.FilterIdSubscriber=void 0;var aSe=Ne(),oSe=VT();function cSe(r){return JSON.parse(JSON.stringify(r))}var ma,k0,dx,vb,lx,v6,Pv,aF,_v,oF,vv=class{constructor(e){I(this,Pv);I(this,_v);I(this,ma,void 0);I(this,k0,void 0);I(this,dx,void 0);I(this,vb,void 0);I(this,lx,void 0);I(this,v6,void 0);_(this,ma,e),_(this,k0,null),_(this,dx,$(this,Pv,aF).bind(this)),_(this,vb,!1),_(this,lx,null),_(this,v6,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){l(this,vb)||(_(this,vb,!0),$(this,Pv,aF).call(this,-2))}stop(){!l(this,vb)||(_(this,vb,!1),_(this,v6,!0),$(this,_v,oF).call(this),l(this,ma).off("block",l(this,dx)))}pause(e){e&&$(this,_v,oF).call(this),l(this,ma).off("block",l(this,dx))}resume(){this.start()}};ma=new WeakMap,k0=new WeakMap,dx=new WeakMap,vb=new WeakMap,lx=new WeakMap,v6=new WeakMap,Pv=new WeakSet,aF=async function(e){try{l(this,k0)==null&&_(this,k0,this._subscribe(l(this,ma)));let t=null;try{t=await l(this,k0)}catch(i){if(!(0,aSe.isError)(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){_(this,k0,null),l(this,ma)._recoverSubscriber(this,this._recover(l(this,ma)));return}let n=await l(this,ma).getNetwork();if(l(this,lx)||_(this,lx,n),l(this,lx).chainId!==n.chainId)throw new Error("chaid changed");if(l(this,v6))return;let s=await l(this,ma).send("eth_getFilterChanges",[t]);await this._emitResults(l(this,ma),s)}catch(t){console.log("@TODO",t)}l(this,ma).once("block",l(this,dx))},_v=new WeakSet,oF=function(){let e=l(this,k0);e&&(_(this,k0,null),e.then(t=>{l(this,ma).destroyed||l(this,ma).send("eth_uninstallFilter",[t])}))};Pb.FilterIdSubscriber=vv;var hx,cF=class extends vv{constructor(t,n){super(t);I(this,hx,void 0);_(this,hx,cSe(n))}_recover(t){return new oSe.PollingEventSubscriber(t,l(this,hx))}async _subscribe(t){return await t.send("eth_newFilter",[l(this,hx)])}async _emitResults(t,n){for(let s of n)t.emit(l(this,hx),t._wrapLog(s,t._network))}};hx=new WeakMap;Pb.FilterIdEventSubscriber=cF;var uF=class extends vv{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(let n of t)e.emit("pending",n)}};Pb.FilterIdPendingSubscriber=uF});var zc=R(I0=>{"use strict";b();p();Object.defineProperty(I0,"__esModule",{value:!0});I0.JsonRpcProvider=I0.JsonRpcApiPollingProvider=I0.JsonRpcApiProvider=I0.JsonRpcSigner=void 0;var uSe=J3(),bx=Ws(),Vae=v0(),fSe=Qa(),Ht=Ne(),zae=x6(),dSe=XT(),fF=ro(),Wae=Gae(),lSe=VT(),hSe="bigint,boolean,function,number,string,symbol".split(/,/g);function tO(r){if(r==null||hSe.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(tO);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function bSe(r){return new Promise(e=>{setTimeout(e,r)})}function P6(r){return r&&r.toLowerCase()}function $ae(r){return r&&typeof r.pollingInterval=="number"}var Jae={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3},_6=class extends dSe.AbstractSigner{constructor(t,n){super(t);N(this,"address");n=(0,bx.getAddress)(n),(0,Ht.defineProperties)(this,{address:n})}connect(t){(0,Ht.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){let n=tO(t),s=[];if(n.from){let a=n.from;s.push((async()=>{let o=await(0,bx.resolveAddress)(a,this.provider);(0,Ht.assertArgument)(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&s.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){let a=n.to;s.push((async()=>{n.to=await(0,bx.resolveAddress)(a,this.provider)})())}s.length&&await Promise.all(s);let i=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(t){let n=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(t);return await new Promise((i,a)=>{let o=[1e3,100],c=0,u=async()=>{try{let f=await this.provider.getTransaction(s);if(f!=null){i(f.replaceableTransaction(n));return}}catch(f){if((0,Ht.isError)(f,"CANCELLED")||(0,Ht.isError)(f,"BAD_DATA")||(0,Ht.isError)(f,"NETWORK_ERROR")||(0,Ht.isError)(f,"UNSUPPORTED_OPERATION")){f.info==null&&(f.info={}),f.info.sendTransactionHash=s,a(f);return}if((0,Ht.isError)(f,"INVALID_ARGUMENT")&&(c++,f.info==null&&(f.info={}),f.info.sendTransactionHash=s,c>10)){a(f);return}this.provider.emit("error",(0,Ht.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:f}))}this.provider._setTimeout(()=>{u()},o.pop()||4e3)};u()})}async signTransaction(t){let n=tO(t);if(n.from){let i=await(0,bx.resolveAddress)(n.from,this.provider);(0,Ht.assertArgument)(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),n.from=i}else n.from=this.address;let s=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[s])}async signMessage(t){let n=typeof t=="string"?(0,Ht.toUtf8Bytes)(t):t;return await this.provider.send("personal_sign",[(0,Ht.hexlify)(n),this.address.toLowerCase()])}async signTypedData(t,n,s){let i=tO(s),a=await Vae.TypedDataEncoder.resolveNames(t,n,i,async o=>{let c=await(0,bx.resolveAddress)(o);return(0,Ht.assertArgument)(c!=null,"TypedData does not support null address","value",o),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Vae.TypedDataEncoder.getPayload(a.domain,n,a.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){let n=typeof t=="string"?(0,Ht.toUtf8Bytes)(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,Ht.hexlify)(n)])}};I0.JsonRpcSigner=_6;var px,A6,tl,N0,xf,Vc,so,Av,dF,rO=class extends zae.AbstractProvider{constructor(t,n){super(t,n);I(this,Av);I(this,px,void 0);I(this,A6,void 0);I(this,tl,void 0);I(this,N0,void 0);I(this,xf,void 0);I(this,Vc,void 0);I(this,so,void 0);_(this,A6,1),_(this,px,Object.assign({},Jae,n||{})),_(this,tl,[]),_(this,N0,null),_(this,Vc,null),_(this,so,null);{let i=null,a=new Promise(o=>{i=o});_(this,xf,{promise:a,resolve:i})}let s=this._getOption("staticNetwork");typeof s=="boolean"?((0,Ht.assertArgument)(!s||t!=="any","staticNetwork cannot be used on special network 'any'","options",n),s&&t!=null&&_(this,Vc,fF.Network.from(t))):s&&((0,Ht.assertArgument)(t==null||s.matches(t),"staticNetwork MUST match network object","options",n),_(this,Vc,s))}_getOption(t){return l(this,px)[t]}get _network(){return(0,Ht.assert)(l(this,Vc),"network is not available yet","NETWORK_ERROR"),l(this,Vc)}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let s=t.transaction;if(s&&s.type!=null&&(0,Ht.getBigInt)(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){let i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},s,{type:void 0})}))}}let n=this.getRpcRequest(t);return n!=null?await this.send(n.method,n.args):super._perform(t)}async _detectNetwork(){let t=this._getOption("staticNetwork");if(t)if(t===!0){if(l(this,Vc))return l(this,Vc)}else return t;return l(this,so)?await l(this,so):this.ready?(_(this,so,(async()=>{try{let n=fF.Network.from((0,Ht.getBigInt)(await this.send("eth_chainId",[])));return _(this,so,null),n}catch(n){throw _(this,so,null),n}})()),await l(this,so)):(_(this,so,(async()=>{let n={id:$s(this,A6)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let s;try{s=(await this._send(n))[0],_(this,so,null)}catch(i){throw _(this,so,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return fF.Network.from((0,Ht.getBigInt)(s.result));throw this.getRpcError(n,s)})()),await l(this,so))}_start(){l(this,xf)==null||l(this,xf).resolve==null||(l(this,xf).resolve(),_(this,xf,null),(async()=>{for(;l(this,Vc)==null&&!this.destroyed;)try{_(this,Vc,await this._detectNetwork())}catch(t){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",(0,Ht.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await bSe(1e3)}$(this,Av,dF).call(this)})())}async _waitUntilReady(){if(l(this,xf)!=null)return await l(this,xf).promise}_getSubscriber(t){return t.type==="pending"?new Wae.FilterIdPendingSubscriber(this):t.type==="event"?this._getOption("polling")?new lSe.PollingEventSubscriber(this,t.filter):new Wae.FilterIdEventSubscriber(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new zae.UnmanagedSubscriber("orphan"):super._getSubscriber(t)}get ready(){return l(this,xf)==null}getRpcTransaction(t){let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(t[s]==null)return;let i=s;s==="gasLimit"&&(i="gas"),n[i]=(0,Ht.toQuantity)((0,Ht.getBigInt)(t[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{t[s]!=null&&(n[s]=(0,Ht.hexlify)(t[s]))}),t.accessList&&(n.accessList=(0,fSe.accessListify)(t.accessList)),t.blobVersionedHashes&&(n.blobVersionedHashes=t.blobVersionedHashes.map(s=>s.toLowerCase())),n}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[P6(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[P6(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[P6(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[P6(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(P6):t.filter.address=P6(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,n){let{method:s}=t,{error:i}=n;if(s==="eth_estimateGas"&&i.message){let c=i.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return(0,Ht.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){let c=hF(i),u=uSe.AbiCoder.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",t.params[0],c?c.data:null);return u.info={error:i,payload:t},u}let a=JSON.stringify(pSe(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i)){let c={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,Ht.makeError)("user rejected action","ACTION_REJECTED",{action:c[s]||"unknown",reason:"rejected",info:{payload:t,error:i}})}if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){let c=t.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return(0,Ht.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:i}});if(a.match(/nonce/i)&&a.match(/too low/i))return(0,Ht.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:i}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return(0,Ht.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:i}});if(a.match(/only replay-protected/i))return(0,Ht.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:c,info:{error:i}}})}let o=!!a.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?(0,Ht.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:i,payload:t}}):(0,Ht.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:t})}send(t,n){if(this.destroyed)return Promise.reject((0,Ht.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));let s=$s(this,A6)._++,i=new Promise((a,o)=>{l(this,tl).push({resolve:a,reject:o,payload:{method:t,params:n,id:s,jsonrpc:"2.0"}})});return $(this,Av,dF).call(this),i}async getSigner(t){t==null&&(t=0);let n=this.send("eth_accounts",[]);if(typeof t=="number"){let i=await n;if(t>=i.length)throw new Error("no such account");return new _6(this,i[t])}let{accounts:s}=await(0,Ht.resolveProperties)({network:this.getNetwork(),accounts:n});t=(0,bx.getAddress)(t);for(let i of s)if((0,bx.getAddress)(i)===t)return new _6(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new _6(this,n))}destroy(){l(this,N0)&&(clearTimeout(l(this,N0)),_(this,N0,null));for(let{payload:t,reject:n}of l(this,tl))n((0,Ht.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));_(this,tl,[]),super.destroy()}};px=new WeakMap,A6=new WeakMap,tl=new WeakMap,N0=new WeakMap,xf=new WeakMap,Vc=new WeakMap,so=new WeakMap,Av=new WeakSet,dF=function(){if(l(this,N0))return;let t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");_(this,N0,setTimeout(()=>{_(this,N0,null);let n=l(this,tl);for(_(this,tl,[]);n.length;){let s=[n.shift()];for(;n.length&&s.length!==l(this,px).batchMaxCount;)if(s.push(n.shift()),JSON.stringify(s.map(a=>a.payload)).length>l(this,px).batchMaxSize){n.unshift(s.pop());break}(async()=>{let i=s.length===1?s[0].payload:s.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{let a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(let{resolve:o,reject:c,payload:u}of s){if(this.destroyed){c((0,Ht.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}let f=a.filter(d=>d.id===u.id)[0];if(f==null){let d=(0,Ht.makeError)("missing response for request","BAD_DATA",{value:a,info:{payload:u}});this.emit("error",d),c(d);continue}if("error"in f){c(this.getRpcError(u,f));continue}o(f.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(let{reject:o}of s)o(a)}})()}},t))};I0.JsonRpcApiProvider=rO;var _b,nO=class extends rO{constructor(t,n){super(t,n);I(this,_b,void 0);let s=this._getOption("pollingInterval");s==null&&(s=Jae.pollingInterval),_(this,_b,s)}_getSubscriber(t){let n=super._getSubscriber(t);return $ae(n)&&(n.pollingInterval=l(this,_b)),n}get pollingInterval(){return l(this,_b)}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");_(this,_b,t),this._forEachSubscriber(n=>{$ae(n)&&(n.pollingInterval=l(this,_b))})}};_b=new WeakMap;I0.JsonRpcApiPollingProvider=nO;var E6,lF=class extends nO{constructor(t,n,s){t==null&&(t="http://localhost:8545");super(n,s);I(this,E6,void 0);typeof t=="string"?_(this,E6,new Ht.FetchRequest(t)):_(this,E6,t.clone())}_getConnection(){return l(this,E6).clone()}async send(t,n){return await this._start(),await super.send(t,n)}async _send(t){let n=this._getConnection();n.body=JSON.stringify(t),n.setHeader("content-type","application/json");let s=await n.send();s.assertOk();let i=s.bodyJson;return Array.isArray(i)||(i=[i]),i}};E6=new WeakMap;I0.JsonRpcProvider=lF;function hF(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&(0,Ht.isHexString)(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(let e in r){let t=hF(r[e]);if(t)return t}return null}if(typeof r=="string")try{return hF(JSON.parse(r))}catch{}return null}function bF(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(let t in r)bF(r[t],e);if(typeof r=="string")try{return bF(JSON.parse(r),e)}catch{}}}function pSe(r){let e=[];return bF(r,e),e}});var gF=R(iO=>{"use strict";b();p();Object.defineProperty(iO,"__esModule",{value:!0});iO.AnkrProvider=void 0;var pF=Ne(),gSe=el(),xSe=ro(),ySe=zc(),sO="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function mSe(r){switch(r){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,pF.assertArgument)(!1,"unsupported network","network",r)}var S6=class extends ySe.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=xSe.Network.from(t);n==null&&(n=sO);let i={polling:!0,staticNetwork:s},a=S6.getRequest(s,n);super(a,s,i);N(this,"apiKey");(0,pF.defineProperties)(this,{apiKey:n})}_getProvider(t){try{return new S6(t,this.apiKey)}catch{}return super._getProvider(t)}static getRequest(t,n){n==null&&(n=sO);let s=new pF.FetchRequest(`https://${mSe(t.name)}/${n}`);return s.allowGzip=!0,n===sO&&(s.retryFunc=async(i,a,o)=>((0,gSe.showThrottleMessage)("AnkrProvider"),!0)),s}getRpcError(t,n){return t.method==="eth_sendRawTransaction"&&n&&n.error&&n.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(n.error.message="replacement transaction underpriced"),super.getRpcError(t,n)}isCommunityResource(){return this.apiKey===sO}};iO.AnkrProvider=S6});var xF=R(oO=>{"use strict";b();p();Object.defineProperty(oO,"__esModule",{value:!0});oO.AlchemyProvider=void 0;var T6=Ne(),wSe=el(),vSe=ro(),PSe=zc(),aO="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function _Se(r){switch(r){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,T6.assertArgument)(!1,"unsupported network","network",r)}var O6=class extends PSe.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=vSe.Network.from(t);n==null&&(n=aO);let i=O6.getRequest(s,n);super(i,s,{staticNetwork:s});N(this,"apiKey");(0,T6.defineProperties)(this,{apiKey:n})}_getProvider(t){try{return new O6(t,this.apiKey)}catch{}return super._getProvider(t)}async _perform(t){if(t.method==="getTransactionResult"){let{trace:n,tx:s}=await(0,T6.resolveProperties)({trace:this.send("trace_transaction",[t.hash]),tx:this.getTransaction(t.hash)});if(n==null||s==null)return null;let i,a=!1;try{i=n[0].result.output,a=n[0].error==="Reverted"}catch{}if(i)return(0,T6.assert)(!a,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:s,invocation:null,revert:null}),i;(0,T6.assert)(!1,"could not parse trace result","BAD_DATA",{value:n})}return await super._perform(t)}isCommunityResource(){return this.apiKey===aO}static getRequest(t,n){n==null&&(n=aO);let s=new T6.FetchRequest(`https://${_Se(t.name)}/v2/${n}`);return s.allowGzip=!0,n===aO&&(s.retryFunc=async(i,a,o)=>((0,wSe.showThrottleMessage)("alchemy"),!0)),s}};oO.AlchemyProvider=O6});var yF=R(fO=>{"use strict";b();p();Object.defineProperty(fO,"__esModule",{value:!0});fO.ChainstackProvider=void 0;var uO=Ne(),ASe=el(),ESe=ro(),SSe=zc();function cO(r){switch(r){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}(0,uO.assertArgument)(!1,"unsupported network","network",r)}function TSe(r){switch(r){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}(0,uO.assertArgument)(!1,"unsupported network","network",r)}var B6=class extends SSe.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=ESe.Network.from(t);n==null&&(n=cO(s.name));let i=B6.getRequest(s,n);super(i,s,{staticNetwork:s});N(this,"apiKey");(0,uO.defineProperties)(this,{apiKey:n})}_getProvider(t){try{return new B6(t,this.apiKey)}catch{}return super._getProvider(t)}isCommunityResource(){return this.apiKey===cO(this._network.name)}static getRequest(t,n){n==null&&(n=cO(t.name));let s=new uO.FetchRequest(`https://${TSe(t.name)}/${n}`);return s.allowGzip=!0,n===cO(t.name)&&(s.retryFunc=async(i,a,o)=>((0,ASe.showThrottleMessage)("ChainstackProvider"),!0)),s}};fO.ChainstackProvider=B6});var wF=R(dO=>{"use strict";b();p();Object.defineProperty(dO,"__esModule",{value:!0});dO.CloudflareProvider=void 0;var OSe=Ne(),BSe=ro(),kSe=zc(),mF=class extends kSe.JsonRpcProvider{constructor(e){e==null&&(e="mainnet");let t=BSe.Network.from(e);(0,OSe.assertArgument)(t.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}};dO.CloudflareProvider=mF});var PF=R(N6=>{"use strict";b();p();Object.defineProperty(N6,"__esModule",{value:!0});N6.EtherscanProvider=N6.EtherscanPlugin=void 0;var NSe=J3(),ISe=nv(),Zae=Qa(),ks=Ne(),RSe=x6(),jSe=ro(),MSe=FT(),CSe=el(),Qae=2e3;function LSe(r){return r&&typeof r.then=="function"}var Yae="org.ethers.plugins.provider.Etherscan",Ev=class extends MSe.NetworkPlugin{constructor(t){super(Yae);N(this,"baseUrl");(0,ks.defineProperties)(this,{baseUrl:t})}clone(){return new Ev(this.baseUrl)}};N6.EtherscanPlugin=Ev;var USe=["enableCcipRead"],FSe=1,k6,vF=class extends RSe.AbstractProvider{constructor(t,n){let s=n??null;super();N(this,"network");N(this,"apiKey");I(this,k6,void 0);let i=jSe.Network.from(t);_(this,k6,i.getPlugin(Yae)),(0,ks.defineProperties)(this,{apiKey:s,network:i}),this.getBaseUrl()}getBaseUrl(){if(l(this,k6))return l(this,k6).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";default:}(0,ks.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(t,n){let s=Object.keys(n).reduce((a,o)=>{let c=n[o];return c!=null&&(a+=`&${o}=${c}`),a},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${t}${s}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(t,n){return n.module=t,n.apikey=this.apiKey,n}async detectNetwork(){return this.network}async fetch(t,n,s){let i=FSe++,a=s?this.getPostUrl():this.getUrl(t,n),o=s?this.getPostData(t,n):null;this.emit("debug",{action:"sendRequest",id:i,url:a,payload:o});let c=new ks.FetchRequest(a);c.setThrottleParams({slotInterval:1e3}),c.retryFunc=(d,g,h)=>(this.isCommunityResource()&&(0,CSe.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),c.processFunc=async(d,g)=>{let h=g.hasBody()?JSON.parse((0,ks.toUtf8String)(g.body)):{},m=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return t==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&m&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:h}),g.throwThrottleError(h.result,Qae)):m&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:h.result}),g.throwThrottleError(h.result,Qae)),g},o&&(c.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),c.body=Object.keys(o).map(d=>`${d}=${o[d]}`).join("&"));let u=await c.send();try{u.assertOk()}catch(d){this.emit("debug",{action:"receiveError",id:i,error:d,reason:"assertOk"}),(0,ks.assert)(!1,"response error","SERVER_ERROR",{request:c,response:u})}u.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),(0,ks.assert)(!1,"missing response","SERVER_ERROR",{request:c,response:u}));let f=JSON.parse((0,ks.toUtf8String)(u.body));return t==="proxy"?(f.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:f,reason:"invalid JSON-RPC"}),(0,ks.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:c,response:u,info:{result:f}})),f.error&&(this.emit("debug",{action:"receiveError",id:i,result:f,reason:"JSON-RPC error"}),(0,ks.assert)(!1,"error response","SERVER_ERROR",{request:c,response:u,info:{result:f}})),this.emit("debug",{action:"receiveRequest",id:i,result:f}),f.result):f.status==0&&(f.message==="No records found"||f.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:f}),f.result):((f.status!=1||typeof f.message=="string"&&!f.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:f}),(0,ks.assert)(!1,"error response","SERVER_ERROR",{request:c,response:u,info:{result:f}})),this.emit("debug",{action:"receiveRequest",id:i,result:f}),f.result)}_getTransactionPostData(t){let n={};for(let s in t){if(USe.indexOf(s)>=0||t[s]==null)continue;let i=t[s];if(!(s==="type"&&i===0)&&!(s==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[s])i=(0,ks.toQuantity)(i);else if(s==="accessList")i="["+(0,Zae.accessListify)(i).map(a=>`{address:"${a.address}",storageKeys:["${a.storageKeys.join('","')}"]}`).join(",")+"]";else if(s==="blobVersionedHashes"){if(i.length===0)continue;(0,ks.assert)(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:t}})}else i=(0,ks.hexlify)(i);n[s]=i}}return n}_checkError(t,n,s){let i="";if((0,ks.isError)(n,"SERVER_ERROR")){try{i=n.info.result.error.message}catch{}if(!i)try{i=n.info.message}catch{}}if(t.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&(0,ks.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.transaction}),(t.method==="call"||t.method==="estimateGas")&&i.match(/execution reverted/i)){let a="";try{a=n.info.result.error.data}catch{}let o=NSe.AbiCoder.getBuiltinCallException(t.method,t.transaction,a);throw o.info={request:t,error:n},o}if(i&&t.method==="broadcastTransaction"){let a=Zae.Transaction.from(t.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&(0,ks.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a}),i.match(/insufficient funds/)&&(0,ks.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,ks.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:a})}throw n}async _detectNetwork(){return this.network}async _perform(t){switch(t.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch(n=>this._checkError(t,n,t.signedTransaction));case"getBlock":if("blockTag"in t)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});(0,ks.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.hash});case"call":{if(t.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");let n=this._getTransactionPostData(t.transaction);n.module="proxy",n.action="eth_call";try{return await this.fetch("proxy",n,!0)}catch(s){return this._checkError(t,s,t.transaction)}}case"estimateGas":{let n=this._getTransactionPostData(t.transaction);n.module="proxy",n.action="eth_estimateGas";try{return await this.fetch("proxy",n,!0)}catch(s){return this._checkError(t,s,t.transaction)}}default:break}return super._perform(t)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(t){let n=this._getAddress(t);LSe(n)&&(n=await n);try{let s=await this.fetch("contract",{action:"getabi",address:n}),i=JSON.parse(s);return new ISe.Contract(n,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}};k6=new WeakMap;N6.EtherscanProvider=vF});var Xae=R(lO=>{"use strict";b();p();Object.defineProperty(lO,"__esModule",{value:!0});lO.WebSocket=void 0;function qSe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}var DSe=qSe().WebSocket;lO.WebSocket=DSe});var gO=R(Wc=>{"use strict";b();p();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.SocketProvider=Wc.SocketEventSubscriber=Wc.SocketPendingSubscriber=Wc.SocketBlockSubscriber=Wc.SocketSubscriber=void 0;var eoe=x6(),Sv=Ne(),HSe=zc(),R0,Tv,Ab,gx,Eb,R6=class{constructor(e,t){I(this,R0,void 0);I(this,Tv,void 0);I(this,Ab,void 0);I(this,gx,void 0);I(this,Eb,void 0);_(this,R0,e),_(this,Tv,JSON.stringify(t)),_(this,Ab,null),_(this,gx,null),_(this,Eb,null)}get filter(){return JSON.parse(l(this,Tv))}start(){_(this,Ab,l(this,R0).send("eth_subscribe",this.filter).then(e=>(l(this,R0)._register(e,this),e)))}stop(){l(this,Ab).then(e=>{l(this,R0).destroyed||l(this,R0).send("eth_unsubscribe",[e])}),_(this,Ab,null)}pause(e){(0,Sv.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),_(this,gx,!!e)}resume(){_(this,gx,null)}_handleMessage(e){if(l(this,Ab)!=null&&l(this,gx)===null){let t=l(this,Eb);t==null?t=this._emit(l(this,R0),e):t=t.then(async()=>{await this._emit(l(this,R0),e)}),_(this,Eb,t.then(()=>{l(this,Eb)===t&&_(this,Eb,null)}))}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}};R0=new WeakMap,Tv=new WeakMap,Ab=new WeakMap,gx=new WeakMap,Eb=new WeakMap;Wc.SocketSubscriber=R6;var hO=class extends R6{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}};Wc.SocketBlockSubscriber=hO;var bO=class extends R6{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}};Wc.SocketPendingSubscriber=bO;var Ov,pO=class extends R6{constructor(t,n){super(t,["logs",n]);I(this,Ov,void 0);_(this,Ov,JSON.stringify(n))}get logFilter(){return JSON.parse(l(this,Ov))}async _emit(t,n){t.emit(this.logFilter,t._wrapLog(n,t._network))}};Ov=new WeakMap;Wc.SocketEventSubscriber=pO;var xx,I6,Sb,_F=class extends HSe.JsonRpcApiProvider{constructor(t,n){let s=Object.assign({},n??{});(0,Sv.assertArgument)(s.batchMaxCount==null||s.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",n),s.batchMaxCount=1,s.staticNetwork==null&&(s.staticNetwork=!0);super(t,s);I(this,xx,void 0);I(this,I6,void 0);I(this,Sb,void 0);_(this,xx,new Map),_(this,I6,new Map),_(this,Sb,new Map)}_getSubscriber(t){switch(t.type){case"close":return new eoe.UnmanagedSubscriber("close");case"block":return new hO(this);case"pending":return new bO(this);case"event":return new pO(this,t.filter);case"orphan":if(t.filter.orphan==="drop-log")return new eoe.UnmanagedSubscriber("drop-log")}return super._getSubscriber(t)}_register(t,n){l(this,I6).set(t,n);let s=l(this,Sb).get(t);if(s){for(let i of s)n._handleMessage(i);l(this,Sb).delete(t)}}async _send(t){(0,Sv.assertArgument)(!Array.isArray(t),"WebSocket does not support batch send","payload",t);let n=new Promise((s,i)=>{l(this,xx).set(t.id,{payload:t,resolve:s,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(t)),[await n]}async _processMessage(t){let n=JSON.parse(t);if(n&&typeof n=="object"&&"id"in n){let s=l(this,xx).get(n.id);if(s==null){this.emit("error",(0,Sv.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:n}));return}l(this,xx).delete(n.id),s.resolve(n)}else if(n&&n.method==="eth_subscription"){let s=n.params.subscription,i=l(this,I6).get(s);if(i)i._handleMessage(n.params.result);else{let a=l(this,Sb).get(s);a==null&&(a=[],l(this,Sb).set(s,a)),a.push(n.params.result)}}else{this.emit("error",(0,Sv.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:n}));return}}async _write(t){throw new Error("sub-classes must override this")}};xx=new WeakMap,I6=new WeakMap,Sb=new WeakMap;Wc.SocketProvider=_F});var yO=R(xO=>{"use strict";b();p();Object.defineProperty(xO,"__esModule",{value:!0});xO.WebSocketProvider=void 0;var KSe=Xae(),GSe=gO(),yx,yf,AF=class extends GSe.SocketProvider{constructor(t,n,s){super(n,s);I(this,yx,void 0);I(this,yf,void 0);typeof t=="string"?(_(this,yx,()=>new KSe.WebSocket(t)),_(this,yf,l(this,yx).call(this))):typeof t=="function"?(_(this,yx,t),_(this,yf,t())):(_(this,yx,null),_(this,yf,t)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(l(this,yf)==null)throw new Error("websocket closed");return l(this,yf)}async _write(t){this.websocket.send(t)}async destroy(){l(this,yf)!=null&&(l(this,yf).close(),_(this,yf,null)),super.destroy()}};yx=new WeakMap,yf=new WeakMap;xO.WebSocketProvider=AF});var EF=R(j6=>{"use strict";b();p();Object.defineProperty(j6,"__esModule",{value:!0});j6.InfuraProvider=j6.InfuraWebSocketProvider=void 0;var kv=Ne(),VSe=el(),zSe=ro(),WSe=zc(),$Se=yO(),Bv="84842078b09946638c03157f83405213";function JSe(r){switch(r){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,kv.assertArgument)(!1,"unsupported network","network",r)}var mO=class extends $Se.WebSocketProvider{constructor(t,n){let s=new mx(t,n),i=s._getConnection();(0,kv.assert)(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});let a=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(a,s._network);N(this,"projectId");N(this,"projectSecret");(0,kv.defineProperties)(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===Bv}};j6.InfuraWebSocketProvider=mO;var mx=class extends WSe.JsonRpcProvider{constructor(t,n,s){t==null&&(t="mainnet");let i=zSe.Network.from(t);n==null&&(n=Bv),s==null&&(s=null);let a=mx.getRequest(i,n,s);super(a,i,{staticNetwork:i});N(this,"projectId");N(this,"projectSecret");(0,kv.defineProperties)(this,{projectId:n,projectSecret:s})}_getProvider(t){try{return new mx(t,this.projectId,this.projectSecret)}catch{}return super._getProvider(t)}isCommunityResource(){return this.projectId===Bv}static getWebSocketProvider(t,n){return new mO(t,n)}static getRequest(t,n,s){n==null&&(n=Bv),s==null&&(s=null);let i=new kv.FetchRequest(`https://${JSe(t.name)}/v3/${n}`);return i.allowGzip=!0,s&&i.setCredentials("",s),n===Bv&&(i.retryFunc=async(a,o,c)=>((0,VSe.showThrottleMessage)("InfuraProvider"),!0)),i}};j6.InfuraProvider=mx});var TF=R(vO=>{"use strict";b();p();Object.defineProperty(vO,"__esModule",{value:!0});vO.QuickNodeProvider=void 0;var SF=Ne(),ZSe=el(),QSe=ro(),YSe=zc(),wO="919b412a057b5e9c9b6dce193c5a60242d6efadb";function XSe(r){switch(r){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,SF.assertArgument)(!1,"unsupported network","network",r)}var M6=class extends YSe.JsonRpcProvider{constructor(t,n){t==null&&(t="mainnet");let s=QSe.Network.from(t);n==null&&(n=wO);let i=M6.getRequest(s,n);super(i,s,{staticNetwork:s});N(this,"token");(0,SF.defineProperties)(this,{token:n})}_getProvider(t){try{return new M6(t,this.token)}catch{}return super._getProvider(t)}isCommunityResource(){return this.token===wO}static getRequest(t,n){n==null&&(n=wO);let s=new SF.FetchRequest(`https://${XSe(t.name)}/${n}`);return s.allowGzip=!0,n===wO&&(s.retryFunc=async(i,a,o)=>((0,ZSe.showThrottleMessage)("QuickNodeProvider"),!0)),s}};vO.QuickNodeProvider=M6});var CF=R(SO=>{"use strict";b();p();Object.defineProperty(SO,"__esModule",{value:!0});SO.FallbackProvider=void 0;var mf=Ne(),toe=x6(),eTe=ro(),tTe=BigInt("1"),rTe=BigInt("2");function nTe(r){for(let e=r.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1)),n=r[e];r[e]=r[t],r[t]=n}}function sTe(r){return new Promise(e=>{setTimeout(e,r)})}function NF(){return new Date().getTime()}function OF(r){return JSON.stringify(r,(e,t)=>typeof t=="bigint"?{type:"bigint",value:t.toString()}:t)}var roe={stallTimeout:400,priority:1,weight:1},noe={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function iTe(r,e){for(;(r.blockNumber<0||r.blockNumber<e)&&(r._updateNumber||(r._updateNumber=(async()=>{try{let t=await r.provider.getBlockNumber();t>r.blockNumber&&(r.blockNumber=t)}catch(t){r.blockNumber=-2,r._lastFatalError=t,r._lastFatalErrorTimestamp=NF()}r._updateNumber=null})()),await r._updateNumber,r.outOfSync++,!r._lastFatalError););}function Nv(r){if(r==null)return"null";if(Array.isArray(r))return"["+r.map(Nv).join(",")+"]";if(typeof r=="object"&&typeof r.toJSON=="function")return Nv(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":case"number":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{"+e.map(t=>`${JSON.stringify(t)}:${Nv(r[t])}`).join(",")+"}"}}throw console.log("Could not serialize",r),new Error("Hmm...")}function BF(r){if("error"in r){let t=r.error;return{tag:Nv(t),value:t}}let e=r.result;return{tag:Nv(e),value:e}}function PO(r,e){let t=new Map;for(let{value:s,tag:i,weight:a}of e){let o=t.get(i)||{value:s,weight:0};o.weight+=a,t.set(i,o)}let n=null;for(let s of t.values())s.weight>=r&&(!n||s.weight>n.weight)&&(n=s);if(n)return n.value}function IF(r,e){let t=0,n=new Map,s=null,i=[];for(let{value:o,tag:c,weight:u}of e)if(o instanceof Error){let f=n.get(c)||{value:o,weight:0};f.weight+=u,n.set(c,f),(s==null||f.weight>s.weight)&&(s=f)}else i.push(BigInt(o)),t+=u;if(t<r)return s&&s.weight>=r?s.value:void 0;i.sort((o,c)=>o<c?-1:c>o?1:0);let a=Math.floor(i.length/2);return i.length%2?i[a]:(i[a-1]+i[a]+tTe)/rTe}function kF(r,e){let t=PO(r,e);if(t!==void 0)return t;for(let n of e)if(n.value)return n.value}function aTe(r,e){if(r===1)return(0,mf.getNumber)(IF(r,e),"%internal");let t=new Map,n=(a,o)=>{let c=t.get(a)||{result:a,weight:0};c.weight+=o,t.set(a,c)};for(let{weight:a,value:o}of e){let c=(0,mf.getNumber)(o);n(c-1,a),n(c,a),n(c+1,a)}let s=0,i;for(let{weight:a,result:o}of t.values())a>=r&&(a>s||i!=null&&a===s&&o>i)&&(s=a,i=o);return i}var io,rl,C6,_O,soe,Iv,jF,AO,ioe,EO,aoe,Rv,MF,RF=class extends toe.AbstractProvider{constructor(t,n,s){super(n,s);I(this,_O);I(this,Iv);I(this,AO);I(this,EO);I(this,Rv);N(this,"quorum");N(this,"eventQuorum");N(this,"eventWorkers");I(this,io,void 0);I(this,rl,void 0);I(this,C6,void 0);_(this,io,t.map(i=>i instanceof toe.AbstractProvider?Object.assign({provider:i},roe,noe):Object.assign({},roe,i,noe))),_(this,rl,-2),_(this,C6,null),s&&s.quorum!=null?this.quorum=s.quorum:this.quorum=Math.ceil(l(this,io).reduce((i,a)=>(i+=a.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,mf.assertArgument)(this.quorum<=l(this,io).reduce((i,a)=>i+a.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return l(this,io).map(t=>{let n=Object.assign({},t);for(let s in n)s[0]==="_"&&delete n[s];return n})}async _detectNetwork(){return eTe.Network.from((0,mf.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(t,n){switch(n.method){case"broadcastTransaction":return await t.broadcastTransaction(n.signedTransaction);case"call":return await t.call(Object.assign({},n.transaction,{blockTag:n.blockTag}));case"chainId":return(await t.getNetwork()).chainId;case"estimateGas":return await t.estimateGas(n.transaction);case"getBalance":return await t.getBalance(n.address,n.blockTag);case"getBlock":{let s="blockHash"in n?n.blockHash:n.blockTag;return await t.getBlock(s,n.includeTransactions)}case"getBlockNumber":return await t.getBlockNumber();case"getCode":return await t.getCode(n.address,n.blockTag);case"getGasPrice":return(await t.getFeeData()).gasPrice;case"getPriorityFee":return(await t.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await t.getLogs(n.filter);case"getStorage":return await t.getStorage(n.address,n.position,n.blockTag);case"getTransaction":return await t.getTransaction(n.hash);case"getTransactionCount":return await t.getTransactionCount(n.address,n.blockTag);case"getTransactionReceipt":return await t.getTransactionReceipt(n.hash);case"getTransactionResult":return await t.getTransactionResult(n.hash)}}async _perform(t){if(t.method==="broadcastTransaction"){let a=l(this,io).map(u=>null),o=l(this,io).map(async({provider:u,weight:f},d)=>{try{let g=await u._perform(t);a[d]=Object.assign(BF({result:g}),{weight:f})}catch(g){a[d]=Object.assign(BF({error:g}),{weight:f})}});for(;;){let u=a.filter(g=>g!=null);for(let{value:g}of u)if(!(g instanceof Error))return g;let f=PO(this.quorum,a.filter(g=>g!=null));if((0,mf.isError)(f,"INSUFFICIENT_FUNDS"))throw f;let d=o.filter((g,h)=>a[h]==null);if(d.length===0)break;await Promise.race(d)}let c=kF(this.quorum,a);if((0,mf.assert)(c!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:a.map(OF)}}),c instanceof Error)throw c;return c}await $(this,AO,ioe).call(this);let n=new Set,s=0;for(;;){let a=$(this,Iv,jF).call(this,n,t);if(a==null||(s+=a.config.weight,s>=this.quorum))break}let i=await $(this,Rv,MF).call(this,n,t);for(let a of n)a.perform&&a.result==null&&a.config.lateResponses++;return i}async destroy(){for(let{provider:t}of l(this,io))t.destroy();super.destroy()}};io=new WeakMap,rl=new WeakMap,C6=new WeakMap,_O=new WeakSet,soe=function(t){let n=Array.from(t).map(i=>i.config),s=l(this,io).slice();nTe(s),s.sort((i,a)=>i.priority-a.priority);for(let i of s)if(!i._lastFatalError&&n.indexOf(i)===-1)return i;return null},Iv=new WeakSet,jF=function(t,n){let s=$(this,_O,soe).call(this,t);if(s==null)return null;let i={config:s,result:null,didBump:!1,perform:null,staller:null},a=NF();return i.perform=(async()=>{try{s.requests++;let c=await this._translatePerform(s.provider,n);i.result={result:c}}catch(c){s.errorResponses++,i.result={error:c}}let o=NF()-a;s._totalTime+=o,s.rollingDuration=.95*s.rollingDuration+.05*o,i.perform=null})(),i.staller=(async()=>{await sTe(s.stallTimeout),i.staller=null})(),t.add(i),i},AO=new WeakSet,ioe=async function(){let t=l(this,C6);if(!t){let n=[];l(this,io).forEach(s=>{n.push((async()=>{await iTe(s,0),s._lastFatalError||(s._network=await s.provider.getNetwork())})())}),_(this,C6,t=(async()=>{await Promise.all(n);let s=null;for(let i of l(this,io)){if(i._lastFatalError)continue;let a=i._network;s==null?s=a.chainId:a.chainId!==s&&(0,mf.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await t},EO=new WeakSet,aoe=async function(t,n){let s=[];for(let i of t)if(i.result!=null){let{tag:a,value:o}=BF(i.result);s.push({tag:a,value:o,weight:i.config.weight})}if(!(s.reduce((i,a)=>i+a.weight,0)<this.quorum)){switch(n.method){case"getBlockNumber":{l(this,rl)===-2&&_(this,rl,Math.ceil((0,mf.getNumber)(IF(this.quorum,l(this,io).filter(a=>!a._lastFatalError).map(a=>({value:a.blockNumber,tag:(0,mf.getNumber)(a.blockNumber).toString(),weight:a.weight}))))));let i=aTe(this.quorum,s);return i===void 0?void 0:(i>l(this,rl)&&_(this,rl,i),l(this,rl))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return IF(this.quorum,s);case"getBlock":return"blockTag"in n&&n.blockTag==="pending"?kF(this.quorum,s):PO(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return PO(this.quorum,s);case"broadcastTransaction":return kF(this.quorum,s)}(0,mf.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${OF(n.method)})`})}},Rv=new WeakSet,MF=async function(t,n){if(t.size===0)throw new Error("no runners?!");let s=[],i=0;for(let o of t){if(o.perform&&s.push(o.perform),o.staller){s.push(o.staller);continue}o.didBump||(o.didBump=!0,i++)}let a=await $(this,EO,aoe).call(this,t,n);if(a!==void 0){if(a instanceof Error)throw a;return a}for(let o=0;o<i;o++)$(this,Iv,jF).call(this,t,n);return(0,mf.assert)(s.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:n,results:Array.from(t).map(o=>OF(o.result))}}),await Promise.race(s),await $(this,Rv,MF).call(this,t,n)};SO.FallbackProvider=RF});var ooe=R(TO=>{"use strict";b();p();Object.defineProperty(TO,"__esModule",{value:!0});TO.getDefaultProvider=void 0;var oTe=Ne(),cTe=gF(),uTe=xF(),fTe=yF(),dTe=wF(),lTe=PF(),hTe=EF(),bTe=TF(),pTe=CF(),LF=zc(),gTe=ro(),xTe=yO();function yTe(r){return r&&typeof r.send=="function"&&typeof r.close=="function"}var mTe="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function wTe(r,e){e==null&&(e={});let t=a=>e[a]==="-"?!1:typeof e.exclusive=="string"?a===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(a)!==-1:!0;if(typeof r=="string"&&r.match(/^https?:/))return new LF.JsonRpcProvider(r);if(typeof r=="string"&&r.match(/^wss?:/)||yTe(r))return new xTe.WebSocketProvider(r);let n=null;try{n=gTe.Network.from(r)}catch{}let s=[];if(t("publicPolygon")&&n&&(n.name==="matic"?s.push(new LF.JsonRpcProvider("https://polygon-rpc.com/",n,{staticNetwork:n})):n.name==="matic-amoy"&&s.push(new LF.JsonRpcProvider("https://rpc-amoy.polygon.technology/",n,{staticNetwork:n}))),t("alchemy"))try{s.push(new uTe.AlchemyProvider(r,e.alchemy))}catch{}if(t("ankr")&&e.ankr!=null)try{s.push(new cTe.AnkrProvider(r,e.ankr))}catch{}if(t("chainstack"))try{s.push(new fTe.ChainstackProvider(r,e.chainstack))}catch{}if(t("cloudflare"))try{s.push(new dTe.CloudflareProvider(r))}catch{}if(t("etherscan"))try{s.push(new lTe.EtherscanProvider(r,e.etherscan))}catch{}if(t("infura"))try{let a=e.infura,o;typeof a=="object"&&(o=a.projectSecret,a=a.projectId),s.push(new hTe.InfuraProvider(r,a,o))}catch{}if(t("quicknode"))try{let a=e.quicknode;s.push(new bTe.QuickNodeProvider(r,a))}catch{}if((0,oTe.assert)(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),n&&mTe.indexOf(n.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new pTe.FallbackProvider(s,void 0,{quorum:i})}TO.getDefaultProvider=wTe});var coe=R(OO=>{"use strict";b();p();Object.defineProperty(OO,"__esModule",{value:!0});OO.NonceManager=void 0;var vTe=Ne(),PTe=XT(),Tb,wx,FF=class extends PTe.AbstractSigner{constructor(t){super(t.provider);N(this,"signer");I(this,Tb,void 0);I(this,wx,void 0);(0,vTe.defineProperties)(this,{signer:t}),_(this,Tb,null),_(this,wx,0)}async getAddress(){return this.signer.getAddress()}connect(t){return new FF(this.signer.connect(t))}async getNonce(t){if(t==="pending"){l(this,Tb)==null&&_(this,Tb,super.getNonce("pending"));let n=l(this,wx);return await l(this,Tb)+n}return super.getNonce(t)}increment(){$s(this,wx)._++}reset(){_(this,wx,0),_(this,Tb,null)}async sendTransaction(t){let n=this.getNonce("pending");return this.increment(),t=await this.signer.populateTransaction(t),t.nonce=await n,await this.signer.sendTransaction(t)}signTransaction(t){return this.signer.signTransaction(t)}signMessage(t){return this.signer.signMessage(t)}signTypedData(t,n,s){return this.signer.signTypedData(t,n,s)}},UF=FF;Tb=new WeakMap,wx=new WeakMap;OO.NonceManager=UF});var foe=R(BO=>{"use strict";b();p();Object.defineProperty(BO,"__esModule",{value:!0});BO.BrowserProvider=void 0;var uoe=Ne(),_Te=zc(),L6,qF=class extends _Te.JsonRpcApiPollingProvider{constructor(t,n,s){let i=Object.assign({},s??{},{batchMaxCount:1});(0,uoe.assertArgument)(t&&t.request,"invalid EIP-1193 provider","ethereum",t);super(n,i);I(this,L6,void 0);_(this,L6,async(a,o)=>{let c={method:a,params:o};this.emit("debug",{action:"sendEip1193Request",payload:c});try{let u=await t.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:u}),u}catch(u){let f=new Error(u.message);throw f.code=u.code,f.data=u.data,f.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:f}),f}})}async send(t,n){return await this._start(),await super.send(t,n)}async _send(t){(0,uoe.assertArgument)(!Array.isArray(t),"EIP-1193 does not support batch request","payload",t);try{let n=await l(this,L6).call(this,t.method,t.params||[]);return[{id:t.id,result:n}]}catch(n){return[{id:t.id,error:{code:n.code,data:n.data,message:n.message}}]}}getRpcError(t,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(t,n)}async hasSigner(t){t==null&&(t=0);let n=await this.send("eth_accounts",[]);return typeof t=="number"?n.length>t:(t=t.toLowerCase(),n.filter(s=>s.toLowerCase()===t).length!==0)}async getSigner(t){if(t==null&&(t=0),!await this.hasSigner(t))try{await l(this,L6).call(this,"eth_requestAccounts",[])}catch(n){let s=n.payload;throw this.getRpcError(s,{id:s.id,error:n})}return await super.getSigner(t)}};L6=new WeakMap;BO.BrowserProvider=qF});var doe=R(NO=>{"use strict";b();p();Object.defineProperty(NO,"__esModule",{value:!0});NO.PocketProvider=void 0;var DF=Ne(),ATe=el(),ETe=ro(),STe=zc(),kO="62e1ad51b37b8e00394bda3b";function TTe(r){switch(r){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,DF.assertArgument)(!1,"unsupported network","network",r)}var U6=class extends STe.JsonRpcProvider{constructor(t,n,s){t==null&&(t="mainnet");let i=ETe.Network.from(t);n==null&&(n=kO),s==null&&(s=null);let a={staticNetwork:i},o=U6.getRequest(i,n,s);super(o,i,a);N(this,"applicationId");N(this,"applicationSecret");(0,DF.defineProperties)(this,{applicationId:n,applicationSecret:s})}_getProvider(t){try{return new U6(t,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(t)}static getRequest(t,n,s){n==null&&(n=kO);let i=new DF.FetchRequest(`https://${TTe(t.name)}/v1/lb/${n}`);return i.allowGzip=!0,s&&i.setCredentials("",s),n===kO&&(i.retryFunc=async(a,o,c)=>((0,ATe.showThrottleMessage)("PocketProvider"),!0)),i}isCommunityResource(){return this.applicationId===kO}};NO.PocketProvider=U6});var loe=R(IO=>{"use strict";b();p();Object.defineProperty(IO,"__esModule",{value:!0});IO.IpcSocketProvider=void 0;var OTe=void 0;IO.IpcSocketProvider=OTe});var jO=R(me=>{"use strict";b();p();Object.defineProperty(me,"__esModule",{value:!0});me.SocketEventSubscriber=me.SocketPendingSubscriber=me.SocketBlockSubscriber=me.SocketSubscriber=me.WebSocketProvider=me.SocketProvider=me.IpcSocketProvider=me.QuickNodeProvider=me.PocketProvider=me.InfuraWebSocketProvider=me.InfuraProvider=me.EtherscanPlugin=me.EtherscanProvider=me.ChainstackProvider=me.CloudflareProvider=me.AnkrProvider=me.AlchemyProvider=me.BrowserProvider=me.JsonRpcSigner=me.JsonRpcProvider=me.JsonRpcApiProvider=me.FallbackProvider=me.copyRequest=me.TransactionResponse=me.TransactionReceipt=me.Log=me.FeeData=me.Block=me.FetchUrlFeeDataNetworkPlugin=me.FeeDataNetworkPlugin=me.EnsPlugin=me.GasCostPlugin=me.NetworkPlugin=me.NonceManager=me.Network=me.MulticoinProviderPlugin=me.EnsResolver=me.getDefaultProvider=me.showThrottleMessage=me.VoidSigner=me.AbstractSigner=me.UnmanagedSubscriber=me.AbstractProvider=void 0;var hoe=x6();Object.defineProperty(me,"AbstractProvider",{enumerable:!0,get:function(){return hoe.AbstractProvider}});Object.defineProperty(me,"UnmanagedSubscriber",{enumerable:!0,get:function(){return hoe.UnmanagedSubscriber}});var boe=XT();Object.defineProperty(me,"AbstractSigner",{enumerable:!0,get:function(){return boe.AbstractSigner}});Object.defineProperty(me,"VoidSigner",{enumerable:!0,get:function(){return boe.VoidSigner}});var BTe=el();Object.defineProperty(me,"showThrottleMessage",{enumerable:!0,get:function(){return BTe.showThrottleMessage}});var kTe=ooe();Object.defineProperty(me,"getDefaultProvider",{enumerable:!0,get:function(){return kTe.getDefaultProvider}});var poe=qU();Object.defineProperty(me,"EnsResolver",{enumerable:!0,get:function(){return poe.EnsResolver}});Object.defineProperty(me,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return poe.MulticoinProviderPlugin}});var NTe=ro();Object.defineProperty(me,"Network",{enumerable:!0,get:function(){return NTe.Network}});var ITe=coe();Object.defineProperty(me,"NonceManager",{enumerable:!0,get:function(){return ITe.NonceManager}});var jv=FT();Object.defineProperty(me,"NetworkPlugin",{enumerable:!0,get:function(){return jv.NetworkPlugin}});Object.defineProperty(me,"GasCostPlugin",{enumerable:!0,get:function(){return jv.GasCostPlugin}});Object.defineProperty(me,"EnsPlugin",{enumerable:!0,get:function(){return jv.EnsPlugin}});Object.defineProperty(me,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return jv.FeeDataNetworkPlugin}});Object.defineProperty(me,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return jv.FetchUrlFeeDataNetworkPlugin}});var F6=Q3();Object.defineProperty(me,"Block",{enumerable:!0,get:function(){return F6.Block}});Object.defineProperty(me,"FeeData",{enumerable:!0,get:function(){return F6.FeeData}});Object.defineProperty(me,"Log",{enumerable:!0,get:function(){return F6.Log}});Object.defineProperty(me,"TransactionReceipt",{enumerable:!0,get:function(){return F6.TransactionReceipt}});Object.defineProperty(me,"TransactionResponse",{enumerable:!0,get:function(){return F6.TransactionResponse}});Object.defineProperty(me,"copyRequest",{enumerable:!0,get:function(){return F6.copyRequest}});var RTe=CF();Object.defineProperty(me,"FallbackProvider",{enumerable:!0,get:function(){return RTe.FallbackProvider}});var HF=zc();Object.defineProperty(me,"JsonRpcApiProvider",{enumerable:!0,get:function(){return HF.JsonRpcApiProvider}});Object.defineProperty(me,"JsonRpcProvider",{enumerable:!0,get:function(){return HF.JsonRpcProvider}});Object.defineProperty(me,"JsonRpcSigner",{enumerable:!0,get:function(){return HF.JsonRpcSigner}});var jTe=foe();Object.defineProperty(me,"BrowserProvider",{enumerable:!0,get:function(){return jTe.BrowserProvider}});var MTe=xF();Object.defineProperty(me,"AlchemyProvider",{enumerable:!0,get:function(){return MTe.AlchemyProvider}});var CTe=gF();Object.defineProperty(me,"AnkrProvider",{enumerable:!0,get:function(){return CTe.AnkrProvider}});var LTe=wF();Object.defineProperty(me,"CloudflareProvider",{enumerable:!0,get:function(){return LTe.CloudflareProvider}});var UTe=yF();Object.defineProperty(me,"ChainstackProvider",{enumerable:!0,get:function(){return UTe.ChainstackProvider}});var goe=PF();Object.defineProperty(me,"EtherscanProvider",{enumerable:!0,get:function(){return goe.EtherscanProvider}});Object.defineProperty(me,"EtherscanPlugin",{enumerable:!0,get:function(){return goe.EtherscanPlugin}});var xoe=EF();Object.defineProperty(me,"InfuraProvider",{enumerable:!0,get:function(){return xoe.InfuraProvider}});Object.defineProperty(me,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return xoe.InfuraWebSocketProvider}});var FTe=doe();Object.defineProperty(me,"PocketProvider",{enumerable:!0,get:function(){return FTe.PocketProvider}});var qTe=TF();Object.defineProperty(me,"QuickNodeProvider",{enumerable:!0,get:function(){return qTe.QuickNodeProvider}});var DTe=loe();Object.defineProperty(me,"IpcSocketProvider",{enumerable:!0,get:function(){return DTe.IpcSocketProvider}});var HTe=gO();Object.defineProperty(me,"SocketProvider",{enumerable:!0,get:function(){return HTe.SocketProvider}});var KTe=yO();Object.defineProperty(me,"WebSocketProvider",{enumerable:!0,get:function(){return KTe.WebSocketProvider}});var RO=gO();Object.defineProperty(me,"SocketSubscriber",{enumerable:!0,get:function(){return RO.SocketSubscriber}});Object.defineProperty(me,"SocketBlockSubscriber",{enumerable:!0,get:function(){return RO.SocketBlockSubscriber}});Object.defineProperty(me,"SocketPendingSubscriber",{enumerable:!0,get:function(){return RO.SocketPendingSubscriber}});Object.defineProperty(me,"SocketEventSubscriber",{enumerable:!0,get:function(){return RO.SocketEventSubscriber}})});var CO=R(MO=>{"use strict";b();p();Object.defineProperty(MO,"__esModule",{value:!0});MO.BaseWallet=void 0;var KF=Ws(),GF=v0(),yoe=jO(),moe=Qa(),q6=Ne(),D6,zF=class extends yoe.AbstractSigner{constructor(t,n){super(n);N(this,"address");I(this,D6,void 0);(0,q6.assertArgument)(t&&typeof t.sign=="function","invalid private key","privateKey","[ REDACTED ]"),_(this,D6,t);let s=(0,moe.computeAddress)(this.signingKey.publicKey);(0,q6.defineProperties)(this,{address:s})}get signingKey(){return l(this,D6)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new zF(l(this,D6),t)}async signTransaction(t){t=(0,yoe.copyRequest)(t);let{to:n,from:s}=await(0,q6.resolveProperties)({to:t.to?(0,KF.resolveAddress)(t.to,this.provider):void 0,from:t.from?(0,KF.resolveAddress)(t.from,this.provider):void 0});n!=null&&(t.to=n),s!=null&&(t.from=s),t.from!=null&&((0,q6.assertArgument)((0,KF.getAddress)(t.from)===this.address,"transaction from address mismatch","tx.from",t.from),delete t.from);let i=moe.Transaction.from(t);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(t){return this.signMessageSync(t)}signMessageSync(t){return this.signingKey.sign((0,GF.hashMessage)(t)).serialized}async signTypedData(t,n,s){let i=await GF.TypedDataEncoder.resolveNames(t,n,s,async a=>{(0,q6.assert)(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:a}});let o=await this.provider.resolveName(a);return(0,q6.assert)(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:a}),o});return this.signingKey.sign(GF.TypedDataEncoder.hash(i.domain,n,i.value)).serialized}},VF=zF;D6=new WeakMap;MO.BaseWallet=VF});var WF=R(H6=>{"use strict";b();p();Object.defineProperty(H6,"__esModule",{value:!0});H6.decodeOwl=H6.decode=void 0;var GTe=Ne(),LO=" !#$%&'()*+,-./<=>?@[]^_`{|}~",VTe=/^[a-z]*$/i;function woe(r,e){let t=97;return r.reduce((n,s)=>(s===e?t++:s.match(VTe)?n.push(String.fromCharCode(t)+s):(t=97,n.push(s)),n),[])}function voe(r,e){for(let s=LO.length-1;s>=0;s--)r=r.split(LO[s]).join(e.substring(2*s,2*s+2));let t=[],n=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,i,a,o)=>{if(a)for(let c=parseInt(a);c>=0;c--)t.push(";");else t.push(i.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return woe(woe(t,";"),":")}H6.decode=voe;function zTe(r){return(0,GTe.assertArgument)(r[0]==="0","unsupported auwl data","data",r),voe(r.substring(1+2*LO.length),r.substring(1,1+2*LO.length))}H6.decodeOwl=zTe});var JF=R(UO=>{"use strict";b();p();Object.defineProperty(UO,"__esModule",{value:!0});UO.Wordlist=void 0;var WTe=Ne(),$F=class{constructor(e){N(this,"locale");(0,WTe.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}};UO.Wordlist=$F});var qO=R(FO=>{"use strict";b();p();Object.defineProperty(FO,"__esModule",{value:!0});FO.WordlistOwl=void 0;var $Te=v0(),JTe=Ne(),ZTe=WF(),QTe=JF(),K6,Mv,vx,Cv,QF,ZF=class extends QTe.Wordlist{constructor(t,n,s){super(t);I(this,Cv);I(this,K6,void 0);I(this,Mv,void 0);I(this,vx,void 0);_(this,K6,n),_(this,Mv,s),_(this,vx,null)}get _data(){return l(this,K6)}_decodeWords(){return(0,ZTe.decodeOwl)(l(this,K6))}getWord(t){let n=$(this,Cv,QF).call(this);return(0,JTe.assertArgument)(t>=0&&t<n.length,`invalid word index: ${t}`,"index",t),n[t]}getWordIndex(t){return $(this,Cv,QF).call(this).indexOf(t)}};K6=new WeakMap,Mv=new WeakMap,vx=new WeakMap,Cv=new WeakSet,QF=function(){if(l(this,vx)==null){let t=this._decodeWords();if((0,$Te.id)(t.join(`
`)+`
`)!==l(this,Mv))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);_(this,vx,t)}return l(this,vx)};FO.WordlistOwl=ZF});var Uv=R(DO=>{"use strict";b();p();Object.defineProperty(DO,"__esModule",{value:!0});DO.LangEn=void 0;var YTe=qO(),XTe="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",eOe="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60",YF=null,Lv=class extends YTe.WordlistOwl{constructor(){super("en",XTe,eOe)}static wordlist(){return YF==null&&(YF=new Lv),YF}};DO.LangEn=Lv});var KO=R(HO=>{"use strict";b();p();Object.defineProperty(HO,"__esModule",{value:!0});HO.Mnemonic=void 0;var rq=di(),wa=Ne(),nq=Uv();function Poe(r){return(1<<r)-1<<8-r&255}function tOe(r){return(1<<r)-1&255}function XF(r,e){(0,wa.assertNormalize)("NFKD"),e==null&&(e=nq.LangEn.wordlist());let t=e.split(r);(0,wa.assertArgument)(t.length%3===0&&t.length>=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");let n=new Uint8Array(Math.ceil(11*t.length/8)),s=0;for(let u=0;u<t.length;u++){let f=e.getWordIndex(t[u].normalize("NFKD"));(0,wa.assertArgument)(f>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let d=0;d<11;d++)f&1<<10-d&&(n[s>>3]|=1<<7-s%8),s++}let i=32*t.length/3,a=t.length/3,o=Poe(a),c=(0,wa.getBytes)((0,rq.sha256)(n.slice(0,i/8)))[0]&o;return(0,wa.assertArgument)(c===(n[n.length-1]&o),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,wa.hexlify)(n.slice(0,i/8))}function eq(r,e){(0,wa.assertArgument)(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=nq.LangEn.wordlist());let t=[0],n=11;for(let a=0;a<r.length;a++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=r[a],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=r[a]>>8-n,t.push(r[a]&tOe(8-n)),n+=3);let s=r.length/4,i=parseInt((0,rq.sha256)(r).substring(2,4),16)&Poe(s);return t[t.length-1]<<=s,t[t.length-1]|=i>>8-s,e.join(t.map(a=>e.getWord(a)))}var tq={},G6=class{constructor(e,t,n,s,i){N(this,"phrase");N(this,"password");N(this,"wordlist");N(this,"entropy");s==null&&(s=""),i==null&&(i=nq.LangEn.wordlist()),(0,wa.assertPrivate)(e,tq,"Mnemonic"),(0,wa.defineProperties)(this,{phrase:n,password:s,wordlist:i,entropy:t})}computeSeed(){let e=(0,wa.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,rq.pbkdf2)((0,wa.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,n){let s=XF(e,n);return e=eq((0,wa.getBytes)(s),n),new G6(tq,s,e,t,n)}static fromEntropy(e,t,n){let s=(0,wa.getBytes)(e,"entropy"),i=eq(s,n);return new G6(tq,(0,wa.hexlify)(s),i,t,n)}static entropyToPhrase(e,t){let n=(0,wa.getBytes)(e,"entropy");return eq(n,t)}static phraseToEntropy(e,t){return XF(e,t)}static isValidMnemonic(e,t){try{return XF(e,t),!0}catch{}return!1}};HO.Mnemonic=G6});var aq=R(Ob=>{"use strict";b();p();var _i=Ob&&Ob.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},sq=Ob&&Ob.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},VO,Jc,j0;Object.defineProperty(Ob,"__esModule",{value:!0});Ob.AES=void 0;var rOe={16:10,24:12,32:14},nOe=[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],$c=[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],GO=[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],sOe=[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],iOe=[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],aOe=[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],oOe=[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],cOe=[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],uOe=[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],fOe=[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],dOe=[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],lOe=[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],hOe=[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],bOe=[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],pOe=[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 iq(r){let e=[];for(let t=0;t<r.length;t+=4)e.push(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]);return e}var Fv=class{get key(){return _i(this,VO,"f").slice()}constructor(e){if(VO.set(this,void 0),Jc.set(this,void 0),j0.set(this,void 0),!(this instanceof Fv))throw Error("AES must be instanitated with `new`");sq(this,VO,new Uint8Array(e),"f");let t=rOe[this.key.length];if(t==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");sq(this,j0,[],"f"),sq(this,Jc,[],"f");for(let f=0;f<=t;f++)_i(this,j0,"f").push([0,0,0,0]),_i(this,Jc,"f").push([0,0,0,0]);let n=(t+1)*4,s=this.key.length/4,i=iq(this.key),a;for(let f=0;f<s;f++)a=f>>2,_i(this,j0,"f")[a][f%4]=i[f],_i(this,Jc,"f")[t-a][f%4]=i[f];let o=0,c=s,u;for(;c<n;){if(u=i[s-1],i[0]^=$c[u>>16&255]<<24^$c[u>>8&255]<<16^$c[u&255]<<8^$c[u>>24&255]^nOe[o]<<24,o+=1,s!=8)for(let h=1;h<s;h++)i[h]^=i[h-1];else{for(let h=1;h<s/2;h++)i[h]^=i[h-1];u=i[s/2-1],i[s/2]^=$c[u&255]^$c[u>>8&255]<<8^$c[u>>16&255]<<16^$c[u>>24&255]<<24;for(let h=s/2+1;h<s;h++)i[h]^=i[h-1]}let f=0,d,g;for(;f<s&&c<n;)d=c>>2,g=c%4,_i(this,j0,"f")[d][g]=i[f],_i(this,Jc,"f")[t-d][g]=i[f++],c++}for(let f=1;f<t;f++)for(let d=0;d<4;d++)u=_i(this,Jc,"f")[f][d],_i(this,Jc,"f")[f][d]=lOe[u>>24&255]^hOe[u>>16&255]^bOe[u>>8&255]^pOe[u&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");let t=_i(this,j0,"f").length-1,n=[0,0,0,0],s=iq(e);for(let o=0;o<4;o++)s[o]^=_i(this,j0,"f")[0][o];for(let o=1;o<t;o++){for(let c=0;c<4;c++)n[c]=sOe[s[c]>>24&255]^iOe[s[(c+1)%4]>>16&255]^aOe[s[(c+2)%4]>>8&255]^oOe[s[(c+3)%4]&255]^_i(this,j0,"f")[o][c];s=n.slice()}let i=new Uint8Array(16),a=0;for(let o=0;o<4;o++)a=_i(this,j0,"f")[t][o],i[4*o]=($c[s[o]>>24&255]^a>>24)&255,i[4*o+1]=($c[s[(o+1)%4]>>16&255]^a>>16)&255,i[4*o+2]=($c[s[(o+2)%4]>>8&255]^a>>8)&255,i[4*o+3]=($c[s[(o+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");let t=_i(this,Jc,"f").length-1,n=[0,0,0,0],s=iq(e);for(let o=0;o<4;o++)s[o]^=_i(this,Jc,"f")[0][o];for(let o=1;o<t;o++){for(let c=0;c<4;c++)n[c]=cOe[s[c]>>24&255]^uOe[s[(c+3)%4]>>16&255]^fOe[s[(c+2)%4]>>8&255]^dOe[s[(c+1)%4]&255]^_i(this,Jc,"f")[o][c];s=n.slice()}let i=new Uint8Array(16),a=0;for(let o=0;o<4;o++)a=_i(this,Jc,"f")[t][o],i[4*o]=(GO[s[o]>>24&255]^a>>24)&255,i[4*o+1]=(GO[s[(o+3)%4]>>16&255]^a>>16)&255,i[4*o+2]=(GO[s[(o+2)%4]>>8&255]^a>>8)&255,i[4*o+3]=(GO[s[(o+1)%4]&255]^a)&255;return i}};Ob.AES=Fv;VO=new WeakMap,Jc=new WeakMap,j0=new WeakMap});var Px=R(zO=>{"use strict";b();p();Object.defineProperty(zO,"__esModule",{value:!0});zO.ModeOfOperation=void 0;var gOe=aq(),oq=class{constructor(e,t,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new gOe.AES(t)},name:{enumerable:!0,value:e}})}};zO.ModeOfOperation=oq});var _oe=R(Bb=>{"use strict";b();p();var WO=Bb&&Bb.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},V6=Bb&&Bb.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qv,nl;Object.defineProperty(Bb,"__esModule",{value:!0});Bb.CBC=void 0;var xOe=Px(),Dv=class extends xOe.ModeOfOperation{constructor(e,t){if(super("ECC",e,Dv),qv.set(this,void 0),nl.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");WO(this,qv,new Uint8Array(t),"f")}else WO(this,qv,new Uint8Array(16),"f");WO(this,nl,this.iv,"f")}get iv(){return new Uint8Array(V6(this,qv,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let s=0;s<16;s++)V6(this,nl,"f")[s]^=e[n+s];WO(this,nl,this.aes.encrypt(V6(this,nl,"f")),"f"),t.set(V6(this,nl,"f"),n)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let s=this.aes.decrypt(e.subarray(n,n+16));for(let i=0;i<16;i++)t[n+i]=s[i]^V6(this,nl,"f")[i],V6(this,nl,"f")[i]=e[n+i]}return t}};Bb.CBC=Dv;qv=new WeakMap,nl=new WeakMap});var Aoe=R(Ib=>{"use strict";b();p();var cq=Ib&&Ib.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},kb=Ib&&Ib.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$O,Hv,Nb,uq;Object.defineProperty(Ib,"__esModule",{value:!0});Ib.CFB=void 0;var yOe=Px(),Kv=class extends yOe.ModeOfOperation{constructor(e,t,n=8){if(super("CFB",e,Kv),$O.add(this),Hv.set(this,void 0),Nb.set(this,void 0),!Number.isInteger(n)||n%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:n}}),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");cq(this,Hv,new Uint8Array(t),"f")}else cq(this,Hv,new Uint8Array(16),"f");cq(this,Nb,this.iv,"f")}get iv(){return new Uint8Array(kb(this,Hv,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(kb(this,Nb,"f"));for(let a=0;a<t;a++)n[s+a]^=i[a];kb(this,$O,"m",uq).call(this,n.subarray(s))}return n}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(kb(this,Nb,"f"));for(let a=0;a<t;a++)n[s+a]^=i[a];kb(this,$O,"m",uq).call(this,e.subarray(s))}return n}};Ib.CFB=Kv;Hv=new WeakMap,Nb=new WeakMap,$O=new WeakSet,uq=function(e){let t=this.segmentSize/8;kb(this,Nb,"f").set(kb(this,Nb,"f").subarray(t)),kb(this,Nb,"f").set(e.subarray(0,t),16-t)}});var Eoe=R(Rb=>{"use strict";b();p();var z6=Rb&&Rb.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Zc=Rb&&Rb.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Gv,_x,Qc;Object.defineProperty(Rb,"__esModule",{value:!0});Rb.CTR=void 0;var mOe=Px(),Vv=class extends mOe.ModeOfOperation{constructor(e,t){super("CTR",e,Vv),Gv.set(this,void 0),_x.set(this,void 0),Qc.set(this,void 0),z6(this,Qc,new Uint8Array(16),"f"),Zc(this,Qc,"f").fill(0),z6(this,Gv,Zc(this,Qc,"f"),"f"),z6(this,_x,16,"f"),t==null&&(t=1),typeof t=="number"?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(Zc(this,Qc,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Zc(this,Qc,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Zc(this,Qc,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Zc(this,Qc,"f")[e]===255)Zc(this,Qc,"f")[e]=0;else{Zc(this,Qc,"f")[e]++;break}}encrypt(e){var t,n;let s=new Uint8Array(e);for(let i=0;i<s.length;i++)Zc(this,_x,"f")===16&&(z6(this,Gv,this.aes.encrypt(Zc(this,Qc,"f")),"f"),z6(this,_x,0,"f"),this.increment()),s[i]^=Zc(this,Gv,"f")[z6(this,_x,(n=Zc(this,_x,"f"),t=n++,n),"f"),t];return s}decrypt(e){return this.encrypt(e)}};Rb.CTR=Vv;Gv=new WeakMap,_x=new WeakMap,Qc=new WeakMap});var Soe=R(JO=>{"use strict";b();p();Object.defineProperty(JO,"__esModule",{value:!0});JO.ECB=void 0;var wOe=Px(),zv=class extends wOe.ModeOfOperation{constructor(e){super("ECB",e,zv)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.encrypt(e.subarray(n,n+16)),n);return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.decrypt(e.subarray(n,n+16)),n);return t}};JO.ECB=zv});var Toe=R(jb=>{"use strict";b();p();var Ax=jb&&jb.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Wv=jb&&jb.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$v,W6,Ex;Object.defineProperty(jb,"__esModule",{value:!0});jb.OFB=void 0;var vOe=Px(),Jv=class extends vOe.ModeOfOperation{constructor(e,t){if(super("OFB",e,Jv),$v.set(this,void 0),W6.set(this,void 0),Ex.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Ax(this,$v,new Uint8Array(t),"f")}else Ax(this,$v,new Uint8Array(16),"f");Ax(this,W6,this.iv,"f"),Ax(this,Ex,16,"f")}get iv(){return new Uint8Array(Wv(this,$v,"f"))}encrypt(e){var t,n;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let s=new Uint8Array(e);for(let i=0;i<s.length;i++)Wv(this,Ex,"f")===16&&(Ax(this,W6,this.aes.encrypt(Wv(this,W6,"f")),"f"),Ax(this,Ex,0,"f")),s[i]^=Wv(this,W6,"f")[Ax(this,Ex,(n=Wv(this,Ex,"f"),t=n++,n),"f"),t];return s}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}};jb.OFB=Jv;$v=new WeakMap,W6=new WeakMap,Ex=new WeakMap});var Ooe=R($6=>{"use strict";b();p();Object.defineProperty($6,"__esModule",{value:!0});$6.pkcs7Strip=$6.pkcs7Pad=void 0;function POe(r){let e=16-r.length%16,t=new Uint8Array(r.length+e);t.set(r);for(let n=r.length;n<t.length;n++)t[n]=e;return t}$6.pkcs7Pad=POe;function _Oe(r){if(r.length<16)throw new TypeError("PKCS#7 invalid length");let e=r[r.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");let t=r.length-e;for(let n=0;n<e;n++)if(r[t+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(r.subarray(0,t))}$6.pkcs7Strip=_Oe});var fq=R(Ns=>{"use strict";b();p();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.pkcs7Strip=Ns.pkcs7Pad=Ns.OFB=Ns.ECB=Ns.CTR=Ns.CFB=Ns.CBC=Ns.ModeOfOperation=Ns.AES=void 0;var AOe=aq();Object.defineProperty(Ns,"AES",{enumerable:!0,get:function(){return AOe.AES}});var EOe=Px();Object.defineProperty(Ns,"ModeOfOperation",{enumerable:!0,get:function(){return EOe.ModeOfOperation}});var SOe=_oe();Object.defineProperty(Ns,"CBC",{enumerable:!0,get:function(){return SOe.CBC}});var TOe=Aoe();Object.defineProperty(Ns,"CFB",{enumerable:!0,get:function(){return TOe.CFB}});var OOe=Eoe();Object.defineProperty(Ns,"CTR",{enumerable:!0,get:function(){return OOe.CTR}});var BOe=Soe();Object.defineProperty(Ns,"ECB",{enumerable:!0,get:function(){return BOe.ECB}});var kOe=Toe();Object.defineProperty(Ns,"OFB",{enumerable:!0,get:function(){return kOe.OFB}});var Boe=Ooe();Object.defineProperty(Ns,"pkcs7Pad",{enumerable:!0,get:function(){return Boe.pkcs7Pad}});Object.defineProperty(Ns,"pkcs7Strip",{enumerable:!0,get:function(){return Boe.pkcs7Strip}})});var dq=R(M0=>{"use strict";b();p();Object.defineProperty(M0,"__esModule",{value:!0});M0.spelunk=M0.getPassword=M0.zpad=M0.looseArrayify=void 0;var J6=Ne();function koe(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),(0,J6.getBytesCopy)(r)}M0.looseArrayify=koe;function NOe(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}M0.zpad=NOe;function IOe(r){return typeof r=="string"?(0,J6.toUtf8Bytes)(r,"NFKC"):(0,J6.getBytesCopy)(r)}M0.getPassword=IOe;function ROe(r,e){let t=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,J6.assertArgument)(t!=null,"invalid path","path",e);let n=t[1],s=t[3],i=t[4]==="!",a=r;for(let o of n.toLowerCase().split(".")){if(Array.isArray(a)){if(!o.match(/^[0-9]+$/))break;a=a[parseInt(o)]}else if(typeof a=="object"){let c=null;for(let u in a)if(u.toLowerCase()===o){c=a[u];break}a=c}else a=null;if(a==null)break}if((0,J6.assertArgument)(!i||a!=null,"missing required value","path",n),s&&a!=null){if(s==="int"){if(typeof a=="string"&&a.match(/^-?[0-9]+$/))return parseInt(a);if(Number.isSafeInteger(a))return a}if(s==="number"&&typeof a=="string"&&a.match(/^-?[0-9.]*$/))return parseFloat(a);if(s==="data"&&typeof a=="string")return koe(a);if(s==="array"&&Array.isArray(a)||s===typeof a)return a;(0,J6.assertArgument)(!1,`wrong type found for ${s} `,"path",n)}return a}M0.spelunk=ROe});var YO=R(Yc=>{"use strict";b();p();Object.defineProperty(Yc,"__esModule",{value:!0});Yc.encryptKeystoreJson=Yc.encryptKeystoreJsonSync=Yc.decryptKeystoreJson=Yc.decryptKeystoreJsonSync=Yc.isKeystoreJson=void 0;var ZO=fq(),jOe=Ws(),Xc=di(),MOe=Qa(),Wt=Ne(),Ir=dq(),COe=CE(),Ioe="m/44'/60'/0'/0/0";function LOe(r){try{let e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}Yc.isKeystoreJson=LOe;function UOe(r,e,t){if((0,Ir.spelunk)(r,"crypto.cipher:string")==="aes-128-ctr"){let s=(0,Ir.spelunk)(r,"crypto.cipherparams.iv:data!"),i=new ZO.CTR(e,s);return(0,Wt.hexlify)(i.decrypt(t))}(0,Wt.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function QO(r,e){let t=(0,Wt.getBytes)(e),n=(0,Ir.spelunk)(r,"crypto.ciphertext:data!"),s=(0,Wt.hexlify)((0,Xc.keccak256)((0,Wt.concat)([t.slice(16,32),n]))).substring(2);(0,Wt.assertArgument)(s===(0,Ir.spelunk)(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");let i=UOe(r,t.slice(0,16),n),a=(0,MOe.computeAddress)(i);if(r.address){let u=r.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),(0,Wt.assertArgument)((0,jOe.getAddress)(u)===a,"keystore address/privateKey mismatch","address",r.address)}let o={address:a,privateKey:i};if((0,Ir.spelunk)(r,"x-ethers.version:string")==="0.1"){let u=t.slice(32,64),f=(0,Ir.spelunk)(r,"x-ethers.mnemonicCiphertext:data!"),d=(0,Ir.spelunk)(r,"x-ethers.mnemonicCounter:data!"),g=new ZO.CTR(u,d);o.mnemonic={path:(0,Ir.spelunk)(r,"x-ethers.path:string")||Ioe,locale:(0,Ir.spelunk)(r,"x-ethers.locale:string")||"en",entropy:(0,Wt.hexlify)((0,Wt.getBytes)(g.decrypt(f)))}}return o}function Roe(r){let e=(0,Ir.spelunk)(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){let t=(0,Ir.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,Ir.spelunk)(r,"crypto.kdfparams.n:int!"),s=(0,Ir.spelunk)(r,"crypto.kdfparams.r:int!"),i=(0,Ir.spelunk)(r,"crypto.kdfparams.p:int!");(0,Wt.assertArgument)(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),(0,Wt.assertArgument)(s>0&&i>0,"invalid kdf","kdf",e);let a=(0,Ir.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,Wt.assertArgument)(a===32,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:t,N:n,r:s,p:i,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){let t=(0,Ir.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,Ir.spelunk)(r,"crypto.kdfparams.prf:string!"),s=n.split("-").pop();(0,Wt.assertArgument)(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",n);let i=(0,Ir.spelunk)(r,"crypto.kdfparams.c:int!"),a=(0,Ir.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,Wt.assertArgument)(a===32,"invalid kdf.dklen","kdf.dklen",a),{name:"pbkdf2",salt:t,count:i,dkLen:a,algorithm:s}}}(0,Wt.assertArgument)(!1,"unsupported key-derivation function","kdf",e)}function FOe(r,e){let t=JSON.parse(r),n=(0,Ir.getPassword)(e),s=Roe(t);if(s.name==="pbkdf2"){let{salt:d,count:g,dkLen:h,algorithm:m}=s,y=(0,Xc.pbkdf2)(n,d,g,h,m);return QO(t,y)}(0,Wt.assert)(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});let{salt:i,N:a,r:o,p:c,dkLen:u}=s,f=(0,Xc.scryptSync)(n,i,a,o,c,u);return QO(t,f)}Yc.decryptKeystoreJsonSync=FOe;function Noe(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function qOe(r,e,t){let n=JSON.parse(r),s=(0,Ir.getPassword)(e),i=Roe(n);if(i.name==="pbkdf2"){t&&(t(0),await Noe(0));let{salt:g,count:h,dkLen:m,algorithm:y}=i,S=(0,Xc.pbkdf2)(s,g,h,m,y);return t&&(t(1),await Noe(0)),QO(n,S)}(0,Wt.assert)(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});let{salt:a,N:o,r:c,p:u,dkLen:f}=i,d=await(0,Xc.scrypt)(s,a,o,c,u,f,t);return QO(n,d)}Yc.decryptKeystoreJson=qOe;function joe(r){let e=r.salt!=null?(0,Wt.getBytes)(r.salt,"options.salt"):(0,Xc.randomBytes)(32),t=1<<17,n=8,s=1;return r.scrypt&&(r.scrypt.N&&(t=r.scrypt.N),r.scrypt.r&&(n=r.scrypt.r),r.scrypt.p&&(s=r.scrypt.p)),(0,Wt.assertArgument)(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,Wt.assertArgument)(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,Wt.assertArgument)(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:e,N:t,r:n,p:s}}function Moe(r,e,t,n){let s=(0,Wt.getBytes)(t.privateKey,"privateKey"),i=n.iv!=null?(0,Wt.getBytes)(n.iv,"options.iv"):(0,Xc.randomBytes)(16);(0,Wt.assertArgument)(i.length===16,"invalid options.iv length","options.iv",n.iv);let a=n.uuid!=null?(0,Wt.getBytes)(n.uuid,"options.uuid"):(0,Xc.randomBytes)(16);(0,Wt.assertArgument)(a.length===16,"invalid options.uuid length","options.uuid",n.iv);let o=r.slice(0,16),c=r.slice(16,32),u=new ZO.CTR(o,i),f=(0,Wt.getBytes)(u.encrypt(s)),d=(0,Xc.keccak256)((0,Wt.concat)([c,f])),g={address:t.address.substring(2).toLowerCase(),id:(0,Wt.uuidV4)(a),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,Wt.hexlify)(i).substring(2)},ciphertext:(0,Wt.hexlify)(f).substring(2),kdf:"scrypt",kdfparams:{salt:(0,Wt.hexlify)(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:d.substring(2)}};if(t.mnemonic){let h=n.client!=null?n.client:`ethers/${COe.version}`,m=t.mnemonic.path||Ioe,y=t.mnemonic.locale||"en",S=r.slice(32,64),T=(0,Wt.getBytes)(t.mnemonic.entropy,"account.mnemonic.entropy"),H=(0,Xc.randomBytes)(16),C=new ZO.CTR(S,H),J=(0,Wt.getBytes)(C.encrypt(T)),z=new Date,Y="UTC--"+(z.getUTCFullYear()+"-"+(0,Ir.zpad)(z.getUTCMonth()+1,2)+"-"+(0,Ir.zpad)(z.getUTCDate(),2)+"T"+(0,Ir.zpad)(z.getUTCHours(),2)+"-"+(0,Ir.zpad)(z.getUTCMinutes(),2)+"-"+(0,Ir.zpad)(z.getUTCSeconds(),2)+".0Z")+"--"+g.address;g["x-ethers"]={client:h,gethFilename:Y,path:m,locale:y,mnemonicCounter:(0,Wt.hexlify)(H).substring(2),mnemonicCiphertext:(0,Wt.hexlify)(J).substring(2),version:"0.1"}}return JSON.stringify(g)}function DOe(r,e,t){t==null&&(t={});let n=(0,Ir.getPassword)(e),s=joe(t),i=(0,Xc.scryptSync)(n,s.salt,s.N,s.r,s.p,64);return Moe((0,Wt.getBytes)(i),s,r,t)}Yc.encryptKeystoreJsonSync=DOe;async function HOe(r,e,t){t==null&&(t={});let n=(0,Ir.getPassword)(e),s=joe(t),i=await(0,Xc.scrypt)(n,s.salt,s.N,s.r,s.p,64,t.progressCallback);return Moe((0,Wt.getBytes)(i),s,r,t)}Yc.encryptKeystoreJson=HOe});var bq=R(va=>{"use strict";b();p();Object.defineProperty(va,"__esModule",{value:!0});va.getIndexedAccountPath=va.getAccountPath=va.HDNodeVoidWallet=va.HDNodeWallet=va.defaultPath=void 0;var No=di(),KOe=jO(),Foe=Qa(),Ze=Ne(),Coe=Uv(),GOe=CO(),Loe=KO(),Uoe=YO();va.defaultPath="m/44'/60'/0'/0/0";var VOe=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),U0=2147483648,zOe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),WOe="0123456789abcdef";function eB(r,e){let t="";for(;r;)t=WOe[r%16]+t,r=Math.trunc(r/16);for(;t.length<e*2;)t="0"+t;return"0x"+t}function lq(r){let e=(0,Ze.getBytes)(r),t=(0,Ze.dataSlice)((0,No.sha256)((0,No.sha256)(e)),0,4),n=(0,Ze.concat)([e,t]);return(0,Ze.encodeBase58)(n)}var L0={};function qoe(r,e,t,n){let s=new Uint8Array(37);r&U0?((0,Ze.assert)(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set((0,Ze.getBytes)(n),1)):s.set((0,Ze.getBytes)(t));for(let a=24;a>=0;a-=8)s[33+(a>>3)]=r>>24-a&255;let i=(0,Ze.getBytes)((0,No.computeHmac)("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function Doe(r,e){let t=e.split("/");(0,Ze.assertArgument)(t.length>0,"invalid path","path",e),t[0]==="m"&&((0,Ze.assertArgument)(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),t.shift());let n=r;for(let s=0;s<t.length;s++){let i=t[s];if(i.match(/^[0-9]+'$/)){let a=parseInt(i.substring(0,i.length-1));(0,Ze.assertArgument)(a<U0,"invalid path index",`path[${s}]`,i),n=n.deriveChild(U0+a)}else if(i.match(/^[0-9]+$/)){let a=parseInt(i);(0,Ze.assertArgument)(a<U0,"invalid path index",`path[${s}]`,i),n=n.deriveChild(a)}else(0,Ze.assertArgument)(!1,"invalid path component",`path[${s}]`,i)}return n}var Qv,hq,Sx,Zv,C0=class extends GOe.BaseWallet{constructor(t,n,s,i,a,o,c,u,f){super(n,f);I(this,Qv);N(this,"publicKey");N(this,"fingerprint");N(this,"parentFingerprint");N(this,"mnemonic");N(this,"chainCode");N(this,"path");N(this,"index");N(this,"depth");(0,Ze.assertPrivate)(t,L0,"HDNodeWallet"),(0,Ze.defineProperties)(this,{publicKey:n.compressedPublicKey});let d=(0,Ze.dataSlice)((0,No.ripemd160)((0,No.sha256)(this.publicKey)),0,4);(0,Ze.defineProperties)(this,{parentFingerprint:s,fingerprint:d,chainCode:i,path:a,index:o,depth:c}),(0,Ze.defineProperties)(this,{mnemonic:u})}connect(t){return new C0(L0,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}async encrypt(t,n){return await(0,Uoe.encryptKeystoreJson)($(this,Qv,hq).call(this),t,{progressCallback:n})}encryptSync(t){return(0,Uoe.encryptKeystoreJsonSync)($(this,Qv,hq).call(this),t)}get extendedKey(){return(0,Ze.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),lq((0,Ze.concat)(["0x0488ADE4",eB(this.depth,1),this.parentFingerprint,eB(this.index,4),this.chainCode,(0,Ze.concat)(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new Mb(L0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=(0,Ze.getNumber)(t,"index");(0,Ze.assertArgument)(n<=4294967295,"invalid index","index",n);let s=this.path;s&&(s+="/"+(n&~U0),n&U0&&(s+="'"));let{IR:i,IL:a}=qoe(n,this.chainCode,this.publicKey,this.privateKey),o=new No.SigningKey((0,Ze.toBeHex)(((0,Ze.toBigInt)(a)+BigInt(this.privateKey))%zOe,32));return new C0(L0,o,this.fingerprint,(0,Ze.hexlify)(i),s,n,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return Doe(this,t)}static fromExtendedKey(t){let n=(0,Ze.toBeArray)((0,Ze.decodeBase58)(t));(0,Ze.assertArgument)(n.length===82||lq(n.slice(0,78))===t,"invalid extended key","extendedKey","[ REDACTED ]");let s=n[4],i=(0,Ze.hexlify)(n.slice(5,9)),a=parseInt((0,Ze.hexlify)(n.slice(9,13)).substring(2),16),o=(0,Ze.hexlify)(n.slice(13,45)),c=n.slice(45,78);switch((0,Ze.hexlify)(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":{let u=(0,Ze.hexlify)(c);return new Mb(L0,(0,Foe.computeAddress)(u),u,i,o,null,a,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new C0(L0,new No.SigningKey(c.slice(1)),i,o,null,a,s,null,null)}(0,Ze.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t,n,s){var a;t==null&&(t=""),n==null&&(n=va.defaultPath),s==null&&(s=Coe.LangEn.wordlist());let i=Loe.Mnemonic.fromEntropy((0,No.randomBytes)(16),t,s);return $(a=C0,Sx,Zv).call(a,i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){var s;return n||(n=va.defaultPath),$(s=C0,Sx,Zv).call(s,t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,s,i){var o;n==null&&(n=""),s==null&&(s=va.defaultPath),i==null&&(i=Coe.LangEn.wordlist());let a=Loe.Mnemonic.fromPhrase(t,n,i);return $(o=C0,Sx,Zv).call(o,a.computeSeed(),a).derivePath(s)}static fromSeed(t){var n;return $(n=C0,Sx,Zv).call(n,t,null)}},XO=C0;Qv=new WeakSet,hq=function(){let t={address:this.address,privateKey:this.privateKey},n=this.mnemonic;return this.path&&n&&n.wordlist.locale==="en"&&n.password===""&&(t.mnemonic={path:this.path,locale:"en",entropy:n.entropy}),t},Sx=new WeakSet,Zv=function(t,n){(0,Ze.assertArgument)((0,Ze.isBytesLike)(t),"invalid seed","seed","[REDACTED]");let s=(0,Ze.getBytes)(t,"seed");(0,Ze.assertArgument)(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");let i=(0,Ze.getBytes)((0,No.computeHmac)("sha512",VOe,s)),a=new No.SigningKey((0,Ze.hexlify)(i.slice(0,32)));return new C0(L0,a,"0x00000000",(0,Ze.hexlify)(i.slice(32)),"m",0,0,n,null)},I(XO,Sx);va.HDNodeWallet=XO;var Mb=class extends KOe.VoidSigner{constructor(t,n,s,i,a,o,c,u,f){super(n,f);N(this,"publicKey");N(this,"fingerprint");N(this,"parentFingerprint");N(this,"chainCode");N(this,"path");N(this,"index");N(this,"depth");(0,Ze.assertPrivate)(t,L0,"HDNodeVoidWallet"),(0,Ze.defineProperties)(this,{publicKey:s});let d=(0,Ze.dataSlice)((0,No.ripemd160)((0,No.sha256)(s)),0,4);(0,Ze.defineProperties)(this,{publicKey:s,fingerprint:d,parentFingerprint:i,chainCode:a,path:o,index:c,depth:u})}connect(t){return new Mb(L0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return(0,Ze.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),lq((0,Ze.concat)(["0x0488B21E",eB(this.depth,1),this.parentFingerprint,eB(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){let n=(0,Ze.getNumber)(t,"index");(0,Ze.assertArgument)(n<=4294967295,"invalid index","index",n);let s=this.path;s&&(s+="/"+(n&~U0),n&U0&&(s+="'"));let{IR:i,IL:a}=qoe(n,this.chainCode,this.publicKey,null),o=No.SigningKey.addPoints(a,this.publicKey,!0),c=(0,Foe.computeAddress)(o);return new Mb(L0,c,o,this.fingerprint,(0,Ze.hexlify)(i),s,n,this.depth+1,this.provider)}derivePath(t){return Doe(this,t)}};va.HDNodeVoidWallet=Mb;function $Oe(r){let e=(0,Ze.getNumber)(r,"index");return(0,Ze.assertArgument)(e>=0&&e<U0,"invalid account index","index",e),`m/44'/60'/${e}'/0/0`}va.getAccountPath=$Oe;function JOe(r){let e=(0,Ze.getNumber)(r,"index");return(0,Ze.assertArgument)(e>=0&&e<U0,"invalid account index","index",e),`m/44'/60'/0'/0/${e}`}va.getIndexedAccountPath=JOe});var gq=R(Z6=>{"use strict";b();p();Object.defineProperty(Z6,"__esModule",{value:!0});Z6.decryptCrowdsaleJson=Z6.isCrowdsaleJson=void 0;var Hoe=fq(),ZOe=Ws(),QOe=di(),YOe=v0(),pq=Ne(),tB=dq();function XOe(r){try{if(JSON.parse(r).encseed)return!0}catch{}return!1}Z6.isCrowdsaleJson=XOe;function eBe(r,e){let t=JSON.parse(r),n=(0,tB.getPassword)(e),s=(0,ZOe.getAddress)((0,tB.spelunk)(t,"ethaddr:string!")),i=(0,tB.looseArrayify)((0,tB.spelunk)(t,"encseed:string!"));(0,pq.assertArgument)(i&&i.length%16===0,"invalid encseed","json",r);let a=(0,pq.getBytes)((0,QOe.pbkdf2)(n,n,2e3,32,"sha256")).slice(0,16),o=i.slice(0,16),c=i.slice(16),u=new Hoe.CBC(a,o),f=(0,Hoe.pkcs7Strip)((0,pq.getBytes)(u.decrypt(c))),d="";for(let g=0;g<f.length;g++)d+=String.fromCharCode(f[g]);return{address:s,privateKey:(0,YOe.id)(d)}}Z6.decryptCrowdsaleJson=eBe});var Goe=R(sB=>{"use strict";b();p();Object.defineProperty(sB,"__esModule",{value:!0});sB.Wallet=void 0;var tBe=di(),xq=Ne(),rBe=CO(),yq=bq(),rB=gq(),Q6=YO(),nBe=KO();function Koe(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}var Yv,mq,Y6=class extends rBe.BaseWallet{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new tBe.SigningKey(e):e;super(n,t)}connect(e){return new Y6(this.signingKey,e)}async encrypt(e,t){let n={address:this.address,privateKey:this.privateKey};return await(0,Q6.encryptKeystoreJson)(n,e,{progressCallback:t})}encryptSync(e){let t={address:this.address,privateKey:this.privateKey};return(0,Q6.encryptKeystoreJsonSync)(t,e)}static async fromEncryptedJson(e,t,n){var i;let s=null;return(0,Q6.isKeystoreJson)(e)?s=await(0,Q6.decryptKeystoreJson)(e,t,n):(0,rB.isCrowdsaleJson)(e)&&(n&&(n(0),await Koe(0)),s=(0,rB.decryptCrowdsaleJson)(e,t),n&&(n(1),await Koe(0))),$(i=Y6,Yv,mq).call(i,s)}static fromEncryptedJsonSync(e,t){var s;let n=null;return(0,Q6.isKeystoreJson)(e)?n=(0,Q6.decryptKeystoreJsonSync)(e,t):(0,rB.isCrowdsaleJson)(e)?n=(0,rB.decryptCrowdsaleJson)(e,t):(0,xq.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),$(s=Y6,Yv,mq).call(s,n)}static createRandom(e){let t=yq.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){let n=yq.HDNodeWallet.fromPhrase(e);return t?n.connect(t):n}},nB=Y6;Yv=new WeakSet,mq=function(e){if((0,xq.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){let n=nBe.Mnemonic.fromEntropy(e.mnemonic.entropy),s=yq.HDNodeWallet.fromMnemonic(n,e.mnemonic.path);if(s.address===e.address&&s.privateKey===e.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}let t=new Y6(e.privateKey);return(0,xq.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t},I(nB,Yv);sB.Wallet=nB});var zoe=R(wr=>{"use strict";b();p();Object.defineProperty(wr,"__esModule",{value:!0});wr.Wallet=wr.Mnemonic=wr.encryptKeystoreJsonSync=wr.encryptKeystoreJson=wr.decryptKeystoreJson=wr.decryptKeystoreJsonSync=wr.isKeystoreJson=wr.decryptCrowdsaleJson=wr.isCrowdsaleJson=wr.HDNodeVoidWallet=wr.HDNodeWallet=wr.getIndexedAccountPath=wr.getAccountPath=wr.defaultPath=wr.BaseWallet=void 0;var sBe=CO();Object.defineProperty(wr,"BaseWallet",{enumerable:!0,get:function(){return sBe.BaseWallet}});var Xv=bq();Object.defineProperty(wr,"defaultPath",{enumerable:!0,get:function(){return Xv.defaultPath}});Object.defineProperty(wr,"getAccountPath",{enumerable:!0,get:function(){return Xv.getAccountPath}});Object.defineProperty(wr,"getIndexedAccountPath",{enumerable:!0,get:function(){return Xv.getIndexedAccountPath}});Object.defineProperty(wr,"HDNodeWallet",{enumerable:!0,get:function(){return Xv.HDNodeWallet}});Object.defineProperty(wr,"HDNodeVoidWallet",{enumerable:!0,get:function(){return Xv.HDNodeVoidWallet}});var Voe=gq();Object.defineProperty(wr,"isCrowdsaleJson",{enumerable:!0,get:function(){return Voe.isCrowdsaleJson}});Object.defineProperty(wr,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Voe.decryptCrowdsaleJson}});var e7=YO();Object.defineProperty(wr,"isKeystoreJson",{enumerable:!0,get:function(){return e7.isKeystoreJson}});Object.defineProperty(wr,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return e7.decryptKeystoreJsonSync}});Object.defineProperty(wr,"decryptKeystoreJson",{enumerable:!0,get:function(){return e7.decryptKeystoreJson}});Object.defineProperty(wr,"encryptKeystoreJson",{enumerable:!0,get:function(){return e7.encryptKeystoreJson}});Object.defineProperty(wr,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return e7.encryptKeystoreJsonSync}});var iBe=KO();Object.defineProperty(wr,"Mnemonic",{enumerable:!0,get:function(){return iBe.Mnemonic}});var aBe=Goe();Object.defineProperty(wr,"Wallet",{enumerable:!0,get:function(){return aBe.Wallet}})});var Woe=R(iB=>{"use strict";b();p();Object.defineProperty(iB,"__esModule",{value:!0});iB.decodeBits=void 0;var oBe=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function cBe(r,e){let t=(1<<r)-1,n=[],s=0,i=0,a=0;for(let o=0;o<e.length;o++)for(s=s<<6|oBe.indexOf(e[o]),i+=6;i>=r;){let c=s>>i-r;s&=(1<<i-r)-1,i-=r,c===0?a+=t:(n.push(c+a),a=0)}return n}iB.decodeBits=cBe});var $oe=R(aB=>{"use strict";b();p();Object.defineProperty(aB,"__esModule",{value:!0});aB.decodeOwlA=void 0;var uBe=Ne(),fBe=Woe(),dBe=WF();function lBe(r,e){let t=(0,dBe.decodeOwl)(r).join(",");return e.split(/,/g).forEach(n=>{let s=n.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,uBe.assertArgument)(s!==null,"internal error parsing accents","accents",e);let i=0,a=(0,fBe.decodeBits)(parseInt(s[3]),s[4]),o=parseInt(s[2]),c=new RegExp(`([${s[1]}])`,"g");t=t.replace(c,(u,f)=>(--a[i]===0&&(f=String.fromCharCode(f.charCodeAt(0),o),i++),f))}),t.split(",")}aB.decodeOwlA=lBe});var Joe=R(oB=>{"use strict";b();p();Object.defineProperty(oB,"__esModule",{value:!0});oB.WordlistOwlA=void 0;var hBe=qO(),bBe=$oe(),t7,wq=class extends hBe.WordlistOwl{constructor(t,n,s,i){super(t,n,i);I(this,t7,void 0);_(this,t7,s)}get _accent(){return l(this,t7)}_decodeWords(){return(0,bBe.decodeOwlA)(this._data,this._accent)}};t7=new WeakMap;oB.WordlistOwlA=wq});var Zoe=R(cB=>{"use strict";b();p();Object.defineProperty(cB,"__esModule",{value:!0});cB.wordlists=void 0;var pBe=Uv();cB.wordlists={en:pBe.LangEn.wordlist()}});var Qoe=R(eu=>{"use strict";b();p();Object.defineProperty(eu,"__esModule",{value:!0});eu.wordlists=eu.WordlistOwlA=eu.WordlistOwl=eu.LangEn=eu.Wordlist=void 0;var gBe=JF();Object.defineProperty(eu,"Wordlist",{enumerable:!0,get:function(){return gBe.Wordlist}});var xBe=Uv();Object.defineProperty(eu,"LangEn",{enumerable:!0,get:function(){return xBe.LangEn}});var yBe=qO();Object.defineProperty(eu,"WordlistOwl",{enumerable:!0,get:function(){return yBe.WordlistOwl}});var mBe=Joe();Object.defineProperty(eu,"WordlistOwlA",{enumerable:!0,get:function(){return mBe.WordlistOwlA}});var wBe=Zoe();Object.defineProperty(eu,"wordlists",{enumerable:!0,get:function(){return wBe.wordlists}})});var vq=R(U=>{"use strict";b();p();Object.defineProperty(U,"__esModule",{value:!0});U.ripemd160=U.keccak256=U.randomBytes=U.computeHmac=U.UndecodedEventLog=U.EventLog=U.ContractUnknownEventPayload=U.ContractTransactionResponse=U.ContractTransactionReceipt=U.ContractEventPayload=U.ContractFactory=U.Contract=U.BaseContract=U.MessagePrefix=U.EtherSymbol=U.ZeroHash=U.N=U.MaxInt256=U.MinInt256=U.MaxUint256=U.WeiPerEther=U.ZeroAddress=U.resolveAddress=U.isAddress=U.isAddressable=U.getCreate2Address=U.getCreateAddress=U.getIcapAddress=U.getAddress=U.Typed=U.TransactionDescription=U.Result=U.LogDescription=U.Interface=U.Indexed=U.ErrorDescription=U.checkResultErrors=U.StructFragment=U.ParamType=U.NamedFragment=U.FunctionFragment=U.FallbackFragment=U.Fragment=U.EventFragment=U.ErrorFragment=U.ConstructorFragment=U.AbiCoder=U.encodeBytes32String=U.decodeBytes32String=U.version=void 0;U.EnsPlugin=U.Network=U.EnsResolver=U.WebSocketProvider=U.SocketProvider=U.IpcSocketProvider=U.QuickNodeProvider=U.PocketProvider=U.InfuraWebSocketProvider=U.InfuraProvider=U.EtherscanProvider=U.CloudflareProvider=U.ChainstackProvider=U.AnkrProvider=U.AlchemyProvider=U.BrowserProvider=U.JsonRpcSigner=U.JsonRpcProvider=U.JsonRpcApiProvider=U.FallbackProvider=U.AbstractProvider=U.VoidSigner=U.NonceManager=U.AbstractSigner=U.TransactionResponse=U.TransactionReceipt=U.Log=U.FeeData=U.Block=U.getDefaultProvider=U.verifyTypedData=U.TypedDataEncoder=U.solidityPackedSha256=U.solidityPackedKeccak256=U.solidityPacked=U.verifyMessage=U.hashMessage=U.dnsEncode=U.namehash=U.isValidName=U.ensNormalize=U.id=U.SigningKey=U.Signature=U.lock=U.scryptSync=U.scrypt=U.pbkdf2=U.sha512=U.sha256=void 0;U.getUint=U.getNumber=U.getBigInt=U.FixedNumber=U.FetchCancelSignal=U.FetchResponse=U.FetchRequest=U.EventPayload=U.isError=U.isCallException=U.makeError=U.assertPrivate=U.assertNormalize=U.assertArgumentCount=U.assertArgument=U.assert=U.resolveProperties=U.defineProperties=U.zeroPadValue=U.zeroPadBytes=U.stripZerosLeft=U.isBytesLike=U.isHexString=U.hexlify=U.getBytesCopy=U.getBytes=U.dataSlice=U.dataLength=U.concat=U.encodeBase64=U.decodeBase64=U.encodeBase58=U.decodeBase58=U.Transaction=U.recoverAddress=U.computeAddress=U.accessListify=U.showThrottleMessage=U.copyRequest=U.UnmanagedSubscriber=U.SocketSubscriber=U.SocketPendingSubscriber=U.SocketEventSubscriber=U.SocketBlockSubscriber=U.MulticoinProviderPlugin=U.NetworkPlugin=U.GasCostPlugin=U.FetchUrlFeeDataNetworkPlugin=U.FeeDataNetworkPlugin=U.EtherscanPlugin=void 0;U.wordlists=U.WordlistOwlA=U.WordlistOwl=U.LangEn=U.Wordlist=U.encryptKeystoreJsonSync=U.encryptKeystoreJson=U.decryptKeystoreJson=U.decryptKeystoreJsonSync=U.decryptCrowdsaleJson=U.isKeystoreJson=U.isCrowdsaleJson=U.getIndexedAccountPath=U.getAccountPath=U.defaultPath=U.Wallet=U.HDNodeVoidWallet=U.HDNodeWallet=U.BaseWallet=U.Mnemonic=U.uuidV4=U.encodeRlp=U.decodeRlp=U.Utf8ErrorFuncs=U.toUtf8String=U.toUtf8CodePoints=U.toUtf8Bytes=U.parseUnits=U.formatUnits=U.parseEther=U.formatEther=U.mask=U.toTwos=U.fromTwos=U.toQuantity=U.toNumber=U.toBeHex=U.toBigInt=U.toBeArray=void 0;var vBe=CE();Object.defineProperty(U,"version",{enumerable:!0,get:function(){return vBe.version}});var Is=J3();Object.defineProperty(U,"decodeBytes32String",{enumerable:!0,get:function(){return Is.decodeBytes32String}});Object.defineProperty(U,"encodeBytes32String",{enumerable:!0,get:function(){return Is.encodeBytes32String}});Object.defineProperty(U,"AbiCoder",{enumerable:!0,get:function(){return Is.AbiCoder}});Object.defineProperty(U,"ConstructorFragment",{enumerable:!0,get:function(){return Is.ConstructorFragment}});Object.defineProperty(U,"ErrorFragment",{enumerable:!0,get:function(){return Is.ErrorFragment}});Object.defineProperty(U,"EventFragment",{enumerable:!0,get:function(){return Is.EventFragment}});Object.defineProperty(U,"Fragment",{enumerable:!0,get:function(){return Is.Fragment}});Object.defineProperty(U,"FallbackFragment",{enumerable:!0,get:function(){return Is.FallbackFragment}});Object.defineProperty(U,"FunctionFragment",{enumerable:!0,get:function(){return Is.FunctionFragment}});Object.defineProperty(U,"NamedFragment",{enumerable:!0,get:function(){return Is.NamedFragment}});Object.defineProperty(U,"ParamType",{enumerable:!0,get:function(){return Is.ParamType}});Object.defineProperty(U,"StructFragment",{enumerable:!0,get:function(){return Is.StructFragment}});Object.defineProperty(U,"checkResultErrors",{enumerable:!0,get:function(){return Is.checkResultErrors}});Object.defineProperty(U,"ErrorDescription",{enumerable:!0,get:function(){return Is.ErrorDescription}});Object.defineProperty(U,"Indexed",{enumerable:!0,get:function(){return Is.Indexed}});Object.defineProperty(U,"Interface",{enumerable:!0,get:function(){return Is.Interface}});Object.defineProperty(U,"LogDescription",{enumerable:!0,get:function(){return Is.LogDescription}});Object.defineProperty(U,"Result",{enumerable:!0,get:function(){return Is.Result}});Object.defineProperty(U,"TransactionDescription",{enumerable:!0,get:function(){return Is.TransactionDescription}});Object.defineProperty(U,"Typed",{enumerable:!0,get:function(){return Is.Typed}});var Tx=Ws();Object.defineProperty(U,"getAddress",{enumerable:!0,get:function(){return Tx.getAddress}});Object.defineProperty(U,"getIcapAddress",{enumerable:!0,get:function(){return Tx.getIcapAddress}});Object.defineProperty(U,"getCreateAddress",{enumerable:!0,get:function(){return Tx.getCreateAddress}});Object.defineProperty(U,"getCreate2Address",{enumerable:!0,get:function(){return Tx.getCreate2Address}});Object.defineProperty(U,"isAddressable",{enumerable:!0,get:function(){return Tx.isAddressable}});Object.defineProperty(U,"isAddress",{enumerable:!0,get:function(){return Tx.isAddress}});Object.defineProperty(U,"resolveAddress",{enumerable:!0,get:function(){return Tx.resolveAddress}});var sl=y3();Object.defineProperty(U,"ZeroAddress",{enumerable:!0,get:function(){return sl.ZeroAddress}});Object.defineProperty(U,"WeiPerEther",{enumerable:!0,get:function(){return sl.WeiPerEther}});Object.defineProperty(U,"MaxUint256",{enumerable:!0,get:function(){return sl.MaxUint256}});Object.defineProperty(U,"MinInt256",{enumerable:!0,get:function(){return sl.MinInt256}});Object.defineProperty(U,"MaxInt256",{enumerable:!0,get:function(){return sl.MaxInt256}});Object.defineProperty(U,"N",{enumerable:!0,get:function(){return sl.N}});Object.defineProperty(U,"ZeroHash",{enumerable:!0,get:function(){return sl.ZeroHash}});Object.defineProperty(U,"EtherSymbol",{enumerable:!0,get:function(){return sl.EtherSymbol}});Object.defineProperty(U,"MessagePrefix",{enumerable:!0,get:function(){return sl.MessagePrefix}});var il=nv();Object.defineProperty(U,"BaseContract",{enumerable:!0,get:function(){return il.BaseContract}});Object.defineProperty(U,"Contract",{enumerable:!0,get:function(){return il.Contract}});Object.defineProperty(U,"ContractFactory",{enumerable:!0,get:function(){return il.ContractFactory}});Object.defineProperty(U,"ContractEventPayload",{enumerable:!0,get:function(){return il.ContractEventPayload}});Object.defineProperty(U,"ContractTransactionReceipt",{enumerable:!0,get:function(){return il.ContractTransactionReceipt}});Object.defineProperty(U,"ContractTransactionResponse",{enumerable:!0,get:function(){return il.ContractTransactionResponse}});Object.defineProperty(U,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return il.ContractUnknownEventPayload}});Object.defineProperty(U,"EventLog",{enumerable:!0,get:function(){return il.EventLog}});Object.defineProperty(U,"UndecodedEventLog",{enumerable:!0,get:function(){return il.UndecodedEventLog}});var tu=di();Object.defineProperty(U,"computeHmac",{enumerable:!0,get:function(){return tu.computeHmac}});Object.defineProperty(U,"randomBytes",{enumerable:!0,get:function(){return tu.randomBytes}});Object.defineProperty(U,"keccak256",{enumerable:!0,get:function(){return tu.keccak256}});Object.defineProperty(U,"ripemd160",{enumerable:!0,get:function(){return tu.ripemd160}});Object.defineProperty(U,"sha256",{enumerable:!0,get:function(){return tu.sha256}});Object.defineProperty(U,"sha512",{enumerable:!0,get:function(){return tu.sha512}});Object.defineProperty(U,"pbkdf2",{enumerable:!0,get:function(){return tu.pbkdf2}});Object.defineProperty(U,"scrypt",{enumerable:!0,get:function(){return tu.scrypt}});Object.defineProperty(U,"scryptSync",{enumerable:!0,get:function(){return tu.scryptSync}});Object.defineProperty(U,"lock",{enumerable:!0,get:function(){return tu.lock}});Object.defineProperty(U,"Signature",{enumerable:!0,get:function(){return tu.Signature}});Object.defineProperty(U,"SigningKey",{enumerable:!0,get:function(){return tu.SigningKey}});var ru=v0();Object.defineProperty(U,"id",{enumerable:!0,get:function(){return ru.id}});Object.defineProperty(U,"ensNormalize",{enumerable:!0,get:function(){return ru.ensNormalize}});Object.defineProperty(U,"isValidName",{enumerable:!0,get:function(){return ru.isValidName}});Object.defineProperty(U,"namehash",{enumerable:!0,get:function(){return ru.namehash}});Object.defineProperty(U,"dnsEncode",{enumerable:!0,get:function(){return ru.dnsEncode}});Object.defineProperty(U,"hashMessage",{enumerable:!0,get:function(){return ru.hashMessage}});Object.defineProperty(U,"verifyMessage",{enumerable:!0,get:function(){return ru.verifyMessage}});Object.defineProperty(U,"solidityPacked",{enumerable:!0,get:function(){return ru.solidityPacked}});Object.defineProperty(U,"solidityPackedKeccak256",{enumerable:!0,get:function(){return ru.solidityPackedKeccak256}});Object.defineProperty(U,"solidityPackedSha256",{enumerable:!0,get:function(){return ru.solidityPackedSha256}});Object.defineProperty(U,"TypedDataEncoder",{enumerable:!0,get:function(){return ru.TypedDataEncoder}});Object.defineProperty(U,"verifyTypedData",{enumerable:!0,get:function(){return ru.verifyTypedData}});var _t=jO();Object.defineProperty(U,"getDefaultProvider",{enumerable:!0,get:function(){return _t.getDefaultProvider}});Object.defineProperty(U,"Block",{enumerable:!0,get:function(){return _t.Block}});Object.defineProperty(U,"FeeData",{enumerable:!0,get:function(){return _t.FeeData}});Object.defineProperty(U,"Log",{enumerable:!0,get:function(){return _t.Log}});Object.defineProperty(U,"TransactionReceipt",{enumerable:!0,get:function(){return _t.TransactionReceipt}});Object.defineProperty(U,"TransactionResponse",{enumerable:!0,get:function(){return _t.TransactionResponse}});Object.defineProperty(U,"AbstractSigner",{enumerable:!0,get:function(){return _t.AbstractSigner}});Object.defineProperty(U,"NonceManager",{enumerable:!0,get:function(){return _t.NonceManager}});Object.defineProperty(U,"VoidSigner",{enumerable:!0,get:function(){return _t.VoidSigner}});Object.defineProperty(U,"AbstractProvider",{enumerable:!0,get:function(){return _t.AbstractProvider}});Object.defineProperty(U,"FallbackProvider",{enumerable:!0,get:function(){return _t.FallbackProvider}});Object.defineProperty(U,"JsonRpcApiProvider",{enumerable:!0,get:function(){return _t.JsonRpcApiProvider}});Object.defineProperty(U,"JsonRpcProvider",{enumerable:!0,get:function(){return _t.JsonRpcProvider}});Object.defineProperty(U,"JsonRpcSigner",{enumerable:!0,get:function(){return _t.JsonRpcSigner}});Object.defineProperty(U,"BrowserProvider",{enumerable:!0,get:function(){return _t.BrowserProvider}});Object.defineProperty(U,"AlchemyProvider",{enumerable:!0,get:function(){return _t.AlchemyProvider}});Object.defineProperty(U,"AnkrProvider",{enumerable:!0,get:function(){return _t.AnkrProvider}});Object.defineProperty(U,"ChainstackProvider",{enumerable:!0,get:function(){return _t.ChainstackProvider}});Object.defineProperty(U,"CloudflareProvider",{enumerable:!0,get:function(){return _t.CloudflareProvider}});Object.defineProperty(U,"EtherscanProvider",{enumerable:!0,get:function(){return _t.EtherscanProvider}});Object.defineProperty(U,"InfuraProvider",{enumerable:!0,get:function(){return _t.InfuraProvider}});Object.defineProperty(U,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return _t.InfuraWebSocketProvider}});Object.defineProperty(U,"PocketProvider",{enumerable:!0,get:function(){return _t.PocketProvider}});Object.defineProperty(U,"QuickNodeProvider",{enumerable:!0,get:function(){return _t.QuickNodeProvider}});Object.defineProperty(U,"IpcSocketProvider",{enumerable:!0,get:function(){return _t.IpcSocketProvider}});Object.defineProperty(U,"SocketProvider",{enumerable:!0,get:function(){return _t.SocketProvider}});Object.defineProperty(U,"WebSocketProvider",{enumerable:!0,get:function(){return _t.WebSocketProvider}});Object.defineProperty(U,"EnsResolver",{enumerable:!0,get:function(){return _t.EnsResolver}});Object.defineProperty(U,"Network",{enumerable:!0,get:function(){return _t.Network}});Object.defineProperty(U,"EnsPlugin",{enumerable:!0,get:function(){return _t.EnsPlugin}});Object.defineProperty(U,"EtherscanPlugin",{enumerable:!0,get:function(){return _t.EtherscanPlugin}});Object.defineProperty(U,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return _t.FeeDataNetworkPlugin}});Object.defineProperty(U,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return _t.FetchUrlFeeDataNetworkPlugin}});Object.defineProperty(U,"GasCostPlugin",{enumerable:!0,get:function(){return _t.GasCostPlugin}});Object.defineProperty(U,"NetworkPlugin",{enumerable:!0,get:function(){return _t.NetworkPlugin}});Object.defineProperty(U,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return _t.MulticoinProviderPlugin}});Object.defineProperty(U,"SocketBlockSubscriber",{enumerable:!0,get:function(){return _t.SocketBlockSubscriber}});Object.defineProperty(U,"SocketEventSubscriber",{enumerable:!0,get:function(){return _t.SocketEventSubscriber}});Object.defineProperty(U,"SocketPendingSubscriber",{enumerable:!0,get:function(){return _t.SocketPendingSubscriber}});Object.defineProperty(U,"SocketSubscriber",{enumerable:!0,get:function(){return _t.SocketSubscriber}});Object.defineProperty(U,"UnmanagedSubscriber",{enumerable:!0,get:function(){return _t.UnmanagedSubscriber}});Object.defineProperty(U,"copyRequest",{enumerable:!0,get:function(){return _t.copyRequest}});Object.defineProperty(U,"showThrottleMessage",{enumerable:!0,get:function(){return _t.showThrottleMessage}});var uB=Qa();Object.defineProperty(U,"accessListify",{enumerable:!0,get:function(){return uB.accessListify}});Object.defineProperty(U,"computeAddress",{enumerable:!0,get:function(){return uB.computeAddress}});Object.defineProperty(U,"recoverAddress",{enumerable:!0,get:function(){return uB.recoverAddress}});Object.defineProperty(U,"Transaction",{enumerable:!0,get:function(){return uB.Transaction}});var et=Ne();Object.defineProperty(U,"decodeBase58",{enumerable:!0,get:function(){return et.decodeBase58}});Object.defineProperty(U,"encodeBase58",{enumerable:!0,get:function(){return et.encodeBase58}});Object.defineProperty(U,"decodeBase64",{enumerable:!0,get:function(){return et.decodeBase64}});Object.defineProperty(U,"encodeBase64",{enumerable:!0,get:function(){return et.encodeBase64}});Object.defineProperty(U,"concat",{enumerable:!0,get:function(){return et.concat}});Object.defineProperty(U,"dataLength",{enumerable:!0,get:function(){return et.dataLength}});Object.defineProperty(U,"dataSlice",{enumerable:!0,get:function(){return et.dataSlice}});Object.defineProperty(U,"getBytes",{enumerable:!0,get:function(){return et.getBytes}});Object.defineProperty(U,"getBytesCopy",{enumerable:!0,get:function(){return et.getBytesCopy}});Object.defineProperty(U,"hexlify",{enumerable:!0,get:function(){return et.hexlify}});Object.defineProperty(U,"isHexString",{enumerable:!0,get:function(){return et.isHexString}});Object.defineProperty(U,"isBytesLike",{enumerable:!0,get:function(){return et.isBytesLike}});Object.defineProperty(U,"stripZerosLeft",{enumerable:!0,get:function(){return et.stripZerosLeft}});Object.defineProperty(U,"zeroPadBytes",{enumerable:!0,get:function(){return et.zeroPadBytes}});Object.defineProperty(U,"zeroPadValue",{enumerable:!0,get:function(){return et.zeroPadValue}});Object.defineProperty(U,"defineProperties",{enumerable:!0,get:function(){return et.defineProperties}});Object.defineProperty(U,"resolveProperties",{enumerable:!0,get:function(){return et.resolveProperties}});Object.defineProperty(U,"assert",{enumerable:!0,get:function(){return et.assert}});Object.defineProperty(U,"assertArgument",{enumerable:!0,get:function(){return et.assertArgument}});Object.defineProperty(U,"assertArgumentCount",{enumerable:!0,get:function(){return et.assertArgumentCount}});Object.defineProperty(U,"assertNormalize",{enumerable:!0,get:function(){return et.assertNormalize}});Object.defineProperty(U,"assertPrivate",{enumerable:!0,get:function(){return et.assertPrivate}});Object.defineProperty(U,"makeError",{enumerable:!0,get:function(){return et.makeError}});Object.defineProperty(U,"isCallException",{enumerable:!0,get:function(){return et.isCallException}});Object.defineProperty(U,"isError",{enumerable:!0,get:function(){return et.isError}});Object.defineProperty(U,"EventPayload",{enumerable:!0,get:function(){return et.EventPayload}});Object.defineProperty(U,"FetchRequest",{enumerable:!0,get:function(){return et.FetchRequest}});Object.defineProperty(U,"FetchResponse",{enumerable:!0,get:function(){return et.FetchResponse}});Object.defineProperty(U,"FetchCancelSignal",{enumerable:!0,get:function(){return et.FetchCancelSignal}});Object.defineProperty(U,"FixedNumber",{enumerable:!0,get:function(){return et.FixedNumber}});Object.defineProperty(U,"getBigInt",{enumerable:!0,get:function(){return et.getBigInt}});Object.defineProperty(U,"getNumber",{enumerable:!0,get:function(){return et.getNumber}});Object.defineProperty(U,"getUint",{enumerable:!0,get:function(){return et.getUint}});Object.defineProperty(U,"toBeArray",{enumerable:!0,get:function(){return et.toBeArray}});Object.defineProperty(U,"toBigInt",{enumerable:!0,get:function(){return et.toBigInt}});Object.defineProperty(U,"toBeHex",{enumerable:!0,get:function(){return et.toBeHex}});Object.defineProperty(U,"toNumber",{enumerable:!0,get:function(){return et.toNumber}});Object.defineProperty(U,"toQuantity",{enumerable:!0,get:function(){return et.toQuantity}});Object.defineProperty(U,"fromTwos",{enumerable:!0,get:function(){return et.fromTwos}});Object.defineProperty(U,"toTwos",{enumerable:!0,get:function(){return et.toTwos}});Object.defineProperty(U,"mask",{enumerable:!0,get:function(){return et.mask}});Object.defineProperty(U,"formatEther",{enumerable:!0,get:function(){return et.formatEther}});Object.defineProperty(U,"parseEther",{enumerable:!0,get:function(){return et.parseEther}});Object.defineProperty(U,"formatUnits",{enumerable:!0,get:function(){return et.formatUnits}});Object.defineProperty(U,"parseUnits",{enumerable:!0,get:function(){return et.parseUnits}});Object.defineProperty(U,"toUtf8Bytes",{enumerable:!0,get:function(){return et.toUtf8Bytes}});Object.defineProperty(U,"toUtf8CodePoints",{enumerable:!0,get:function(){return et.toUtf8CodePoints}});Object.defineProperty(U,"toUtf8String",{enumerable:!0,get:function(){return et.toUtf8String}});Object.defineProperty(U,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return et.Utf8ErrorFuncs}});Object.defineProperty(U,"decodeRlp",{enumerable:!0,get:function(){return et.decodeRlp}});Object.defineProperty(U,"encodeRlp",{enumerable:!0,get:function(){return et.encodeRlp}});Object.defineProperty(U,"uuidV4",{enumerable:!0,get:function(){return et.uuidV4}});var Pa=zoe();Object.defineProperty(U,"Mnemonic",{enumerable:!0,get:function(){return Pa.Mnemonic}});Object.defineProperty(U,"BaseWallet",{enumerable:!0,get:function(){return Pa.BaseWallet}});Object.defineProperty(U,"HDNodeWallet",{enumerable:!0,get:function(){return Pa.HDNodeWallet}});Object.defineProperty(U,"HDNodeVoidWallet",{enumerable:!0,get:function(){return Pa.HDNodeVoidWallet}});Object.defineProperty(U,"Wallet",{enumerable:!0,get:function(){return Pa.Wallet}});Object.defineProperty(U,"defaultPath",{enumerable:!0,get:function(){return Pa.defaultPath}});Object.defineProperty(U,"getAccountPath",{enumerable:!0,get:function(){return Pa.getAccountPath}});Object.defineProperty(U,"getIndexedAccountPath",{enumerable:!0,get:function(){return Pa.getIndexedAccountPath}});Object.defineProperty(U,"isCrowdsaleJson",{enumerable:!0,get:function(){return Pa.isCrowdsaleJson}});Object.defineProperty(U,"isKeystoreJson",{enumerable:!0,get:function(){return Pa.isKeystoreJson}});Object.defineProperty(U,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Pa.decryptCrowdsaleJson}});Object.defineProperty(U,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Pa.decryptKeystoreJsonSync}});Object.defineProperty(U,"decryptKeystoreJson",{enumerable:!0,get:function(){return Pa.decryptKeystoreJson}});Object.defineProperty(U,"encryptKeystoreJson",{enumerable:!0,get:function(){return Pa.encryptKeystoreJson}});Object.defineProperty(U,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Pa.encryptKeystoreJsonSync}});var r7=Qoe();Object.defineProperty(U,"Wordlist",{enumerable:!0,get:function(){return r7.Wordlist}});Object.defineProperty(U,"LangEn",{enumerable:!0,get:function(){return r7.LangEn}});Object.defineProperty(U,"WordlistOwl",{enumerable:!0,get:function(){return r7.WordlistOwl}});Object.defineProperty(U,"WordlistOwlA",{enumerable:!0,get:function(){return r7.WordlistOwlA}});Object.defineProperty(U,"wordlists",{enumerable:!0,get:function(){return r7.wordlists}})});var s7=R(n7=>{"use strict";b();p();Object.defineProperty(n7,"__esModule",{value:!0});n7.ethers=void 0;var Yoe=nte(),PBe=Yoe.__importStar(vq());n7.ethers=PBe;Yoe.__exportStar(vq(),n7)});var Pq=R(Cb=>{"use strict";b();p();var _Be=Cb&&Cb.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cb,"__esModule",{value:!0});Cb.decryptKeystoreListSync=Cb.decryptKeystoreList=void 0;var X6=s7(),fB=_Be(yB()),dB=Sg();function ABe(r,e,t){let n=JSON.parse(r),s=(0,dB.splitKeystoreKIP3)(r),i=s.length,a=fB.default.map(s,(o,c)=>{let u=(0,X6.decryptKeystoreJsonSync)(o,e);return t&&t((c+1)/i),u});return Promise.resolve({address:(0,X6.getAddress)(n.address),privateKey:a[0].privateKey,privateKeyList:fB.default.map(a,o=>o.privateKey)})}function EBe(r,e){let t=JSON.parse(r),n=(0,dB.splitKeystoreKIP3)(r),s=fB.default.map(n,i=>(0,X6.decryptKeystoreJsonSync)(i,e));return{address:(0,X6.getAddress)(t.address),privateKey:s[0].privateKey,privateKeyList:fB.default.map(s,i=>i.privateKey)}}function SBe(r,e,t){return(0,dB.isKIP3Json)(r)?ABe(r,e,t):(0,X6.decryptKeystoreJson)(r,e,t).then(n=>({address:n.address,privateKey:n.privateKey,privateKeyList:[n.privateKey]}))}Cb.decryptKeystoreList=SBe;function TBe(r,e){if((0,dB.isKIP3Json)(r))return EBe(r,e);{let t=(0,X6.decryptKeystoreJsonSync)(r,e);return{address:t.address,privateKey:t.privateKey,privateKeyList:[t.privateKey]}}}Cb.decryptKeystoreListSync=TBe});var Aq=R(tn=>{"use strict";b();p();var OBe=tn&&tn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tn,"__esModule",{value:!0});tn.poll=tn.sleep=tn.populateFeePayerAndSignatures=tn.populateChainId=tn.eip155sign=tn.populateGasPrice=tn.populateGasLimit=tn.populateNonce=tn.populateTo=tn.populateFrom=tn.getTransactionRequest=void 0;var Lb=s7(),_q=OBe(yB()),lB=Sg();async function BBe(r){if(_q.default.isString(r))return(0,lB.parseTransaction)(r);{if(r instanceof Lb.Transaction)return r.toJSON();let e=await(0,Lb.resolveProperties)(r);return typeof e?.type=="string"&&(e.type=(0,lB.parseTxType)(e.type)),e}}tn.getTransactionRequest=BBe;async function kBe(r,e){!r.from||r.from=="0x"||(0,Lb.assert)(r.from?.toString().toLowerCase()===e?.toLowerCase(),`from address mismatch (wallet address=${e}) (tx.from=${r.from})`,"INVALID_ARGUMENT",{argument:"from",value:r.from}),r.from=e}tn.populateFrom=kBe;async function NBe(r){!r.to||r.to=="0x"?r.to=Lb.ZeroAddress:r.to=await(0,Lb.resolveAddress)(r.to,null)}tn.populateTo=NBe;async function IBe(r,e){if(!r.nonce)throw new Error("MISSING_ARGUMENT")}tn.populateNonce=IBe;async function RBe(r){if(!r.gasLimit)throw new Error("MISSING_ARGUMENT")}tn.populateGasLimit=RBe;async function jBe(r){if(!r.gasPrice)throw new Error("MISSING_ARGUMENT")}tn.populateGasPrice=jBe;function MBe(r,e,t){let n=r.sign(e),i=(n.v===27?0:1)+ +t*2+35;return{r:n.r,s:n.s,v:i}}tn.eip155sign=MBe;async function CBe(r){r.chainId||(r.chainId=(0,lB.getChainIdFromSignatureTuples)(r.txSignatures)??(0,lB.getChainIdFromSignatureTuples)(r.feePayerSignatures))}tn.populateChainId=CBe;async function LBe(r,e){!r.feePayer||r.feePayer==Lb.ZeroAddress||(0,Lb.assert)(r.feePayer.toLowerCase()===e.toLowerCase(),"feePayer address mismatch","INVALID_ARGUMENT",{argument:"feePayer",value:r.feePayer}),r.feePayer=e,_q.default.isArray(r.feePayerSignatures)&&(r.feePayerSignatures=r.feePayerSignatures.filter(t=>!(_q.default.isArray(t)&&t.length==3&&t[0]=="0x01"&&t[1]=="0x"&&t[2]=="0x")))}tn.populateFeePayerAndSignatures=LBe;function Xoe(r){return new Promise((e,t)=>{setTimeout(()=>e(),r)})}tn.sleep=Xoe;async function UBe(r,e,t=100){let n;for(let s=0;s<t;s++){try{let i=await r();if(i&&e(i)){n=i;break}}catch{continue}await Xoe(250)}return(0,Lb.assert)(n,"Transaction timeout!","NETWORK_ERROR",{event:"pollTransactionInPool"}),n}tn.poll=UBe});var Eq=R(ew=>{"use strict";b();p();var FBe=ew&&ew.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ew,"__esModule",{value:!0});ew.Wallet=void 0;var hB=s7(),ece=FBe(yB()),nu=Sg(),bB=Pq(),Io=Aq(),Ub=class extends hB.Wallet{static async fromEncryptedJson(e,t,n){let{address:s,privateKey:i}=await(0,bB.decryptKeystoreList)(e,t,n);return new Ub(s,i)}static fromEncryptedJsonSync(e,t){let{address:n,privateKey:s}=(0,bB.decryptKeystoreListSync)(e,t);return new Ub(n,s)}static async fromEncryptedJsonList(e,t,n){let{address:s,privateKeyList:i}=await(0,bB.decryptKeystoreList)(e,t,n);return ece.default.map(i,a=>new Ub(s,a))}static fromEncryptedJsonListSync(e,t){let{address:n,privateKeyList:s}=(0,bB.decryptKeystoreListSync)(e,t);return ece.default.map(s,i=>new Ub(n,i))}constructor(e,t){if(nu.HexStr.isHex(e,20)){let n=nu.HexStr.from(e),s=t;super(s),this.klaytnAddr=n}else{let n=e;super(n)}}getAddress(e){return e||!this.klaytnAddr?super.getAddress():Promise.resolve(this.klaytnAddr)}getEtherAddress(){return super.getAddress()}decodeTxFromRLP(e){return(0,nu.parseTransaction)(e)}async isDecoupled(){return this.klaytnAddr?await this.getAddress(!1)==await this.getAddress(!0):!1}async populateTransaction(e){return this._populateTransaction(e,!1)}async _populateTransaction(e,t){let n=await(0,Io.getTransactionRequest)(e);if(!(0,nu.isKlaytnTxType)((0,nu.parseTxType)(n.type)))return super.populateTransaction(n);if(t||await(0,Io.populateFrom)(n,await this.getAddress()),await(0,Io.populateTo)(n),n.nonce==null)throw new Error("invalid nonce");if(n.gasLimit==null)throw new Error("invalid gasLimit");if(await(0,Io.populateGasLimit)(n),n.gasPrice==null)throw new Error("invalid gasPrice");if(await(0,Io.populateGasPrice)(n),n.chainId==null)throw new Error("invalid chainId");return await(0,Io.populateChainId)(n),n}async signTransaction(e){let t=await(0,Io.getTransactionRequest)(e);if(!(0,nu.isKlaytnTxType)((0,nu.parseTxType)(t.type)))return super.signTransaction(t);await(0,Io.populateChainId)(t);let n=t.chainId,s=nu.KlaytnTxFactory.fromObject(t),i=(0,hB.keccak256)(s.sigRLP()),a=(0,Io.eip155sign)(this.signingKey,i,Number(n.toString()));return s.addSenderSig(a),(0,nu.isFeePayerSigTxType)(s.type)?s.senderTxHashRLP():s.txHashRLP()}async signTransactionAsFeePayer(e){let t=await(0,Io.getTransactionRequest)(e);(0,hB.assert)((0,nu.isFeePayerSigTxType)((0,nu.parseTxType)(t.type)),`signTransactionAsFeePayer not supported for tx type ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"signTransactionAsFeePayer"}),await(0,Io.populateFeePayerAndSignatures)(t,await this.getAddress()),await(0,Io.populateChainId)(t);let n=t.chainId,s=nu.KlaytnTxFactory.fromObject(t),i=(0,hB.keccak256)(s.sigFeePayerRLP()),a=(0,Io.eip155sign)(this.signingKey,i,Number(n));return s.addFeePayerSig(a),s.txHashRLP()}};ew.Wallet=Ub});var nce=R(tw=>{"use strict";b();p();Object.defineProperty(tw,"__esModule",{value:!0});tw.AccountStore=tw.Accounts=void 0;var F0=s7(),Sq=Sg(),tce=Eq();function Ox(r,e){return(0,F0.getAddress)(r)==(0,F0.getAddress)(e)}function rce(r,e){return(0,F0.computeAddress)(r)==(0,F0.computeAddress)(e)}var Tq=class{constructor(e){this.wallets=[];for(let t=0;t<e.length;t++)if(e[t]instanceof tce.Wallet)this.wallets.push(e[t]);else if(Array.isArray(e[t]))if(e[t].length==1)this.add([e[t][0]]);else if(e[t].length==2)this.add([e[t][0],e[t][1]]);else throw new Error("Input has to be the array of [address, privateKey] or [privateKey]");else throw new Error("Input has to be Wallet, [address, privateKey], or [privateKey]")}async add(e){let t,n;if(e.length==1){let s=new F0.SigningKey(e[0]);t=(0,F0.computeAddress)(s.compressedPublicKey),n=e[0]}else if(e.length==2&&e[1]!=null)t=e[0],n=e[1];else throw new Error("Input has to be [address, privateKey] or [privateKey]");for(let s=0;s<this.wallets.length;s++)if(Ox(await this.wallets[s].getAddress(),t)&&rce(this.wallets[s].privateKey,n))return!1;return this.wallets.push(new tce.Wallet(t,n)),!0}async remove(e){let t,n;if(e.length==1){let s=new F0.SigningKey(e[0]);t=(0,F0.computeAddress)(s.compressedPublicKey),n=e[0]}else if(e.length==2&&e[1]!=null)t=e[0],n=e[1];else throw new Error("Input has to be [address, privateKey] or [privateKey]");for(let s=0;s<this.wallets.length;s++)if(Ox(await this.wallets[s].getAddress(),t)&&rce(await this.wallets[s].privateKey,n))return delete this.wallets[s],this.wallets.splice(s,1),!0;return!1}removeAll(){if(this.wallets.length!=0)for(let e=this.wallets.length-1;e>=0&&e<this.wallets.length;e--)delete this.wallets[e],this.wallets.splice(e,1)}accountByKey(e){let t=[];for(let n=0;n<this.wallets.length;n++)Ox(this.wallets[n].privateKey,e)&&t.push(this.wallets[n]);return t}async accountByAddress(e){let t=[];for(let n=0;n<this.wallets.length;n++)Ox(await this.wallets[n].getAddress(),e)&&t.push(this.wallets[n]);return t}};tw.Accounts=Tq;var Oq=class{constructor(){this.signableKeyList=[]}async updateSignableKeyList(){let e;for(e=0;this.accounts!=null&&e<this.accounts.wallets.length;e++){let t=await this.accounts.wallets[e].getEtherAddress();t=String(t).toLocaleLowerCase(),this.hasInSignableKeyList(t)==!1&&this.signableKeyList.push(t)}}hasInSignableKeyList(e){let t=String(e).toLocaleLowerCase();return this.signableKeyList.indexOf(t)!=-1}hasAccountInfos(e){let t;for(t=0;this.accountInfos!=null&&t<this.accountInfos.length;t++)if(Ox(this.accountInfos[t].address,e))return!0;return!1}getType(e){let t;for(t=0;this.accountInfos!=null&&t<this.accountInfos.length;t++)if(Ox(this.accountInfos[t].address,e))return this.accountInfos[t].key.type;return null}getAccountInfo(e){let t;for(t=0;this.accountInfos!=null&&t<this.accountInfos.length;t++)if(Ox(this.accountInfos[t].address,e))return this.accountInfos[t];return null}getAccountInfos(){return this.accountInfos}getPubkeyInfo(e,t){let n=Sq.HexStr.zeroPad(e,32),s=Sq.HexStr.zeroPad(t,32),i=String(n).substring(2),a=String(s).substring(2),o=F0.SigningKey.computePublicKey(Sq.HexStr.concat("0x04"+i+a),!0),c=(0,F0.computeAddress)(o),u=this.hasInSignableKeyList(c);return{compressed:o,hashed:c,hasPrivateKey:u}}};tw.AccountStore=Oq});var sce=R(Rs=>{"use strict";b();p();var qBe=Rs&&Rs.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),pB=Rs&&Rs.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qBe(e,r,t)};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.parseTransaction=Rs.KlaytnTxFactory=Rs.KlaytnTx=Rs.AccountKeyFactory=Rs.AccountKey=void 0;var i7=Sg();Object.defineProperty(Rs,"AccountKey",{enumerable:!0,get:function(){return i7.AccountKey}});Object.defineProperty(Rs,"AccountKeyFactory",{enumerable:!0,get:function(){return i7.AccountKeyFactory}});Object.defineProperty(Rs,"KlaytnTx",{enumerable:!0,get:function(){return i7.KlaytnTx}});Object.defineProperty(Rs,"KlaytnTxFactory",{enumerable:!0,get:function(){return i7.KlaytnTxFactory}});Object.defineProperty(Rs,"parseTransaction",{enumerable:!0,get:function(){return i7.parseTransaction}});pB(nce(),Rs);pB(Pq(),Rs);pB(Eq(),Rs);pB(Aq(),Rs)});var oce=R(gB=>{"use strict";b();p();Object.defineProperty(gB,"__esModule",{value:!0});gB.KaiaWallet=void 0;var wf=KG(),Fb=qr(),ice=UN(),DBe=wB(),HBe=Rce(),ace=Wk(),Bq=sce(),KBe=Sg(),kq=class extends ice.EthWallet{async getNewAddress(e){let t=e.privateKey;if(!(0,ace.validPrivateKey)(t))throw new Error("invalid key");try{let s=Fb.base.fromHex(t.toLowerCase());(0,wf.assertBufferLength)(s,32);let i=new Bq.Wallet(t);return Promise.resolve({address:await i.getAddress(),publicKey:i.signingKey.publicKey})}catch{}return Promise.reject(wf.NewAddressError)}async validPrivateKey(e){let n={isValid:(0,ace.validPrivateKey)(e.privateKey),privateKey:e.privateKey};return Promise.resolve(n)}async validAddress(e){let t=!1,n;try{n=(0,DBe.getAddress)(e.address),t=!0}catch{t=!1}return Promise.resolve({isValid:t,address:n})}convert2HexString(e){let t;return Fb.BigNumber.isBigNumber(e)?t=e:t=new Fb.BigNumber(e),Fb.base.toBigIntHex(t)}convert2KaiaTxParam(e){if(!e.gasPrice||!e.gasLimit)throw new Error("invalid parameter");return{kaiaTxType:e.kaiaTxType,feePayer:e.feePayer,senderRawTx:e.senderRawTx,from:e.from,to:e.to,value:this.convert2HexString(e.value||0),nonce:e.nonce,contractAddress:e.contractAddress,gasPrice:this.convert2HexString(e.gasPrice||0),gasLimit:this.convert2HexString(e.gasLimit||0),data:e.data,humanReadable:e.humanReadable,codeFormat:e.codeFormat,key:e.key,chainId:this.convert2HexString(e.chainId||1),type:e.type||0,maxPriorityFeePerGas:this.convert2HexString(e.maxPriorityFeePerGas||0),maxFeePerGas:this.convert2HexString(e.maxFeePerGas||0),feeRatio:e.feeRatio}}async signTransaction(e){try{let t=e.privateKey;if(t&&(0,wf.assertBufferLength)(Fb.base.fromHex(t),32),e.data.senderRawTx)return new Bq.Wallet(e.privateKey).signTransactionAsFeePayer(e.data.senderRawTx);if(e.data.kaiaTxType){let n=new Bq.Wallet(e.privateKey),s=this.convert2KaiaTxParam(e.data),i={type:s.kaiaTxType,chainId:s.chainId,from:s.from,nonce:s.nonce,to:s.to,data:s.data,humanReadable:s.humanReadable,codeFormat:s.codeFormat,key:s.key,value:s.value,gasLimit:s.gasLimit,gasPrice:s.gasPrice,maxFeePerGas:s.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas,feeRatio:s.feeRatio},a=await n.populateTransaction(i);return Promise.resolve(n.signTransaction(a))}else return super.signTransaction(e)}catch{return Promise.reject(wf.SignTxError)}}getAddressByPublicKey(e){return Promise.resolve((0,HBe.computeAddress)(Fb.base.fromHex(e.publicKey)))}async getMPCRawTransaction(e){return Promise.reject(wf.GetMpcRawTransactionError)}async getMPCTransaction(e){return Promise.reject(wf.GetMpcTransactionError)}async getMPCRawMessage(e){return Promise.reject(wf.GetMpcRawTransactionError)}async getMPCSignedMessage(e){return Promise.reject(wf.GetMpcTransactionError)}async getHardWareRawTransaction(e){return Promise.reject(wf.GetHardwareRawTransactionError)}async getHardWareSignedTransaction(e){return Promise.reject(wf.GetHardwareSignedTransactionError)}async calcTxHash(e){let n=KBe.KlaytnTxFactory.fromRLP(e.data).txHashRLP();return Promise.resolve(Fb.base.toHex((0,ice.keccak256)(Fb.base.fromHex(n)),!0))}async validSignedTransaction(e){return Promise.reject(wf.validSignedTransactionError)}};gB.KaiaWallet=kq});var VBe=R(qb=>{b();p();var GBe=qb&&qb.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),cce=qb&&qb.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&GBe(e,r,t)};Object.defineProperty(qb,"__esModule",{value:!0});cce(Wk(),qb);cce(oce(),qb)});export{VBe as a};
window.inOKXExtension = true;
window.inMiniApp = false;
window.ASSETS_BUILD_TYPE = "publish";
//# sourceMappingURL=chunk-QVMDY4IS.js.map