@dcl/governance-site 2.1.1 → 2.1.2-21396561927.commit-5f7c81e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{BlockOverrides-b253ac3c.js → BlockOverrides-303f7e9f.js} +5 -5
- package/assets/{ConstantsUtil-8392393d.js → ConstantsUtil-a131dde8.js} +1 -1
- package/assets/ContentfulRichText-16284a17.js +1 -0
- package/assets/{ExchangeController-8312cbac.js → ExchangeController-a14191f2.js} +1 -1
- package/assets/{HelpersUtil-422d6b63.js → HelpersUtil-2b99f8bd.js} +1 -1
- package/assets/{NetworkUtil-f04f30f1.js → NetworkUtil-c907cd4d.js} +1 -1
- package/assets/{ReownAuthentication-95163b2a.js → ReownAuthentication-b2c2d543.js} +1 -1
- package/assets/{SwapController-a78fa27a.js → SwapController-cd0f257b.js} +1 -1
- package/assets/{UserAvatar-ba80ecc0.js → UserAvatar-fd309664.js} +1 -1
- package/assets/__vite-optional-peer-dep_lottie-react_decentraland-ui2-b25bb000.js +1 -0
- package/assets/{ccip-afcae892.js → ccip-44049d54.js} +1 -1
- package/assets/{data-capture-a3e503e9.js → data-capture-7e26f0ce.js} +1 -1
- package/assets/{email-707c1fd2.js → email-8a377eee.js} +1 -1
- package/assets/{embedded-wallet-5cdc1540.js → embedded-wallet-0fb24cc2.js} +1 -1
- package/assets/features-7aff3cdd.js +1 -0
- package/assets/{fortmatic-c27206e9.js → fortmatic-19aac1db.js} +1 -1
- package/assets/{if-defined-7c3cfad4.js → if-defined-5ecb5632.js} +1 -1
- package/assets/{index-1912ccb5.js → index-02cebb5e.js} +208 -211
- package/assets/{index-3beb72c7.js → index-0687b660.js} +1 -1
- package/assets/{index-2a442cfb.js → index-088190d3.js} +1 -1
- package/assets/{index-3d9f7aa4.js → index-12ec15f0.js} +1 -1
- package/assets/{index-c1960f8b.js → index-15da260e.js} +1 -1
- package/assets/{index-11611d06.js → index-1ef89fbf.js} +1 -1
- package/assets/{index-25743d75.js → index-2428c92d.js} +1 -1
- package/assets/{index-24f70ec2.js → index-304c2025.js} +1 -1
- package/assets/{index-0d9e7a1b.js → index-45573641.js} +1 -1
- package/assets/{index-a6ebc22c.js → index-4795bc6d.js} +1 -1
- package/assets/{index-d606cdd8.js → index-52bd0c54.js} +3 -2
- package/assets/{index-f1b0fa49.js → index-557ac282.js} +1 -1
- package/assets/{index-8a1e4e8f.js → index-5b7f5468.js} +1 -1
- package/assets/{index-50d289a7.js → index-5db900d2.js} +1 -1
- package/assets/{index-378e1ef5.js → index-61219cbe.js} +46 -43
- package/assets/{index-29524bff.js → index-67af3d9f.js} +1 -1
- package/assets/{index-0155e9d0.js → index-6a478a1a.js} +1 -1
- package/assets/{index-674cfbc1.js → index-6aa35c4c.js} +1 -1
- package/assets/{index-6b3f1dc3.js → index-6d67eda0.js} +1 -1
- package/assets/{index-c4bd5468.js → index-6efd5958.js} +1 -1
- package/assets/{index-d3a32d19.js → index-7cb264a1.js} +1 -1
- package/assets/index-863e8fd6.js +277 -0
- package/assets/{index-b079bc07.js → index-906aeedb.js} +39 -39
- package/assets/{index-e65926ac.js → index-91e7b718.js} +1 -1
- package/assets/{index-88b3d2d0.js → index-9c5f86d3.js} +1 -1
- package/assets/{index-9b4b1d43.js → index-9ed03248.js} +1 -1
- package/assets/{index-033dbcb1.js → index-a30fd37b.js} +1 -1
- package/assets/index-b249573f.js +43 -0
- package/assets/{index-3aca6a72.js → index-b612aba6.js} +1 -1
- package/assets/{index-cae81f79.css → index-bad2d6e3.css} +4 -4
- package/assets/{index-327f2bbb.js → index-bfa1b0b2.js} +1 -1
- package/assets/{index-66b13afd.js → index-bfcb1eaf.js} +2 -2
- package/assets/{index-e4a556a6.js → index-cdede9c1.js} +1 -1
- package/assets/{index-e66b5a2a.js → index-d4cf6fd5.js} +1 -1
- package/assets/{index-628f4c66.js → index-e0285d09.js} +1 -1
- package/assets/{index-a1f961e2.js → index-e82b1bf2.js} +1 -1
- package/assets/networks-f92d44f1.js +1 -0
- package/assets/{onramp-e920d24b.js → onramp-531cac52.js} +1 -1
- package/assets/{pay-with-exchange-591f2a34.js → pay-with-exchange-7c86030c.js} +1 -1
- package/assets/{receive-731a2ffa.js → receive-168aa468.js} +1 -1
- package/assets/{ref-27933252.js → ref-f07b284a.js} +1 -1
- package/assets/rich-text-react-renderer_decentraland-ui2-b25bb000.js +1 -0
- package/assets/{send-40d251c3.js → send-d84e8cd4.js} +28 -28
- package/assets/{socials-4e758372.js → socials-a7521156.js} +1 -1
- package/assets/{swaps-62f6ad92.js → swaps-35bf1db5.js} +1 -1
- package/assets/{transactions-6223734a.js → transactions-ffdabf4e.js} +1 -1
- package/assets/{tslib.es6-08ac7de7.js → tslib.es6-f2b18d1b.js} +1 -1
- package/assets/{w3m-modal-caef023e.js → w3m-modal-c647dc65.js} +1 -1
- package/assets/zoraTestnet-bea7fe0f.js +36 -0
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/features-eaf3f10e.js +0 -1
- package/assets/index-139e0e8d.js +0 -277
- package/assets/index-7a343a6c.js +0 -43
- package/assets/networks-afe9d5a8.js +0 -1
- package/assets/zoraTestnet-f8dce652.js +0 -36
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as Zn}from"./index-1912ccb5.js";var Ae={},ce={},ye={},Ct={},it={},sr;function Wn(){return sr||(sr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.crypto=void 0,it.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),it}var or;function Me(){return or||(or=1,function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=h,e.anumber=o,e.abytes=f,e.ahash=g,e.aexists=l,e.aoutput=B,e.u8=O,e.u32=P,e.clean=L,e.createView=j,e.rotr=k,e.rotl=q,e.byteSwap=C,e.byteSwap32=z,e.bytesToHex=u,e.hexToBytes=d,e.asyncLoop=_,e.utf8ToBytes=H,e.bytesToUtf8=E,e.toBytes=x,e.kdfInputToBytes=A,e.concatBytes=p,e.checkOpts=v,e.createHasher=$,e.createOptHasher=w,e.createXOFer=a,e.randomBytes=I;const i=Wn();function h(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function o(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function f(r,...n){if(!h(r))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(r.length))throw new Error("Uint8Array expected of length "+n+", got length="+r.length)}function g(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");o(r.outputLen),o(r.blockLen)}function l(r,n=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(n&&r.finished)throw new Error("Hash#digest() has already been called")}function B(r,n){f(r);const s=n.outputLen;if(r.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function O(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function P(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function L(...r){for(let n=0;n<r.length;n++)r[n].fill(0)}function j(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function k(r,n){return r<<32-n|r>>>n}function q(r,n){return r<<n|r>>>32-n>>>0}e.isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function C(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}e.swap8IfBE=e.isLE?r=>r:r=>C(r),e.byteSwapIfBE=e.swap8IfBE;function z(r){for(let n=0;n<r.length;n++)r[n]=C(r[n]);return r}e.swap32IfBE=e.isLE?r=>r:z;const N=(()=>typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function")(),y=Array.from({length:256},(r,n)=>n.toString(16).padStart(2,"0"));function u(r){if(f(r),N)return r.toHex();let n="";for(let s=0;s<r.length;s++)n+=y[r[s]];return n}const m={_0:48,_9:57,A:65,F:70,a:97,f:102};function t(r){if(r>=m._0&&r<=m._9)return r-m._0;if(r>=m.A&&r<=m.F)return r-(m.A-10);if(r>=m.a&&r<=m.f)return r-(m.a-10)}function d(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);if(N)return Uint8Array.fromHex(r);const n=r.length,s=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const c=new Uint8Array(s);for(let S=0,M=0;S<s;S++,M+=2){const U=t(r.charCodeAt(M)),V=t(r.charCodeAt(M+1));if(U===void 0||V===void 0){const D=r[M]+r[M+1];throw new Error('hex string expected, got non-hex character "'+D+'" at index '+M)}c[S]=U*16+V}return c}const b=async()=>{};e.nextTick=b;async function _(r,n,s){let c=Date.now();for(let S=0;S<r;S++){s(S);const M=Date.now()-c;M>=0&&M<n||(await(0,e.nextTick)(),c+=M)}}function H(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}function E(r){return new TextDecoder().decode(r)}function x(r){return typeof r=="string"&&(r=H(r)),f(r),r}function A(r){return typeof r=="string"&&(r=H(r)),f(r),r}function p(...r){let n=0;for(let c=0;c<r.length;c++){const S=r[c];f(S),n+=S.length}const s=new Uint8Array(n);for(let c=0,S=0;c<r.length;c++){const M=r[c];s.set(M,S),S+=M.length}return s}function v(r,n){if(n!==void 0&&{}.toString.call(n)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(r,n)}class T{}e.Hash=T;function $(r){const n=c=>r().update(x(c)).digest(),s=r();return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=()=>r(),n}function w(r){const n=(c,S)=>r(S).update(x(c)).digest(),s=r({});return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=c=>r(c),n}function a(r){const n=(c,S)=>r(S).update(x(c)).digest(),s=r({});return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=c=>r(c),n}e.wrapConstructor=$,e.wrapConstructorWithOpts=w,e.wrapXOFConstructorWithOpts=a;function I(r=32){if(i.crypto&&typeof i.crypto.getRandomValues=="function")return i.crypto.getRandomValues(new Uint8Array(r));if(i.crypto&&typeof i.crypto.randomBytes=="function")return Uint8Array.from(i.crypto.randomBytes(r));throw new Error("crypto.getRandomValues must be defined")}}(Ct)),Ct}var ar;function vn(){if(ar)return ye;ar=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.SHA512_IV=ye.SHA384_IV=ye.SHA224_IV=ye.SHA256_IV=ye.HashMD=void 0,ye.setBigUint64=i,ye.Chi=h,ye.Maj=o;const e=Me();function i(g,l,B,O){if(typeof g.setBigUint64=="function")return g.setBigUint64(l,B,O);const P=BigInt(32),L=BigInt(4294967295),j=Number(B>>P&L),k=Number(B&L),q=O?4:0,C=O?0:4;g.setUint32(l+q,j,O),g.setUint32(l+C,k,O)}function h(g,l,B){return g&l^~g&B}function o(g,l,B){return g&l^g&B^l&B}class f extends e.Hash{constructor(l,B,O,P){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=l,this.outputLen=B,this.padOffset=O,this.isLE=P,this.buffer=new Uint8Array(l),this.view=(0,e.createView)(this.buffer)}update(l){(0,e.aexists)(this),l=(0,e.toBytes)(l),(0,e.abytes)(l);const{view:B,buffer:O,blockLen:P}=this,L=l.length;for(let j=0;j<L;){const k=Math.min(P-this.pos,L-j);if(k===P){const q=(0,e.createView)(l);for(;P<=L-j;j+=P)this.process(q,j);continue}O.set(l.subarray(j,j+k),this.pos),this.pos+=k,j+=k,this.pos===P&&(this.process(B,0),this.pos=0)}return this.length+=l.length,this.roundClean(),this}digestInto(l){(0,e.aexists)(this),(0,e.aoutput)(l,this),this.finished=!0;const{buffer:B,view:O,blockLen:P,isLE:L}=this;let{pos:j}=this;B[j++]=128,(0,e.clean)(this.buffer.subarray(j)),this.padOffset>P-j&&(this.process(O,0),j=0);for(let N=j;N<P;N++)B[N]=0;i(O,P-8,BigInt(this.length*8),L),this.process(O,0);const k=(0,e.createView)(l),q=this.outputLen;if(q%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const C=q/4,z=this.get();if(C>z.length)throw new Error("_sha2: outputLen bigger than state");for(let N=0;N<C;N++)k.setUint32(4*N,z[N],L)}digest(){const{buffer:l,outputLen:B}=this;this.digestInto(l);const O=l.slice(0,B);return this.destroy(),O}_cloneInto(l){l||(l=new this.constructor),l.set(...this.get());const{blockLen:B,buffer:O,length:P,finished:L,destroyed:j,pos:k}=this;return l.destroyed=j,l.finished=L,l.length=P,l.pos=k,P%B&&l.buffer.set(O),l}clone(){return this._cloneInto()}}return ye.HashMD=f,ye.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ye.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),ye.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ye.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ye}var J={},cr;function En(){if(cr)return J;cr=1,Object.defineProperty(J,"__esModule",{value:!0}),J.toBig=J.shrSL=J.shrSH=J.rotrSL=J.rotrSH=J.rotrBL=J.rotrBH=J.rotr32L=J.rotr32H=J.rotlSL=J.rotlSH=J.rotlBL=J.rotlBH=J.add5L=J.add5H=J.add4L=J.add4H=J.add3L=J.add3H=void 0,J.add=y,J.fromBig=h,J.split=o;const e=BigInt(2**32-1),i=BigInt(32);function h(E,x=!1){return x?{h:Number(E&e),l:Number(E>>i&e)}:{h:Number(E>>i&e)|0,l:Number(E&e)|0}}function o(E,x=!1){const A=E.length;let p=new Uint32Array(A),v=new Uint32Array(A);for(let T=0;T<A;T++){const{h:$,l:w}=h(E[T],x);[p[T],v[T]]=[$,w]}return[p,v]}const f=(E,x)=>BigInt(E>>>0)<<i|BigInt(x>>>0);J.toBig=f;const g=(E,x,A)=>E>>>A;J.shrSH=g;const l=(E,x,A)=>E<<32-A|x>>>A;J.shrSL=l;const B=(E,x,A)=>E>>>A|x<<32-A;J.rotrSH=B;const O=(E,x,A)=>E<<32-A|x>>>A;J.rotrSL=O;const P=(E,x,A)=>E<<64-A|x>>>A-32;J.rotrBH=P;const L=(E,x,A)=>E>>>A-32|x<<64-A;J.rotrBL=L;const j=(E,x)=>x;J.rotr32H=j;const k=(E,x)=>E;J.rotr32L=k;const q=(E,x,A)=>E<<A|x>>>32-A;J.rotlSH=q;const C=(E,x,A)=>x<<A|E>>>32-A;J.rotlSL=C;const z=(E,x,A)=>x<<A-32|E>>>64-A;J.rotlBH=z;const N=(E,x,A)=>E<<A-32|x>>>64-A;J.rotlBL=N;function y(E,x,A,p){const v=(x>>>0)+(p>>>0);return{h:E+A+(v/2**32|0)|0,l:v|0}}const u=(E,x,A)=>(E>>>0)+(x>>>0)+(A>>>0);J.add3L=u;const m=(E,x,A,p)=>x+A+p+(E/2**32|0)|0;J.add3H=m;const t=(E,x,A,p)=>(E>>>0)+(x>>>0)+(A>>>0)+(p>>>0);J.add4L=t;const d=(E,x,A,p,v)=>x+A+p+v+(E/2**32|0)|0;J.add4H=d;const b=(E,x,A,p,v)=>(E>>>0)+(x>>>0)+(A>>>0)+(p>>>0)+(v>>>0);J.add5L=b;const _=(E,x,A,p,v,T)=>x+A+p+v+T+(E/2**32|0)|0;J.add5H=_;const H={fromBig:h,split:o,toBig:f,shrSH:g,shrSL:l,rotrSH:B,rotrSL:O,rotrBH:P,rotrBL:L,rotr32H:j,rotr32L:k,rotlSH:q,rotlSL:C,rotlBH:z,rotlBL:N,add:y,add3L:u,add3H:m,add4L:t,add4H:d,add5H:_,add5L:b};return J.default=H,J}var ur;function Jt(){if(ur)return ce;ur=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.sha512_224=ce.sha512_256=ce.sha384=ce.sha512=ce.sha224=ce.sha256=ce.SHA512_256=ce.SHA512_224=ce.SHA384=ce.SHA512=ce.SHA224=ce.SHA256=void 0;const e=vn(),i=En(),h=Me(),o=Uint32Array.from([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]),f=new Uint32Array(64);class g extends e.HashMD{constructor(m=32){super(64,m,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:m,B:t,C:d,D:b,E:_,F:H,G:E,H:x}=this;return[m,t,d,b,_,H,E,x]}set(m,t,d,b,_,H,E,x){this.A=m|0,this.B=t|0,this.C=d|0,this.D=b|0,this.E=_|0,this.F=H|0,this.G=E|0,this.H=x|0}process(m,t){for(let v=0;v<16;v++,t+=4)f[v]=m.getUint32(t,!1);for(let v=16;v<64;v++){const T=f[v-15],$=f[v-2],w=(0,h.rotr)(T,7)^(0,h.rotr)(T,18)^T>>>3,a=(0,h.rotr)($,17)^(0,h.rotr)($,19)^$>>>10;f[v]=a+f[v-7]+w+f[v-16]|0}let{A:d,B:b,C:_,D:H,E,F:x,G:A,H:p}=this;for(let v=0;v<64;v++){const T=(0,h.rotr)(E,6)^(0,h.rotr)(E,11)^(0,h.rotr)(E,25),$=p+T+(0,e.Chi)(E,x,A)+o[v]+f[v]|0,a=((0,h.rotr)(d,2)^(0,h.rotr)(d,13)^(0,h.rotr)(d,22))+(0,e.Maj)(d,b,_)|0;p=A,A=x,x=E,E=H+$|0,H=_,_=b,b=d,d=$+a|0}d=d+this.A|0,b=b+this.B|0,_=_+this.C|0,H=H+this.D|0,E=E+this.E|0,x=x+this.F|0,A=A+this.G|0,p=p+this.H|0,this.set(d,b,_,H,E,x,A,p)}roundClean(){(0,h.clean)(f)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,h.clean)(this.buffer)}}ce.SHA256=g;class l extends g{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}ce.SHA224=l;const B=(()=>i.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(u=>BigInt(u))))(),O=(()=>B[0])(),P=(()=>B[1])(),L=new Uint32Array(80),j=new Uint32Array(80);class k extends e.HashMD{constructor(m=64){super(128,m,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:m,Al:t,Bh:d,Bl:b,Ch:_,Cl:H,Dh:E,Dl:x,Eh:A,El:p,Fh:v,Fl:T,Gh:$,Gl:w,Hh:a,Hl:I}=this;return[m,t,d,b,_,H,E,x,A,p,v,T,$,w,a,I]}set(m,t,d,b,_,H,E,x,A,p,v,T,$,w,a,I){this.Ah=m|0,this.Al=t|0,this.Bh=d|0,this.Bl=b|0,this.Ch=_|0,this.Cl=H|0,this.Dh=E|0,this.Dl=x|0,this.Eh=A|0,this.El=p|0,this.Fh=v|0,this.Fl=T|0,this.Gh=$|0,this.Gl=w|0,this.Hh=a|0,this.Hl=I|0}process(m,t){for(let s=0;s<16;s++,t+=4)L[s]=m.getUint32(t),j[s]=m.getUint32(t+=4);for(let s=16;s<80;s++){const c=L[s-15]|0,S=j[s-15]|0,M=i.rotrSH(c,S,1)^i.rotrSH(c,S,8)^i.shrSH(c,S,7),U=i.rotrSL(c,S,1)^i.rotrSL(c,S,8)^i.shrSL(c,S,7),V=L[s-2]|0,D=j[s-2]|0,G=i.rotrSH(V,D,19)^i.rotrBH(V,D,61)^i.shrSH(V,D,6),W=i.rotrSL(V,D,19)^i.rotrBL(V,D,61)^i.shrSL(V,D,6),Y=i.add4L(U,W,j[s-7],j[s-16]),F=i.add4H(Y,M,G,L[s-7],L[s-16]);L[s]=F|0,j[s]=Y|0}let{Ah:d,Al:b,Bh:_,Bl:H,Ch:E,Cl:x,Dh:A,Dl:p,Eh:v,El:T,Fh:$,Fl:w,Gh:a,Gl:I,Hh:r,Hl:n}=this;for(let s=0;s<80;s++){const c=i.rotrSH(v,T,14)^i.rotrSH(v,T,18)^i.rotrBH(v,T,41),S=i.rotrSL(v,T,14)^i.rotrSL(v,T,18)^i.rotrBL(v,T,41),M=v&$^~v&a,U=T&w^~T&I,V=i.add5L(n,S,U,P[s],j[s]),D=i.add5H(V,r,c,M,O[s],L[s]),G=V|0,W=i.rotrSH(d,b,28)^i.rotrBH(d,b,34)^i.rotrBH(d,b,39),Y=i.rotrSL(d,b,28)^i.rotrBL(d,b,34)^i.rotrBL(d,b,39),F=d&_^d&E^_&E,se=b&H^b&x^H&x;r=a|0,n=I|0,a=$|0,I=w|0,$=v|0,w=T|0,{h:v,l:T}=i.add(A|0,p|0,D|0,G|0),A=E|0,p=x|0,E=_|0,x=H|0,_=d|0,H=b|0;const K=i.add3L(G,Y,se);d=i.add3H(K,D,W,F),b=K|0}({h:d,l:b}=i.add(this.Ah|0,this.Al|0,d|0,b|0)),{h:_,l:H}=i.add(this.Bh|0,this.Bl|0,_|0,H|0),{h:E,l:x}=i.add(this.Ch|0,this.Cl|0,E|0,x|0),{h:A,l:p}=i.add(this.Dh|0,this.Dl|0,A|0,p|0),{h:v,l:T}=i.add(this.Eh|0,this.El|0,v|0,T|0),{h:$,l:w}=i.add(this.Fh|0,this.Fl|0,$|0,w|0),{h:a,l:I}=i.add(this.Gh|0,this.Gl|0,a|0,I|0),{h:r,l:n}=i.add(this.Hh|0,this.Hl|0,r|0,n|0),this.set(d,b,_,H,E,x,A,p,v,T,$,w,a,I,r,n)}roundClean(){(0,h.clean)(L,j)}destroy(){(0,h.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}ce.SHA512=k;class q extends k{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}ce.SHA384=q;const C=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),z=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class N extends k{constructor(){super(28),this.Ah=C[0]|0,this.Al=C[1]|0,this.Bh=C[2]|0,this.Bl=C[3]|0,this.Ch=C[4]|0,this.Cl=C[5]|0,this.Dh=C[6]|0,this.Dl=C[7]|0,this.Eh=C[8]|0,this.El=C[9]|0,this.Fh=C[10]|0,this.Fl=C[11]|0,this.Gh=C[12]|0,this.Gl=C[13]|0,this.Hh=C[14]|0,this.Hl=C[15]|0}}ce.SHA512_224=N;class y extends k{constructor(){super(32),this.Ah=z[0]|0,this.Al=z[1]|0,this.Bh=z[2]|0,this.Bl=z[3]|0,this.Ch=z[4]|0,this.Cl=z[5]|0,this.Dh=z[6]|0,this.Dl=z[7]|0,this.Eh=z[8]|0,this.El=z[9]|0,this.Fh=z[10]|0,this.Fl=z[11]|0,this.Gh=z[12]|0,this.Gl=z[13]|0,this.Hh=z[14]|0,this.Hl=z[15]|0}}return ce.SHA512_256=y,ce.sha256=(0,h.createHasher)(()=>new g),ce.sha224=(0,h.createHasher)(()=>new l),ce.sha512=(0,h.createHasher)(()=>new k),ce.sha384=(0,h.createHasher)(()=>new q),ce.sha512_256=(0,h.createHasher)(()=>new y),ce.sha512_224=(0,h.createHasher)(()=>new N),ce}var fr;function Sn(){if(fr)return Ae;fr=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.sha224=Ae.SHA224=Ae.sha256=Ae.SHA256=void 0;const e=Jt();return Ae.SHA256=e.SHA256,Ae.sha256=e.sha256,Ae.SHA224=e.SHA224,Ae.sha224=e.sha224,Ae}var ki=Sn(),ue={},dr;function In(){if(dr)return ue;dr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.shake256=ue.shake128=ue.keccak_512=ue.keccak_384=ue.keccak_256=ue.keccak_224=ue.sha3_512=ue.sha3_384=ue.sha3_256=ue.sha3_224=ue.Keccak=void 0,ue.keccakP=N;const e=En(),i=Me(),h=BigInt(0),o=BigInt(1),f=BigInt(2),g=BigInt(7),l=BigInt(256),B=BigInt(113),O=[],P=[],L=[];for(let t=0,d=o,b=1,_=0;t<24;t++){[b,_]=[_,(2*b+3*_)%5],O.push(2*(5*_+b)),P.push((t+1)*(t+2)/2%64);let H=h;for(let E=0;E<7;E++)d=(d<<o^(d>>g)*B)%l,d&f&&(H^=o<<(o<<BigInt(E))-o);L.push(H)}const j=(0,e.split)(L,!0),k=j[0],q=j[1],C=(t,d,b)=>b>32?(0,e.rotlBH)(t,d,b):(0,e.rotlSH)(t,d,b),z=(t,d,b)=>b>32?(0,e.rotlBL)(t,d,b):(0,e.rotlSL)(t,d,b);function N(t,d=24){const b=new Uint32Array(10);for(let _=24-d;_<24;_++){for(let x=0;x<10;x++)b[x]=t[x]^t[x+10]^t[x+20]^t[x+30]^t[x+40];for(let x=0;x<10;x+=2){const A=(x+8)%10,p=(x+2)%10,v=b[p],T=b[p+1],$=C(v,T,1)^b[A],w=z(v,T,1)^b[A+1];for(let a=0;a<50;a+=10)t[x+a]^=$,t[x+a+1]^=w}let H=t[2],E=t[3];for(let x=0;x<24;x++){const A=P[x],p=C(H,E,A),v=z(H,E,A),T=O[x];H=t[T],E=t[T+1],t[T]=p,t[T+1]=v}for(let x=0;x<50;x+=10){for(let A=0;A<10;A++)b[A]=t[x+A];for(let A=0;A<10;A++)t[x+A]^=~b[(A+2)%10]&b[(A+4)%10]}t[0]^=k[_],t[1]^=q[_]}(0,i.clean)(b)}class y extends i.Hash{constructor(d,b,_,H=!1,E=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=d,this.suffix=b,this.outputLen=_,this.enableXOF=H,this.rounds=E,(0,i.anumber)(_),!(0<d&&d<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.swap32IfBE)(this.state32),N(this.state32,this.rounds),(0,i.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(d){(0,i.aexists)(this),d=(0,i.toBytes)(d),(0,i.abytes)(d);const{blockLen:b,state:_}=this,H=d.length;for(let E=0;E<H;){const x=Math.min(b-this.pos,H-E);for(let A=0;A<x;A++)_[this.pos++]^=d[E++];this.pos===b&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:d,suffix:b,pos:_,blockLen:H}=this;d[_]^=b,b&128&&_===H-1&&this.keccak(),d[H-1]^=128,this.keccak()}writeInto(d){(0,i.aexists)(this,!1),(0,i.abytes)(d),this.finish();const b=this.state,{blockLen:_}=this;for(let H=0,E=d.length;H<E;){this.posOut>=_&&this.keccak();const x=Math.min(_-this.posOut,E-H);d.set(b.subarray(this.posOut,this.posOut+x),H),this.posOut+=x,H+=x}return d}xofInto(d){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(d)}xof(d){return(0,i.anumber)(d),this.xofInto(new Uint8Array(d))}digestInto(d){if((0,i.aoutput)(d,this),this.finished)throw new Error("digest() was already called");return this.writeInto(d),this.destroy(),d}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.clean)(this.state)}_cloneInto(d){const{blockLen:b,suffix:_,outputLen:H,rounds:E,enableXOF:x}=this;return d||(d=new y(b,_,H,x,E)),d.state32.set(this.state32),d.pos=this.pos,d.posOut=this.posOut,d.finished=this.finished,d.rounds=E,d.suffix=_,d.outputLen=H,d.enableXOF=x,d.destroyed=this.destroyed,d}}ue.Keccak=y;const u=(t,d,b)=>(0,i.createHasher)(()=>new y(d,t,b));ue.sha3_224=(()=>u(6,144,224/8))(),ue.sha3_256=(()=>u(6,136,256/8))(),ue.sha3_384=(()=>u(6,104,384/8))(),ue.sha3_512=(()=>u(6,72,512/8))(),ue.keccak_224=(()=>u(1,144,224/8))(),ue.keccak_256=(()=>u(1,136,256/8))(),ue.keccak_384=(()=>u(1,104,384/8))(),ue.keccak_512=(()=>u(1,72,512/8))();const m=(t,d,b)=>(0,i.createXOFer)((_={})=>new y(d,t,_.dkLen===void 0?b:_.dkLen,!0));return ue.shake128=(()=>m(31,168,128/8))(),ue.shake256=(()=>m(31,136,256/8))(),ue}var Ni=In(),Vt={},st={},ot={},lr;function Fn(){return lr||(lr=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.version=void 0,ot.version="1.2.3"),ot}var hr;function Qe(){if(hr)return st;hr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.BaseError=void 0;const e=Fn();class i extends Error{constructor(o,f={}){var O;const g=f.cause instanceof i?f.cause.details:(O=f.cause)!=null&&O.message?f.cause.message:f.details,l=f.cause instanceof i&&f.cause.docsPath||f.docsPath,B=[o||"An error occurred.","",...f.metaMessages?[...f.metaMessages,""]:[],...l?[`Docs: https://abitype.dev${l}`]:[],...g?[`Details: ${g}`]:[],`Version: abitype@${e.version}`].join(`
|
|
2
|
-
`);super(B),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),f.cause&&(this.cause=f.cause),this.details=g,this.docsPath=l,this.metaMessages=f.metaMessages,this.shortMessage=o}}return st.BaseError=i,st}var vt={},mr;function Gn(){if(mr)return vt;mr=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.narrow=e;function e(i){return i}return vt}var Et={},St={},It={},Bt={},Oe={},br;function Rt(){if(br)return Oe;br=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.isTupleRegex=Oe.integerRegex=Oe.bytesRegex=void 0,Oe.execTyped=e;function e(i,h){const o=i.exec(h);return o==null?void 0:o.groups}return Oe.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Oe.integerRegex=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Oe.isTupleRegex=/^\(.+?\).*?$/,Oe}var yr;function Bn(){if(yr)return Bt;yr=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.formatAbiParameter=h;const e=Rt(),i=/^tuple(?<array>(\[(\d*)\])*)$/;function h(o){let f=o.type;if(i.test(o.type)&&"components"in o){f="(";const g=o.components.length;for(let B=0;B<g;B++){const O=o.components[B];f+=h(O),B<g-1&&(f+=", ")}const l=(0,e.execTyped)(i,o.type);return f+=`)${(l==null?void 0:l.array)||""}`,h({...o,type:f})}return"indexed"in o&&o.indexed&&(f=`${f} indexed`),o.name?`${f} ${o.name}`:f}return Bt}var pr;function _n(){if(pr)return It;pr=1,Object.defineProperty(It,"__esModule",{value:!0}),It.formatAbiParameters=i;const e=Bn();function i(h){let o="";const f=h.length;for(let g=0;g<f;g++){const l=h[g];o+=(0,e.formatAbiParameter)(l),g!==f-1&&(o+=", ")}return o}return It}var gr;function An(){if(gr)return St;gr=1,Object.defineProperty(St,"__esModule",{value:!0}),St.formatAbiItem=i;const e=_n();function i(h){var o;return h.type==="function"?`function ${h.name}(${(0,e.formatAbiParameters)(h.inputs)})${h.stateMutability&&h.stateMutability!=="nonpayable"?` ${h.stateMutability}`:""}${(o=h.outputs)!=null&&o.length?` returns (${(0,e.formatAbiParameters)(h.outputs)})`:""}`:h.type==="event"?`event ${h.name}(${(0,e.formatAbiParameters)(h.inputs)})`:h.type==="error"?`error ${h.name}(${(0,e.formatAbiParameters)(h.inputs)})`:h.type==="constructor"?`constructor(${(0,e.formatAbiParameters)(h.inputs)})${h.stateMutability==="payable"?" payable":""}`:h.type==="fallback"?`fallback() external${h.stateMutability==="payable"?" payable":""}`:"receive() external payable"}return St}var xr;function Yn(){if(xr)return Et;xr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.formatAbi=i;const e=An();function i(h){const o=[],f=h.length;for(let g=0;g<f;g++){const l=h[g],B=(0,e.formatAbiItem)(l);o.push(B)}return o}return Et}var _t={},he={},wr;function et(){if(wr)return he;wr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.functionModifiers=he.eventModifiers=he.modifiers=void 0,he.isErrorSignature=h,he.execErrorSignature=o,he.isEventSignature=g,he.execEventSignature=l,he.isFunctionSignature=O,he.execFunctionSignature=P,he.isStructSignature=j,he.execStructSignature=k,he.isConstructorSignature=C,he.execConstructorSignature=z,he.isFallbackSignature=y,he.execFallbackSignature=u,he.isReceiveSignature=t;const e=Rt(),i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function h(d){return i.test(d)}function o(d){return(0,e.execTyped)(i,d)}const f=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function g(d){return f.test(d)}function l(d){return(0,e.execTyped)(f,d)}const B=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function O(d){return B.test(d)}function P(d){return(0,e.execTyped)(B,d)}const L=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function j(d){return L.test(d)}function k(d){return(0,e.execTyped)(L,d)}const q=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function C(d){return q.test(d)}function z(d){return(0,e.execTyped)(q,d)}const N=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function y(d){return N.test(d)}function u(d){return(0,e.execTyped)(N,d)}const m=/^receive\(\) external payable$/;function t(d){return m.test(d)}return he.modifiers=new Set(["memory","indexed","storage","calldata"]),he.eventModifiers=new Set(["indexed"]),he.functionModifiers=new Set(["calldata","memory","storage"]),he}var At={},je={},vr;function Ut(){if(vr)return je;vr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.UnknownSolidityTypeError=je.UnknownTypeError=je.InvalidAbiItemError=void 0;const e=Qe();class i extends e.BaseError{constructor({signature:g}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(g,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}je.InvalidAbiItemError=i;class h extends e.BaseError{constructor({type:g}){super("Unknown type.",{metaMessages:[`Type "${g}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}je.UnknownTypeError=h;class o extends e.BaseError{constructor({type:g}){super("Unknown type.",{metaMessages:[`Type "${g}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}return je.UnknownSolidityTypeError=o,je}var be={},Er;function xt(){if(Er)return be;Er=1,Object.defineProperty(be,"__esModule",{value:!0}),be.InvalidAbiTypeParameterError=be.InvalidFunctionModifierError=be.InvalidModifierError=be.SolidityProtectedKeywordError=be.InvalidParameterError=be.InvalidAbiParametersError=be.InvalidAbiParameterError=void 0;const e=Qe();class i extends e.BaseError{constructor({param:P}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(P,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}}be.InvalidAbiParameterError=i;class h extends e.BaseError{constructor({params:P}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(P,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}be.InvalidAbiParametersError=h;class o extends e.BaseError{constructor({param:P}){super("Invalid ABI parameter.",{details:P}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}be.InvalidParameterError=o;class f extends e.BaseError{constructor({param:P,name:L}){super("Invalid ABI parameter.",{details:P,metaMessages:[`"${L}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}be.SolidityProtectedKeywordError=f;class g extends e.BaseError{constructor({param:P,type:L,modifier:j}){super("Invalid ABI parameter.",{details:P,metaMessages:[`Modifier "${j}" not allowed${L?` in "${L}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}be.InvalidModifierError=g;class l extends e.BaseError{constructor({param:P,type:L,modifier:j}){super("Invalid ABI parameter.",{details:P,metaMessages:[`Modifier "${j}" not allowed${L?` in "${L}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${j}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}be.InvalidFunctionModifierError=l;class B extends e.BaseError{constructor({abiParameter:P}){super("Invalid ABI parameter.",{details:JSON.stringify(P,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}return be.InvalidAbiTypeParameterError=B,be}var Te={},Sr;function Qt(){if(Sr)return Te;Sr=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.InvalidStructSignatureError=Te.UnknownSignatureError=Te.InvalidSignatureError=void 0;const e=Qe();class i extends e.BaseError{constructor({signature:g,type:l}){super(`Invalid ${l} signature.`,{details:g}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}Te.InvalidSignatureError=i;class h extends e.BaseError{constructor({signature:g}){super("Unknown signature.",{details:g}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}Te.UnknownSignatureError=h;class o extends e.BaseError{constructor({signature:g}){super("Invalid struct signature.",{details:g,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}return Te.InvalidStructSignatureError=o,Te}var at={},Ir;function Pn(){if(Ir)return at;Ir=1,Object.defineProperty(at,"__esModule",{value:!0}),at.CircularReferenceError=void 0;const e=Qe();class i extends e.BaseError{constructor({type:o}){super("Circular reference detected.",{metaMessages:[`Struct "${o}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}return at.CircularReferenceError=i,at}var ve={},ct={},Br;function On(){if(Br)return ct;Br=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.InvalidParenthesisError=void 0;const e=Qe();class i extends e.BaseError{constructor({current:o,depth:f}){super("Unbalanced parentheses.",{metaMessages:[`"${o.trim()}" has too many ${f>0?"opening":"closing"} parentheses.`],details:`Depth "${f}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}return ct.InvalidParenthesisError=i,ct}var Ge={},_r;function Xn(){if(_r)return Ge;_r=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.parameterCache=void 0,Ge.getParameterCacheKey=e;function e(i,h,o){let f="";if(o)for(const g of Object.entries(o)){if(!g)continue;let l="";for(const B of g[1])l+=`[${B.type}${B.name?`:${B.name}`:""}]`;f+=`(${g[0]}{${l}})`}return h?`${h}:${i}${f}`:`${i}${f}`}return Ge.parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),Ge}var Ar;function Je(){if(Ar)return ve;Ar=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.parseSignature=B,ve.parseFunctionSignature=O,ve.parseEventSignature=P,ve.parseErrorSignature=L,ve.parseConstructorSignature=j,ve.parseFallbackSignature=k,ve.parseAbiParameter=N,ve.splitParameters=y,ve.isSolidityType=u,ve.isSolidityKeyword=t,ve.isValidDataLocation=d;const e=Rt(),i=Ut(),h=xt(),o=Qt(),f=On(),g=Xn(),l=et();function B(b,_={}){if((0,l.isFunctionSignature)(b))return O(b,_);if((0,l.isEventSignature)(b))return P(b,_);if((0,l.isErrorSignature)(b))return L(b,_);if((0,l.isConstructorSignature)(b))return j(b,_);if((0,l.isFallbackSignature)(b))return k(b);if((0,l.isReceiveSignature)(b))return{type:"receive",stateMutability:"payable"};throw new o.UnknownSignatureError({signature:b})}function O(b,_={}){const H=(0,l.execFunctionSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"function"});const E=y(H.parameters),x=[],A=E.length;for(let v=0;v<A;v++)x.push(N(E[v],{modifiers:l.functionModifiers,structs:_,type:"function"}));const p=[];if(H.returns){const v=y(H.returns),T=v.length;for(let $=0;$<T;$++)p.push(N(v[$],{modifiers:l.functionModifiers,structs:_,type:"function"}))}return{name:H.name,type:"function",stateMutability:H.stateMutability??"nonpayable",inputs:x,outputs:p}}function P(b,_={}){const H=(0,l.execEventSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"event"});const E=y(H.parameters),x=[],A=E.length;for(let p=0;p<A;p++)x.push(N(E[p],{modifiers:l.eventModifiers,structs:_,type:"event"}));return{name:H.name,type:"event",inputs:x}}function L(b,_={}){const H=(0,l.execErrorSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"error"});const E=y(H.parameters),x=[],A=E.length;for(let p=0;p<A;p++)x.push(N(E[p],{structs:_,type:"error"}));return{name:H.name,type:"error",inputs:x}}function j(b,_={}){const H=(0,l.execConstructorSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"constructor"});const E=y(H.parameters),x=[],A=E.length;for(let p=0;p<A;p++)x.push(N(E[p],{structs:_,type:"constructor"}));return{type:"constructor",stateMutability:H.stateMutability??"nonpayable",inputs:x}}function k(b){const _=(0,l.execFallbackSignature)(b);if(!_)throw new o.InvalidSignatureError({signature:b,type:"fallback"});return{type:"fallback",stateMutability:_.stateMutability??"nonpayable"}}const q=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,C=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,z=/^u?int$/;function N(b,_){var a,I;const H=(0,g.getParameterCacheKey)(b,_==null?void 0:_.type,_==null?void 0:_.structs);if(g.parameterCache.has(H))return g.parameterCache.get(H);const E=e.isTupleRegex.test(b),x=(0,e.execTyped)(E?C:q,b);if(!x)throw new h.InvalidParameterError({param:b});if(x.name&&t(x.name))throw new h.SolidityProtectedKeywordError({param:b,name:x.name});const A=x.name?{name:x.name}:{},p=x.modifier==="indexed"?{indexed:!0}:{},v=(_==null?void 0:_.structs)??{};let T,$={};if(E){T="tuple";const r=y(x.type),n=[],s=r.length;for(let c=0;c<s;c++)n.push(N(r[c],{structs:v}));$={components:n}}else if(x.type in v)T="tuple",$={components:v[x.type]};else if(z.test(x.type))T=`${x.type}256`;else if(x.type==="address payable")T="address";else if(T=x.type,(_==null?void 0:_.type)!=="struct"&&!u(T))throw new i.UnknownSolidityTypeError({type:T});if(x.modifier){if(!((I=(a=_==null?void 0:_.modifiers)==null?void 0:a.has)!=null&&I.call(a,x.modifier)))throw new h.InvalidModifierError({param:b,type:_==null?void 0:_.type,modifier:x.modifier});if(l.functionModifiers.has(x.modifier)&&!d(T,!!x.array))throw new h.InvalidFunctionModifierError({param:b,type:_==null?void 0:_.type,modifier:x.modifier})}const w={type:`${T}${x.array??""}`,...A,...p,...$};return g.parameterCache.set(H,w),w}function y(b,_=[],H="",E=0){const x=b.trim().length;for(let A=0;A<x;A++){const p=b[A],v=b.slice(A+1);switch(p){case",":return E===0?y(v,[..._,H.trim()]):y(v,_,`${H}${p}`,E);case"(":return y(v,_,`${H}${p}`,E+1);case")":return y(v,_,`${H}${p}`,E-1);default:return y(v,_,`${H}${p}`,E)}}if(H==="")return _;if(E!==0)throw new f.InvalidParenthesisError({current:H,depth:E});return _.push(H.trim()),_}function u(b){return b==="address"||b==="bool"||b==="function"||b==="string"||e.bytesRegex.test(b)||e.integerRegex.test(b)}const m=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function t(b){return b==="address"||b==="bool"||b==="function"||b==="string"||b==="tuple"||e.bytesRegex.test(b)||e.integerRegex.test(b)||m.test(b)}function d(b,_){return _||b==="bytes"||b==="string"||b==="tuple"}return ve}var Pr;function jt(){if(Pr)return At;Pr=1,Object.defineProperty(At,"__esModule",{value:!0}),At.parseStructs=B;const e=Rt(),i=Ut(),h=xt(),o=Qt(),f=Pn(),g=et(),l=Je();function B(L){const j={},k=L.length;for(let N=0;N<k;N++){const y=L[N];if(!(0,g.isStructSignature)(y))continue;const u=(0,g.execStructSignature)(y);if(!u)throw new o.InvalidSignatureError({signature:y,type:"struct"});const m=u.properties.split(";"),t=[],d=m.length;for(let b=0;b<d;b++){const H=m[b].trim();if(!H)continue;const E=(0,l.parseAbiParameter)(H,{type:"struct"});t.push(E)}if(!t.length)throw new o.InvalidStructSignatureError({signature:y});j[u.name]=t}const q={},C=Object.entries(j),z=C.length;for(let N=0;N<z;N++){const[y,u]=C[N];q[y]=P(u,j)}return q}const O=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function P(L=[],j={},k=new Set){const q=[],C=L.length;for(let z=0;z<C;z++){const N=L[z];if(e.isTupleRegex.test(N.type))q.push(N);else{const u=(0,e.execTyped)(O,N.type);if(!(u!=null&&u.type))throw new h.InvalidAbiTypeParameterError({abiParameter:N});const{array:m,type:t}=u;if(t in j){if(k.has(t))throw new f.CircularReferenceError({type:t});q.push({...N,type:`tuple${m??""}`,components:P(j[t],j,new Set([...k,t]))})}else if((0,l.isSolidityType)(t))q.push(N);else throw new i.UnknownTypeError({type:t})}}return q}return At}var Or;function Jn(){if(Or)return _t;Or=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.parseAbi=o;const e=et(),i=jt(),h=Je();function o(f){const g=(0,i.parseStructs)(f),l=[],B=f.length;for(let O=0;O<B;O++){const P=f[O];(0,e.isStructSignature)(P)||l.push((0,h.parseSignature)(P,g))}return l}return _t}var Pt={},Hr;function Qn(){if(Hr)return Pt;Hr=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.parseAbiItem=f;const e=Ut(),i=et(),h=jt(),o=Je();function f(g){let l;if(typeof g=="string")l=(0,o.parseSignature)(g);else{const B=(0,h.parseStructs)(g),O=g.length;for(let P=0;P<O;P++){const L=g[P];if(!(0,i.isStructSignature)(L)){l=(0,o.parseSignature)(L,B);break}}}if(!l)throw new e.InvalidAbiItemError({signature:g});return l}return Pt}var Ot={},Rr;function ei(){if(Rr)return Ot;Rr=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.parseAbiParameter=f;const e=xt(),i=et(),h=jt(),o=Je();function f(g){let l;if(typeof g=="string")l=(0,o.parseAbiParameter)(g,{modifiers:i.modifiers});else{const B=(0,h.parseStructs)(g),O=g.length;for(let P=0;P<O;P++){const L=g[P];if(!(0,i.isStructSignature)(L)){l=(0,o.parseAbiParameter)(L,{modifiers:i.modifiers,structs:B});break}}}if(!l)throw new e.InvalidAbiParameterError({param:g});return l}return Ot}var Ht={},Ur;function ti(){if(Ur)return Ht;Ur=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.parseAbiParameters=g;const e=xt(),i=et(),h=jt(),o=Je(),f=Je();function g(l){const B=[];if(typeof l=="string"){const O=(0,o.splitParameters)(l),P=O.length;for(let L=0;L<P;L++)B.push((0,f.parseAbiParameter)(O[L],{modifiers:i.modifiers}))}else{const O=(0,h.parseStructs)(l),P=l.length;for(let L=0;L<P;L++){const j=l[L];if((0,i.isStructSignature)(j))continue;const k=(0,o.splitParameters)(j),q=k.length;for(let C=0;C<q;C++)B.push((0,f.parseAbiParameter)(k[C],{modifiers:i.modifiers,structs:O}))}}if(B.length===0)throw new e.InvalidAbiParametersError({params:l});return B}return Ht}var jr;function ri(){return jr||(jr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CircularReferenceError=e.InvalidParenthesisError=e.UnknownSignatureError=e.InvalidSignatureError=e.InvalidStructSignatureError=e.InvalidAbiParameterError=e.InvalidAbiParametersError=e.InvalidParameterError=e.SolidityProtectedKeywordError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.UnknownSolidityTypeError=e.InvalidAbiItemError=e.UnknownTypeError=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.formatAbiParameters=e.formatAbiParameter=e.formatAbiItem=e.formatAbi=e.narrow=e.BaseError=void 0;var i=Qe();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return i.BaseError}});var h=Gn();Object.defineProperty(e,"narrow",{enumerable:!0,get:function(){return h.narrow}});var o=Yn();Object.defineProperty(e,"formatAbi",{enumerable:!0,get:function(){return o.formatAbi}});var f=An();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return f.formatAbiItem}});var g=Bn();Object.defineProperty(e,"formatAbiParameter",{enumerable:!0,get:function(){return g.formatAbiParameter}});var l=_n();Object.defineProperty(e,"formatAbiParameters",{enumerable:!0,get:function(){return l.formatAbiParameters}});var B=Jn();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return B.parseAbi}});var O=Qn();Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return O.parseAbiItem}});var P=ei();Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return P.parseAbiParameter}});var L=ti();Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return L.parseAbiParameters}});var j=Ut();Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return j.UnknownTypeError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return j.InvalidAbiItemError}}),Object.defineProperty(e,"UnknownSolidityTypeError",{enumerable:!0,get:function(){return j.UnknownSolidityTypeError}});var k=xt();Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return k.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return k.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return k.InvalidModifierError}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return k.SolidityProtectedKeywordError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return k.InvalidParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return k.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return k.InvalidAbiParameterError}});var q=Qt();Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return q.InvalidStructSignatureError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return q.InvalidSignatureError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return q.UnknownSignatureError}});var C=On();Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return C.InvalidParenthesisError}});var z=Pn();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return z.CircularReferenceError}})}(Vt)),Vt}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tt=BigInt(0),gt=BigInt(1);function Lt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Mt(e){if(!Lt(e))throw new Error("Uint8Array expected")}function ni(e,i){if(typeof i!="boolean")throw new Error(e+" boolean expected, got "+i)}function Hn(e){const i=e.toString(16);return i.length&1?"0"+i:i}function er(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Tt:BigInt("0x"+e)}const Rn=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ii=Array.from({length:256},(e,i)=>i.toString(16).padStart(2,"0"));function tr(e){if(Mt(e),Rn)return e.toHex();let i="";for(let h=0;h<e.length;h++)i+=ii[e[h]];return i}const Le={_0:48,_9:57,A:65,F:70,a:97,f:102};function Tr(e){if(e>=Le._0&&e<=Le._9)return e-Le._0;if(e>=Le.A&&e<=Le.F)return e-(Le.A-10);if(e>=Le.a&&e<=Le.f)return e-(Le.a-10)}function zt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Rn)return Uint8Array.fromHex(e);const i=e.length,h=i/2;if(i%2)throw new Error("hex string expected, got unpadded hex of length "+i);const o=new Uint8Array(h);for(let f=0,g=0;f<h;f++,g+=2){const l=Tr(e.charCodeAt(g)),B=Tr(e.charCodeAt(g+1));if(l===void 0||B===void 0){const O=e[g]+e[g+1];throw new Error('hex string expected, got non-hex character "'+O+'" at index '+g)}o[f]=l*16+B}return o}function si(e){return er(tr(e))}function oi(e){return Mt(e),er(tr(Uint8Array.from(e).reverse()))}function Un(e,i){return zt(e.toString(16).padStart(i*2,"0"))}function ai(e,i){return Un(e,i).reverse()}function ci(e){return zt(Hn(e))}function ui(e,i,h){let o;if(typeof i=="string")try{o=zt(i)}catch(g){throw new Error(e+" must be hex string or Uint8Array, cause: "+g)}else if(Lt(i))o=Uint8Array.from(i);else throw new Error(e+" must be hex string or Uint8Array");const f=o.length;if(typeof h=="number"&&f!==h)throw new Error(e+" of length "+h+" expected, got "+f);return o}function jn(...e){let i=0;for(let o=0;o<e.length;o++){const f=e[o];Mt(f),i+=f.length}const h=new Uint8Array(i);for(let o=0,f=0;o<e.length;o++){const g=e[o];h.set(g,f),f+=g.length}return h}function fi(e,i){if(e.length!==i.length)return!1;let h=0;for(let o=0;o<e.length;o++)h|=e[o]^i[o];return h===0}function di(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}const Dt=e=>typeof e=="bigint"&&Tt<=e;function Tn(e,i,h){return Dt(e)&&Dt(i)&&Dt(h)&&i<=e&&e<h}function li(e,i,h,o){if(!Tn(i,h,o))throw new Error("expected valid "+e+": "+h+" <= n < "+o+", got "+i)}function hi(e){let i;for(i=0;e>Tt;e>>=gt,i+=1);return i}function mi(e,i){return e>>BigInt(i)>}function bi(e,i,h){return e|(h?gt:Tt)<<BigInt(i)}const yi=e=>(gt<<BigInt(e))-gt,Kt=e=>new Uint8Array(e),Lr=e=>Uint8Array.from(e);function pi(e,i,h){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof i!="number"||i<2)throw new Error("qByteLen must be a number");if(typeof h!="function")throw new Error("hmacFn must be a function");let o=Kt(e),f=Kt(e),g=0;const l=()=>{o.fill(1),f.fill(0),g=0},B=(...j)=>h(f,o,...j),O=(j=Kt(0))=>{f=B(Lr([0]),j),o=B(),j.length!==0&&(f=B(Lr([1]),j),o=B())},P=()=>{if(g++>=1e3)throw new Error("drbg: tried 1000 values");let j=0;const k=[];for(;j<i;){o=B();const q=o.slice();k.push(q),j+=o.length}return jn(...k)};return(j,k)=>{l(),O(j);let q;for(;!(q=k(P()));)O();return l(),q}}const gi={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Lt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,i)=>i.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function xi(e,i,h={}){const o=(f,g,l)=>{const B=gi[g];if(typeof B!="function")throw new Error("invalid validator function");const O=e[f];if(!(l&&O===void 0)&&!B(O,e))throw new Error("param "+String(f)+" is invalid. Expected "+g+", got "+O)};for(const[f,g]of Object.entries(i))o(f,g,!1);for(const[f,g]of Object.entries(h))o(f,g,!0);return e}const wi=()=>{throw new Error("not implemented")};function vi(e){const i=new WeakMap;return(h,...o)=>{const f=i.get(h);if(f!==void 0)return f;const g=e(h,...o);return i.set(h,g),g}}const Ei=Object.freeze(Object.defineProperty({__proto__:null,aInRange:li,abool:ni,abytes:Mt,bitGet:mi,bitLen:hi,bitMask:yi,bitSet:bi,bytesToHex:tr,bytesToNumberBE:si,bytesToNumberLE:oi,concatBytes:jn,createHmacDrbg:pi,ensureBytes:ui,equalBytes:fi,hexToBytes:zt,hexToNumber:er,inRange:Tn,isBytes:Lt,memoized:vi,notImplemented:wi,numberToBytesBE:Un,numberToBytesLE:ai,numberToHexUnpadded:Hn,numberToVarBytesBE:ci,utf8ToBytes:di,validateObject:xi},Symbol.toStringTag,{value:"Module"}));var Ce={},ge={},Mr;function Si(){if(Mr)return ge;Mr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.ripemd160=ge.RIPEMD160=ge.md5=ge.MD5=ge.sha1=ge.SHA1=void 0;const e=vn(),i=Me(),h=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),o=new Uint32Array(80);class f extends e.HashMD{constructor(){super(64,20,8,!1),this.A=h[0]|0,this.B=h[1]|0,this.C=h[2]|0,this.D=h[3]|0,this.E=h[4]|0}get(){const{A:E,B:x,C:A,D:p,E:v}=this;return[E,x,A,p,v]}set(E,x,A,p,v){this.A=E|0,this.B=x|0,this.C=A|0,this.D=p|0,this.E=v|0}process(E,x){for(let w=0;w<16;w++,x+=4)o[w]=E.getUint32(x,!1);for(let w=16;w<80;w++)o[w]=(0,i.rotl)(o[w-3]^o[w-8]^o[w-14]^o[w-16],1);let{A,B:p,C:v,D:T,E:$}=this;for(let w=0;w<80;w++){let a,I;w<20?(a=(0,e.Chi)(p,v,T),I=1518500249):w<40?(a=p^v^T,I=1859775393):w<60?(a=(0,e.Maj)(p,v,T),I=2400959708):(a=p^v^T,I=3395469782);const r=(0,i.rotl)(A,5)+a+$+I+o[w]|0;$=T,T=v,v=(0,i.rotl)(p,30),p=A,A=r}A=A+this.A|0,p=p+this.B|0,v=v+this.C|0,T=T+this.D|0,$=$+this.E|0,this.set(A,p,v,T,$)}roundClean(){(0,i.clean)(o)}destroy(){this.set(0,0,0,0,0),(0,i.clean)(this.buffer)}}ge.SHA1=f,ge.sha1=(0,i.createHasher)(()=>new f);const g=Math.pow(2,32),l=Array.from({length:64},(H,E)=>Math.floor(g*Math.abs(Math.sin(E+1)))),B=h.slice(0,4),O=new Uint32Array(16);class P extends e.HashMD{constructor(){super(64,16,8,!0),this.A=B[0]|0,this.B=B[1]|0,this.C=B[2]|0,this.D=B[3]|0}get(){const{A:E,B:x,C:A,D:p}=this;return[E,x,A,p]}set(E,x,A,p){this.A=E|0,this.B=x|0,this.C=A|0,this.D=p|0}process(E,x){for(let $=0;$<16;$++,x+=4)O[$]=E.getUint32(x,!0);let{A,B:p,C:v,D:T}=this;for(let $=0;$<64;$++){let w,a,I;$<16?(w=(0,e.Chi)(p,v,T),a=$,I=[7,12,17,22]):$<32?(w=(0,e.Chi)(T,p,v),a=(5*$+1)%16,I=[5,9,14,20]):$<48?(w=p^v^T,a=(3*$+5)%16,I=[4,11,16,23]):(w=v^(p|~T),a=7*$%16,I=[6,10,15,21]),w=w+A+l[$]+O[a],A=T,T=v,v=p,p=p+(0,i.rotl)(w,I[$%4])}A=A+this.A|0,p=p+this.B|0,v=v+this.C|0,T=T+this.D|0,this.set(A,p,v,T)}roundClean(){(0,i.clean)(O)}destroy(){this.set(0,0,0,0),(0,i.clean)(this.buffer)}}ge.MD5=P,ge.md5=(0,i.createHasher)(()=>new P);const L=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),j=(()=>Uint8Array.from(new Array(16).fill(0).map((H,E)=>E)))(),k=(()=>j.map(H=>(9*H+5)%16))(),q=(()=>{const x=[[j],[k]];for(let A=0;A<4;A++)for(let p of x)p.push(p[A].map(v=>L[v]));return x})(),C=(()=>q[0])(),z=(()=>q[1])(),N=[[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(H=>Uint8Array.from(H)),y=C.map((H,E)=>H.map(x=>N[E][x])),u=z.map((H,E)=>H.map(x=>N[E][x])),m=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),t=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function d(H,E,x,A){return H===0?E^x^A:H===1?E&x|~E&A:H===2?(E|~x)^A:H===3?E&A|x&~A:E^(x|~A)}const b=new Uint32Array(16);class _ extends e.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:E,h1:x,h2:A,h3:p,h4:v}=this;return[E,x,A,p,v]}set(E,x,A,p,v){this.h0=E|0,this.h1=x|0,this.h2=A|0,this.h3=p|0,this.h4=v|0}process(E,x){for(let s=0;s<16;s++,x+=4)b[s]=E.getUint32(x,!0);let A=this.h0|0,p=A,v=this.h1|0,T=v,$=this.h2|0,w=$,a=this.h3|0,I=a,r=this.h4|0,n=r;for(let s=0;s<5;s++){const c=4-s,S=m[s],M=t[s],U=C[s],V=z[s],D=y[s],G=u[s];for(let W=0;W<16;W++){const Y=(0,i.rotl)(A+d(s,v,$,a)+b[U[W]]+S,D[W])+r|0;A=r,r=a,a=(0,i.rotl)($,10)|0,$=v,v=Y}for(let W=0;W<16;W++){const Y=(0,i.rotl)(p+d(c,T,w,I)+b[V[W]]+M,G[W])+n|0;p=n,n=I,I=(0,i.rotl)(w,10)|0,w=T,T=Y}}this.set(this.h1+$+I|0,this.h2+a+n|0,this.h3+r+p|0,this.h4+A+T|0,this.h0+v+w|0)}roundClean(){(0,i.clean)(b)}destroy(){this.destroyed=!0,(0,i.clean)(this.buffer),this.set(0,0,0,0,0)}}return ge.RIPEMD160=_,ge.ripemd160=(0,i.createHasher)(()=>new _),ge}var zr;function Ln(){if(zr)return Ce;zr=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.ripemd160=Ce.RIPEMD160=void 0;const e=Si();return Ce.RIPEMD160=e.RIPEMD160,Ce.ripemd160=e.ripemd160,Ce}Ln();var Ci=Me(),Vi=Jt(),Zt={},$r;function Mn(){return $r||($r=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const i=Me();class h extends i.Hash{constructor(g,l){super(),this.finished=!1,this.destroyed=!1,(0,i.ahash)(g);const B=(0,i.toBytes)(l);if(this.iHash=g.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const O=this.blockLen,P=new Uint8Array(O);P.set(B.length>O?g.create().update(B).digest():B);for(let L=0;L<P.length;L++)P[L]^=54;this.iHash.update(P),this.oHash=g.create();for(let L=0;L<P.length;L++)P[L]^=106;this.oHash.update(P),(0,i.clean)(P)}update(g){return(0,i.aexists)(this),this.iHash.update(g),this}digestInto(g){(0,i.aexists)(this),(0,i.abytes)(g,this.outputLen),this.finished=!0,this.iHash.digestInto(g),this.oHash.update(g),this.oHash.digestInto(g),this.destroy()}digest(){const g=new Uint8Array(this.oHash.outputLen);return this.digestInto(g),g}_cloneInto(g){g||(g=Object.create(Object.getPrototypeOf(this),{}));const{oHash:l,iHash:B,finished:O,destroyed:P,blockLen:L,outputLen:j}=this;return g=g,g.finished=O,g.destroyed=P,g.blockLen=L,g.outputLen=j,g.oHash=l._cloneInto(g.oHash),g.iHash=B._cloneInto(g.iHash),g}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=h;const o=(f,g,l)=>new h(f,g).update(l).digest();e.hmac=o,e.hmac.create=(f,g)=>new h(f,g)}(Zt)),Zt}var Di=Mn(),Wt={},ut={},Ft={},Ve={},fe={},oe={},qr;function wt(){if(qr)return oe;qr=1;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(oe,"__esModule",{value:!0}),oe.notImplemented=oe.bitMask=void 0,oe.isBytes=h,oe.abytes=o,oe.abool=f,oe.numberToHexUnpadded=g,oe.hexToNumber=l,oe.bytesToHex=P,oe.hexToBytes=k,oe.bytesToNumberBE=q,oe.bytesToNumberLE=C,oe.numberToBytesBE=z,oe.numberToBytesLE=N,oe.numberToVarBytesBE=y,oe.ensureBytes=u,oe.concatBytes=m,oe.equalBytes=t,oe.utf8ToBytes=d,oe.inRange=_,oe.aInRange=H,oe.bitLen=E,oe.bitGet=x,oe.bitSet=A,oe.createHmacDrbg=$,oe.validateObject=a,oe.memoized=r;const e=BigInt(0),i=BigInt(1);function h(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function o(n){if(!h(n))throw new Error("Uint8Array expected")}function f(n,s){if(typeof s!="boolean")throw new Error(n+" boolean expected, got "+s)}function g(n){const s=n.toString(16);return s.length&1?"0"+s:s}function l(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?e:BigInt("0x"+n)}const B=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",O=Array.from({length:256},(n,s)=>s.toString(16).padStart(2,"0"));function P(n){if(o(n),B)return n.toHex();let s="";for(let c=0;c<n.length;c++)s+=O[n[c]];return s}const L={_0:48,_9:57,A:65,F:70,a:97,f:102};function j(n){if(n>=L._0&&n<=L._9)return n-L._0;if(n>=L.A&&n<=L.F)return n-(L.A-10);if(n>=L.a&&n<=L.f)return n-(L.a-10)}function k(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);if(B)return Uint8Array.fromHex(n);const s=n.length,c=s/2;if(s%2)throw new Error("hex string expected, got unpadded hex of length "+s);const S=new Uint8Array(c);for(let M=0,U=0;M<c;M++,U+=2){const V=j(n.charCodeAt(U)),D=j(n.charCodeAt(U+1));if(V===void 0||D===void 0){const G=n[U]+n[U+1];throw new Error('hex string expected, got non-hex character "'+G+'" at index '+U)}S[M]=V*16+D}return S}function q(n){return l(P(n))}function C(n){return o(n),l(P(Uint8Array.from(n).reverse()))}function z(n,s){return k(n.toString(16).padStart(s*2,"0"))}function N(n,s){return z(n,s).reverse()}function y(n){return k(g(n))}function u(n,s,c){let S;if(typeof s=="string")try{S=k(s)}catch(U){throw new Error(n+" must be hex string or Uint8Array, cause: "+U)}else if(h(s))S=Uint8Array.from(s);else throw new Error(n+" must be hex string or Uint8Array");const M=S.length;if(typeof c=="number"&&M!==c)throw new Error(n+" of length "+c+" expected, got "+M);return S}function m(...n){let s=0;for(let S=0;S<n.length;S++){const M=n[S];o(M),s+=M.length}const c=new Uint8Array(s);for(let S=0,M=0;S<n.length;S++){const U=n[S];c.set(U,M),M+=U.length}return c}function t(n,s){if(n.length!==s.length)return!1;let c=0;for(let S=0;S<n.length;S++)c|=n[S]^s[S];return c===0}function d(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}const b=n=>typeof n=="bigint"&&e<=n;function _(n,s,c){return b(n)&&b(s)&&b(c)&&s<=n&&n<c}function H(n,s,c,S){if(!_(s,c,S))throw new Error("expected valid "+n+": "+c+" <= n < "+S+", got "+s)}function E(n){let s;for(s=0;n>e;n>>=i,s+=1);return s}function x(n,s){return n>>BigInt(s)&i}function A(n,s,c){return n|(c?i:e)<<BigInt(s)}const p=n=>(i<<BigInt(n))-i;oe.bitMask=p;const v=n=>new Uint8Array(n),T=n=>Uint8Array.from(n);function $(n,s,c){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof s!="number"||s<2)throw new Error("qByteLen must be a number");if(typeof c!="function")throw new Error("hmacFn must be a function");let S=v(n),M=v(n),U=0;const V=()=>{S.fill(1),M.fill(0),U=0},D=(...F)=>c(M,S,...F),G=(F=v(0))=>{M=D(T([0]),F),S=D(),F.length!==0&&(M=D(T([1]),F),S=D())},W=()=>{if(U++>=1e3)throw new Error("drbg: tried 1000 values");let F=0;const se=[];for(;F<s;){S=D();const K=S.slice();se.push(K),F+=S.length}return m(...se)};return(F,se)=>{V(),G(F);let K;for(;!(K=se(W()));)G();return V(),K}}const w={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||h(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,s)=>s.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function a(n,s,c={}){const S=(M,U,V)=>{const D=w[U];if(typeof D!="function")throw new Error("invalid validator function");const G=n[M];if(!(V&&G===void 0)&&!D(G,n))throw new Error("param "+String(M)+" is invalid. Expected "+U+", got "+G)};for(const[M,U]of Object.entries(s))S(M,U,!1);for(const[M,U]of Object.entries(c))S(M,U,!0);return n}const I=()=>{throw new Error("not implemented")};oe.notImplemented=I;function r(n){const s=new WeakMap;return(c,...S)=>{const M=s.get(c);if(M!==void 0)return M;const U=n(c,...S);return s.set(c,U),U}}return oe}var kr;function $t(){if(kr)return fe;kr=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.isNegativeLE=void 0,fe.mod=P,fe.pow=L,fe.pow2=j,fe.invert=k,fe.tonelliShanks=z,fe.FpSqrt=N,fe.validateField=m,fe.FpPow=t,fe.FpInvertBatch=d,fe.FpDiv=b,fe.FpLegendre=_,fe.FpIsSquare=H,fe.nLength=E,fe.Field=x,fe.FpSqrtOdd=A,fe.FpSqrtEven=p,fe.hashToPrivateScalar=v,fe.getFieldBytesLength=T,fe.getMinHashLength=$,fe.mapHashToField=w;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=Me(),i=wt(),h=BigInt(0),o=BigInt(1),f=BigInt(2),g=BigInt(3),l=BigInt(4),B=BigInt(5),O=BigInt(8);function P(a,I){const r=a%I;return r>=h?r:I+r}function L(a,I,r){return t(x(r),a,I)}function j(a,I,r){let n=a;for(;I-- >h;)n*=n,n%=r;return n}function k(a,I){if(a===h)throw new Error("invert: expected non-zero number");if(I<=h)throw new Error("invert: expected positive modulus, got "+I);let r=P(a,I),n=I,s=h,c=o;for(;r!==h;){const M=n/r,U=n%r,V=s-c*M;n=r,r=U,s=c,c=V}if(n!==o)throw new Error("invert: does not exist");return P(s,I)}function q(a,I){const r=(a.ORDER+o)/l,n=a.pow(I,r);if(!a.eql(a.sqr(n),I))throw new Error("Cannot find square root");return n}function C(a,I){const r=(a.ORDER-B)/O,n=a.mul(I,f),s=a.pow(n,r),c=a.mul(I,s),S=a.mul(a.mul(c,f),s),M=a.mul(c,a.sub(S,a.ONE));if(!a.eql(a.sqr(M),I))throw new Error("Cannot find square root");return M}function z(a){if(a<BigInt(3))throw new Error("sqrt is not defined for small field");let I=a-o,r=0;for(;I%f===h;)I/=f,r++;let n=f;const s=x(a);for(;_(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return q;let c=s.pow(n,I);const S=(I+o)/f;return function(U,V){if(U.is0(V))return V;if(_(U,V)!==1)throw new Error("Cannot find square root");let D=r,G=U.mul(U.ONE,c),W=U.pow(V,I),Y=U.pow(V,S);for(;!U.eql(W,U.ONE);){if(U.is0(W))return U.ZERO;let F=1,se=U.sqr(W);for(;!U.eql(se,U.ONE);)if(F++,se=U.sqr(se),F===D)throw new Error("Cannot find square root");const K=o<<BigInt(D-F-1),Z=U.pow(G,K);D=F,G=U.sqr(Z),W=U.mul(W,G),Y=U.mul(Y,Z)}return Y}}function N(a){return a%l===g?q:a%O===B?C:z(a)}const y=(a,I)=>(P(a,I)&o)===o;fe.isNegativeLE=y;const u=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(a){const I={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=u.reduce((n,s)=>(n[s]="function",n),I);return(0,i.validateObject)(a,r)}function t(a,I,r){if(r<h)throw new Error("invalid exponent, negatives unsupported");if(r===h)return a.ONE;if(r===o)return I;let n=a.ONE,s=I;for(;r>h;)r&o&&(n=a.mul(n,s)),s=a.sqr(s),r>>=o;return n}function d(a,I,r=!1){const n=new Array(I.length).fill(r?a.ZERO:void 0),s=I.reduce((S,M,U)=>a.is0(M)?S:(n[U]=S,a.mul(S,M)),a.ONE),c=a.inv(s);return I.reduceRight((S,M,U)=>a.is0(M)?S:(n[U]=a.mul(S,n[U]),a.mul(S,M)),c),n}function b(a,I,r){return a.mul(I,typeof r=="bigint"?k(r,a.ORDER):a.inv(r))}function _(a,I){const r=(a.ORDER-o)/f,n=a.pow(I,r),s=a.eql(n,a.ONE),c=a.eql(n,a.ZERO),S=a.eql(n,a.neg(a.ONE));if(!s&&!c&&!S)throw new Error("invalid Legendre symbol result");return s?1:c?0:-1}function H(a,I){return _(a,I)===1}function E(a,I){I!==void 0&&(0,e.anumber)(I);const r=I!==void 0?I:a.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function x(a,I,r=!1,n={}){if(a<=h)throw new Error("invalid field: expected ORDER > 0, got "+a);const{nBitLength:s,nByteLength:c}=E(a,I);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let S;const M=Object.freeze({ORDER:a,isLE:r,BITS:s,BYTES:c,MASK:(0,i.bitMask)(s),ZERO:h,ONE:o,create:U=>P(U,a),isValid:U=>{if(typeof U!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof U);return h<=U&&U<a},is0:U=>U===h,isOdd:U=>(U&o)===o,neg:U=>P(-U,a),eql:(U,V)=>U===V,sqr:U=>P(U*U,a),add:(U,V)=>P(U+V,a),sub:(U,V)=>P(U-V,a),mul:(U,V)=>P(U*V,a),pow:(U,V)=>t(M,U,V),div:(U,V)=>P(U*k(V,a),a),sqrN:U=>U*U,addN:(U,V)=>U+V,subN:(U,V)=>U-V,mulN:(U,V)=>U*V,inv:U=>k(U,a),sqrt:n.sqrt||(U=>(S||(S=N(a)),S(M,U))),toBytes:U=>r?(0,i.numberToBytesLE)(U,c):(0,i.numberToBytesBE)(U,c),fromBytes:U=>{if(U.length!==c)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+U.length);return r?(0,i.bytesToNumberLE)(U):(0,i.bytesToNumberBE)(U)},invertBatch:U=>d(M,U),cmov:(U,V,D)=>D?V:U});return Object.freeze(M)}function A(a,I){if(!a.isOdd)throw new Error("Field doesn't have isOdd");const r=a.sqrt(I);return a.isOdd(r)?r:a.neg(r)}function p(a,I){if(!a.isOdd)throw new Error("Field doesn't have isOdd");const r=a.sqrt(I);return a.isOdd(r)?a.neg(r):r}function v(a,I,r=!1){a=(0,i.ensureBytes)("privateHash",a);const n=a.length,s=E(I).nByteLength+8;if(s<24||n<s||n>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+n);const c=r?(0,i.bytesToNumberLE)(a):(0,i.bytesToNumberBE)(a);return P(c,I-o)+o}function T(a){if(typeof a!="bigint")throw new Error("field order must be bigint");const I=a.toString(2).length;return Math.ceil(I/8)}function $(a){const I=T(a);return I+Math.ceil(I/2)}function w(a,I,r=!1){const n=a.length,s=T(I),c=$(I);if(n<16||n<c||n>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+n);const S=r?(0,i.bytesToNumberLE)(a):(0,i.bytesToNumberBE)(a),M=P(S,I-o)+o;return r?(0,i.numberToBytesLE)(M,s):(0,i.numberToBytesBE)(M,s)}return fe}var Nr;function Ii(){if(Nr)return Ve;Nr=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.wNAF=q,Ve.pippenger=C,Ve.precomputeMSMUnsafe=z,Ve.validateBasic=N;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=$t(),i=wt(),h=BigInt(0),o=BigInt(1);function f(y,u){const m=u.negate();return y?m:u}function g(y,u){if(!Number.isSafeInteger(y)||y<=0||y>u)throw new Error("invalid window size, expected [1.."+u+"], got W="+y)}function l(y,u){g(y,u);const m=Math.ceil(u/y)+1,t=2**(y-1),d=2**y,b=(0,i.bitMask)(y),_=BigInt(y);return{windows:m,windowSize:t,mask:b,maxNumber:d,shiftBy:_}}function B(y,u,m){const{windowSize:t,mask:d,maxNumber:b,shiftBy:_}=m;let H=Number(y&d),E=y>>_;H>t&&(H-=b,E+=o);const x=u*t,A=x+Math.abs(H)-1,p=H===0,v=H<0,T=u%2!==0;return{nextN:E,offset:A,isZero:p,isNeg:v,isNegF:T,offsetF:x}}function O(y,u){if(!Array.isArray(y))throw new Error("array expected");y.forEach((m,t)=>{if(!(m instanceof u))throw new Error("invalid point at index "+t)})}function P(y,u){if(!Array.isArray(y))throw new Error("array of scalars expected");y.forEach((m,t)=>{if(!u.isValid(m))throw new Error("invalid scalar at index "+t)})}const L=new WeakMap,j=new WeakMap;function k(y){return j.get(y)||1}function q(y,u){return{constTimeNegate:f,hasPrecomputes(m){return k(m)!==1},unsafeLadder(m,t,d=y.ZERO){let b=m;for(;t>h;)t&o&&(d=d.add(b)),b=b.double(),t>>=o;return d},precomputeWindow(m,t){const{windows:d,windowSize:b}=l(t,u),_=[];let H=m,E=H;for(let x=0;x<d;x++){E=H,_.push(E);for(let A=1;A<b;A++)E=E.add(H),_.push(E);H=E.double()}return _},wNAF(m,t,d){let b=y.ZERO,_=y.BASE;const H=l(m,u);for(let E=0;E<H.windows;E++){const{nextN:x,offset:A,isZero:p,isNeg:v,isNegF:T,offsetF:$}=B(d,E,H);d=x,p?_=_.add(f(T,t[$])):b=b.add(f(v,t[A]))}return{p:b,f:_}},wNAFUnsafe(m,t,d,b=y.ZERO){const _=l(m,u);for(let H=0;H<_.windows&&d!==h;H++){const{nextN:E,offset:x,isZero:A,isNeg:p}=B(d,H,_);if(d=E,!A){const v=t[x];b=b.add(p?v.negate():v)}}return b},getPrecomputes(m,t,d){let b=L.get(t);return b||(b=this.precomputeWindow(t,m),m!==1&&L.set(t,d(b))),b},wNAFCached(m,t,d){const b=k(m);return this.wNAF(b,this.getPrecomputes(b,m,d),t)},wNAFCachedUnsafe(m,t,d,b){const _=k(m);return _===1?this.unsafeLadder(m,t,b):this.wNAFUnsafe(_,this.getPrecomputes(_,m,d),t,b)},setWindowSize(m,t){g(t,u),j.set(m,t),L.delete(m)}}}function C(y,u,m,t){O(m,y),P(t,u);const d=m.length,b=t.length;if(d!==b)throw new Error("arrays of points and scalars must have equal length");const _=y.ZERO,H=(0,i.bitLen)(BigInt(d));let E=1;H>12?E=H-3:H>4?E=H-2:H>0&&(E=2);const x=(0,i.bitMask)(E),A=new Array(Number(x)+1).fill(_),p=Math.floor((u.BITS-1)/E)*E;let v=_;for(let T=p;T>=0;T-=E){A.fill(_);for(let w=0;w<b;w++){const a=t[w],I=Number(a>>BigInt(T)&x);A[I]=A[I].add(m[w])}let $=_;for(let w=A.length-1,a=_;w>0;w--)a=a.add(A[w]),$=$.add(a);if(v=v.add($),T!==0)for(let w=0;w<E;w++)v=v.double()}return v}function z(y,u,m,t){g(t,u.BITS),O(m,y);const d=y.ZERO,b=2**t-1,_=Math.ceil(u.BITS/t),H=(0,i.bitMask)(t),E=m.map(x=>{const A=[];for(let p=0,v=x;p<b;p++)A.push(v),v=v.add(x);return A});return x=>{if(P(x,u),x.length>m.length)throw new Error("array of scalars must be smaller than array of points");let A=d;for(let p=0;p<_;p++){if(A!==d)for(let T=0;T<t;T++)A=A.double();const v=BigInt(_*t-(p+1)*t);for(let T=0;T<x.length;T++){const $=x[T],w=Number($>>v&H);w&&(A=A.add(E[T][w-1]))}}return A}}function N(y){return(0,e.validateField)(y.Fp),(0,i.validateObject)(y,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(y.n,y.nBitLength),...y,p:y.Fp.ORDER})}return Ve}var Cr;function zn(){return Cr||(Cr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e.weierstrassPoints=q,e.weierstrass=z,e.SWUFpSqrtRatio=N,e.mapToCurveSimpleSWU=y;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i=Ii(),h=$t(),o=wt();function f(u){u.lowS!==void 0&&(0,o.abool)("lowS",u.lowS),u.prehash!==void 0&&(0,o.abool)("prehash",u.prehash)}function g(u){const m=(0,i.validateBasic)(u);(0,o.validateObject)(m,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:t,Fp:d,a:b}=m;if(t){if(!d.eql(b,d.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...m})}class l extends Error{constructor(m=""){super(m)}}e.DERErr=l,e.DER={Err:l,_tlv:{encode:(u,m)=>{const{Err:t}=e.DER;if(u<0||u>256)throw new t("tlv.encode: wrong tag");if(m.length&1)throw new t("tlv.encode: unpadded data");const d=m.length/2,b=(0,o.numberToHexUnpadded)(d);if(b.length/2&128)throw new t("tlv.encode: long form length too big");const _=d>127?(0,o.numberToHexUnpadded)(b.length/2|128):"";return(0,o.numberToHexUnpadded)(u)+_+b+m},decode(u,m){const{Err:t}=e.DER;let d=0;if(u<0||u>256)throw new t("tlv.encode: wrong tag");if(m.length<2||m[d++]!==u)throw new t("tlv.decode: wrong tlv");const b=m[d++],_=!!(b&128);let H=0;if(!_)H=b;else{const x=b&127;if(!x)throw new t("tlv.decode(long): indefinite length not supported");if(x>4)throw new t("tlv.decode(long): byte length is too big");const A=m.subarray(d,d+x);if(A.length!==x)throw new t("tlv.decode: length bytes not complete");if(A[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const p of A)H=H<<8|p;if(d+=x,H<128)throw new t("tlv.decode(long): not minimal encoding")}const E=m.subarray(d,d+H);if(E.length!==H)throw new t("tlv.decode: wrong value length");return{v:E,l:m.subarray(d+H)}}},_int:{encode(u){const{Err:m}=e.DER;if(u<O)throw new m("integer: negative integers are not allowed");let t=(0,o.numberToHexUnpadded)(u);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new m("unexpected DER parsing assertion: unpadded hex");return t},decode(u){const{Err:m}=e.DER;if(u[0]&128)throw new m("invalid signature integer: negative");if(u[0]===0&&!(u[1]&128))throw new m("invalid signature integer: unnecessary leading zero");return(0,o.bytesToNumberBE)(u)}},toSig(u){const{Err:m,_int:t,_tlv:d}=e.DER,b=(0,o.ensureBytes)("signature",u),{v:_,l:H}=d.decode(48,b);if(H.length)throw new m("invalid signature: left bytes after parsing");const{v:E,l:x}=d.decode(2,_),{v:A,l:p}=d.decode(2,x);if(p.length)throw new m("invalid signature: left bytes after parsing");return{r:t.decode(E),s:t.decode(A)}},hexFromSig(u){const{_tlv:m,_int:t}=e.DER,d=m.encode(2,t.encode(u.r)),b=m.encode(2,t.encode(u.s)),_=d+b;return m.encode(48,_)}};function B(u,m){return(0,o.bytesToHex)((0,o.numberToBytesBE)(u,m))}const O=BigInt(0),P=BigInt(1),L=BigInt(2),j=BigInt(3),k=BigInt(4);function q(u){const m=g(u),{Fp:t}=m,d=(0,h.Field)(m.n,m.nBitLength),b=m.toBytes||((s,c,S)=>{const M=c.toAffine();return(0,o.concatBytes)(Uint8Array.from([4]),t.toBytes(M.x),t.toBytes(M.y))}),_=m.fromBytes||(s=>{const c=s.subarray(1),S=t.fromBytes(c.subarray(0,t.BYTES)),M=t.fromBytes(c.subarray(t.BYTES,2*t.BYTES));return{x:S,y:M}});function H(s){const{a:c,b:S}=m,M=t.sqr(s),U=t.mul(M,s);return t.add(t.add(U,t.mul(s,c)),S)}function E(s,c){const S=t.sqr(c),M=H(s);return t.eql(S,M)}if(!E(m.Gx,m.Gy))throw new Error("bad curve params: generator point");const x=t.mul(t.pow(m.a,j),k),A=t.mul(t.sqr(m.b),BigInt(27));if(t.is0(t.add(x,A)))throw new Error("bad curve params: a or b");function p(s){return(0,o.inRange)(s,P,m.n)}function v(s){const{allowedPrivateKeyLengths:c,nByteLength:S,wrapPrivateKey:M,n:U}=m;if(c&&typeof s!="bigint"){if((0,o.isBytes)(s)&&(s=(0,o.bytesToHex)(s)),typeof s!="string"||!c.includes(s.length))throw new Error("invalid private key");s=s.padStart(S*2,"0")}let V;try{V=typeof s=="bigint"?s:(0,o.bytesToNumberBE)((0,o.ensureBytes)("private key",s,S))}catch{throw new Error("invalid private key, expected hex or "+S+" bytes, got "+typeof s)}return M&&(V=(0,h.mod)(V,U)),(0,o.aInRange)("private key",V,P,U),V}function T(s){if(!(s instanceof a))throw new Error("ProjectivePoint expected")}const $=(0,o.memoized)((s,c)=>{const{px:S,py:M,pz:U}=s;if(t.eql(U,t.ONE))return{x:S,y:M};const V=s.is0();c==null&&(c=V?t.ONE:t.inv(U));const D=t.mul(S,c),G=t.mul(M,c),W=t.mul(U,c);if(V)return{x:t.ZERO,y:t.ZERO};if(!t.eql(W,t.ONE))throw new Error("invZ was invalid");return{x:D,y:G}}),w=(0,o.memoized)(s=>{if(s.is0()){if(m.allowInfinityPoint&&!t.is0(s.py))return;throw new Error("bad point: ZERO")}const{x:c,y:S}=s.toAffine();if(!t.isValid(c)||!t.isValid(S))throw new Error("bad point: x or y not FE");if(!E(c,S))throw new Error("bad point: equation left != right");if(!s.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class a{constructor(c,S,M){if(c==null||!t.isValid(c))throw new Error("x required");if(S==null||!t.isValid(S)||t.is0(S))throw new Error("y required");if(M==null||!t.isValid(M))throw new Error("z required");this.px=c,this.py=S,this.pz=M,Object.freeze(this)}static fromAffine(c){const{x:S,y:M}=c||{};if(!c||!t.isValid(S)||!t.isValid(M))throw new Error("invalid affine point");if(c instanceof a)throw new Error("projective point not allowed");const U=V=>t.eql(V,t.ZERO);return U(S)&&U(M)?a.ZERO:new a(S,M,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(c){const S=(0,h.FpInvertBatch)(t,c.map(M=>M.pz));return c.map((M,U)=>M.toAffine(S[U])).map(a.fromAffine)}static fromHex(c){const S=a.fromAffine(_((0,o.ensureBytes)("pointHex",c)));return S.assertValidity(),S}static fromPrivateKey(c){return a.BASE.multiply(v(c))}static msm(c,S){return(0,i.pippenger)(a,d,c,S)}_setWindowSize(c){n.setWindowSize(this,c)}assertValidity(){w(this)}hasEvenY(){const{y:c}=this.toAffine();if(t.isOdd)return!t.isOdd(c);throw new Error("Field doesn't support isOdd")}equals(c){T(c);const{px:S,py:M,pz:U}=this,{px:V,py:D,pz:G}=c,W=t.eql(t.mul(S,G),t.mul(V,U)),Y=t.eql(t.mul(M,G),t.mul(D,U));return W&&Y}negate(){return new a(this.px,t.neg(this.py),this.pz)}double(){const{a:c,b:S}=m,M=t.mul(S,j),{px:U,py:V,pz:D}=this;let G=t.ZERO,W=t.ZERO,Y=t.ZERO,F=t.mul(U,U),se=t.mul(V,V),K=t.mul(D,D),Z=t.mul(U,V);return Z=t.add(Z,Z),Y=t.mul(U,D),Y=t.add(Y,Y),G=t.mul(c,Y),W=t.mul(M,K),W=t.add(G,W),G=t.sub(se,W),W=t.add(se,W),W=t.mul(G,W),G=t.mul(Z,G),Y=t.mul(M,Y),K=t.mul(c,K),Z=t.sub(F,K),Z=t.mul(c,Z),Z=t.add(Z,Y),Y=t.add(F,F),F=t.add(Y,F),F=t.add(F,K),F=t.mul(F,Z),W=t.add(W,F),K=t.mul(V,D),K=t.add(K,K),F=t.mul(K,Z),G=t.sub(G,F),Y=t.mul(K,se),Y=t.add(Y,Y),Y=t.add(Y,Y),new a(G,W,Y)}add(c){T(c);const{px:S,py:M,pz:U}=this,{px:V,py:D,pz:G}=c;let W=t.ZERO,Y=t.ZERO,F=t.ZERO;const se=m.a,K=t.mul(m.b,j);let Z=t.mul(S,V),X=t.mul(M,D),re=t.mul(U,G),Q=t.add(S,M),ee=t.add(V,D);Q=t.mul(Q,ee),ee=t.add(Z,X),Q=t.sub(Q,ee),ee=t.add(S,U);let ae=t.add(V,G);return ee=t.mul(ee,ae),ae=t.add(Z,re),ee=t.sub(ee,ae),ae=t.add(M,U),W=t.add(D,G),ae=t.mul(ae,W),W=t.add(X,re),ae=t.sub(ae,W),F=t.mul(se,ee),W=t.mul(K,re),F=t.add(W,F),W=t.sub(X,F),F=t.add(X,F),Y=t.mul(W,F),X=t.add(Z,Z),X=t.add(X,Z),re=t.mul(se,re),ee=t.mul(K,ee),X=t.add(X,re),re=t.sub(Z,re),re=t.mul(se,re),ee=t.add(ee,re),Z=t.mul(X,ee),Y=t.add(Y,Z),Z=t.mul(ae,ee),W=t.mul(Q,W),W=t.sub(W,Z),Z=t.mul(Q,X),F=t.mul(ae,F),F=t.add(F,Z),new a(W,Y,F)}subtract(c){return this.add(c.negate())}is0(){return this.equals(a.ZERO)}wNAF(c){return n.wNAFCached(this,c,a.normalizeZ)}multiplyUnsafe(c){const{endo:S,n:M}=m;(0,o.aInRange)("scalar",c,O,M);const U=a.ZERO;if(c===O)return U;if(this.is0()||c===P)return this;if(!S||n.hasPrecomputes(this))return n.wNAFCachedUnsafe(this,c,a.normalizeZ);let{k1neg:V,k1:D,k2neg:G,k2:W}=S.splitScalar(c),Y=U,F=U,se=this;for(;D>O||W>O;)D&P&&(Y=Y.add(se)),W&P&&(F=F.add(se)),se=se.double(),D>>=P,W>>=P;return V&&(Y=Y.negate()),G&&(F=F.negate()),F=new a(t.mul(F.px,S.beta),F.py,F.pz),Y.add(F)}multiply(c){const{endo:S,n:M}=m;(0,o.aInRange)("scalar",c,P,M);let U,V;if(S){const{k1neg:D,k1:G,k2neg:W,k2:Y}=S.splitScalar(c);let{p:F,f:se}=this.wNAF(G),{p:K,f:Z}=this.wNAF(Y);F=n.constTimeNegate(D,F),K=n.constTimeNegate(W,K),K=new a(t.mul(K.px,S.beta),K.py,K.pz),U=F.add(K),V=se.add(Z)}else{const{p:D,f:G}=this.wNAF(c);U=D,V=G}return a.normalizeZ([U,V])[0]}multiplyAndAddUnsafe(c,S,M){const U=a.BASE,V=(G,W)=>W===O||W===P||!G.equals(U)?G.multiplyUnsafe(W):G.multiply(W),D=V(this,S).add(V(c,M));return D.is0()?void 0:D}toAffine(c){return $(this,c)}isTorsionFree(){const{h:c,isTorsionFree:S}=m;if(c===P)return!0;if(S)return S(a,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:c,clearCofactor:S}=m;return c===P?this:S?S(a,this):this.multiplyUnsafe(m.h)}toRawBytes(c=!0){return(0,o.abool)("isCompressed",c),this.assertValidity(),b(a,this,c)}toHex(c=!0){return(0,o.abool)("isCompressed",c),(0,o.bytesToHex)(this.toRawBytes(c))}}a.BASE=new a(m.Gx,m.Gy,t.ONE),a.ZERO=new a(t.ZERO,t.ONE,t.ZERO);const{endo:I,nBitLength:r}=m,n=(0,i.wNAF)(a,I?Math.ceil(r/2):r);return{CURVE:m,ProjectivePoint:a,normPrivateKeyToScalar:v,weierstrassEquation:H,isWithinCurveOrder:p}}function C(u){const m=(0,i.validateBasic)(u);return(0,o.validateObject)(m,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...m})}function z(u){const m=C(u),{Fp:t,n:d,nByteLength:b,nBitLength:_}=m,H=t.BYTES+1,E=2*t.BYTES+1;function x(K){return(0,h.mod)(K,d)}function A(K){return(0,h.invert)(K,d)}const{ProjectivePoint:p,normPrivateKeyToScalar:v,weierstrassEquation:T,isWithinCurveOrder:$}=q({...m,toBytes(K,Z,X){const re=Z.toAffine(),Q=t.toBytes(re.x),ee=o.concatBytes;return(0,o.abool)("isCompressed",X),X?ee(Uint8Array.from([Z.hasEvenY()?2:3]),Q):ee(Uint8Array.from([4]),Q,t.toBytes(re.y))},fromBytes(K){const Z=K.length,X=K[0],re=K.subarray(1);if(Z===H&&(X===2||X===3)){const Q=(0,o.bytesToNumberBE)(re);if(!(0,o.inRange)(Q,P,t.ORDER))throw new Error("Point is not on curve");const ee=T(Q);let ae;try{ae=t.sqrt(ee)}catch(_e){const we=_e instanceof Error?": "+_e.message:"";throw new Error("Point is not on curve"+we)}const pe=(ae&P)===P;return(X&1)===1!==pe&&(ae=t.neg(ae)),{x:Q,y:ae}}else if(Z===E&&X===4){const Q=t.fromBytes(re.subarray(0,t.BYTES)),ee=t.fromBytes(re.subarray(t.BYTES,2*t.BYTES));return{x:Q,y:ee}}else{const Q=H,ee=E;throw new Error("invalid Point, expected length of "+Q+", or uncompressed "+ee+", got "+Z)}}});function w(K){const Z=d>>P;return K>Z}function a(K){return w(K)?x(-K):K}const I=(K,Z,X)=>(0,o.bytesToNumberBE)(K.slice(Z,X));class r{constructor(Z,X,re){(0,o.aInRange)("r",Z,P,d),(0,o.aInRange)("s",X,P,d),this.r=Z,this.s=X,re!=null&&(this.recovery=re),Object.freeze(this)}static fromCompact(Z){const X=b;return Z=(0,o.ensureBytes)("compactSignature",Z,X*2),new r(I(Z,0,X),I(Z,X,2*X))}static fromDER(Z){const{r:X,s:re}=e.DER.toSig((0,o.ensureBytes)("DER",Z));return new r(X,re)}assertValidity(){}addRecoveryBit(Z){return new r(this.r,this.s,Z)}recoverPublicKey(Z){const{r:X,s:re,recovery:Q}=this,ee=U((0,o.ensureBytes)("msgHash",Z));if(Q==null||![0,1,2,3].includes(Q))throw new Error("recovery id invalid");const ae=Q===2||Q===3?X+m.n:X;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const pe=Q&1?"03":"02",Ue=p.fromHex(pe+B(ae,t.BYTES)),_e=A(ae),we=x(-ee*_e),Ze=x(re*_e),ze=p.BASE.multiplyAndAddUnsafe(Ue,we,Ze);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new r(this.r,x(-this.s),this.recovery):this}toDERRawBytes(){return(0,o.hexToBytes)(this.toDERHex())}toDERHex(){return e.DER.hexFromSig(this)}toCompactRawBytes(){return(0,o.hexToBytes)(this.toCompactHex())}toCompactHex(){const Z=b;return B(this.r,Z)+B(this.s,Z)}}const n={isValidPrivateKey(K){try{return v(K),!0}catch{return!1}},normPrivateKeyToScalar:v,randomPrivateKey:()=>{const K=(0,h.getMinHashLength)(m.n);return(0,h.mapHashToField)(m.randomBytes(K),m.n)},precompute(K=8,Z=p.BASE){return Z._setWindowSize(K),Z.multiply(BigInt(3)),Z}};function s(K,Z=!0){return p.fromPrivateKey(K).toRawBytes(Z)}function c(K){if(typeof K=="bigint")return!1;if(K instanceof p)return!0;const X=(0,o.ensureBytes)("key",K).length,re=t.BYTES,Q=re+1,ee=2*re+1;if(!(m.allowedPrivateKeyLengths||b===Q))return X===Q||X===ee}function S(K,Z,X=!0){if(c(K)===!0)throw new Error("first arg must be private key");if(c(Z)===!1)throw new Error("second arg must be public key");return p.fromHex(Z).multiply(v(K)).toRawBytes(X)}const M=m.bits2int||function(K){if(K.length>8192)throw new Error("input is too large");const Z=(0,o.bytesToNumberBE)(K),X=K.length*8-_;return X>0?Z>>BigInt(X):Z},U=m.bits2int_modN||function(K){return x(M(K))},V=(0,o.bitMask)(_);function D(K){return(0,o.aInRange)("num < 2^"+_,K,O,V),(0,o.numberToBytesBE)(K,b)}function G(K,Z,X=W){if(["recovered","canonical"].some(ke=>ke in X))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:Q}=m;let{lowS:ee,prehash:ae,extraEntropy:pe}=X;ee==null&&(ee=!0),K=(0,o.ensureBytes)("msgHash",K),f(X),ae&&(K=(0,o.ensureBytes)("prehashed msgHash",re(K)));const Ue=U(K),_e=v(Z),we=[D(_e),D(Ue)];if(pe!=null&&pe!==!1){const ke=pe===!0?Q(t.BYTES):pe;we.push((0,o.ensureBytes)("extraEntropy",ke))}const Ze=(0,o.concatBytes)(...we),ze=Ue;function kt(ke){const We=M(ke);if(!$(We))return;const Nt=A(We),tt=p.BASE.multiply(We).toAffine(),Ne=x(tt.x);if(Ne===O)return;const rt=x(Nt*x(ze+Ne*_e));if(rt===O)return;let nt=(tt.x===Ne?0:2)|Number(tt.y&P),Fe=rt;return ee&&w(rt)&&(Fe=a(rt),nt^=1),new r(Ne,Fe,nt)}return{seed:Ze,k2sig:kt}}const W={lowS:m.lowS,prehash:!1},Y={lowS:m.lowS,prehash:!1};function F(K,Z,X=W){const{seed:re,k2sig:Q}=G(K,Z,X),ee=m;return(0,o.createHmacDrbg)(ee.hash.outputLen,ee.nByteLength,ee.hmac)(re,Q)}p.BASE._setWindowSize(8);function se(K,Z,X,re=Y){var nt;const Q=K;Z=(0,o.ensureBytes)("msgHash",Z),X=(0,o.ensureBytes)("publicKey",X);const{lowS:ee,prehash:ae,format:pe}=re;if(f(re),"strict"in re)throw new Error("options.strict was renamed to lowS");if(pe!==void 0&&pe!=="compact"&&pe!=="der")throw new Error("format must be compact or der");const Ue=typeof Q=="string"||(0,o.isBytes)(Q),_e=!Ue&&!pe&&typeof Q=="object"&&Q!==null&&typeof Q.r=="bigint"&&typeof Q.s=="bigint";if(!Ue&&!_e)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let we,Ze;try{if(_e&&(we=new r(Q.r,Q.s)),Ue){try{pe!=="compact"&&(we=r.fromDER(Q))}catch(Fe){if(!(Fe instanceof e.DER.Err))throw Fe}!we&&pe!=="der"&&(we=r.fromCompact(Q))}Ze=p.fromHex(X)}catch{return!1}if(!we||ee&&we.hasHighS())return!1;ae&&(Z=m.hash(Z));const{r:ze,s:kt}=we,ke=U(Z),We=A(kt),Nt=x(ke*We),tt=x(ze*We),Ne=(nt=p.BASE.multiplyAndAddUnsafe(Ze,Nt,tt))==null?void 0:nt.toAffine();return Ne?x(Ne.x)===ze:!1}return{CURVE:m,getPublicKey:s,getSharedSecret:S,sign:F,verify:se,ProjectivePoint:p,Signature:r,utils:n}}function N(u,m){const t=u.ORDER;let d=O;for(let w=t-P;w%L===O;w/=L)d+=P;const b=d,_=L<<b-P-P,H=_*L,E=(t-P)/H,x=(E-P)/L,A=H-P,p=_,v=u.pow(m,E),T=u.pow(m,(E+P)/L);let $=(w,a)=>{let I=v,r=u.pow(a,A),n=u.sqr(r);n=u.mul(n,a);let s=u.mul(w,n);s=u.pow(s,x),s=u.mul(s,r),r=u.mul(s,a),n=u.mul(s,w);let c=u.mul(n,r);s=u.pow(c,p);let S=u.eql(s,u.ONE);r=u.mul(n,T),s=u.mul(c,I),n=u.cmov(r,n,S),c=u.cmov(s,c,S);for(let M=b;M>P;M--){let U=M-L;U=L<<U-P;let V=u.pow(c,U);const D=u.eql(V,u.ONE);r=u.mul(n,I),I=u.mul(I,I),V=u.mul(c,I),n=u.cmov(r,n,D),c=u.cmov(V,c,D)}return{isValid:S,value:n}};if(u.ORDER%k===j){const w=(u.ORDER-j)/k,a=u.sqrt(u.neg(m));$=(I,r)=>{let n=u.sqr(r);const s=u.mul(I,r);n=u.mul(n,s);let c=u.pow(n,w);c=u.mul(c,s);const S=u.mul(c,a),M=u.mul(u.sqr(c),r),U=u.eql(M,I);let V=u.cmov(S,c,U);return{isValid:U,value:V}}}return $}function y(u,m){if((0,h.validateField)(u),!u.isValid(m.A)||!u.isValid(m.B)||!u.isValid(m.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const t=N(u,m.Z);if(!u.isOdd)throw new Error("Fp.isOdd is not implemented!");return d=>{let b,_,H,E,x,A,p,v;b=u.sqr(d),b=u.mul(b,m.Z),_=u.sqr(b),_=u.add(_,b),H=u.add(_,u.ONE),H=u.mul(H,m.B),E=u.cmov(m.Z,u.neg(_),!u.eql(_,u.ZERO)),E=u.mul(E,m.A),_=u.sqr(H),A=u.sqr(E),x=u.mul(A,m.A),_=u.add(_,x),_=u.mul(_,H),A=u.mul(A,E),x=u.mul(A,m.B),_=u.add(_,x),p=u.mul(b,H);const{isValid:T,value:$}=t(_,A);v=u.mul(b,d),v=u.mul(v,$),p=u.cmov(p,H,T),v=u.cmov(v,$,T);const w=u.isOdd(d)===u.isOdd(v);v=u.cmov(u.neg(v),v,w);const a=(0,h.FpInvertBatch)(u,[E],!0)[0];return p=u.mul(p,a),{x:p,y:v}}}}(Ft)),Ft}var Vr;function Bi(){if(Vr)return ut;Vr=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.getHash=o,ut.createCurve=f;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=Mn(),i=Me(),h=zn();function o(g){return{hash:g,hmac:(l,...B)=>(0,e.hmac)(g,l,(0,i.concatBytes)(...B)),randomBytes:i.randomBytes}}function f(g,l){const B=O=>(0,h.weierstrass)({...g,...o(O)});return{...B(l),create:B}}return ut}var $e={},Dr;function _i(){if(Dr)return $e;Dr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.expand_message_xmd=l,$e.expand_message_xof=B,$e.hash_to_field=O,$e.isogenyMap=P,$e.createHasher=L;const e=$t(),i=wt(),h=i.bytesToNumberBE;function o(j,k){if(g(j),g(k),j<0||j>=1<<8*k)throw new Error("invalid I2OSP input: "+j);const q=Array.from({length:k}).fill(0);for(let C=k-1;C>=0;C--)q[C]=j&255,j>>>=8;return new Uint8Array(q)}function f(j,k){const q=new Uint8Array(j.length);for(let C=0;C<j.length;C++)q[C]=j[C]^k[C];return q}function g(j){if(!Number.isSafeInteger(j))throw new Error("number expected")}function l(j,k,q,C){(0,i.abytes)(j),(0,i.abytes)(k),g(q),k.length>255&&(k=C((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),k)));const{outputLen:z,blockLen:N}=C,y=Math.ceil(q/z);if(q>65535||y>255)throw new Error("expand_message_xmd: invalid lenInBytes");const u=(0,i.concatBytes)(k,o(k.length,1)),m=o(0,N),t=o(q,2),d=new Array(y),b=C((0,i.concatBytes)(m,j,t,o(0,1),u));d[0]=C((0,i.concatBytes)(b,o(1,1),u));for(let H=1;H<=y;H++){const E=[f(b,d[H-1]),o(H+1,1),u];d[H]=C((0,i.concatBytes)(...E))}return(0,i.concatBytes)(...d).slice(0,q)}function B(j,k,q,C,z){if((0,i.abytes)(j),(0,i.abytes)(k),g(q),k.length>255){const N=Math.ceil(2*C/8);k=z.create({dkLen:N}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(k).digest()}if(q>65535||k.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return z.create({dkLen:q}).update(j).update(o(q,2)).update(k).update(o(k.length,1)).digest()}function O(j,k,q){(0,i.validateObject)(q,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:C,k:z,m:N,hash:y,expand:u,DST:m}=q;(0,i.abytes)(j),g(k);const t=typeof m=="string"?(0,i.utf8ToBytes)(m):m,d=C.toString(2).length,b=Math.ceil((d+z)/8),_=k*N*b;let H;if(u==="xmd")H=l(j,t,_,y);else if(u==="xof")H=B(j,t,_,z,y);else if(u==="_internal_pass")H=j;else throw new Error('expand must be "xmd" or "xof"');const E=new Array(k);for(let x=0;x<k;x++){const A=new Array(N);for(let p=0;p<N;p++){const v=b*(p+x*N),T=H.subarray(v,v+b);A[p]=(0,e.mod)(h(T),C)}E[x]=A}return E}function P(j,k){const q=k.map(C=>Array.from(C).reverse());return(C,z)=>{const[N,y,u,m]=q.map(b=>b.reduce((_,H)=>j.add(j.mul(_,C),H))),[t,d]=(0,e.FpInvertBatch)(j,[y,m],!0);return C=j.mul(N,t),z=j.mul(z,j.mul(u,d)),{x:C,y:z}}}function L(j,k,q){if(typeof k!="function")throw new Error("mapToCurve() must be defined");function C(N){return j.fromAffine(k(N))}function z(N){const y=N.clearCofactor();return y.equals(j.ZERO)?j.ZERO:(y.assertValidity(),y)}return{defaults:q,hashToCurve(N,y){const u=O(N,2,{...q,DST:q.DST,...y}),m=C(u[0]),t=C(u[1]);return z(m.add(t))},encodeToCurve(N,y){const u=O(N,1,{...q,DST:q.encodeDST,...y});return z(C(u[0]))},mapToCurve(N){if(!Array.isArray(N))throw new Error("expected array of bigints");for(const y of N)if(typeof y!="bigint")throw new Error("expected array of bigints");return z(C(N))}}}return $e}var Kr;function $n(){return Kr||(Kr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i=Jt(),h=Me(),o=Bi(),f=_i(),g=$t(),l=wt(),B=zn(),O=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),P=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),L=BigInt(0),j=BigInt(1),k=BigInt(2),q=(a,I)=>(a+I/k)/I;function C(a){const I=O,r=BigInt(3),n=BigInt(6),s=BigInt(11),c=BigInt(22),S=BigInt(23),M=BigInt(44),U=BigInt(88),V=a*a*a%I,D=V*V*a%I,G=(0,g.pow2)(D,r,I)*D%I,W=(0,g.pow2)(G,r,I)*D%I,Y=(0,g.pow2)(W,k,I)*V%I,F=(0,g.pow2)(Y,s,I)*Y%I,se=(0,g.pow2)(F,c,I)*F%I,K=(0,g.pow2)(se,M,I)*se%I,Z=(0,g.pow2)(K,U,I)*K%I,X=(0,g.pow2)(Z,M,I)*se%I,re=(0,g.pow2)(X,r,I)*D%I,Q=(0,g.pow2)(re,S,I)*F%I,ee=(0,g.pow2)(Q,n,I)*V%I,ae=(0,g.pow2)(ee,k,I);if(!z.eql(z.sqr(ae),a))throw new Error("Cannot find square root");return ae}const z=(0,g.Field)(O,void 0,void 0,{sqrt:C});e.secp256k1=(0,o.createCurve)({a:L,b:BigInt(7),Fp:z,n:P,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:a=>{const I=P,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-j*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),c=r,S=BigInt("0x100000000000000000000000000000000"),M=q(c*a,I),U=q(-n*a,I);let V=(0,g.mod)(a-M*r-U*s,I),D=(0,g.mod)(-M*n-U*c,I);const G=V>S,W=D>S;if(G&&(V=I-V),W&&(D=I-D),V>S||D>S)throw new Error("splitScalar: Endomorphism failed, k="+a);return{k1neg:G,k1:V,k2neg:W,k2:D}}}},i.sha256);const N={};function y(a,...I){let r=N[a];if(r===void 0){const n=(0,i.sha256)(Uint8Array.from(a,s=>s.charCodeAt(0)));r=(0,l.concatBytes)(n,n),N[a]=r}return(0,i.sha256)((0,l.concatBytes)(r,...I))}const u=a=>a.toRawBytes(!0).slice(1),m=a=>(0,l.numberToBytesBE)(a,32),t=a=>(0,g.mod)(a,O),d=a=>(0,g.mod)(a,P),b=(()=>e.secp256k1.ProjectivePoint)(),_=(a,I,r)=>b.BASE.multiplyAndAddUnsafe(a,I,r);function H(a){let I=e.secp256k1.utils.normPrivateKeyToScalar(a),r=b.fromPrivateKey(I);return{scalar:r.hasEvenY()?I:d(-I),bytes:u(r)}}function E(a){(0,l.aInRange)("x",a,j,O);const I=t(a*a),r=t(I*a+BigInt(7));let n=C(r);n%k!==L&&(n=t(-n));const s=new b(a,n,j);return s.assertValidity(),s}const x=l.bytesToNumberBE;function A(...a){return d(x(y("BIP0340/challenge",...a)))}function p(a){return H(a).bytes}function v(a,I,r=(0,h.randomBytes)(32)){const n=(0,l.ensureBytes)("message",a),{bytes:s,scalar:c}=H(I),S=(0,l.ensureBytes)("auxRand",r,32),M=m(c^x(y("BIP0340/aux",S))),U=y("BIP0340/nonce",M,s,n),V=d(x(U));if(V===L)throw new Error("sign failed: k is zero");const{bytes:D,scalar:G}=H(V),W=A(D,s,n),Y=new Uint8Array(64);if(Y.set(D,0),Y.set(m(d(G+W*c)),32),!T(Y,n,s))throw new Error("sign: Invalid signature produced");return Y}function T(a,I,r){const n=(0,l.ensureBytes)("signature",a,64),s=(0,l.ensureBytes)("message",I),c=(0,l.ensureBytes)("publicKey",r,32);try{const S=E(x(c)),M=x(n.subarray(0,32));if(!(0,l.inRange)(M,j,O))return!1;const U=x(n.subarray(32,64));if(!(0,l.inRange)(U,j,P))return!1;const V=A(m(M),u(S),s),D=_(S,U,d(-V));return!(!D||!D.hasEvenY()||D.toAffine().x!==M)}catch{return!1}}e.schnorr=(()=>({getPublicKey:p,sign:v,verify:T,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:E,pointToBytes:u,numberToBytesBE:l.numberToBytesBE,bytesToNumberBE:l.bytesToNumberBE,taggedHash:y,mod:g.mod}}))();const $=(()=>(0,f.isogenyMap)(z,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(a=>a.map(I=>BigInt(I)))))(),w=(()=>(0,B.mapToCurveSimpleSWU)(z,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:z.create(BigInt("-11"))}))();e.secp256k1_hasher=(()=>(0,f.createHasher)(e.secp256k1.ProjectivePoint,a=>{const{x:I,y:r}=w(z.create(a[0]));return $(I,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:z.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256}))(),e.hashToCurve=(()=>e.secp256k1_hasher.hashToCurve)(),e.encodeToCurve=(()=>e.secp256k1_hasher.encodeToCurve)()}(Wt)),Wt}var ft={},Gt={},de={},xe={},ne={};const qn=Zn(Ei);var dt={},Ye={},lt={},Zr;function Ai(){return Zr||(Zr=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.version=void 0,lt.version="0.1.1"),lt}var Wr;function Pi(){if(Wr)return Ye;Wr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.getUrl=i,Ye.getVersion=h,Ye.prettyPrint=o;const e=Ai();function i(f){return f}function h(){return e.version}function o(f){if(!f)return"";const g=Object.entries(f).map(([B,O])=>O===void 0||O===!1?null:[B,O]).filter(Boolean),l=g.reduce((B,[O])=>Math.max(B,O.length),0);return g.map(([B,O])=>` ${`${B}:`.padEnd(l+1)} ${O}`).join(`
|
|
3
|
-
`)}return Ye}var
|
|
4
|
-
`);super(k,g.cause?{cause:g.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=g.cause,this.details=l,this.docs=P,this.docsOrigin=O,this.docsPath=B,this.shortMessage=f,this.showVersion=L,this.version=j}walk(f){return h(this,f)}}dt.BaseError=i,Object.defineProperty(i,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${(0,e.getVersion)()}`}}),i.setStaticOptions(i.defaultStaticOptions);function h(o,f){return f!=null&&f(o)?o:o&&typeof o=="object"&&"cause"in o&&o.cause?h(o.cause,f):f?null:o}return dt}var te={},Yt={},Gr;function kn(){return Gr||(Gr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeMap=void 0,e.assertSize=h,e.assertStartOffset=o,e.assertEndOffset=f,e.charCodeToBase16=g,e.pad=l,e.trim=B;const i=Re();function h(O,P){if(i.size(O)>P)throw new i.SizeOverflowError({givenSize:i.size(O),maxSize:P})}function o(O,P){if(typeof P=="number"&&P>0&&P>i.size(O)-1)throw new i.SliceOffsetOutOfBoundsError({offset:P,position:"start",size:i.size(O)})}function f(O,P,L){if(typeof P=="number"&&typeof L=="number"&&i.size(O)!==L-P)throw new i.SliceOffsetOutOfBoundsError({offset:L,position:"end",size:i.size(O)})}e.charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(O){if(O>=e.charCodeMap.zero&&O<=e.charCodeMap.nine)return O-e.charCodeMap.zero;if(O>=e.charCodeMap.A&&O<=e.charCodeMap.F)return O-(e.charCodeMap.A-10);if(O>=e.charCodeMap.a&&O<=e.charCodeMap.f)return O-(e.charCodeMap.a-10)}function l(O,P={}){const{dir:L,size:j=32}=P;if(j===0)return O;if(O.length>j)throw new i.SizeExceedsPaddingSizeError({size:O.length,targetSize:j,type:"Bytes"});const k=new Uint8Array(j);for(let q=0;q<j;q++){const C=L==="right";k[C?q:j-q-1]=O[C?q:O.length-q-1]}return k}function B(O,P={}){const{dir:L="left"}=P;let j=O,k=0;for(let q=0;q<j.length-1&&j[L==="left"?q:j.length-q-1].toString()==="0";q++)k++;return j=L==="left"?j.slice(k):j.slice(0,j.length-k),j}}(Yt)),Yt}var qe={},Yr;function Nn(){if(Yr)return qe;Yr=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.assertSize=i,qe.assertStartOffset=h,qe.assertEndOffset=o,qe.pad=f,qe.trim=g;const e=Se();function i(l,B){if(e.size(l)>B)throw new e.SizeOverflowError({givenSize:e.size(l),maxSize:B})}function h(l,B){if(typeof B=="number"&&B>0&&B>e.size(l)-1)throw new e.SliceOffsetOutOfBoundsError({offset:B,position:"start",size:e.size(l)})}function o(l,B,O){if(typeof B=="number"&&typeof O=="number"&&e.size(l)!==O-B)throw new e.SliceOffsetOutOfBoundsError({offset:O,position:"end",size:e.size(l)})}function f(l,B={}){const{dir:O,size:P=32}=B;if(P===0)return l;const L=l.replace("0x","");if(L.length>P*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(L.length/2),targetSize:P,type:"Hex"});return`0x${L[O==="right"?"padEnd":"padStart"](P*2,"0")}`}function g(l,B={}){const{dir:O="left"}=B;let P=l.replace("0x",""),L=0;for(let j=0;j<P.length-1&&P[O==="left"?j:P.length-j-1].toString()==="0";j++)L++;return P=O==="left"?P.slice(L):P.slice(0,P.length-L),P==="0"?"0x":O==="right"&&P.length%2===1?`0x${P}0`:`0x${P}`}return qe}var ht={},Xr;function qt(){if(Xr)return ht;Xr=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.parse=i,ht.stringify=h;const e="#__bigint";function i(o,f){return JSON.parse(o,(g,l)=>{const B=l;return typeof B=="string"&&B.endsWith(e)?BigInt(B.slice(0,-e.length)):typeof f=="function"?f(g,B):B})}function h(o,f,g){return JSON.stringify(o,(l,B)=>typeof f=="function"?f(l,B):typeof B=="bigint"?B.toString()+e:B,g)}return ht}var Jr;function Se(){if(Jr)return te;Jr=1,Object.defineProperty(te,"__esModule",{value:!0}),te.SizeExceedsPaddingSizeError=te.SliceOffsetOutOfBoundsError=te.SizeOverflowError=te.InvalidLengthError=te.InvalidHexValueError=te.InvalidHexTypeError=te.InvalidHexBooleanError=te.IntegerOutOfRangeError=void 0,te.assert=O,te.concat=P,te.from=L,te.fromBoolean=j,te.fromBytes=k,te.fromNumber=q,te.fromString=C,te.isEqual=z,te.padLeft=N,te.padRight=y,te.random=u,te.slice=m,te.size=t,te.trimLeft=d,te.trimRight=b,te.toBigInt=_,te.toBoolean=H,te.toBytes=E,te.toNumber=x,te.toString=A,te.validate=p;const e=qn,i=Re(),h=Pe(),o=kn(),f=Nn(),g=qt(),l=new TextEncoder,B=Array.from({length:256},(s,c)=>c.toString(16).padStart(2,"0"));function O(s,c={}){const{strict:S=!1}=c;if(!s)throw new $(s);if(typeof s!="string")throw new $(s);if(S&&!/^0x[0-9a-fA-F]*$/.test(s))throw new w(s);if(!s.startsWith("0x"))throw new w(s)}function P(...s){return`0x${s.reduce((c,S)=>c+S.replace("0x",""),"")}`}function L(s){return s instanceof Uint8Array?k(s):Array.isArray(s)?k(new Uint8Array(s)):s}function j(s,c={}){const S=`0x${Number(s)}`;return typeof c.size=="number"?(f.assertSize(S,c.size),N(S,c.size)):S}function k(s,c={}){let S="";for(let U=0;U<s.length;U++)S+=B[s[U]];const M=`0x${S}`;return typeof c.size=="number"?(f.assertSize(M,c.size),y(M,c.size)):M}function q(s,c={}){const{signed:S,size:M}=c,U=BigInt(s);let V;M?S?V=(1n<<BigInt(M)*8n-1n)-1n:V=2n**(BigInt(M)*8n)-1n:typeof s=="number"&&(V=BigInt(Number.MAX_SAFE_INTEGER));const D=typeof V=="bigint"&&S?-V-1n:0;if(V&&U>V||U<D){const Y=typeof s=="bigint"?"n":"";throw new v({max:V?`${V}${Y}`:void 0,min:`${D}${Y}`,signed:S,size:M,value:`${s}${Y}`})}const W=`0x${(S&&U<0?BigInt.asUintN(M*8,BigInt(U)):U).toString(16)}`;return M?N(W,M):W}function C(s,c={}){return k(l.encode(s),c)}function z(s,c){return(0,e.equalBytes)(i.fromHex(s),i.fromHex(c))}function N(s,c){return f.pad(s,{dir:"left",size:c})}function y(s,c){return f.pad(s,{dir:"right",size:c})}function u(s){return k(i.random(s))}function m(s,c,S,M={}){const{strict:U}=M;f.assertStartOffset(s,c);const V=`0x${s.replace("0x","").slice((c??0)*2,(S??s.length)*2)}`;return U&&f.assertEndOffset(V,c,S),V}function t(s){return Math.ceil((s.length-2)/2)}function d(s){return f.trim(s,{dir:"left"})}function b(s){return f.trim(s,{dir:"right"})}function _(s,c={}){const{signed:S}=c;c.size&&f.assertSize(s,c.size);const M=BigInt(s);if(!S)return M;const U=(s.length-2)/2,V=(1n<<BigInt(U)*8n)-1n,D=V>>1n;return M<=D?M:M-V-1n}function H(s,c={}){c.size&&f.assertSize(s,c.size);const S=d(s);if(S==="0x")return!1;if(S==="0x1")return!0;throw new T(s)}function E(s,c={}){return i.fromHex(s,c)}function x(s,c={}){const{signed:S,size:M}=c;return Number(!S&&!M?s:_(s,c))}function A(s,c={}){const{size:S}=c;let M=i.fromHex(s);return S&&(o.assertSize(M,S),M=i.trimRight(M)),new TextDecoder().decode(M)}function p(s,c={}){const{strict:S=!1}=c;try{return O(s,{strict:S}),!0}catch{return!1}}class v extends h.BaseError{constructor({max:c,min:S,signed:M,size:U,value:V}){super(`Number \`${V}\` is not in safe${U?` ${U*8}-bit`:""}${M?" signed":" unsigned"} integer range ${c?`(\`${S}\` to \`${c}\`)`:`(above \`${S}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}te.IntegerOutOfRangeError=v;class T extends h.BaseError{constructor(c){super(`Hex value \`"${c}"\` is not a valid boolean.`,{metaMessages:['The hex value must be `"0x0"` (false) or `"0x1"` (true).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexBooleanError"})}}te.InvalidHexBooleanError=T;class $ extends h.BaseError{constructor(c){super(`Value \`${typeof c=="object"?g.stringify(c):c}\` of type \`${typeof c}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}te.InvalidHexTypeError=$;class w extends h.BaseError{constructor(c){super(`Value \`${c}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}te.InvalidHexValueError=w;class a extends h.BaseError{constructor(c){super(`Hex value \`"${c}"\` is an odd length (${c.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}te.InvalidLengthError=a;class I extends h.BaseError{constructor({givenSize:c,maxSize:S}){super(`Size cannot exceed \`${S}\` bytes. Given size: \`${c}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}te.SizeOverflowError=I;class r extends h.BaseError{constructor({offset:c,position:S,size:M}){super(`Slice ${S==="start"?"starting":"ending"} at offset \`${c}\` is out-of-bounds (size: \`${M}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}te.SliceOffsetOutOfBoundsError=r;class n extends h.BaseError{constructor({size:c,targetSize:S,type:M}){super(`${M.charAt(0).toUpperCase()}${M.slice(1).toLowerCase()} size (\`${c}\`) exceeds padding size (\`${S}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}return te.SizeExceedsPaddingSizeError=n,te}var Qr;function Re(){if(Qr)return ne;Qr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.SizeExceedsPaddingSizeError=ne.SliceOffsetOutOfBoundsError=ne.SizeOverflowError=ne.InvalidBytesTypeError=ne.InvalidBytesBooleanError=void 0,ne.assert=O,ne.concat=P,ne.from=L,ne.fromArray=j,ne.fromBoolean=k,ne.fromHex=q,ne.fromNumber=C,ne.fromString=z,ne.isEqual=N,ne.padLeft=y,ne.padRight=u,ne.random=m,ne.size=t,ne.slice=d,ne.toBigInt=b,ne.toBoolean=_,ne.toHex=H,ne.toNumber=E,ne.toString=x,ne.trimLeft=A,ne.trimRight=p,ne.validate=v;const e=qn,i=Pe(),h=Se(),o=kn(),f=Nn(),g=qt(),l=new TextDecoder,B=new TextEncoder;function O(r){if(!(r instanceof Uint8Array)){if(!r)throw new $(r);if(typeof r!="object")throw new $(r);if(!("BYTES_PER_ELEMENT"in r))throw new $(r);if(r.BYTES_PER_ELEMENT!==1||r.constructor.name!=="Uint8Array")throw new $(r)}}function P(...r){let n=0;for(const c of r)n+=c.length;const s=new Uint8Array(n);for(let c=0,S=0;c<r.length;c++){const M=r[c];s.set(M,S),S+=M.length}return s}function L(r){return r instanceof Uint8Array?r:typeof r=="string"?q(r):j(r)}function j(r){return r instanceof Uint8Array?r:new Uint8Array(r)}function k(r,n={}){const{size:s}=n,c=new Uint8Array(1);return c[0]=Number(r),typeof s=="number"?(o.assertSize(c,s),y(c,s)):c}function q(r,n={}){const{size:s}=n;let c=r;s&&(f.assertSize(r,s),c=h.padRight(r,s));let S=c.slice(2);S.length%2&&(S=`0${S}`);const M=S.length/2,U=new Uint8Array(M);for(let V=0,D=0;V<M;V++){const G=o.charCodeToBase16(S.charCodeAt(D++)),W=o.charCodeToBase16(S.charCodeAt(D++));if(G===void 0||W===void 0)throw new i.BaseError(`Invalid byte sequence ("${S[D-2]}${S[D-1]}" in "${S}").`);U[V]=G<<4|W}return U}function C(r,n){const s=h.fromNumber(r,n);return q(s)}function z(r,n={}){const{size:s}=n,c=B.encode(r);return typeof s=="number"?(o.assertSize(c,s),u(c,s)):c}function N(r,n){return(0,e.equalBytes)(r,n)}function y(r,n){return o.pad(r,{dir:"left",size:n})}function u(r,n){return o.pad(r,{dir:"right",size:n})}function m(r){return crypto.getRandomValues(new Uint8Array(r))}function t(r){return r.length}function d(r,n,s,c={}){const{strict:S}=c;o.assertStartOffset(r,n);const M=r.slice(n,s);return S&&o.assertEndOffset(M,n,s),M}function b(r,n={}){const{size:s}=n;typeof s<"u"&&o.assertSize(r,s);const c=h.fromBytes(r,n);return h.toBigInt(c,n)}function _(r,n={}){const{size:s}=n;let c=r;if(typeof s<"u"&&(o.assertSize(c,s),c=A(c)),c.length>1||c[0]>1)throw new T(c);return!!c[0]}function H(r,n={}){return h.fromBytes(r,n)}function E(r,n={}){const{size:s}=n;typeof s<"u"&&o.assertSize(r,s);const c=h.fromBytes(r,n);return h.toNumber(c,n)}function x(r,n={}){const{size:s}=n;let c=r;return typeof s<"u"&&(o.assertSize(c,s),c=p(c)),l.decode(c)}function A(r){return o.trim(r,{dir:"left"})}function p(r){return o.trim(r,{dir:"right"})}function v(r){try{return O(r),!0}catch{return!1}}class T extends i.BaseError{constructor(n){super(`Bytes value \`${n}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}ne.InvalidBytesBooleanError=T;class $ extends i.BaseError{constructor(n){super(`Value \`${typeof n=="object"?g.stringify(n):n}\` of type \`${typeof n}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}ne.InvalidBytesTypeError=$;class w extends i.BaseError{constructor({givenSize:n,maxSize:s}){super(`Size cannot exceed \`${s}\` bytes. Given size: \`${n}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}ne.SizeOverflowError=w;class a extends i.BaseError{constructor({offset:n,position:s,size:c}){super(`Slice ${s==="start"?"starting":"ending"} at offset \`${n}\` is out-of-bounds (size: \`${c}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}ne.SliceOffsetOutOfBoundsError=a;class I extends i.BaseError{constructor({size:n,targetSize:s,type:c}){super(`${c.charAt(0).toUpperCase()}${c.slice(1).toLowerCase()} size (\`${n}\`) exceeds padding size (\`${s}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}return ne.SizeExceedsPaddingSizeError=I,ne}var Xe={},mt={},en;function Oi(){if(en)return mt;en=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.LruMap=void 0;class e extends Map{constructor(h){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=h}get(h){const o=super.get(h);return super.has(h)&&o!==void 0&&(this.delete(h),super.set(h,o)),o}set(h,o){if(super.set(h,o),this.maxSize&&this.size>this.maxSize){const f=this.keys().next().value;f&&this.delete(f)}return this}}return mt.LruMap=e,mt}var tn;function Hi(){if(tn)return Xe;tn=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.checksum=void 0,Xe.clear=h;const e=Oi(),i={checksum:new e.LruMap(8192)};Xe.checksum=i.checksum;function h(){for(const o of Object.values(i))o.clear()}return Xe}var De={},rn;function Cn(){if(rn)return De;rn=1,Object.defineProperty(De,"__esModule",{value:!0}),De.keccak256=g,De.ripemd160=l,De.sha256=B,De.validate=O;const e=Ln(),i=In(),h=Sn(),o=Re(),f=Se();function g(P,L={}){const{as:j=typeof P=="string"?"Hex":"Bytes"}=L,k=(0,i.keccak_256)(o.from(P));return j==="Bytes"?k:f.fromBytes(k)}function l(P,L={}){const{as:j=typeof P=="string"?"Hex":"Bytes"}=L,k=(0,e.ripemd160)(o.from(P));return j==="Bytes"?k:f.fromBytes(k)}function B(P,L={}){const{as:j=typeof P=="string"?"Hex":"Bytes"}=L,k=(0,h.sha256)(o.from(P));return j==="Bytes"?k:f.fromBytes(k)}function O(P){return f.validate(P)&&f.size(P)===32}return De}var me={},nn;function Vn(){if(nn)return me;nn=1,Object.defineProperty(me,"__esModule",{value:!0}),me.InvalidSerializedSizeError=me.InvalidUncompressedPrefixError=me.InvalidCompressedPrefixError=me.InvalidPrefixError=me.InvalidError=void 0,me.assert=f,me.compress=g,me.from=l,me.fromBytes=B,me.fromHex=O,me.toBytes=P,me.toHex=L,me.validate=j;const e=Re(),i=Pe(),h=Se(),o=qt();function f(y,u={}){const{compressed:m}=u,{prefix:t,x:d,y:b}=y;if(m===!1||typeof d=="bigint"&&typeof b=="bigint"){if(t!==4)throw new q({prefix:t,cause:new z});return}if(m===!0||typeof d=="bigint"&&typeof b>"u"){if(t!==3&&t!==2)throw new q({prefix:t,cause:new C});return}throw new k({publicKey:y})}function g(y){const{x:u,y:m}=y;return{prefix:m%2n===0n?2:3,x:u}}function l(y){const u=(()=>{if(h.validate(y))return O(y);if(e.validate(y))return B(y);const{prefix:m,x:t,y:d}=y;return typeof t=="bigint"&&typeof d=="bigint"?{prefix:m??4,x:t,y:d}:{prefix:m,x:t}})();return f(u),u}function B(y){return O(h.fromBytes(y))}function O(y){if(y.length!==132&&y.length!==130&&y.length!==68)throw new N({publicKey:y});if(y.length===130){const t=BigInt(h.slice(y,0,32)),d=BigInt(h.slice(y,32,64));return{prefix:4,x:t,y:d}}if(y.length===132){const t=Number(h.slice(y,0,1)),d=BigInt(h.slice(y,1,33)),b=BigInt(h.slice(y,33,65));return{prefix:t,x:d,y:b}}const u=Number(h.slice(y,0,1)),m=BigInt(h.slice(y,1,33));return{prefix:u,x:m}}function P(y,u={}){return e.fromHex(L(y,u))}function L(y,u={}){f(y);const{prefix:m,x:t,y:d}=y,{includePrefix:b=!0}=u;return h.concat(b?h.fromNumber(m,{size:1}):"0x",h.fromNumber(t,{size:32}),typeof d=="bigint"?h.fromNumber(d,{size:32}):"0x")}function j(y,u={}){try{return f(y,u),!0}catch{return!1}}class k extends i.BaseError{constructor({publicKey:u}){super(`Value \`${o.stringify(u)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}me.InvalidError=k;class q extends i.BaseError{constructor({prefix:u,cause:m}){super(`Prefix "${u}" is invalid.`,{cause:m}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}me.InvalidPrefixError=q;class C extends i.BaseError{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}me.InvalidCompressedPrefixError=C;class z extends i.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}me.InvalidUncompressedPrefixError=z;class N extends i.BaseError{constructor({publicKey:u}){super(`Value \`${u}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${h.size(h.from(u))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}return me.InvalidSerializedSizeError=N,me}var sn;function rr(){if(sn)return xe;sn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.InvalidChecksumError=xe.InvalidInputError=xe.InvalidAddressError=void 0,xe.assert=l,xe.checksum=B,xe.from=O,xe.fromPublicKey=P,xe.isEqual=L,xe.validate=j;const e=Re(),i=Hi(),h=Pe(),o=Cn(),f=Vn(),g=/^0x[a-fA-F0-9]{40}$/;function l(z,N={}){const{strict:y=!0}=N;if(!g.test(z))throw new k({address:z,cause:new q});if(y){if(z.toLowerCase()===z)return;if(B(z)!==z)throw new k({address:z,cause:new C})}}function B(z){if(i.checksum.has(z))return i.checksum.get(z);l(z,{strict:!1});const N=z.substring(2).toLowerCase(),y=o.keccak256(e.fromString(N),{as:"Bytes"}),u=N.split("");for(let t=0;t<40;t+=2)y[t>>1]>>4>=8&&u[t]&&(u[t]=u[t].toUpperCase()),(y[t>>1]&15)>=8&&u[t+1]&&(u[t+1]=u[t+1].toUpperCase());const m=`0x${u.join("")}`;return i.checksum.set(z,m),m}function O(z,N={}){const{checksum:y=!1}=N;return l(z),y?B(z):z}function P(z,N={}){const y=o.keccak256(`0x${f.toHex(z).slice(4)}`).substring(26);return O(`0x${y}`,N)}function L(z,N){return l(z,{strict:!1}),l(N,{strict:!1}),z.toLowerCase()===N.toLowerCase()}function j(z,N={}){const{strict:y=!0}=N??{};try{return l(z,{strict:y}),!0}catch{return!1}}class k extends h.BaseError{constructor({address:N,cause:y}){super(`Address "${N}" is invalid.`,{cause:y}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}xe.InvalidAddressError=k;class q extends h.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}xe.InvalidInputError=q;class C extends h.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}return xe.InvalidChecksumError=C,xe}var le={},R={},on;function nr(){return on||(on=1,Object.defineProperty(R,"__esModule",{value:!0}),R.minInt120=R.minInt112=R.minInt104=R.minInt96=R.minInt88=R.minInt80=R.minInt72=R.minInt64=R.minInt56=R.minInt48=R.minInt40=R.minInt32=R.minInt24=R.minInt16=R.minInt8=R.maxInt256=R.maxInt248=R.maxInt240=R.maxInt232=R.maxInt224=R.maxInt216=R.maxInt208=R.maxInt200=R.maxInt192=R.maxInt184=R.maxInt176=R.maxInt168=R.maxInt160=R.maxInt152=R.maxInt144=R.maxInt136=R.maxInt128=R.maxInt120=R.maxInt112=R.maxInt104=R.maxInt96=R.maxInt88=R.maxInt80=R.maxInt72=R.maxInt64=R.maxInt56=R.maxInt48=R.maxInt40=R.maxInt32=R.maxInt24=R.maxInt16=R.maxInt8=R.integerRegex=R.bytesRegex=R.arrayRegex=void 0,R.maxUint256=R.maxUint248=R.maxUint240=R.maxUint232=R.maxUint224=R.maxUint216=R.maxUint208=R.maxUint200=R.maxUint192=R.maxUint184=R.maxUint176=R.maxUint168=R.maxUint160=R.maxUint152=R.maxUint144=R.maxUint136=R.maxUint128=R.maxUint120=R.maxUint112=R.maxUint104=R.maxUint96=R.maxUint88=R.maxUint80=R.maxUint72=R.maxUint64=R.maxUint56=R.maxUint48=R.maxUint40=R.maxUint32=R.maxUint24=R.maxUint16=R.maxUint8=R.minInt256=R.minInt248=R.minInt240=R.minInt232=R.minInt224=R.minInt216=R.minInt208=R.minInt200=R.minInt192=R.minInt184=R.minInt176=R.minInt168=R.minInt160=R.minInt152=R.minInt144=R.minInt136=R.minInt128=void 0,R.arrayRegex=/^(.*)\[([0-9]*)\]$/,R.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,R.integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,R.maxInt8=2n**(8n-1n)-1n,R.maxInt16=2n**(16n-1n)-1n,R.maxInt24=2n**(24n-1n)-1n,R.maxInt32=2n**(32n-1n)-1n,R.maxInt40=2n**(40n-1n)-1n,R.maxInt48=2n**(48n-1n)-1n,R.maxInt56=2n**(56n-1n)-1n,R.maxInt64=2n**(64n-1n)-1n,R.maxInt72=2n**(72n-1n)-1n,R.maxInt80=2n**(80n-1n)-1n,R.maxInt88=2n**(88n-1n)-1n,R.maxInt96=2n**(96n-1n)-1n,R.maxInt104=2n**(104n-1n)-1n,R.maxInt112=2n**(112n-1n)-1n,R.maxInt120=2n**(120n-1n)-1n,R.maxInt128=2n**(128n-1n)-1n,R.maxInt136=2n**(136n-1n)-1n,R.maxInt144=2n**(144n-1n)-1n,R.maxInt152=2n**(152n-1n)-1n,R.maxInt160=2n**(160n-1n)-1n,R.maxInt168=2n**(168n-1n)-1n,R.maxInt176=2n**(176n-1n)-1n,R.maxInt184=2n**(184n-1n)-1n,R.maxInt192=2n**(192n-1n)-1n,R.maxInt200=2n**(200n-1n)-1n,R.maxInt208=2n**(208n-1n)-1n,R.maxInt216=2n**(216n-1n)-1n,R.maxInt224=2n**(224n-1n)-1n,R.maxInt232=2n**(232n-1n)-1n,R.maxInt240=2n**(240n-1n)-1n,R.maxInt248=2n**(248n-1n)-1n,R.maxInt256=2n**(256n-1n)-1n,R.minInt8=-(2n**(8n-1n)),R.minInt16=-(2n**(16n-1n)),R.minInt24=-(2n**(24n-1n)),R.minInt32=-(2n**(32n-1n)),R.minInt40=-(2n**(40n-1n)),R.minInt48=-(2n**(48n-1n)),R.minInt56=-(2n**(56n-1n)),R.minInt64=-(2n**(64n-1n)),R.minInt72=-(2n**(72n-1n)),R.minInt80=-(2n**(80n-1n)),R.minInt88=-(2n**(88n-1n)),R.minInt96=-(2n**(96n-1n)),R.minInt104=-(2n**(104n-1n)),R.minInt112=-(2n**(112n-1n)),R.minInt120=-(2n**(120n-1n)),R.minInt128=-(2n**(128n-1n)),R.minInt136=-(2n**(136n-1n)),R.minInt144=-(2n**(144n-1n)),R.minInt152=-(2n**(152n-1n)),R.minInt160=-(2n**(160n-1n)),R.minInt168=-(2n**(168n-1n)),R.minInt176=-(2n**(176n-1n)),R.minInt184=-(2n**(184n-1n)),R.minInt192=-(2n**(192n-1n)),R.minInt200=-(2n**(200n-1n)),R.minInt208=-(2n**(208n-1n)),R.minInt216=-(2n**(216n-1n)),R.minInt224=-(2n**(224n-1n)),R.minInt232=-(2n**(232n-1n)),R.minInt240=-(2n**(240n-1n)),R.minInt248=-(2n**(248n-1n)),R.minInt256=-(2n**(256n-1n)),R.maxUint8=2n**8n-1n,R.maxUint16=2n**16n-1n,R.maxUint24=2n**24n-1n,R.maxUint32=2n**32n-1n,R.maxUint40=2n**40n-1n,R.maxUint48=2n**48n-1n,R.maxUint56=2n**56n-1n,R.maxUint64=2n**64n-1n,R.maxUint72=2n**72n-1n,R.maxUint80=2n**80n-1n,R.maxUint88=2n**88n-1n,R.maxUint96=2n**96n-1n,R.maxUint104=2n**104n-1n,R.maxUint112=2n**112n-1n,R.maxUint120=2n**120n-1n,R.maxUint128=2n**128n-1n,R.maxUint136=2n**136n-1n,R.maxUint144=2n**144n-1n,R.maxUint152=2n**152n-1n,R.maxUint160=2n**160n-1n,R.maxUint168=2n**168n-1n,R.maxUint176=2n**176n-1n,R.maxUint184=2n**184n-1n,R.maxUint192=2n**192n-1n,R.maxUint200=2n**200n-1n,R.maxUint208=2n**208n-1n,R.maxUint216=2n**216n-1n,R.maxUint224=2n**224n-1n,R.maxUint232=2n**232n-1n,R.maxUint240=2n**240n-1n,R.maxUint248=2n**248n-1n,R.maxUint256=2n**256n-1n),R}var an;function Ri(){if(an)return le;an=1,Object.defineProperty(le,"__esModule",{value:!0}),le.decodeParameter=l,le.decodeAddress=P,le.decodeArray=L,le.decodeBool=j,le.decodeBytes=k,le.decodeNumber=q,le.decodeTuple=C,le.decodeString=z,le.prepareParameters=N,le.prepareParameter=y,le.encode=u,le.encodeAddress=m,le.encodeArray=t,le.encodeBytes=d,le.encodeBoolean=b,le.encodeNumber=_,le.encodeString=H,le.encodeTuple=E,le.getArrayComponents=x,le.hasDynamicChild=A;const e=ir(),i=rr(),h=Re(),o=Pe(),f=Se(),g=nr();function l(p,v,T){const{checksumAddress:$,staticPosition:w}=T,a=x(v.type);if(a){const[I,r]=a;return L(p,{...v,type:r},{checksumAddress:$,length:I,staticPosition:w})}if(v.type==="tuple")return C(p,v,{checksumAddress:$,staticPosition:w});if(v.type==="address")return P(p,{checksum:$});if(v.type==="bool")return j(p);if(v.type.startsWith("bytes"))return k(p,v,{staticPosition:w});if(v.type.startsWith("uint")||v.type.startsWith("int"))return q(p,v);if(v.type==="string")return z(p,{staticPosition:w});throw new e.InvalidTypeError(v.type)}const B=32,O=32;function P(p,v={}){const{checksum:T=!1}=v,$=p.readBytes(32);return[(a=>T?i.checksum(a):a)(f.fromBytes(h.slice($,-20))),32]}function L(p,v,T){const{checksumAddress:$,length:w,staticPosition:a}=T;if(!w){const n=h.toNumber(p.readBytes(O)),s=a+n,c=s+B;p.setPosition(s);const S=h.toNumber(p.readBytes(B)),M=A(v);let U=0;const V=[];for(let D=0;D<S;++D){p.setPosition(c+(M?D*32:U));const[G,W]=l(p,v,{checksumAddress:$,staticPosition:c});U+=W,V.push(G)}return p.setPosition(a+32),[V,32]}if(A(v)){const n=h.toNumber(p.readBytes(O)),s=a+n,c=[];for(let S=0;S<w;++S){p.setPosition(s+S*32);const[M]=l(p,v,{checksumAddress:$,staticPosition:s});c.push(M)}return p.setPosition(a+32),[c,32]}let I=0;const r=[];for(let n=0;n<w;++n){const[s,c]=l(p,v,{checksumAddress:$,staticPosition:a+I});I+=c,r.push(s)}return[r,I]}function j(p){return[h.toBoolean(p.readBytes(32),{size:32}),32]}function k(p,v,{staticPosition:T}){const[$,w]=v.type.split("bytes");if(!w){const I=h.toNumber(p.readBytes(32));p.setPosition(T+I);const r=h.toNumber(p.readBytes(32));if(r===0)return p.setPosition(T+32),["0x",32];const n=p.readBytes(r);return p.setPosition(T+32),[f.fromBytes(n),32]}return[f.fromBytes(p.readBytes(Number.parseInt(w,10),32)),32]}function q(p,v){const T=v.type.startsWith("int"),$=Number.parseInt(v.type.split("int")[1]||"256",10),w=p.readBytes(32);return[$>48?h.toBigInt(w,{signed:T}):h.toNumber(w,{signed:T}),32]}function C(p,v,T){const{checksumAddress:$,staticPosition:w}=T,a=v.components.length===0||v.components.some(({name:n})=>!n),I=a?[]:{};let r=0;if(A(v)){const n=h.toNumber(p.readBytes(O)),s=w+n;for(let c=0;c<v.components.length;++c){const S=v.components[c];p.setPosition(s+r);const[M,U]=l(p,S,{checksumAddress:$,staticPosition:s});r+=U,I[a?c:S==null?void 0:S.name]=M}return p.setPosition(w+32),[I,32]}for(let n=0;n<v.components.length;++n){const s=v.components[n],[c,S]=l(p,s,{checksumAddress:$,staticPosition:w});I[a?n:s==null?void 0:s.name]=c,r+=S}return[I,r]}function z(p,{staticPosition:v}){const T=h.toNumber(p.readBytes(32)),$=v+T;p.setPosition($);const w=h.toNumber(p.readBytes(32));if(w===0)return p.setPosition(v+32),["",32];const a=p.readBytes(w,32),I=h.toString(h.trimLeft(a));return p.setPosition(v+32),[I,32]}function N({checksumAddress:p,parameters:v,values:T}){const $=[];for(let w=0;w<v.length;w++)$.push(y({checksumAddress:p,parameter:v[w],value:T[w]}));return $}function y({checksumAddress:p=!1,parameter:v,value:T}){const $=v,w=x($.type);if(w){const[a,I]=w;return t(T,{checksumAddress:p,length:a,parameter:{...$,type:I}})}if($.type==="tuple")return E(T,{checksumAddress:p,parameter:$});if($.type==="address")return m(T,{checksum:p});if($.type==="bool")return b(T);if($.type.startsWith("uint")||$.type.startsWith("int")){const a=$.type.startsWith("int"),[,,I="256"]=g.integerRegex.exec($.type)??[];return _(T,{signed:a,size:Number(I)})}if($.type.startsWith("bytes"))return d(T,{type:$.type});if($.type==="string")return H(T);throw new e.InvalidTypeError($.type)}function u(p){let v=0;for(let a=0;a<p.length;a++){const{dynamic:I,encoded:r}=p[a];I?v+=32:v+=f.size(r)}const T=[],$=[];let w=0;for(let a=0;a<p.length;a++){const{dynamic:I,encoded:r}=p[a];I?(T.push(f.fromNumber(v+w,{size:32})),$.push(r),w+=f.size(r)):T.push(r)}return f.concat(...T,...$)}function m(p,v){const{checksum:T=!1}=v;return i.assert(p,{strict:T}),{dynamic:!1,encoded:f.padLeft(p.toLowerCase())}}function t(p,v){const{checksumAddress:T,length:$,parameter:w}=v,a=$===null;if(!Array.isArray(p))throw new e.InvalidArrayError(p);if(!a&&p.length!==$)throw new e.ArrayLengthMismatchError({expectedLength:$,givenLength:p.length,type:`${w.type}[${$}]`});let I=!1;const r=[];for(let n=0;n<p.length;n++){const s=y({checksumAddress:T,parameter:w,value:p[n]});s.dynamic&&(I=!0),r.push(s)}if(a||I){const n=u(r);if(a){const s=f.fromNumber(r.length,{size:32});return{dynamic:!0,encoded:r.length>0?f.concat(s,n):s}}if(I)return{dynamic:!0,encoded:n}}return{dynamic:!1,encoded:f.concat(...r.map(({encoded:n})=>n))}}function d(p,{type:v}){const[,T]=v.split("bytes"),$=f.size(p);if(!T){let w=p;return $%32!==0&&(w=f.padRight(w,Math.ceil((p.length-2)/2/32)*32)),{dynamic:!0,encoded:f.concat(f.padLeft(f.fromNumber($,{size:32})),w)}}if($!==Number.parseInt(T,10))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(T,10),value:p});return{dynamic:!1,encoded:f.padRight(p)}}function b(p){if(typeof p!="boolean")throw new o.BaseError(`Invalid boolean value: "${p}" (type: ${typeof p}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:f.padLeft(f.fromBoolean(p))}}function _(p,{signed:v,size:T}){if(typeof T=="number"){const $=2n**(BigInt(T)-(v?1n:0n))-1n,w=v?-$-1n:0n;if(p>$||p<w)throw new f.IntegerOutOfRangeError({max:$.toString(),min:w.toString(),signed:v,size:T/8,value:p.toString()})}return{dynamic:!1,encoded:f.fromNumber(p,{size:32,signed:v})}}function H(p){const v=f.fromString(p),T=Math.ceil(f.size(v)/32),$=[];for(let w=0;w<T;w++)$.push(f.padRight(f.slice(v,w*32,(w+1)*32)));return{dynamic:!0,encoded:f.concat(f.padRight(f.fromNumber(f.size(v),{size:32})),...$)}}function E(p,v){const{checksumAddress:T,parameter:$}=v;let w=!1;const a=[];for(let I=0;I<$.components.length;I++){const r=$.components[I],n=Array.isArray(p)?I:r.name,s=y({checksumAddress:T,parameter:r,value:p[n]});a.push(s),s.dynamic&&(w=!0)}return{dynamic:w,encoded:w?u(a):f.concat(...a.map(({encoded:I})=>I))}}function x(p){const v=p.match(/^(.*)\[(\d+)?\]$/);return v?[v[2]?Number(v[2]):null,v[1]]:void 0}function A(p){var $;const{type:v}=p;if(v==="string"||v==="bytes"||v.endsWith("[]"))return!0;if(v==="tuple")return($=p.components)==null?void 0:$.some(A);const T=x(p.type);return!!(T&&A({...p,type:T[1]}))}return le}var He={},cn;function Dn(){if(cn)return He;cn=1,Object.defineProperty(He,"__esModule",{value:!0}),He.RecursiveReadLimitExceededError=He.PositionOutOfBoundsError=He.NegativeOffsetError=void 0,He.create=h;const e=Pe(),i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new g({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(l){if(l<0||l>this.bytes.length-1)throw new f({length:this.bytes.length,position:l})},decrementPosition(l){if(l<0)throw new o({offset:l});const B=this.position-l;this.assertPosition(B),this.position=B},getReadCount(l){return this.positionReadCount.get(l||this.position)||0},incrementPosition(l){if(l<0)throw new o({offset:l});const B=this.position+l;this.assertPosition(B),this.position=B},inspectByte(l){const B=l??this.position;return this.assertPosition(B),this.bytes[B]},inspectBytes(l,B){const O=B??this.position;return this.assertPosition(O+l-1),this.bytes.subarray(O,O+l)},inspectUint8(l){const B=l??this.position;return this.assertPosition(B),this.bytes[B]},inspectUint16(l){const B=l??this.position;return this.assertPosition(B+1),this.dataView.getUint16(B)},inspectUint24(l){const B=l??this.position;return this.assertPosition(B+2),(this.dataView.getUint16(B)<<8)+this.dataView.getUint8(B+2)},inspectUint32(l){const B=l??this.position;return this.assertPosition(B+3),this.dataView.getUint32(B)},pushByte(l){this.assertPosition(this.position),this.bytes[this.position]=l,this.position++},pushBytes(l){this.assertPosition(this.position+l.length-1),this.bytes.set(l,this.position),this.position+=l.length},pushUint8(l){this.assertPosition(this.position),this.bytes[this.position]=l,this.position++},pushUint16(l){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,l),this.position+=2},pushUint24(l){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,l>>8),this.dataView.setUint8(this.position+2,l&255),this.position+=3},pushUint32(l){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,l),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const l=this.inspectByte();return this.position++,l},readBytes(l,B){this.assertReadLimit(),this._touch();const O=this.inspectBytes(l);return this.position+=B??l,O},readUint8(){this.assertReadLimit(),this._touch();const l=this.inspectUint8();return this.position+=1,l},readUint16(){this.assertReadLimit(),this._touch();const l=this.inspectUint16();return this.position+=2,l},readUint24(){this.assertReadLimit(),this._touch();const l=this.inspectUint24();return this.position+=3,l},readUint32(){this.assertReadLimit(),this._touch();const l=this.inspectUint32();return this.position+=4,l},get remaining(){return this.bytes.length-this.position},setPosition(l){const B=this.position;return this.assertPosition(l),this.position=l,()=>this.position=B},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const l=this.getReadCount();this.positionReadCount.set(this.position,l+1),l>0&&this.recursiveReadCount++}};function h(l,{recursiveReadLimit:B=8192}={}){const O=Object.create(i);return O.bytes=l,O.dataView=new DataView(l.buffer,l.byteOffset,l.byteLength),O.positionReadCount=new Map,O.recursiveReadLimit=B,O}class o extends e.BaseError{constructor({offset:B}){super(`Offset \`${B}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}He.NegativeOffsetError=o;class f extends e.BaseError{constructor({length:B,position:O}){super(`Position \`${O}\` is out of bounds (\`0 < position < ${B}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}He.PositionOutOfBoundsError=f;class g extends e.BaseError{constructor({count:B,limit:O}){super(`Recursive read limit of \`${O}\` exceeded (recursive read count: \`${B}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}return He.RecursiveReadLimitExceededError=g,He}var un;function ir(){if(un)return de;un=1,Object.defineProperty(de,"__esModule",{value:!0}),de.InvalidTypeError=de.InvalidArrayError=de.LengthMismatchError=de.BytesSizeMismatchError=de.ArrayLengthMismatchError=de.ZeroDataError=de.DataSizeTooSmallError=void 0,de.decode=O,de.encode=P,de.encodePacked=L,de.format=j,de.from=k;const e=ri(),i=rr(),h=Re(),o=Pe(),f=Se(),g=Ri(),l=Dn(),B=nr();function O(t,d,b={}){const{as:_="Array",checksumAddress:H=!1}=b,E=typeof d=="string"?h.fromHex(d):d,x=l.create(E);if(h.size(E)===0&&t.length>0)throw new C;if(h.size(E)&&h.size(E)<32)throw new q({data:typeof d=="string"?d:f.fromBytes(d),parameters:t,size:h.size(E)});let A=0;const p=_==="Array"?[]:{};for(let v=0;v<t.length;++v){const T=t[v];x.setPosition(A);const[$,w]=g.decodeParameter(x,T,{checksumAddress:H,staticPosition:0});A+=w,_==="Array"?p.push($):p[T.name??v]=$}return p}function P(t,d,b){const{checksumAddress:_=!1}=b??{};if(t.length!==d.length)throw new y({expectedLength:t.length,givenLength:d.length});const H=g.prepareParameters({checksumAddress:_,parameters:t,values:d}),E=g.encode(H);return E.length===0?"0x":E}function L(t,d){if(t.length!==d.length)throw new y({expectedLength:t.length,givenLength:d.length});const b=[];for(let _=0;_<t.length;_++){const H=t[_],E=d[_];b.push(L.encode(H,E))}return f.concat(...b)}(function(t){function d(b,_,H=!1){if(b==="address"){const p=_;return i.assert(p),f.padLeft(p.toLowerCase(),H?32:0)}if(b==="string")return f.fromString(_);if(b==="bytes")return _;if(b==="bool")return f.padLeft(f.fromBoolean(_),H?32:1);const E=b.match(B.integerRegex);if(E){const[p,v,T="256"]=E,$=Number.parseInt(T,10)/8;return f.fromNumber(_,{size:H?32:$,signed:v==="int"})}const x=b.match(B.bytesRegex);if(x){const[p,v]=x;if(Number.parseInt(v,10)!==(_.length-2)/2)throw new N({expectedSize:Number.parseInt(v,10),value:_});return f.padRight(_,H?32:0)}const A=b.match(B.arrayRegex);if(A&&Array.isArray(_)){const[p,v]=A,T=[];for(let $=0;$<_.length;$++)T.push(d(v,_[$],!0));return T.length===0?"0x":f.concat(...T)}throw new m(b)}t.encode=d})(L||(de.encodePacked=L={}));function j(t){return e.formatAbiParameters(t)}function k(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?e.parseAbiParameters(t):t}class q extends o.BaseError{constructor({data:d,parameters:b,size:_}){super(`Data size of ${_} bytes is too small for given parameters.`,{metaMessages:[`Params: (${e.formatAbiParameters(b)})`,`Data: ${d} (${_} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}de.DataSizeTooSmallError=q;class C extends o.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}de.ZeroDataError=C;class z extends o.BaseError{constructor({expectedLength:d,givenLength:b,type:_}){super(`Array length mismatch for type \`${_}\`. Expected: \`${d}\`. Given: \`${b}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}de.ArrayLengthMismatchError=z;class N extends o.BaseError{constructor({expectedSize:d,value:b}){super(`Size of bytes "${b}" (bytes${f.size(b)}) does not match expected size (bytes${d}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}de.BytesSizeMismatchError=N;class y extends o.BaseError{constructor({expectedLength:d,givenLength:b}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${d}`,`Given length (values): ${b}`].join(`
|
|
5
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}de.LengthMismatchError=y;class u extends o.BaseError{constructor(d){super(`Value \`${d}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}de.InvalidArrayError=u;class m extends o.BaseError{constructor(d){super(`Type \`${d}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}return de.InvalidTypeError=m,de}var fn;function Ui(){return fn||(fn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidWrappedSignatureError=e.universalSignatureValidatorAbi=e.universalSignatureValidatorBytecode=e.magicBytes=void 0,e.assert=f,e.from=g,e.unwrap=l,e.wrap=B,e.validate=O;const i=ir(),h=Pe(),o=Se();e.magicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",e.universalSignatureValidatorBytecode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",e.universalSignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function f(L){if(o.slice(L,-32)!==e.magicBytes)throw new P(L)}function g(L){return typeof L=="string"?l(L):L}function l(L){f(L);const[j,k,q]=i.decode(i.from("address, bytes, bytes"),L);return{data:k,signature:q,to:j}}function B(L){const{data:j,signature:k,to:q}=L;return o.concat(i.encode(i.from("address, bytes, bytes"),[q,j,k]),e.magicBytes)}function O(L){try{return f(L),!0}catch{return!1}}class P extends h.BaseError{constructor(j){super(`Value \`${j}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=P}(Gt)),Gt}var dn;function Ki(){return dn||(dn=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.SignatureErc6492=void 0,ft.SignatureErc6492=Ui()),ft}var bt={},Xt={},Ee={},Be={},ln;function ji(){if(ln)return Be;ln=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.toBytes=f,Be.toHex=g,Be.to=l,Be.decodeRlpCursor=B,Be.readLength=O,Be.readList=P,Be.from=L,Be.fromBytes=j,Be.fromHex=k;const e=Re(),i=Pe(),h=Se(),o=Dn();function f(y){return l(y,"Bytes")}function g(y){return l(y,"Hex")}function l(y,u){const m=u??(typeof y=="string"?"Hex":"Bytes"),t=(()=>{if(typeof y=="string"){if(y.length>3&&y.length%2!==0)throw new h.InvalidLengthError(y);return e.fromHex(y)}return y})(),d=o.create(t,{recursiveReadLimit:Number.POSITIVE_INFINITY});return B(d,m)}function B(y,u="Hex"){if(y.bytes.length===0)return u==="Hex"?h.fromBytes(y.bytes):y.bytes;const m=y.readByte();if(m<128&&y.decrementPosition(1),m<192){const d=O(y,m,128),b=y.readBytes(d);return u==="Hex"?h.fromBytes(b):b}const t=O(y,m,192);return P(y,t,u)}function O(y,u,m){if(m===128&&u<128)return 1;if(u<=m+55)return u-m;if(u===m+55+1)return y.readUint8();if(u===m+55+2)return y.readUint16();if(u===m+55+3)return y.readUint24();if(u===m+55+4)return y.readUint32();throw new i.BaseError("Invalid RLP prefix")}function P(y,u,m){const t=y.position,d=[];for(;y.position-t<u;)d.push(B(y,m));return d}function L(y,u){const{as:m}=u,t=q(y),d=o.create(new Uint8Array(t.length));return t.encode(d),m==="Hex"?h.fromBytes(d.bytes):d.bytes}function j(y,u={}){const{as:m="Bytes"}=u;return L(y,{as:m})}function k(y,u={}){const{as:m="Hex"}=u;return L(y,{as:m})}function q(y){return Array.isArray(y)?C(y.map(u=>q(u))):z(y)}function C(y){const u=y.reduce((d,b)=>d+b.length,0),m=N(u);return{length:(()=>u<=55?1+u:1+m+u)(),encode(d){u<=55?d.pushByte(192+u):(d.pushByte(192+55+m),m===1?d.pushUint8(u):m===2?d.pushUint16(u):m===3?d.pushUint24(u):d.pushUint32(u));for(const{encode:b}of y)b(d)}}}function z(y){const u=typeof y=="string"?e.fromHex(y):y,m=N(u.length);return{length:(()=>u.length===1&&u[0]<128?1:u.length<=55?1+u.length:1+m+u.length)(),encode(d){u.length===1&&u[0]<128?d.pushBytes(u):u.length<=55?(d.pushByte(128+u.length),d.pushBytes(u)):(d.pushByte(128+55+m),m===1?d.pushUint8(u.length):m===2?d.pushUint16(u.length):m===3?d.pushUint24(u.length):d.pushUint32(u.length),d.pushBytes(u))}}}function N(y){if(y<=255)return 1;if(y<=65535)return 2;if(y<=16777215)return 3;if(y<=4294967295)return 4;throw new i.BaseError("Length is too large.")}return Be}var ie={},hn;function Kn(){if(hn)return ie;hn=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.InvalidVError=ie.InvalidYParityError=ie.InvalidSError=ie.InvalidRError=ie.MissingPropertiesError=ie.InvalidSerializedSizeError=void 0,ie.assert=l,ie.fromBytes=B,ie.fromHex=O,ie.extract=P,ie.from=L,ie.fromDerBytes=j,ie.fromDerHex=k,ie.fromLegacy=q,ie.fromRpc=C,ie.fromTuple=z,ie.toBytes=N,ie.toHex=y,ie.toDerBytes=u,ie.toDerHex=m,ie.toLegacy=t,ie.toRpc=d,ie.toTuple=b,ie.validate=_,ie.vToYParity=H,ie.yParityToV=E;const e=$n(),i=Re(),h=Pe(),o=Se(),f=qt(),g=nr();function l(w,a={}){const{recovered:I}=a;if(typeof w.r>"u")throw new A({signature:w});if(typeof w.s>"u")throw new A({signature:w});if(I&&typeof w.yParity>"u")throw new A({signature:w});if(w.r<0n||w.r>g.maxUint256)throw new p({value:w.r});if(w.s<0n||w.s>g.maxUint256)throw new v({value:w.s});if(typeof w.yParity=="number"&&w.yParity!==0&&w.yParity!==1)throw new T({value:w.yParity})}function B(w){return O(o.fromBytes(w))}function O(w){if(w.length!==130&&w.length!==132)throw new x({signature:w});const a=BigInt(o.slice(w,0,32)),I=BigInt(o.slice(w,32,64)),r=(()=>{const n=+`0x${w.slice(130)}`;if(!Number.isNaN(n))try{return H(n)}catch{throw new T({value:n})}})();return typeof r>"u"?{r:a,s:I}:{r:a,s:I,yParity:r}}function P(w){if(!(typeof w.r>"u")&&!(typeof w.s>"u"))return L(w)}function L(w){const a=(()=>typeof w=="string"?O(w):w instanceof Uint8Array?B(w):typeof w.r=="string"?C(w):w.v?q(w):{r:w.r,s:w.s,...typeof w.yParity<"u"?{yParity:w.yParity}:{}})();return l(a),a}function j(w){return k(o.fromBytes(w))}function k(w){const{r:a,s:I}=e.secp256k1.Signature.fromDER(o.from(w).slice(2));return{r:a,s:I}}function q(w){return{r:w.r,s:w.s,yParity:H(w.v)}}function C(w){const a=(()=>{const I=w.v?Number(w.v):void 0;let r=w.yParity?Number(w.yParity):void 0;if(typeof I=="number"&&typeof r!="number"&&(r=H(I)),typeof r!="number")throw new T({value:w.yParity});return r})();return{r:BigInt(w.r),s:BigInt(w.s),yParity:a}}function z(w){const[a,I,r]=w;return L({r:I==="0x"?0n:BigInt(I),s:r==="0x"?0n:BigInt(r),yParity:a==="0x"?0:Number(a)})}function N(w){return i.fromHex(y(w))}function y(w){l(w);const a=w.r,I=w.s;return o.concat(o.fromNumber(a,{size:32}),o.fromNumber(I,{size:32}),typeof w.yParity=="number"?o.fromNumber(E(w.yParity),{size:1}):"0x")}function u(w){return new e.secp256k1.Signature(w.r,w.s).toDERRawBytes()}function m(w){return`0x${new e.secp256k1.Signature(w.r,w.s).toDERHex()}`}function t(w){return{r:w.r,s:w.s,v:E(w.yParity)}}function d(w){const{r:a,s:I,yParity:r}=w;return{r:o.fromNumber(a,{size:32}),s:o.fromNumber(I,{size:32}),yParity:r===0?"0x0":"0x1"}}function b(w){const{r:a,s:I,yParity:r}=w;return[r?"0x01":"0x",a===0n?"0x":o.trimLeft(o.fromNumber(a)),I===0n?"0x":o.trimLeft(o.fromNumber(I))]}function _(w,a={}){try{return l(w,a),!0}catch{return!1}}function H(w){if(w===0||w===27)return 0;if(w===1||w===28)return 1;if(w>=35)return w%2===0?1:0;throw new $({value:w})}function E(w){if(w===0)return 27;if(w===1)return 28;throw new T({value:w})}class x extends h.BaseError{constructor({signature:a}){super(`Value \`${a}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${o.size(o.from(a))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}ie.InvalidSerializedSizeError=x;class A extends h.BaseError{constructor({signature:a}){super(`Signature \`${f.stringify(a)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}ie.MissingPropertiesError=A;class p extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}ie.InvalidRError=p;class v extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}ie.InvalidSError=v;class T extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}ie.InvalidYParityError=T;class $ extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}return ie.InvalidVError=$,ie}var mn;function Ti(){if(mn)return Ee;mn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.from=f,Ee.fromRpc=g,Ee.fromRpcList=l,Ee.fromTuple=B,Ee.fromTupleList=O,Ee.getSignPayload=P,Ee.hash=L,Ee.toRpc=j,Ee.toRpcList=k,Ee.toTuple=q,Ee.toTupleList=C;const e=Cn(),i=Se(),h=ji(),o=Kn();function f(z,N={}){return typeof z.chainId=="string"?g(z):{...z,...N.signature}}function g(z){const{address:N,chainId:y,nonce:u}=z,m=o.extract(z);return{address:N,chainId:Number(y),nonce:BigInt(u),...m}}function l(z){return z.map(g)}function B(z){const[N,y,u,m,t,d]=z;let b={address:y,chainId:N==="0x"?0:Number(N),nonce:u==="0x"?0n:BigInt(u)};return m&&t&&d&&(b={...b,...o.fromTuple([m,t,d])}),f(b)}function O(z){const N=[];for(const y of z)N.push(B(y));return N}function P(z){return L(z,{presign:!0})}function L(z,N={}){const{presign:y}=N;return e.keccak256(i.concat("0x05",h.fromHex(q(y?{address:z.address,chainId:z.chainId,nonce:z.nonce}:z))))}function j(z){const{address:N,chainId:y,nonce:u,...m}=z;return{address:N,chainId:i.fromNumber(y),nonce:i.fromNumber(u),...o.toRpc(m)}}function k(z){return z.map(j)}function q(z){const{address:N,chainId:y,nonce:u}=z,m=o.extract(z);return[y?i.fromNumber(y):"0x",N,u?i.fromNumber(u):"0x",...m?o.toTuple(m):[]]}function C(z){if(!z||z.length===0)return[];const N=[];for(const y of z)N.push(q(y));return N}return Ee}var Ie={},Ke={},bn;function Li(){if(bn)return Ke;bn=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.extraEntropy=void 0,Ke.setExtraEntropy=e,Ke.extraEntropy=!1;function e(i){Ke.extraEntropy=i}return Ke}var yn;function Mi(){if(yn)return Ie;yn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.noble=void 0,Ie.createKeyPair=l,Ie.getPublicKey=B,Ie.getSharedSecret=O,Ie.randomPrivateKey=P,Ie.recoverAddress=L,Ie.recoverPublicKey=j,Ie.sign=k,Ie.verify=q;const e=$n(),i=rr(),h=Re(),o=Se(),f=Li(),g=Vn();Ie.noble=e.secp256k1;function l(C={}){const{as:z="Hex"}=C,N=P({as:z}),y=B({privateKey:N});return{privateKey:N,publicKey:y}}function B(C){const{privateKey:z}=C,N=e.secp256k1.ProjectivePoint.fromPrivateKey(o.from(z).slice(2));return g.from(N)}function O(C){const{as:z="Hex",privateKey:N,publicKey:y}=C,t=e.secp256k1.ProjectivePoint.fromHex(g.toHex(y).slice(2)).multiply(e.secp256k1.utils.normPrivateKeyToScalar(o.from(N).slice(2))).toRawBytes(!0);return z==="Hex"?o.fromBytes(t):t}function P(C={}){const{as:z="Hex"}=C,N=e.secp256k1.utils.randomPrivateKey();return z==="Hex"?o.fromBytes(N):N}function L(C){return i.fromPublicKey(j(C))}function j(C){const{payload:z,signature:N}=C,{r:y,s:u,yParity:m}=N,d=new e.secp256k1.Signature(BigInt(y),BigInt(u)).addRecoveryBit(m).recoverPublicKey(o.from(z).substring(2));return g.from(d)}function k(C){const{extraEntropy:z=f.extraEntropy,hash:N,payload:y,privateKey:u}=C,{r:m,s:t,recovery:d}=e.secp256k1.sign(h.from(y),h.from(u),{extraEntropy:typeof z=="boolean"?z:o.from(z).slice(2),lowS:!0,...N?{prehash:!0}:{}});return{r:m,s:t,yParity:d}}function q(C){const{address:z,hash:N,payload:y,publicKey:u,signature:m}=C;return z?i.isEqual(z,L({payload:y,signature:m})):e.secp256k1.verify(m,h.from(y),g.toBytes(u),...N?[{prehash:!0,lowS:!0}]:[])}return Ie}var pn;function zi(){return pn||(pn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidWrappedSignatureError=e.suffixParameters=e.magicBytes=void 0,e.assert=B,e.from=O,e.unwrap=P,e.wrap=L,e.validate=j;const i=ir(),h=Ti(),o=Pe(),f=Se(),g=Mi(),l=Kn();e.magicBytes="0x8010801080108010801080108010801080108010801080108010801080108010",e.suffixParameters=i.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function B(q){if(typeof q=="string"){if(f.slice(q,-32)!==e.magicBytes)throw new k(q)}else l.assert(q.authorization)}function O(q){return typeof q=="string"?P(q):q}function P(q){B(q);const C=f.toNumber(f.slice(q,-64,-32)),z=f.slice(q,-C-64,-64),N=f.slice(q,0,-C-64),[y,u,m]=i.decode(e.suffixParameters,z);return{authorization:h.from({address:y.delegation,chainId:Number(y.chainId),nonce:y.nonce,yParity:y.yParity,r:y.r,s:y.s}),signature:N,...m&&m!=="0x"?{data:m,to:u}:{}}}function L(q){const{data:C,signature:z}=q;B(q);const N=g.recoverAddress({payload:h.getSignPayload(q.authorization),signature:l.from(q.authorization)}),y=i.encode(e.suffixParameters,[{...q.authorization,delegation:q.authorization.address,chainId:BigInt(q.authorization.chainId)},q.to??N,C??"0x"]),u=f.fromNumber(f.size(y),{size:32});return f.concat(z,y,u,e.magicBytes)}function j(q){try{return B(q),!0}catch{return!1}}class k extends o.BaseError{constructor(C){super(`Value \`${C}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=k}(Xt)),Xt}var gn;function Zi(){return gn||(gn=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.SignatureErc8010=void 0,bt.SignatureErc8010=zi()),bt}var yt={},pt={},xn;function $i(){if(xn)return pt;xn=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.fromRpc=i,pt.toRpc=h;const e=Se();function i(o){return{...o,amount:BigInt(o.amount),index:Number(o.index),validatorIndex:Number(o.validatorIndex)}}function h(o){return{address:o.address,amount:e.fromNumber(o.amount),index:e.fromNumber(o.index),validatorIndex:e.fromNumber(o.validatorIndex)}}return pt}var wn;function Wi(){if(wn)return yt;wn=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.fromRpc=h,yt.toRpc=o;const e=Se(),i=$i();function h(f){return{...f.baseFeePerGas&&{baseFeePerGas:BigInt(f.baseFeePerGas)},...f.blobBaseFee&&{blobBaseFee:BigInt(f.blobBaseFee)},...f.feeRecipient&&{feeRecipient:f.feeRecipient},...f.gasLimit&&{gasLimit:BigInt(f.gasLimit)},...f.number&&{number:BigInt(f.number)},...f.prevRandao&&{prevRandao:BigInt(f.prevRandao)},...f.time&&{time:BigInt(f.time)},...f.withdrawals&&{withdrawals:f.withdrawals.map(i.fromRpc)}}}function o(f){return{...typeof f.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(f.baseFeePerGas)},...typeof f.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(f.blobBaseFee)},...typeof f.feeRecipient=="string"&&{feeRecipient:f.feeRecipient},...typeof f.gasLimit=="bigint"&&{gasLimit:e.fromNumber(f.gasLimit)},...typeof f.number=="bigint"&&{number:e.fromNumber(f.number)},...typeof f.prevRandao=="bigint"&&{prevRandao:e.fromNumber(f.prevRandao)},...typeof f.time=="bigint"&&{time:e.fromNumber(f.time)},...f.withdrawals&&{withdrawals:f.withdrawals.map(i.toRpc)}}}return yt}export{Tn as A,jn as B,li as C,ui as D,zt as E,pi as F,Lt as G,Hn as H,tr as I,vi as J,Vi as a,ri as b,$n as c,Sn as d,Wi as e,Ln as f,Zi as g,Di as h,rr as i,Pe as j,Cn as k,Se as l,ir as m,Ki as n,ki as o,yi as p,ai as q,In as r,Ni as s,Un as t,Ci as u,oi as v,si as w,xi as x,hi as y,ni as z};
|
|
1
|
+
import{a as Cn}from"./index-02cebb5e.js";var Ae={},ce={},ye={},Ct={},it={},ir;function Vn(){return ir||(ir=1,Object.defineProperty(it,"__esModule",{value:!0}),it.crypto=void 0,it.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),it}var sr;function qe(){return sr||(sr=1,function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=h,e.anumber=o,e.abytes=f,e.ahash=g,e.aexists=l,e.aoutput=B,e.u8=O,e.u32=P,e.clean=L,e.createView=j,e.rotr=k,e.rotl=q,e.byteSwap=C,e.byteSwap32=z,e.bytesToHex=u,e.hexToBytes=d,e.asyncLoop=_,e.utf8ToBytes=H,e.bytesToUtf8=E,e.toBytes=x,e.kdfInputToBytes=A,e.concatBytes=p,e.checkOpts=v,e.createHasher=$,e.createOptHasher=w,e.createXOFer=a,e.randomBytes=I;const i=Vn();function h(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function o(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function f(r,...n){if(!h(r))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(r.length))throw new Error("Uint8Array expected of length "+n+", got length="+r.length)}function g(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");o(r.outputLen),o(r.blockLen)}function l(r,n=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(n&&r.finished)throw new Error("Hash#digest() has already been called")}function B(r,n){f(r);const s=n.outputLen;if(r.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function O(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function P(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function L(...r){for(let n=0;n<r.length;n++)r[n].fill(0)}function j(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function k(r,n){return r<<32-n|r>>>n}function q(r,n){return r<<n|r>>>32-n>>>0}e.isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function C(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}e.swap8IfBE=e.isLE?r=>r:r=>C(r),e.byteSwapIfBE=e.swap8IfBE;function z(r){for(let n=0;n<r.length;n++)r[n]=C(r[n]);return r}e.swap32IfBE=e.isLE?r=>r:z;const N=(()=>typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function")(),y=Array.from({length:256},(r,n)=>n.toString(16).padStart(2,"0"));function u(r){if(f(r),N)return r.toHex();let n="";for(let s=0;s<r.length;s++)n+=y[r[s]];return n}const m={_0:48,_9:57,A:65,F:70,a:97,f:102};function t(r){if(r>=m._0&&r<=m._9)return r-m._0;if(r>=m.A&&r<=m.F)return r-(m.A-10);if(r>=m.a&&r<=m.f)return r-(m.a-10)}function d(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);if(N)return Uint8Array.fromHex(r);const n=r.length,s=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const c=new Uint8Array(s);for(let S=0,M=0;S<s;S++,M+=2){const U=t(r.charCodeAt(M)),V=t(r.charCodeAt(M+1));if(U===void 0||V===void 0){const D=r[M]+r[M+1];throw new Error('hex string expected, got non-hex character "'+D+'" at index '+M)}c[S]=U*16+V}return c}const b=async()=>{};e.nextTick=b;async function _(r,n,s){let c=Date.now();for(let S=0;S<r;S++){s(S);const M=Date.now()-c;M>=0&&M<n||(await(0,e.nextTick)(),c+=M)}}function H(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}function E(r){return new TextDecoder().decode(r)}function x(r){return typeof r=="string"&&(r=H(r)),f(r),r}function A(r){return typeof r=="string"&&(r=H(r)),f(r),r}function p(...r){let n=0;for(let c=0;c<r.length;c++){const S=r[c];f(S),n+=S.length}const s=new Uint8Array(n);for(let c=0,S=0;c<r.length;c++){const M=r[c];s.set(M,S),S+=M.length}return s}function v(r,n){if(n!==void 0&&{}.toString.call(n)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(r,n)}class T{}e.Hash=T;function $(r){const n=c=>r().update(x(c)).digest(),s=r();return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=()=>r(),n}function w(r){const n=(c,S)=>r(S).update(x(c)).digest(),s=r({});return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=c=>r(c),n}function a(r){const n=(c,S)=>r(S).update(x(c)).digest(),s=r({});return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=c=>r(c),n}e.wrapConstructor=$,e.wrapConstructorWithOpts=w,e.wrapXOFConstructorWithOpts=a;function I(r=32){if(i.crypto&&typeof i.crypto.getRandomValues=="function")return i.crypto.getRandomValues(new Uint8Array(r));if(i.crypto&&typeof i.crypto.randomBytes=="function")return Uint8Array.from(i.crypto.randomBytes(r));throw new Error("crypto.getRandomValues must be defined")}}(Ct)),Ct}var or;function wn(){if(or)return ye;or=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.SHA512_IV=ye.SHA384_IV=ye.SHA224_IV=ye.SHA256_IV=ye.HashMD=void 0,ye.setBigUint64=i,ye.Chi=h,ye.Maj=o;const e=qe();function i(g,l,B,O){if(typeof g.setBigUint64=="function")return g.setBigUint64(l,B,O);const P=BigInt(32),L=BigInt(4294967295),j=Number(B>>P&L),k=Number(B&L),q=O?4:0,C=O?0:4;g.setUint32(l+q,j,O),g.setUint32(l+C,k,O)}function h(g,l,B){return g&l^~g&B}function o(g,l,B){return g&l^g&B^l&B}class f extends e.Hash{constructor(l,B,O,P){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=l,this.outputLen=B,this.padOffset=O,this.isLE=P,this.buffer=new Uint8Array(l),this.view=(0,e.createView)(this.buffer)}update(l){(0,e.aexists)(this),l=(0,e.toBytes)(l),(0,e.abytes)(l);const{view:B,buffer:O,blockLen:P}=this,L=l.length;for(let j=0;j<L;){const k=Math.min(P-this.pos,L-j);if(k===P){const q=(0,e.createView)(l);for(;P<=L-j;j+=P)this.process(q,j);continue}O.set(l.subarray(j,j+k),this.pos),this.pos+=k,j+=k,this.pos===P&&(this.process(B,0),this.pos=0)}return this.length+=l.length,this.roundClean(),this}digestInto(l){(0,e.aexists)(this),(0,e.aoutput)(l,this),this.finished=!0;const{buffer:B,view:O,blockLen:P,isLE:L}=this;let{pos:j}=this;B[j++]=128,(0,e.clean)(this.buffer.subarray(j)),this.padOffset>P-j&&(this.process(O,0),j=0);for(let N=j;N<P;N++)B[N]=0;i(O,P-8,BigInt(this.length*8),L),this.process(O,0);const k=(0,e.createView)(l),q=this.outputLen;if(q%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const C=q/4,z=this.get();if(C>z.length)throw new Error("_sha2: outputLen bigger than state");for(let N=0;N<C;N++)k.setUint32(4*N,z[N],L)}digest(){const{buffer:l,outputLen:B}=this;this.digestInto(l);const O=l.slice(0,B);return this.destroy(),O}_cloneInto(l){l||(l=new this.constructor),l.set(...this.get());const{blockLen:B,buffer:O,length:P,finished:L,destroyed:j,pos:k}=this;return l.destroyed=j,l.finished=L,l.length=P,l.pos=k,P%B&&l.buffer.set(O),l}clone(){return this._cloneInto()}}return ye.HashMD=f,ye.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ye.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),ye.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ye.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ye}var J={},ar;function vn(){if(ar)return J;ar=1,Object.defineProperty(J,"__esModule",{value:!0}),J.toBig=J.shrSL=J.shrSH=J.rotrSL=J.rotrSH=J.rotrBL=J.rotrBH=J.rotr32L=J.rotr32H=J.rotlSL=J.rotlSH=J.rotlBL=J.rotlBH=J.add5L=J.add5H=J.add4L=J.add4H=J.add3L=J.add3H=void 0,J.add=y,J.fromBig=h,J.split=o;const e=BigInt(2**32-1),i=BigInt(32);function h(E,x=!1){return x?{h:Number(E&e),l:Number(E>>i&e)}:{h:Number(E>>i&e)|0,l:Number(E&e)|0}}function o(E,x=!1){const A=E.length;let p=new Uint32Array(A),v=new Uint32Array(A);for(let T=0;T<A;T++){const{h:$,l:w}=h(E[T],x);[p[T],v[T]]=[$,w]}return[p,v]}const f=(E,x)=>BigInt(E>>>0)<<i|BigInt(x>>>0);J.toBig=f;const g=(E,x,A)=>E>>>A;J.shrSH=g;const l=(E,x,A)=>E<<32-A|x>>>A;J.shrSL=l;const B=(E,x,A)=>E>>>A|x<<32-A;J.rotrSH=B;const O=(E,x,A)=>E<<32-A|x>>>A;J.rotrSL=O;const P=(E,x,A)=>E<<64-A|x>>>A-32;J.rotrBH=P;const L=(E,x,A)=>E>>>A-32|x<<64-A;J.rotrBL=L;const j=(E,x)=>x;J.rotr32H=j;const k=(E,x)=>E;J.rotr32L=k;const q=(E,x,A)=>E<<A|x>>>32-A;J.rotlSH=q;const C=(E,x,A)=>x<<A|E>>>32-A;J.rotlSL=C;const z=(E,x,A)=>x<<A-32|E>>>64-A;J.rotlBH=z;const N=(E,x,A)=>E<<A-32|x>>>64-A;J.rotlBL=N;function y(E,x,A,p){const v=(x>>>0)+(p>>>0);return{h:E+A+(v/2**32|0)|0,l:v|0}}const u=(E,x,A)=>(E>>>0)+(x>>>0)+(A>>>0);J.add3L=u;const m=(E,x,A,p)=>x+A+p+(E/2**32|0)|0;J.add3H=m;const t=(E,x,A,p)=>(E>>>0)+(x>>>0)+(A>>>0)+(p>>>0);J.add4L=t;const d=(E,x,A,p,v)=>x+A+p+v+(E/2**32|0)|0;J.add4H=d;const b=(E,x,A,p,v)=>(E>>>0)+(x>>>0)+(A>>>0)+(p>>>0)+(v>>>0);J.add5L=b;const _=(E,x,A,p,v,T)=>x+A+p+v+T+(E/2**32|0)|0;J.add5H=_;const H={fromBig:h,split:o,toBig:f,shrSH:g,shrSL:l,rotrSH:B,rotrSL:O,rotrBH:P,rotrBL:L,rotr32H:j,rotr32L:k,rotlSH:q,rotlSL:C,rotlBH:z,rotlBL:N,add:y,add3L:u,add3H:m,add4L:t,add4H:d,add5H:_,add5L:b};return J.default=H,J}var cr;function En(){if(cr)return ce;cr=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.sha512_224=ce.sha512_256=ce.sha384=ce.sha512=ce.sha224=ce.sha256=ce.SHA512_256=ce.SHA512_224=ce.SHA384=ce.SHA512=ce.SHA224=ce.SHA256=void 0;const e=wn(),i=vn(),h=qe(),o=Uint32Array.from([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]),f=new Uint32Array(64);class g extends e.HashMD{constructor(m=32){super(64,m,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:m,B:t,C:d,D:b,E:_,F:H,G:E,H:x}=this;return[m,t,d,b,_,H,E,x]}set(m,t,d,b,_,H,E,x){this.A=m|0,this.B=t|0,this.C=d|0,this.D=b|0,this.E=_|0,this.F=H|0,this.G=E|0,this.H=x|0}process(m,t){for(let v=0;v<16;v++,t+=4)f[v]=m.getUint32(t,!1);for(let v=16;v<64;v++){const T=f[v-15],$=f[v-2],w=(0,h.rotr)(T,7)^(0,h.rotr)(T,18)^T>>>3,a=(0,h.rotr)($,17)^(0,h.rotr)($,19)^$>>>10;f[v]=a+f[v-7]+w+f[v-16]|0}let{A:d,B:b,C:_,D:H,E,F:x,G:A,H:p}=this;for(let v=0;v<64;v++){const T=(0,h.rotr)(E,6)^(0,h.rotr)(E,11)^(0,h.rotr)(E,25),$=p+T+(0,e.Chi)(E,x,A)+o[v]+f[v]|0,a=((0,h.rotr)(d,2)^(0,h.rotr)(d,13)^(0,h.rotr)(d,22))+(0,e.Maj)(d,b,_)|0;p=A,A=x,x=E,E=H+$|0,H=_,_=b,b=d,d=$+a|0}d=d+this.A|0,b=b+this.B|0,_=_+this.C|0,H=H+this.D|0,E=E+this.E|0,x=x+this.F|0,A=A+this.G|0,p=p+this.H|0,this.set(d,b,_,H,E,x,A,p)}roundClean(){(0,h.clean)(f)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,h.clean)(this.buffer)}}ce.SHA256=g;class l extends g{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}ce.SHA224=l;const B=(()=>i.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(u=>BigInt(u))))(),O=(()=>B[0])(),P=(()=>B[1])(),L=new Uint32Array(80),j=new Uint32Array(80);class k extends e.HashMD{constructor(m=64){super(128,m,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:m,Al:t,Bh:d,Bl:b,Ch:_,Cl:H,Dh:E,Dl:x,Eh:A,El:p,Fh:v,Fl:T,Gh:$,Gl:w,Hh:a,Hl:I}=this;return[m,t,d,b,_,H,E,x,A,p,v,T,$,w,a,I]}set(m,t,d,b,_,H,E,x,A,p,v,T,$,w,a,I){this.Ah=m|0,this.Al=t|0,this.Bh=d|0,this.Bl=b|0,this.Ch=_|0,this.Cl=H|0,this.Dh=E|0,this.Dl=x|0,this.Eh=A|0,this.El=p|0,this.Fh=v|0,this.Fl=T|0,this.Gh=$|0,this.Gl=w|0,this.Hh=a|0,this.Hl=I|0}process(m,t){for(let s=0;s<16;s++,t+=4)L[s]=m.getUint32(t),j[s]=m.getUint32(t+=4);for(let s=16;s<80;s++){const c=L[s-15]|0,S=j[s-15]|0,M=i.rotrSH(c,S,1)^i.rotrSH(c,S,8)^i.shrSH(c,S,7),U=i.rotrSL(c,S,1)^i.rotrSL(c,S,8)^i.shrSL(c,S,7),V=L[s-2]|0,D=j[s-2]|0,G=i.rotrSH(V,D,19)^i.rotrBH(V,D,61)^i.shrSH(V,D,6),W=i.rotrSL(V,D,19)^i.rotrBL(V,D,61)^i.shrSL(V,D,6),Y=i.add4L(U,W,j[s-7],j[s-16]),F=i.add4H(Y,M,G,L[s-7],L[s-16]);L[s]=F|0,j[s]=Y|0}let{Ah:d,Al:b,Bh:_,Bl:H,Ch:E,Cl:x,Dh:A,Dl:p,Eh:v,El:T,Fh:$,Fl:w,Gh:a,Gl:I,Hh:r,Hl:n}=this;for(let s=0;s<80;s++){const c=i.rotrSH(v,T,14)^i.rotrSH(v,T,18)^i.rotrBH(v,T,41),S=i.rotrSL(v,T,14)^i.rotrSL(v,T,18)^i.rotrBL(v,T,41),M=v&$^~v&a,U=T&w^~T&I,V=i.add5L(n,S,U,P[s],j[s]),D=i.add5H(V,r,c,M,O[s],L[s]),G=V|0,W=i.rotrSH(d,b,28)^i.rotrBH(d,b,34)^i.rotrBH(d,b,39),Y=i.rotrSL(d,b,28)^i.rotrBL(d,b,34)^i.rotrBL(d,b,39),F=d&_^d&E^_&E,se=b&H^b&x^H&x;r=a|0,n=I|0,a=$|0,I=w|0,$=v|0,w=T|0,{h:v,l:T}=i.add(A|0,p|0,D|0,G|0),A=E|0,p=x|0,E=_|0,x=H|0,_=d|0,H=b|0;const K=i.add3L(G,Y,se);d=i.add3H(K,D,W,F),b=K|0}({h:d,l:b}=i.add(this.Ah|0,this.Al|0,d|0,b|0)),{h:_,l:H}=i.add(this.Bh|0,this.Bl|0,_|0,H|0),{h:E,l:x}=i.add(this.Ch|0,this.Cl|0,E|0,x|0),{h:A,l:p}=i.add(this.Dh|0,this.Dl|0,A|0,p|0),{h:v,l:T}=i.add(this.Eh|0,this.El|0,v|0,T|0),{h:$,l:w}=i.add(this.Fh|0,this.Fl|0,$|0,w|0),{h:a,l:I}=i.add(this.Gh|0,this.Gl|0,a|0,I|0),{h:r,l:n}=i.add(this.Hh|0,this.Hl|0,r|0,n|0),this.set(d,b,_,H,E,x,A,p,v,T,$,w,a,I,r,n)}roundClean(){(0,h.clean)(L,j)}destroy(){(0,h.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}ce.SHA512=k;class q extends k{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}ce.SHA384=q;const C=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),z=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class N extends k{constructor(){super(28),this.Ah=C[0]|0,this.Al=C[1]|0,this.Bh=C[2]|0,this.Bl=C[3]|0,this.Ch=C[4]|0,this.Cl=C[5]|0,this.Dh=C[6]|0,this.Dl=C[7]|0,this.Eh=C[8]|0,this.El=C[9]|0,this.Fh=C[10]|0,this.Fl=C[11]|0,this.Gh=C[12]|0,this.Gl=C[13]|0,this.Hh=C[14]|0,this.Hl=C[15]|0}}ce.SHA512_224=N;class y extends k{constructor(){super(32),this.Ah=z[0]|0,this.Al=z[1]|0,this.Bh=z[2]|0,this.Bl=z[3]|0,this.Ch=z[4]|0,this.Cl=z[5]|0,this.Dh=z[6]|0,this.Dl=z[7]|0,this.Eh=z[8]|0,this.El=z[9]|0,this.Fh=z[10]|0,this.Fl=z[11]|0,this.Gh=z[12]|0,this.Gl=z[13]|0,this.Hh=z[14]|0,this.Hl=z[15]|0}}return ce.SHA512_256=y,ce.sha256=(0,h.createHasher)(()=>new g),ce.sha224=(0,h.createHasher)(()=>new l),ce.sha512=(0,h.createHasher)(()=>new k),ce.sha384=(0,h.createHasher)(()=>new q),ce.sha512_256=(0,h.createHasher)(()=>new y),ce.sha512_224=(0,h.createHasher)(()=>new N),ce}var ur;function Dn(){if(ur)return Ae;ur=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.sha224=Ae.SHA224=Ae.sha256=Ae.SHA256=void 0;const e=En();return Ae.SHA256=e.SHA256,Ae.sha256=e.sha256,Ae.SHA224=e.SHA224,Ae.sha224=e.sha224,Ae}var ue={},fr;function Kn(){if(fr)return ue;fr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.shake256=ue.shake128=ue.keccak_512=ue.keccak_384=ue.keccak_256=ue.keccak_224=ue.sha3_512=ue.sha3_384=ue.sha3_256=ue.sha3_224=ue.Keccak=void 0,ue.keccakP=N;const e=vn(),i=qe(),h=BigInt(0),o=BigInt(1),f=BigInt(2),g=BigInt(7),l=BigInt(256),B=BigInt(113),O=[],P=[],L=[];for(let t=0,d=o,b=1,_=0;t<24;t++){[b,_]=[_,(2*b+3*_)%5],O.push(2*(5*_+b)),P.push((t+1)*(t+2)/2%64);let H=h;for(let E=0;E<7;E++)d=(d<<o^(d>>g)*B)%l,d&f&&(H^=o<<(o<<BigInt(E))-o);L.push(H)}const j=(0,e.split)(L,!0),k=j[0],q=j[1],C=(t,d,b)=>b>32?(0,e.rotlBH)(t,d,b):(0,e.rotlSH)(t,d,b),z=(t,d,b)=>b>32?(0,e.rotlBL)(t,d,b):(0,e.rotlSL)(t,d,b);function N(t,d=24){const b=new Uint32Array(10);for(let _=24-d;_<24;_++){for(let x=0;x<10;x++)b[x]=t[x]^t[x+10]^t[x+20]^t[x+30]^t[x+40];for(let x=0;x<10;x+=2){const A=(x+8)%10,p=(x+2)%10,v=b[p],T=b[p+1],$=C(v,T,1)^b[A],w=z(v,T,1)^b[A+1];for(let a=0;a<50;a+=10)t[x+a]^=$,t[x+a+1]^=w}let H=t[2],E=t[3];for(let x=0;x<24;x++){const A=P[x],p=C(H,E,A),v=z(H,E,A),T=O[x];H=t[T],E=t[T+1],t[T]=p,t[T+1]=v}for(let x=0;x<50;x+=10){for(let A=0;A<10;A++)b[A]=t[x+A];for(let A=0;A<10;A++)t[x+A]^=~b[(A+2)%10]&b[(A+4)%10]}t[0]^=k[_],t[1]^=q[_]}(0,i.clean)(b)}class y extends i.Hash{constructor(d,b,_,H=!1,E=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=d,this.suffix=b,this.outputLen=_,this.enableXOF=H,this.rounds=E,(0,i.anumber)(_),!(0<d&&d<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.swap32IfBE)(this.state32),N(this.state32,this.rounds),(0,i.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(d){(0,i.aexists)(this),d=(0,i.toBytes)(d),(0,i.abytes)(d);const{blockLen:b,state:_}=this,H=d.length;for(let E=0;E<H;){const x=Math.min(b-this.pos,H-E);for(let A=0;A<x;A++)_[this.pos++]^=d[E++];this.pos===b&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:d,suffix:b,pos:_,blockLen:H}=this;d[_]^=b,b&128&&_===H-1&&this.keccak(),d[H-1]^=128,this.keccak()}writeInto(d){(0,i.aexists)(this,!1),(0,i.abytes)(d),this.finish();const b=this.state,{blockLen:_}=this;for(let H=0,E=d.length;H<E;){this.posOut>=_&&this.keccak();const x=Math.min(_-this.posOut,E-H);d.set(b.subarray(this.posOut,this.posOut+x),H),this.posOut+=x,H+=x}return d}xofInto(d){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(d)}xof(d){return(0,i.anumber)(d),this.xofInto(new Uint8Array(d))}digestInto(d){if((0,i.aoutput)(d,this),this.finished)throw new Error("digest() was already called");return this.writeInto(d),this.destroy(),d}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.clean)(this.state)}_cloneInto(d){const{blockLen:b,suffix:_,outputLen:H,rounds:E,enableXOF:x}=this;return d||(d=new y(b,_,H,x,E)),d.state32.set(this.state32),d.pos=this.pos,d.posOut=this.posOut,d.finished=this.finished,d.rounds=E,d.suffix=_,d.outputLen=H,d.enableXOF=x,d.destroyed=this.destroyed,d}}ue.Keccak=y;const u=(t,d,b)=>(0,i.createHasher)(()=>new y(d,t,b));ue.sha3_224=(()=>u(6,144,224/8))(),ue.sha3_256=(()=>u(6,136,256/8))(),ue.sha3_384=(()=>u(6,104,384/8))(),ue.sha3_512=(()=>u(6,72,512/8))(),ue.keccak_224=(()=>u(1,144,224/8))(),ue.keccak_256=(()=>u(1,136,256/8))(),ue.keccak_384=(()=>u(1,104,384/8))(),ue.keccak_512=(()=>u(1,72,512/8))();const m=(t,d,b)=>(0,i.createXOFer)((_={})=>new y(d,t,_.dkLen===void 0?b:_.dkLen,!0));return ue.shake128=(()=>m(31,168,128/8))(),ue.shake256=(()=>m(31,136,256/8))(),ue}var Vt={},st={},ot={},dr;function Zn(){return dr||(dr=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.version=void 0,ot.version="1.2.3"),ot}var lr;function Qe(){if(lr)return st;lr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.BaseError=void 0;const e=Zn();class i extends Error{constructor(o,f={}){var O;const g=f.cause instanceof i?f.cause.details:(O=f.cause)!=null&&O.message?f.cause.message:f.details,l=f.cause instanceof i&&f.cause.docsPath||f.docsPath,B=[o||"An error occurred.","",...f.metaMessages?[...f.metaMessages,""]:[],...l?[`Docs: https://abitype.dev${l}`]:[],...g?[`Details: ${g}`]:[],`Version: abitype@${e.version}`].join(`
|
|
2
|
+
`);super(B),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),f.cause&&(this.cause=f.cause),this.details=g,this.docsPath=l,this.metaMessages=f.metaMessages,this.shortMessage=o}}return st.BaseError=i,st}var vt={},hr;function Wn(){if(hr)return vt;hr=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.narrow=e;function e(i){return i}return vt}var Et={},St={},It={},Bt={},Oe={},mr;function Rt(){if(mr)return Oe;mr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.isTupleRegex=Oe.integerRegex=Oe.bytesRegex=void 0,Oe.execTyped=e;function e(i,h){const o=i.exec(h);return o==null?void 0:o.groups}return Oe.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Oe.integerRegex=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Oe.isTupleRegex=/^\(.+?\).*?$/,Oe}var br;function Sn(){if(br)return Bt;br=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.formatAbiParameter=h;const e=Rt(),i=/^tuple(?<array>(\[(\d*)\])*)$/;function h(o){let f=o.type;if(i.test(o.type)&&"components"in o){f="(";const g=o.components.length;for(let B=0;B<g;B++){const O=o.components[B];f+=h(O),B<g-1&&(f+=", ")}const l=(0,e.execTyped)(i,o.type);return f+=`)${(l==null?void 0:l.array)||""}`,h({...o,type:f})}return"indexed"in o&&o.indexed&&(f=`${f} indexed`),o.name?`${f} ${o.name}`:f}return Bt}var yr;function In(){if(yr)return It;yr=1,Object.defineProperty(It,"__esModule",{value:!0}),It.formatAbiParameters=i;const e=Sn();function i(h){let o="";const f=h.length;for(let g=0;g<f;g++){const l=h[g];o+=(0,e.formatAbiParameter)(l),g!==f-1&&(o+=", ")}return o}return It}var pr;function Bn(){if(pr)return St;pr=1,Object.defineProperty(St,"__esModule",{value:!0}),St.formatAbiItem=i;const e=In();function i(h){var o;return h.type==="function"?`function ${h.name}(${(0,e.formatAbiParameters)(h.inputs)})${h.stateMutability&&h.stateMutability!=="nonpayable"?` ${h.stateMutability}`:""}${(o=h.outputs)!=null&&o.length?` returns (${(0,e.formatAbiParameters)(h.outputs)})`:""}`:h.type==="event"?`event ${h.name}(${(0,e.formatAbiParameters)(h.inputs)})`:h.type==="error"?`error ${h.name}(${(0,e.formatAbiParameters)(h.inputs)})`:h.type==="constructor"?`constructor(${(0,e.formatAbiParameters)(h.inputs)})${h.stateMutability==="payable"?" payable":""}`:h.type==="fallback"?`fallback() external${h.stateMutability==="payable"?" payable":""}`:"receive() external payable"}return St}var gr;function Fn(){if(gr)return Et;gr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.formatAbi=i;const e=Bn();function i(h){const o=[],f=h.length;for(let g=0;g<f;g++){const l=h[g],B=(0,e.formatAbiItem)(l);o.push(B)}return o}return Et}var _t={},he={},xr;function et(){if(xr)return he;xr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.functionModifiers=he.eventModifiers=he.modifiers=void 0,he.isErrorSignature=h,he.execErrorSignature=o,he.isEventSignature=g,he.execEventSignature=l,he.isFunctionSignature=O,he.execFunctionSignature=P,he.isStructSignature=j,he.execStructSignature=k,he.isConstructorSignature=C,he.execConstructorSignature=z,he.isFallbackSignature=y,he.execFallbackSignature=u,he.isReceiveSignature=t;const e=Rt(),i=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function h(d){return i.test(d)}function o(d){return(0,e.execTyped)(i,d)}const f=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function g(d){return f.test(d)}function l(d){return(0,e.execTyped)(f,d)}const B=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function O(d){return B.test(d)}function P(d){return(0,e.execTyped)(B,d)}const L=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function j(d){return L.test(d)}function k(d){return(0,e.execTyped)(L,d)}const q=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function C(d){return q.test(d)}function z(d){return(0,e.execTyped)(q,d)}const N=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function y(d){return N.test(d)}function u(d){return(0,e.execTyped)(N,d)}const m=/^receive\(\) external payable$/;function t(d){return m.test(d)}return he.modifiers=new Set(["memory","indexed","storage","calldata"]),he.eventModifiers=new Set(["indexed"]),he.functionModifiers=new Set(["calldata","memory","storage"]),he}var At={},je={},wr;function Ut(){if(wr)return je;wr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.UnknownSolidityTypeError=je.UnknownTypeError=je.InvalidAbiItemError=void 0;const e=Qe();class i extends e.BaseError{constructor({signature:g}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(g,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}je.InvalidAbiItemError=i;class h extends e.BaseError{constructor({type:g}){super("Unknown type.",{metaMessages:[`Type "${g}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}je.UnknownTypeError=h;class o extends e.BaseError{constructor({type:g}){super("Unknown type.",{metaMessages:[`Type "${g}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}return je.UnknownSolidityTypeError=o,je}var be={},vr;function xt(){if(vr)return be;vr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.InvalidAbiTypeParameterError=be.InvalidFunctionModifierError=be.InvalidModifierError=be.SolidityProtectedKeywordError=be.InvalidParameterError=be.InvalidAbiParametersError=be.InvalidAbiParameterError=void 0;const e=Qe();class i extends e.BaseError{constructor({param:P}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(P,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}}be.InvalidAbiParameterError=i;class h extends e.BaseError{constructor({params:P}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(P,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}be.InvalidAbiParametersError=h;class o extends e.BaseError{constructor({param:P}){super("Invalid ABI parameter.",{details:P}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}be.InvalidParameterError=o;class f extends e.BaseError{constructor({param:P,name:L}){super("Invalid ABI parameter.",{details:P,metaMessages:[`"${L}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}be.SolidityProtectedKeywordError=f;class g extends e.BaseError{constructor({param:P,type:L,modifier:j}){super("Invalid ABI parameter.",{details:P,metaMessages:[`Modifier "${j}" not allowed${L?` in "${L}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}be.InvalidModifierError=g;class l extends e.BaseError{constructor({param:P,type:L,modifier:j}){super("Invalid ABI parameter.",{details:P,metaMessages:[`Modifier "${j}" not allowed${L?` in "${L}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${j}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}be.InvalidFunctionModifierError=l;class B extends e.BaseError{constructor({abiParameter:P}){super("Invalid ABI parameter.",{details:JSON.stringify(P,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}return be.InvalidAbiTypeParameterError=B,be}var Te={},Er;function Jt(){if(Er)return Te;Er=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.InvalidStructSignatureError=Te.UnknownSignatureError=Te.InvalidSignatureError=void 0;const e=Qe();class i extends e.BaseError{constructor({signature:g,type:l}){super(`Invalid ${l} signature.`,{details:g}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}Te.InvalidSignatureError=i;class h extends e.BaseError{constructor({signature:g}){super("Unknown signature.",{details:g}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}Te.UnknownSignatureError=h;class o extends e.BaseError{constructor({signature:g}){super("Invalid struct signature.",{details:g,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}return Te.InvalidStructSignatureError=o,Te}var at={},Sr;function _n(){if(Sr)return at;Sr=1,Object.defineProperty(at,"__esModule",{value:!0}),at.CircularReferenceError=void 0;const e=Qe();class i extends e.BaseError{constructor({type:o}){super("Circular reference detected.",{metaMessages:[`Struct "${o}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}return at.CircularReferenceError=i,at}var ve={},ct={},Ir;function An(){if(Ir)return ct;Ir=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.InvalidParenthesisError=void 0;const e=Qe();class i extends e.BaseError{constructor({current:o,depth:f}){super("Unbalanced parentheses.",{metaMessages:[`"${o.trim()}" has too many ${f>0?"opening":"closing"} parentheses.`],details:`Depth "${f}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}return ct.InvalidParenthesisError=i,ct}var Ge={},Br;function Gn(){if(Br)return Ge;Br=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.parameterCache=void 0,Ge.getParameterCacheKey=e;function e(i,h,o){let f="";if(o)for(const g of Object.entries(o)){if(!g)continue;let l="";for(const B of g[1])l+=`[${B.type}${B.name?`:${B.name}`:""}]`;f+=`(${g[0]}{${l}})`}return h?`${h}:${i}${f}`:`${i}${f}`}return Ge.parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),Ge}var _r;function Je(){if(_r)return ve;_r=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.parseSignature=B,ve.parseFunctionSignature=O,ve.parseEventSignature=P,ve.parseErrorSignature=L,ve.parseConstructorSignature=j,ve.parseFallbackSignature=k,ve.parseAbiParameter=N,ve.splitParameters=y,ve.isSolidityType=u,ve.isSolidityKeyword=t,ve.isValidDataLocation=d;const e=Rt(),i=Ut(),h=xt(),o=Jt(),f=An(),g=Gn(),l=et();function B(b,_={}){if((0,l.isFunctionSignature)(b))return O(b,_);if((0,l.isEventSignature)(b))return P(b,_);if((0,l.isErrorSignature)(b))return L(b,_);if((0,l.isConstructorSignature)(b))return j(b,_);if((0,l.isFallbackSignature)(b))return k(b);if((0,l.isReceiveSignature)(b))return{type:"receive",stateMutability:"payable"};throw new o.UnknownSignatureError({signature:b})}function O(b,_={}){const H=(0,l.execFunctionSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"function"});const E=y(H.parameters),x=[],A=E.length;for(let v=0;v<A;v++)x.push(N(E[v],{modifiers:l.functionModifiers,structs:_,type:"function"}));const p=[];if(H.returns){const v=y(H.returns),T=v.length;for(let $=0;$<T;$++)p.push(N(v[$],{modifiers:l.functionModifiers,structs:_,type:"function"}))}return{name:H.name,type:"function",stateMutability:H.stateMutability??"nonpayable",inputs:x,outputs:p}}function P(b,_={}){const H=(0,l.execEventSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"event"});const E=y(H.parameters),x=[],A=E.length;for(let p=0;p<A;p++)x.push(N(E[p],{modifiers:l.eventModifiers,structs:_,type:"event"}));return{name:H.name,type:"event",inputs:x}}function L(b,_={}){const H=(0,l.execErrorSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"error"});const E=y(H.parameters),x=[],A=E.length;for(let p=0;p<A;p++)x.push(N(E[p],{structs:_,type:"error"}));return{name:H.name,type:"error",inputs:x}}function j(b,_={}){const H=(0,l.execConstructorSignature)(b);if(!H)throw new o.InvalidSignatureError({signature:b,type:"constructor"});const E=y(H.parameters),x=[],A=E.length;for(let p=0;p<A;p++)x.push(N(E[p],{structs:_,type:"constructor"}));return{type:"constructor",stateMutability:H.stateMutability??"nonpayable",inputs:x}}function k(b){const _=(0,l.execFallbackSignature)(b);if(!_)throw new o.InvalidSignatureError({signature:b,type:"fallback"});return{type:"fallback",stateMutability:_.stateMutability??"nonpayable"}}const q=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,C=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,z=/^u?int$/;function N(b,_){var a,I;const H=(0,g.getParameterCacheKey)(b,_==null?void 0:_.type,_==null?void 0:_.structs);if(g.parameterCache.has(H))return g.parameterCache.get(H);const E=e.isTupleRegex.test(b),x=(0,e.execTyped)(E?C:q,b);if(!x)throw new h.InvalidParameterError({param:b});if(x.name&&t(x.name))throw new h.SolidityProtectedKeywordError({param:b,name:x.name});const A=x.name?{name:x.name}:{},p=x.modifier==="indexed"?{indexed:!0}:{},v=(_==null?void 0:_.structs)??{};let T,$={};if(E){T="tuple";const r=y(x.type),n=[],s=r.length;for(let c=0;c<s;c++)n.push(N(r[c],{structs:v}));$={components:n}}else if(x.type in v)T="tuple",$={components:v[x.type]};else if(z.test(x.type))T=`${x.type}256`;else if(x.type==="address payable")T="address";else if(T=x.type,(_==null?void 0:_.type)!=="struct"&&!u(T))throw new i.UnknownSolidityTypeError({type:T});if(x.modifier){if(!((I=(a=_==null?void 0:_.modifiers)==null?void 0:a.has)!=null&&I.call(a,x.modifier)))throw new h.InvalidModifierError({param:b,type:_==null?void 0:_.type,modifier:x.modifier});if(l.functionModifiers.has(x.modifier)&&!d(T,!!x.array))throw new h.InvalidFunctionModifierError({param:b,type:_==null?void 0:_.type,modifier:x.modifier})}const w={type:`${T}${x.array??""}`,...A,...p,...$};return g.parameterCache.set(H,w),w}function y(b,_=[],H="",E=0){const x=b.trim().length;for(let A=0;A<x;A++){const p=b[A],v=b.slice(A+1);switch(p){case",":return E===0?y(v,[..._,H.trim()]):y(v,_,`${H}${p}`,E);case"(":return y(v,_,`${H}${p}`,E+1);case")":return y(v,_,`${H}${p}`,E-1);default:return y(v,_,`${H}${p}`,E)}}if(H==="")return _;if(E!==0)throw new f.InvalidParenthesisError({current:H,depth:E});return _.push(H.trim()),_}function u(b){return b==="address"||b==="bool"||b==="function"||b==="string"||e.bytesRegex.test(b)||e.integerRegex.test(b)}const m=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function t(b){return b==="address"||b==="bool"||b==="function"||b==="string"||b==="tuple"||e.bytesRegex.test(b)||e.integerRegex.test(b)||m.test(b)}function d(b,_){return _||b==="bytes"||b==="string"||b==="tuple"}return ve}var Ar;function jt(){if(Ar)return At;Ar=1,Object.defineProperty(At,"__esModule",{value:!0}),At.parseStructs=B;const e=Rt(),i=Ut(),h=xt(),o=Jt(),f=_n(),g=et(),l=Je();function B(L){const j={},k=L.length;for(let N=0;N<k;N++){const y=L[N];if(!(0,g.isStructSignature)(y))continue;const u=(0,g.execStructSignature)(y);if(!u)throw new o.InvalidSignatureError({signature:y,type:"struct"});const m=u.properties.split(";"),t=[],d=m.length;for(let b=0;b<d;b++){const H=m[b].trim();if(!H)continue;const E=(0,l.parseAbiParameter)(H,{type:"struct"});t.push(E)}if(!t.length)throw new o.InvalidStructSignatureError({signature:y});j[u.name]=t}const q={},C=Object.entries(j),z=C.length;for(let N=0;N<z;N++){const[y,u]=C[N];q[y]=P(u,j)}return q}const O=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function P(L=[],j={},k=new Set){const q=[],C=L.length;for(let z=0;z<C;z++){const N=L[z];if(e.isTupleRegex.test(N.type))q.push(N);else{const u=(0,e.execTyped)(O,N.type);if(!(u!=null&&u.type))throw new h.InvalidAbiTypeParameterError({abiParameter:N});const{array:m,type:t}=u;if(t in j){if(k.has(t))throw new f.CircularReferenceError({type:t});q.push({...N,type:`tuple${m??""}`,components:P(j[t],j,new Set([...k,t]))})}else if((0,l.isSolidityType)(t))q.push(N);else throw new i.UnknownTypeError({type:t})}}return q}return At}var Pr;function Yn(){if(Pr)return _t;Pr=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.parseAbi=o;const e=et(),i=jt(),h=Je();function o(f){const g=(0,i.parseStructs)(f),l=[],B=f.length;for(let O=0;O<B;O++){const P=f[O];(0,e.isStructSignature)(P)||l.push((0,h.parseSignature)(P,g))}return l}return _t}var Pt={},Or;function Xn(){if(Or)return Pt;Or=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.parseAbiItem=f;const e=Ut(),i=et(),h=jt(),o=Je();function f(g){let l;if(typeof g=="string")l=(0,o.parseSignature)(g);else{const B=(0,h.parseStructs)(g),O=g.length;for(let P=0;P<O;P++){const L=g[P];if(!(0,i.isStructSignature)(L)){l=(0,o.parseSignature)(L,B);break}}}if(!l)throw new e.InvalidAbiItemError({signature:g});return l}return Pt}var Ot={},Hr;function Jn(){if(Hr)return Ot;Hr=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.parseAbiParameter=f;const e=xt(),i=et(),h=jt(),o=Je();function f(g){let l;if(typeof g=="string")l=(0,o.parseAbiParameter)(g,{modifiers:i.modifiers});else{const B=(0,h.parseStructs)(g),O=g.length;for(let P=0;P<O;P++){const L=g[P];if(!(0,i.isStructSignature)(L)){l=(0,o.parseAbiParameter)(L,{modifiers:i.modifiers,structs:B});break}}}if(!l)throw new e.InvalidAbiParameterError({param:g});return l}return Ot}var Ht={},Rr;function Qn(){if(Rr)return Ht;Rr=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.parseAbiParameters=g;const e=xt(),i=et(),h=jt(),o=Je(),f=Je();function g(l){const B=[];if(typeof l=="string"){const O=(0,o.splitParameters)(l),P=O.length;for(let L=0;L<P;L++)B.push((0,f.parseAbiParameter)(O[L],{modifiers:i.modifiers}))}else{const O=(0,h.parseStructs)(l),P=l.length;for(let L=0;L<P;L++){const j=l[L];if((0,i.isStructSignature)(j))continue;const k=(0,o.splitParameters)(j),q=k.length;for(let C=0;C<q;C++)B.push((0,f.parseAbiParameter)(k[C],{modifiers:i.modifiers,structs:O}))}}if(B.length===0)throw new e.InvalidAbiParametersError({params:l});return B}return Ht}var Ur;function ei(){return Ur||(Ur=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CircularReferenceError=e.InvalidParenthesisError=e.UnknownSignatureError=e.InvalidSignatureError=e.InvalidStructSignatureError=e.InvalidAbiParameterError=e.InvalidAbiParametersError=e.InvalidParameterError=e.SolidityProtectedKeywordError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.UnknownSolidityTypeError=e.InvalidAbiItemError=e.UnknownTypeError=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.formatAbiParameters=e.formatAbiParameter=e.formatAbiItem=e.formatAbi=e.narrow=e.BaseError=void 0;var i=Qe();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return i.BaseError}});var h=Wn();Object.defineProperty(e,"narrow",{enumerable:!0,get:function(){return h.narrow}});var o=Fn();Object.defineProperty(e,"formatAbi",{enumerable:!0,get:function(){return o.formatAbi}});var f=Bn();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return f.formatAbiItem}});var g=Sn();Object.defineProperty(e,"formatAbiParameter",{enumerable:!0,get:function(){return g.formatAbiParameter}});var l=In();Object.defineProperty(e,"formatAbiParameters",{enumerable:!0,get:function(){return l.formatAbiParameters}});var B=Yn();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return B.parseAbi}});var O=Xn();Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return O.parseAbiItem}});var P=Jn();Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return P.parseAbiParameter}});var L=Qn();Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return L.parseAbiParameters}});var j=Ut();Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return j.UnknownTypeError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return j.InvalidAbiItemError}}),Object.defineProperty(e,"UnknownSolidityTypeError",{enumerable:!0,get:function(){return j.UnknownSolidityTypeError}});var k=xt();Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return k.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return k.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return k.InvalidModifierError}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return k.SolidityProtectedKeywordError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return k.InvalidParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return k.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return k.InvalidAbiParameterError}});var q=Jt();Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return q.InvalidStructSignatureError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return q.InvalidSignatureError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return q.UnknownSignatureError}});var C=An();Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return C.InvalidParenthesisError}});var z=_n();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return z.CircularReferenceError}})}(Vt)),Vt}var Ce={},ge={},jr;function ti(){if(jr)return ge;jr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.ripemd160=ge.RIPEMD160=ge.md5=ge.MD5=ge.sha1=ge.SHA1=void 0;const e=wn(),i=qe(),h=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),o=new Uint32Array(80);class f extends e.HashMD{constructor(){super(64,20,8,!1),this.A=h[0]|0,this.B=h[1]|0,this.C=h[2]|0,this.D=h[3]|0,this.E=h[4]|0}get(){const{A:E,B:x,C:A,D:p,E:v}=this;return[E,x,A,p,v]}set(E,x,A,p,v){this.A=E|0,this.B=x|0,this.C=A|0,this.D=p|0,this.E=v|0}process(E,x){for(let w=0;w<16;w++,x+=4)o[w]=E.getUint32(x,!1);for(let w=16;w<80;w++)o[w]=(0,i.rotl)(o[w-3]^o[w-8]^o[w-14]^o[w-16],1);let{A,B:p,C:v,D:T,E:$}=this;for(let w=0;w<80;w++){let a,I;w<20?(a=(0,e.Chi)(p,v,T),I=1518500249):w<40?(a=p^v^T,I=1859775393):w<60?(a=(0,e.Maj)(p,v,T),I=2400959708):(a=p^v^T,I=3395469782);const r=(0,i.rotl)(A,5)+a+$+I+o[w]|0;$=T,T=v,v=(0,i.rotl)(p,30),p=A,A=r}A=A+this.A|0,p=p+this.B|0,v=v+this.C|0,T=T+this.D|0,$=$+this.E|0,this.set(A,p,v,T,$)}roundClean(){(0,i.clean)(o)}destroy(){this.set(0,0,0,0,0),(0,i.clean)(this.buffer)}}ge.SHA1=f,ge.sha1=(0,i.createHasher)(()=>new f);const g=Math.pow(2,32),l=Array.from({length:64},(H,E)=>Math.floor(g*Math.abs(Math.sin(E+1)))),B=h.slice(0,4),O=new Uint32Array(16);class P extends e.HashMD{constructor(){super(64,16,8,!0),this.A=B[0]|0,this.B=B[1]|0,this.C=B[2]|0,this.D=B[3]|0}get(){const{A:E,B:x,C:A,D:p}=this;return[E,x,A,p]}set(E,x,A,p){this.A=E|0,this.B=x|0,this.C=A|0,this.D=p|0}process(E,x){for(let $=0;$<16;$++,x+=4)O[$]=E.getUint32(x,!0);let{A,B:p,C:v,D:T}=this;for(let $=0;$<64;$++){let w,a,I;$<16?(w=(0,e.Chi)(p,v,T),a=$,I=[7,12,17,22]):$<32?(w=(0,e.Chi)(T,p,v),a=(5*$+1)%16,I=[5,9,14,20]):$<48?(w=p^v^T,a=(3*$+5)%16,I=[4,11,16,23]):(w=v^(p|~T),a=7*$%16,I=[6,10,15,21]),w=w+A+l[$]+O[a],A=T,T=v,v=p,p=p+(0,i.rotl)(w,I[$%4])}A=A+this.A|0,p=p+this.B|0,v=v+this.C|0,T=T+this.D|0,this.set(A,p,v,T)}roundClean(){(0,i.clean)(O)}destroy(){this.set(0,0,0,0),(0,i.clean)(this.buffer)}}ge.MD5=P,ge.md5=(0,i.createHasher)(()=>new P);const L=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),j=(()=>Uint8Array.from(new Array(16).fill(0).map((H,E)=>E)))(),k=(()=>j.map(H=>(9*H+5)%16))(),q=(()=>{const x=[[j],[k]];for(let A=0;A<4;A++)for(let p of x)p.push(p[A].map(v=>L[v]));return x})(),C=(()=>q[0])(),z=(()=>q[1])(),N=[[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(H=>Uint8Array.from(H)),y=C.map((H,E)=>H.map(x=>N[E][x])),u=z.map((H,E)=>H.map(x=>N[E][x])),m=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),t=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function d(H,E,x,A){return H===0?E^x^A:H===1?E&x|~E&A:H===2?(E|~x)^A:H===3?E&A|x&~A:E^(x|~A)}const b=new Uint32Array(16);class _ extends e.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:E,h1:x,h2:A,h3:p,h4:v}=this;return[E,x,A,p,v]}set(E,x,A,p,v){this.h0=E|0,this.h1=x|0,this.h2=A|0,this.h3=p|0,this.h4=v|0}process(E,x){for(let s=0;s<16;s++,x+=4)b[s]=E.getUint32(x,!0);let A=this.h0|0,p=A,v=this.h1|0,T=v,$=this.h2|0,w=$,a=this.h3|0,I=a,r=this.h4|0,n=r;for(let s=0;s<5;s++){const c=4-s,S=m[s],M=t[s],U=C[s],V=z[s],D=y[s],G=u[s];for(let W=0;W<16;W++){const Y=(0,i.rotl)(A+d(s,v,$,a)+b[U[W]]+S,D[W])+r|0;A=r,r=a,a=(0,i.rotl)($,10)|0,$=v,v=Y}for(let W=0;W<16;W++){const Y=(0,i.rotl)(p+d(c,T,w,I)+b[V[W]]+M,G[W])+n|0;p=n,n=I,I=(0,i.rotl)(w,10)|0,w=T,T=Y}}this.set(this.h1+$+I|0,this.h2+a+n|0,this.h3+r+p|0,this.h4+A+T|0,this.h0+v+w|0)}roundClean(){(0,i.clean)(b)}destroy(){this.destroyed=!0,(0,i.clean)(this.buffer),this.set(0,0,0,0,0)}}return ge.RIPEMD160=_,ge.ripemd160=(0,i.createHasher)(()=>new _),ge}var Tr;function ri(){if(Tr)return Ce;Tr=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.ripemd160=Ce.RIPEMD160=void 0;const e=ti();return Ce.RIPEMD160=e.RIPEMD160,Ce.ripemd160=e.ripemd160,Ce}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tt=BigInt(0),gt=BigInt(1);function Lt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Mt(e){if(!Lt(e))throw new Error("Uint8Array expected")}function ni(e,i){if(typeof i!="boolean")throw new Error(e+" boolean expected, got "+i)}function Pn(e){const i=e.toString(16);return i.length&1?"0"+i:i}function Qt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Tt:BigInt("0x"+e)}const On=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ii=Array.from({length:256},(e,i)=>i.toString(16).padStart(2,"0"));function er(e){if(Mt(e),On)return e.toHex();let i="";for(let h=0;h<e.length;h++)i+=ii[e[h]];return i}const Le={_0:48,_9:57,A:65,F:70,a:97,f:102};function Lr(e){if(e>=Le._0&&e<=Le._9)return e-Le._0;if(e>=Le.A&&e<=Le.F)return e-(Le.A-10);if(e>=Le.a&&e<=Le.f)return e-(Le.a-10)}function zt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(On)return Uint8Array.fromHex(e);const i=e.length,h=i/2;if(i%2)throw new Error("hex string expected, got unpadded hex of length "+i);const o=new Uint8Array(h);for(let f=0,g=0;f<h;f++,g+=2){const l=Lr(e.charCodeAt(g)),B=Lr(e.charCodeAt(g+1));if(l===void 0||B===void 0){const O=e[g]+e[g+1];throw new Error('hex string expected, got non-hex character "'+O+'" at index '+g)}o[f]=l*16+B}return o}function si(e){return Qt(er(e))}function oi(e){return Mt(e),Qt(er(Uint8Array.from(e).reverse()))}function Hn(e,i){return zt(e.toString(16).padStart(i*2,"0"))}function ai(e,i){return Hn(e,i).reverse()}function ci(e){return zt(Pn(e))}function ui(e,i,h){let o;if(typeof i=="string")try{o=zt(i)}catch(g){throw new Error(e+" must be hex string or Uint8Array, cause: "+g)}else if(Lt(i))o=Uint8Array.from(i);else throw new Error(e+" must be hex string or Uint8Array");const f=o.length;if(typeof h=="number"&&f!==h)throw new Error(e+" of length "+h+" expected, got "+f);return o}function Rn(...e){let i=0;for(let o=0;o<e.length;o++){const f=e[o];Mt(f),i+=f.length}const h=new Uint8Array(i);for(let o=0,f=0;o<e.length;o++){const g=e[o];h.set(g,f),f+=g.length}return h}function fi(e,i){if(e.length!==i.length)return!1;let h=0;for(let o=0;o<e.length;o++)h|=e[o]^i[o];return h===0}function di(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}const Dt=e=>typeof e=="bigint"&&Tt<=e;function Un(e,i,h){return Dt(e)&&Dt(i)&&Dt(h)&&i<=e&&e<h}function li(e,i,h,o){if(!Un(i,h,o))throw new Error("expected valid "+e+": "+h+" <= n < "+o+", got "+i)}function hi(e){let i;for(i=0;e>Tt;e>>=gt,i+=1);return i}function mi(e,i){return e>>BigInt(i)>}function bi(e,i,h){return e|(h?gt:Tt)<<BigInt(i)}const yi=e=>(gt<<BigInt(e))-gt,Kt=e=>new Uint8Array(e),Mr=e=>Uint8Array.from(e);function pi(e,i,h){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof i!="number"||i<2)throw new Error("qByteLen must be a number");if(typeof h!="function")throw new Error("hmacFn must be a function");let o=Kt(e),f=Kt(e),g=0;const l=()=>{o.fill(1),f.fill(0),g=0},B=(...j)=>h(f,o,...j),O=(j=Kt(0))=>{f=B(Mr([0]),j),o=B(),j.length!==0&&(f=B(Mr([1]),j),o=B())},P=()=>{if(g++>=1e3)throw new Error("drbg: tried 1000 values");let j=0;const k=[];for(;j<i;){o=B();const q=o.slice();k.push(q),j+=o.length}return Rn(...k)};return(j,k)=>{l(),O(j);let q;for(;!(q=k(P()));)O();return l(),q}}const gi={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Lt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,i)=>i.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function xi(e,i,h={}){const o=(f,g,l)=>{const B=gi[g];if(typeof B!="function")throw new Error("invalid validator function");const O=e[f];if(!(l&&O===void 0)&&!B(O,e))throw new Error("param "+String(f)+" is invalid. Expected "+g+", got "+O)};for(const[f,g]of Object.entries(i))o(f,g,!1);for(const[f,g]of Object.entries(h))o(f,g,!0);return e}const wi=()=>{throw new Error("not implemented")};function vi(e){const i=new WeakMap;return(h,...o)=>{const f=i.get(h);if(f!==void 0)return f;const g=e(h,...o);return i.set(h,g),g}}const Ei=Object.freeze(Object.defineProperty({__proto__:null,aInRange:li,abool:ni,abytes:Mt,bitGet:mi,bitLen:hi,bitMask:yi,bitSet:bi,bytesToHex:er,bytesToNumberBE:si,bytesToNumberLE:oi,concatBytes:Rn,createHmacDrbg:pi,ensureBytes:ui,equalBytes:fi,hexToBytes:zt,hexToNumber:Qt,inRange:Un,isBytes:Lt,memoized:vi,notImplemented:wi,numberToBytesBE:Hn,numberToBytesLE:ai,numberToHexUnpadded:Pn,numberToVarBytesBE:ci,utf8ToBytes:di,validateObject:xi},Symbol.toStringTag,{value:"Module"}));var Zt={},zr;function Si(){return zr||(zr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const i=qe();class h extends i.Hash{constructor(g,l){super(),this.finished=!1,this.destroyed=!1,(0,i.ahash)(g);const B=(0,i.toBytes)(l);if(this.iHash=g.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const O=this.blockLen,P=new Uint8Array(O);P.set(B.length>O?g.create().update(B).digest():B);for(let L=0;L<P.length;L++)P[L]^=54;this.iHash.update(P),this.oHash=g.create();for(let L=0;L<P.length;L++)P[L]^=106;this.oHash.update(P),(0,i.clean)(P)}update(g){return(0,i.aexists)(this),this.iHash.update(g),this}digestInto(g){(0,i.aexists)(this),(0,i.abytes)(g,this.outputLen),this.finished=!0,this.iHash.digestInto(g),this.oHash.update(g),this.oHash.digestInto(g),this.destroy()}digest(){const g=new Uint8Array(this.oHash.outputLen);return this.digestInto(g),g}_cloneInto(g){g||(g=Object.create(Object.getPrototypeOf(this),{}));const{oHash:l,iHash:B,finished:O,destroyed:P,blockLen:L,outputLen:j}=this;return g=g,g.finished=O,g.destroyed=P,g.blockLen=L,g.outputLen=j,g.oHash=l._cloneInto(g.oHash),g.iHash=B._cloneInto(g.iHash),g}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=h;const o=(f,g,l)=>new h(f,g).update(l).digest();e.hmac=o,e.hmac.create=(f,g)=>new h(f,g)}(Zt)),Zt}var Wt={},ut={},Ft={},Ve={},fe={},oe={},$r;function wt(){if($r)return oe;$r=1;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(oe,"__esModule",{value:!0}),oe.notImplemented=oe.bitMask=void 0,oe.isBytes=h,oe.abytes=o,oe.abool=f,oe.numberToHexUnpadded=g,oe.hexToNumber=l,oe.bytesToHex=P,oe.hexToBytes=k,oe.bytesToNumberBE=q,oe.bytesToNumberLE=C,oe.numberToBytesBE=z,oe.numberToBytesLE=N,oe.numberToVarBytesBE=y,oe.ensureBytes=u,oe.concatBytes=m,oe.equalBytes=t,oe.utf8ToBytes=d,oe.inRange=_,oe.aInRange=H,oe.bitLen=E,oe.bitGet=x,oe.bitSet=A,oe.createHmacDrbg=$,oe.validateObject=a,oe.memoized=r;const e=BigInt(0),i=BigInt(1);function h(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function o(n){if(!h(n))throw new Error("Uint8Array expected")}function f(n,s){if(typeof s!="boolean")throw new Error(n+" boolean expected, got "+s)}function g(n){const s=n.toString(16);return s.length&1?"0"+s:s}function l(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?e:BigInt("0x"+n)}const B=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",O=Array.from({length:256},(n,s)=>s.toString(16).padStart(2,"0"));function P(n){if(o(n),B)return n.toHex();let s="";for(let c=0;c<n.length;c++)s+=O[n[c]];return s}const L={_0:48,_9:57,A:65,F:70,a:97,f:102};function j(n){if(n>=L._0&&n<=L._9)return n-L._0;if(n>=L.A&&n<=L.F)return n-(L.A-10);if(n>=L.a&&n<=L.f)return n-(L.a-10)}function k(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);if(B)return Uint8Array.fromHex(n);const s=n.length,c=s/2;if(s%2)throw new Error("hex string expected, got unpadded hex of length "+s);const S=new Uint8Array(c);for(let M=0,U=0;M<c;M++,U+=2){const V=j(n.charCodeAt(U)),D=j(n.charCodeAt(U+1));if(V===void 0||D===void 0){const G=n[U]+n[U+1];throw new Error('hex string expected, got non-hex character "'+G+'" at index '+U)}S[M]=V*16+D}return S}function q(n){return l(P(n))}function C(n){return o(n),l(P(Uint8Array.from(n).reverse()))}function z(n,s){return k(n.toString(16).padStart(s*2,"0"))}function N(n,s){return z(n,s).reverse()}function y(n){return k(g(n))}function u(n,s,c){let S;if(typeof s=="string")try{S=k(s)}catch(U){throw new Error(n+" must be hex string or Uint8Array, cause: "+U)}else if(h(s))S=Uint8Array.from(s);else throw new Error(n+" must be hex string or Uint8Array");const M=S.length;if(typeof c=="number"&&M!==c)throw new Error(n+" of length "+c+" expected, got "+M);return S}function m(...n){let s=0;for(let S=0;S<n.length;S++){const M=n[S];o(M),s+=M.length}const c=new Uint8Array(s);for(let S=0,M=0;S<n.length;S++){const U=n[S];c.set(U,M),M+=U.length}return c}function t(n,s){if(n.length!==s.length)return!1;let c=0;for(let S=0;S<n.length;S++)c|=n[S]^s[S];return c===0}function d(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}const b=n=>typeof n=="bigint"&&e<=n;function _(n,s,c){return b(n)&&b(s)&&b(c)&&s<=n&&n<c}function H(n,s,c,S){if(!_(s,c,S))throw new Error("expected valid "+n+": "+c+" <= n < "+S+", got "+s)}function E(n){let s;for(s=0;n>e;n>>=i,s+=1);return s}function x(n,s){return n>>BigInt(s)&i}function A(n,s,c){return n|(c?i:e)<<BigInt(s)}const p=n=>(i<<BigInt(n))-i;oe.bitMask=p;const v=n=>new Uint8Array(n),T=n=>Uint8Array.from(n);function $(n,s,c){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof s!="number"||s<2)throw new Error("qByteLen must be a number");if(typeof c!="function")throw new Error("hmacFn must be a function");let S=v(n),M=v(n),U=0;const V=()=>{S.fill(1),M.fill(0),U=0},D=(...F)=>c(M,S,...F),G=(F=v(0))=>{M=D(T([0]),F),S=D(),F.length!==0&&(M=D(T([1]),F),S=D())},W=()=>{if(U++>=1e3)throw new Error("drbg: tried 1000 values");let F=0;const se=[];for(;F<s;){S=D();const K=S.slice();se.push(K),F+=S.length}return m(...se)};return(F,se)=>{V(),G(F);let K;for(;!(K=se(W()));)G();return V(),K}}const w={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||h(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,s)=>s.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function a(n,s,c={}){const S=(M,U,V)=>{const D=w[U];if(typeof D!="function")throw new Error("invalid validator function");const G=n[M];if(!(V&&G===void 0)&&!D(G,n))throw new Error("param "+String(M)+" is invalid. Expected "+U+", got "+G)};for(const[M,U]of Object.entries(s))S(M,U,!1);for(const[M,U]of Object.entries(c))S(M,U,!0);return n}const I=()=>{throw new Error("not implemented")};oe.notImplemented=I;function r(n){const s=new WeakMap;return(c,...S)=>{const M=s.get(c);if(M!==void 0)return M;const U=n(c,...S);return s.set(c,U),U}}return oe}var qr;function $t(){if(qr)return fe;qr=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.isNegativeLE=void 0,fe.mod=P,fe.pow=L,fe.pow2=j,fe.invert=k,fe.tonelliShanks=z,fe.FpSqrt=N,fe.validateField=m,fe.FpPow=t,fe.FpInvertBatch=d,fe.FpDiv=b,fe.FpLegendre=_,fe.FpIsSquare=H,fe.nLength=E,fe.Field=x,fe.FpSqrtOdd=A,fe.FpSqrtEven=p,fe.hashToPrivateScalar=v,fe.getFieldBytesLength=T,fe.getMinHashLength=$,fe.mapHashToField=w;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=qe(),i=wt(),h=BigInt(0),o=BigInt(1),f=BigInt(2),g=BigInt(3),l=BigInt(4),B=BigInt(5),O=BigInt(8);function P(a,I){const r=a%I;return r>=h?r:I+r}function L(a,I,r){return t(x(r),a,I)}function j(a,I,r){let n=a;for(;I-- >h;)n*=n,n%=r;return n}function k(a,I){if(a===h)throw new Error("invert: expected non-zero number");if(I<=h)throw new Error("invert: expected positive modulus, got "+I);let r=P(a,I),n=I,s=h,c=o;for(;r!==h;){const M=n/r,U=n%r,V=s-c*M;n=r,r=U,s=c,c=V}if(n!==o)throw new Error("invert: does not exist");return P(s,I)}function q(a,I){const r=(a.ORDER+o)/l,n=a.pow(I,r);if(!a.eql(a.sqr(n),I))throw new Error("Cannot find square root");return n}function C(a,I){const r=(a.ORDER-B)/O,n=a.mul(I,f),s=a.pow(n,r),c=a.mul(I,s),S=a.mul(a.mul(c,f),s),M=a.mul(c,a.sub(S,a.ONE));if(!a.eql(a.sqr(M),I))throw new Error("Cannot find square root");return M}function z(a){if(a<BigInt(3))throw new Error("sqrt is not defined for small field");let I=a-o,r=0;for(;I%f===h;)I/=f,r++;let n=f;const s=x(a);for(;_(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return q;let c=s.pow(n,I);const S=(I+o)/f;return function(U,V){if(U.is0(V))return V;if(_(U,V)!==1)throw new Error("Cannot find square root");let D=r,G=U.mul(U.ONE,c),W=U.pow(V,I),Y=U.pow(V,S);for(;!U.eql(W,U.ONE);){if(U.is0(W))return U.ZERO;let F=1,se=U.sqr(W);for(;!U.eql(se,U.ONE);)if(F++,se=U.sqr(se),F===D)throw new Error("Cannot find square root");const K=o<<BigInt(D-F-1),Z=U.pow(G,K);D=F,G=U.sqr(Z),W=U.mul(W,G),Y=U.mul(Y,Z)}return Y}}function N(a){return a%l===g?q:a%O===B?C:z(a)}const y=(a,I)=>(P(a,I)&o)===o;fe.isNegativeLE=y;const u=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(a){const I={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=u.reduce((n,s)=>(n[s]="function",n),I);return(0,i.validateObject)(a,r)}function t(a,I,r){if(r<h)throw new Error("invalid exponent, negatives unsupported");if(r===h)return a.ONE;if(r===o)return I;let n=a.ONE,s=I;for(;r>h;)r&o&&(n=a.mul(n,s)),s=a.sqr(s),r>>=o;return n}function d(a,I,r=!1){const n=new Array(I.length).fill(r?a.ZERO:void 0),s=I.reduce((S,M,U)=>a.is0(M)?S:(n[U]=S,a.mul(S,M)),a.ONE),c=a.inv(s);return I.reduceRight((S,M,U)=>a.is0(M)?S:(n[U]=a.mul(S,n[U]),a.mul(S,M)),c),n}function b(a,I,r){return a.mul(I,typeof r=="bigint"?k(r,a.ORDER):a.inv(r))}function _(a,I){const r=(a.ORDER-o)/f,n=a.pow(I,r),s=a.eql(n,a.ONE),c=a.eql(n,a.ZERO),S=a.eql(n,a.neg(a.ONE));if(!s&&!c&&!S)throw new Error("invalid Legendre symbol result");return s?1:c?0:-1}function H(a,I){return _(a,I)===1}function E(a,I){I!==void 0&&(0,e.anumber)(I);const r=I!==void 0?I:a.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function x(a,I,r=!1,n={}){if(a<=h)throw new Error("invalid field: expected ORDER > 0, got "+a);const{nBitLength:s,nByteLength:c}=E(a,I);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let S;const M=Object.freeze({ORDER:a,isLE:r,BITS:s,BYTES:c,MASK:(0,i.bitMask)(s),ZERO:h,ONE:o,create:U=>P(U,a),isValid:U=>{if(typeof U!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof U);return h<=U&&U<a},is0:U=>U===h,isOdd:U=>(U&o)===o,neg:U=>P(-U,a),eql:(U,V)=>U===V,sqr:U=>P(U*U,a),add:(U,V)=>P(U+V,a),sub:(U,V)=>P(U-V,a),mul:(U,V)=>P(U*V,a),pow:(U,V)=>t(M,U,V),div:(U,V)=>P(U*k(V,a),a),sqrN:U=>U*U,addN:(U,V)=>U+V,subN:(U,V)=>U-V,mulN:(U,V)=>U*V,inv:U=>k(U,a),sqrt:n.sqrt||(U=>(S||(S=N(a)),S(M,U))),toBytes:U=>r?(0,i.numberToBytesLE)(U,c):(0,i.numberToBytesBE)(U,c),fromBytes:U=>{if(U.length!==c)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+U.length);return r?(0,i.bytesToNumberLE)(U):(0,i.bytesToNumberBE)(U)},invertBatch:U=>d(M,U),cmov:(U,V,D)=>D?V:U});return Object.freeze(M)}function A(a,I){if(!a.isOdd)throw new Error("Field doesn't have isOdd");const r=a.sqrt(I);return a.isOdd(r)?r:a.neg(r)}function p(a,I){if(!a.isOdd)throw new Error("Field doesn't have isOdd");const r=a.sqrt(I);return a.isOdd(r)?a.neg(r):r}function v(a,I,r=!1){a=(0,i.ensureBytes)("privateHash",a);const n=a.length,s=E(I).nByteLength+8;if(s<24||n<s||n>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+n);const c=r?(0,i.bytesToNumberLE)(a):(0,i.bytesToNumberBE)(a);return P(c,I-o)+o}function T(a){if(typeof a!="bigint")throw new Error("field order must be bigint");const I=a.toString(2).length;return Math.ceil(I/8)}function $(a){const I=T(a);return I+Math.ceil(I/2)}function w(a,I,r=!1){const n=a.length,s=T(I),c=$(I);if(n<16||n<c||n>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+n);const S=r?(0,i.bytesToNumberLE)(a):(0,i.bytesToNumberBE)(a),M=P(S,I-o)+o;return r?(0,i.numberToBytesLE)(M,s):(0,i.numberToBytesBE)(M,s)}return fe}var kr;function Ii(){if(kr)return Ve;kr=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.wNAF=q,Ve.pippenger=C,Ve.precomputeMSMUnsafe=z,Ve.validateBasic=N;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=$t(),i=wt(),h=BigInt(0),o=BigInt(1);function f(y,u){const m=u.negate();return y?m:u}function g(y,u){if(!Number.isSafeInteger(y)||y<=0||y>u)throw new Error("invalid window size, expected [1.."+u+"], got W="+y)}function l(y,u){g(y,u);const m=Math.ceil(u/y)+1,t=2**(y-1),d=2**y,b=(0,i.bitMask)(y),_=BigInt(y);return{windows:m,windowSize:t,mask:b,maxNumber:d,shiftBy:_}}function B(y,u,m){const{windowSize:t,mask:d,maxNumber:b,shiftBy:_}=m;let H=Number(y&d),E=y>>_;H>t&&(H-=b,E+=o);const x=u*t,A=x+Math.abs(H)-1,p=H===0,v=H<0,T=u%2!==0;return{nextN:E,offset:A,isZero:p,isNeg:v,isNegF:T,offsetF:x}}function O(y,u){if(!Array.isArray(y))throw new Error("array expected");y.forEach((m,t)=>{if(!(m instanceof u))throw new Error("invalid point at index "+t)})}function P(y,u){if(!Array.isArray(y))throw new Error("array of scalars expected");y.forEach((m,t)=>{if(!u.isValid(m))throw new Error("invalid scalar at index "+t)})}const L=new WeakMap,j=new WeakMap;function k(y){return j.get(y)||1}function q(y,u){return{constTimeNegate:f,hasPrecomputes(m){return k(m)!==1},unsafeLadder(m,t,d=y.ZERO){let b=m;for(;t>h;)t&o&&(d=d.add(b)),b=b.double(),t>>=o;return d},precomputeWindow(m,t){const{windows:d,windowSize:b}=l(t,u),_=[];let H=m,E=H;for(let x=0;x<d;x++){E=H,_.push(E);for(let A=1;A<b;A++)E=E.add(H),_.push(E);H=E.double()}return _},wNAF(m,t,d){let b=y.ZERO,_=y.BASE;const H=l(m,u);for(let E=0;E<H.windows;E++){const{nextN:x,offset:A,isZero:p,isNeg:v,isNegF:T,offsetF:$}=B(d,E,H);d=x,p?_=_.add(f(T,t[$])):b=b.add(f(v,t[A]))}return{p:b,f:_}},wNAFUnsafe(m,t,d,b=y.ZERO){const _=l(m,u);for(let H=0;H<_.windows&&d!==h;H++){const{nextN:E,offset:x,isZero:A,isNeg:p}=B(d,H,_);if(d=E,!A){const v=t[x];b=b.add(p?v.negate():v)}}return b},getPrecomputes(m,t,d){let b=L.get(t);return b||(b=this.precomputeWindow(t,m),m!==1&&L.set(t,d(b))),b},wNAFCached(m,t,d){const b=k(m);return this.wNAF(b,this.getPrecomputes(b,m,d),t)},wNAFCachedUnsafe(m,t,d,b){const _=k(m);return _===1?this.unsafeLadder(m,t,b):this.wNAFUnsafe(_,this.getPrecomputes(_,m,d),t,b)},setWindowSize(m,t){g(t,u),j.set(m,t),L.delete(m)}}}function C(y,u,m,t){O(m,y),P(t,u);const d=m.length,b=t.length;if(d!==b)throw new Error("arrays of points and scalars must have equal length");const _=y.ZERO,H=(0,i.bitLen)(BigInt(d));let E=1;H>12?E=H-3:H>4?E=H-2:H>0&&(E=2);const x=(0,i.bitMask)(E),A=new Array(Number(x)+1).fill(_),p=Math.floor((u.BITS-1)/E)*E;let v=_;for(let T=p;T>=0;T-=E){A.fill(_);for(let w=0;w<b;w++){const a=t[w],I=Number(a>>BigInt(T)&x);A[I]=A[I].add(m[w])}let $=_;for(let w=A.length-1,a=_;w>0;w--)a=a.add(A[w]),$=$.add(a);if(v=v.add($),T!==0)for(let w=0;w<E;w++)v=v.double()}return v}function z(y,u,m,t){g(t,u.BITS),O(m,y);const d=y.ZERO,b=2**t-1,_=Math.ceil(u.BITS/t),H=(0,i.bitMask)(t),E=m.map(x=>{const A=[];for(let p=0,v=x;p<b;p++)A.push(v),v=v.add(x);return A});return x=>{if(P(x,u),x.length>m.length)throw new Error("array of scalars must be smaller than array of points");let A=d;for(let p=0;p<_;p++){if(A!==d)for(let T=0;T<t;T++)A=A.double();const v=BigInt(_*t-(p+1)*t);for(let T=0;T<x.length;T++){const $=x[T],w=Number($>>v&H);w&&(A=A.add(E[T][w-1]))}}return A}}function N(y){return(0,e.validateField)(y.Fp),(0,i.validateObject)(y,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(y.n,y.nBitLength),...y,p:y.Fp.ORDER})}return Ve}var Nr;function jn(){return Nr||(Nr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e.weierstrassPoints=q,e.weierstrass=z,e.SWUFpSqrtRatio=N,e.mapToCurveSimpleSWU=y;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i=Ii(),h=$t(),o=wt();function f(u){u.lowS!==void 0&&(0,o.abool)("lowS",u.lowS),u.prehash!==void 0&&(0,o.abool)("prehash",u.prehash)}function g(u){const m=(0,i.validateBasic)(u);(0,o.validateObject)(m,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:t,Fp:d,a:b}=m;if(t){if(!d.eql(b,d.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...m})}class l extends Error{constructor(m=""){super(m)}}e.DERErr=l,e.DER={Err:l,_tlv:{encode:(u,m)=>{const{Err:t}=e.DER;if(u<0||u>256)throw new t("tlv.encode: wrong tag");if(m.length&1)throw new t("tlv.encode: unpadded data");const d=m.length/2,b=(0,o.numberToHexUnpadded)(d);if(b.length/2&128)throw new t("tlv.encode: long form length too big");const _=d>127?(0,o.numberToHexUnpadded)(b.length/2|128):"";return(0,o.numberToHexUnpadded)(u)+_+b+m},decode(u,m){const{Err:t}=e.DER;let d=0;if(u<0||u>256)throw new t("tlv.encode: wrong tag");if(m.length<2||m[d++]!==u)throw new t("tlv.decode: wrong tlv");const b=m[d++],_=!!(b&128);let H=0;if(!_)H=b;else{const x=b&127;if(!x)throw new t("tlv.decode(long): indefinite length not supported");if(x>4)throw new t("tlv.decode(long): byte length is too big");const A=m.subarray(d,d+x);if(A.length!==x)throw new t("tlv.decode: length bytes not complete");if(A[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const p of A)H=H<<8|p;if(d+=x,H<128)throw new t("tlv.decode(long): not minimal encoding")}const E=m.subarray(d,d+H);if(E.length!==H)throw new t("tlv.decode: wrong value length");return{v:E,l:m.subarray(d+H)}}},_int:{encode(u){const{Err:m}=e.DER;if(u<O)throw new m("integer: negative integers are not allowed");let t=(0,o.numberToHexUnpadded)(u);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new m("unexpected DER parsing assertion: unpadded hex");return t},decode(u){const{Err:m}=e.DER;if(u[0]&128)throw new m("invalid signature integer: negative");if(u[0]===0&&!(u[1]&128))throw new m("invalid signature integer: unnecessary leading zero");return(0,o.bytesToNumberBE)(u)}},toSig(u){const{Err:m,_int:t,_tlv:d}=e.DER,b=(0,o.ensureBytes)("signature",u),{v:_,l:H}=d.decode(48,b);if(H.length)throw new m("invalid signature: left bytes after parsing");const{v:E,l:x}=d.decode(2,_),{v:A,l:p}=d.decode(2,x);if(p.length)throw new m("invalid signature: left bytes after parsing");return{r:t.decode(E),s:t.decode(A)}},hexFromSig(u){const{_tlv:m,_int:t}=e.DER,d=m.encode(2,t.encode(u.r)),b=m.encode(2,t.encode(u.s)),_=d+b;return m.encode(48,_)}};function B(u,m){return(0,o.bytesToHex)((0,o.numberToBytesBE)(u,m))}const O=BigInt(0),P=BigInt(1),L=BigInt(2),j=BigInt(3),k=BigInt(4);function q(u){const m=g(u),{Fp:t}=m,d=(0,h.Field)(m.n,m.nBitLength),b=m.toBytes||((s,c,S)=>{const M=c.toAffine();return(0,o.concatBytes)(Uint8Array.from([4]),t.toBytes(M.x),t.toBytes(M.y))}),_=m.fromBytes||(s=>{const c=s.subarray(1),S=t.fromBytes(c.subarray(0,t.BYTES)),M=t.fromBytes(c.subarray(t.BYTES,2*t.BYTES));return{x:S,y:M}});function H(s){const{a:c,b:S}=m,M=t.sqr(s),U=t.mul(M,s);return t.add(t.add(U,t.mul(s,c)),S)}function E(s,c){const S=t.sqr(c),M=H(s);return t.eql(S,M)}if(!E(m.Gx,m.Gy))throw new Error("bad curve params: generator point");const x=t.mul(t.pow(m.a,j),k),A=t.mul(t.sqr(m.b),BigInt(27));if(t.is0(t.add(x,A)))throw new Error("bad curve params: a or b");function p(s){return(0,o.inRange)(s,P,m.n)}function v(s){const{allowedPrivateKeyLengths:c,nByteLength:S,wrapPrivateKey:M,n:U}=m;if(c&&typeof s!="bigint"){if((0,o.isBytes)(s)&&(s=(0,o.bytesToHex)(s)),typeof s!="string"||!c.includes(s.length))throw new Error("invalid private key");s=s.padStart(S*2,"0")}let V;try{V=typeof s=="bigint"?s:(0,o.bytesToNumberBE)((0,o.ensureBytes)("private key",s,S))}catch{throw new Error("invalid private key, expected hex or "+S+" bytes, got "+typeof s)}return M&&(V=(0,h.mod)(V,U)),(0,o.aInRange)("private key",V,P,U),V}function T(s){if(!(s instanceof a))throw new Error("ProjectivePoint expected")}const $=(0,o.memoized)((s,c)=>{const{px:S,py:M,pz:U}=s;if(t.eql(U,t.ONE))return{x:S,y:M};const V=s.is0();c==null&&(c=V?t.ONE:t.inv(U));const D=t.mul(S,c),G=t.mul(M,c),W=t.mul(U,c);if(V)return{x:t.ZERO,y:t.ZERO};if(!t.eql(W,t.ONE))throw new Error("invZ was invalid");return{x:D,y:G}}),w=(0,o.memoized)(s=>{if(s.is0()){if(m.allowInfinityPoint&&!t.is0(s.py))return;throw new Error("bad point: ZERO")}const{x:c,y:S}=s.toAffine();if(!t.isValid(c)||!t.isValid(S))throw new Error("bad point: x or y not FE");if(!E(c,S))throw new Error("bad point: equation left != right");if(!s.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class a{constructor(c,S,M){if(c==null||!t.isValid(c))throw new Error("x required");if(S==null||!t.isValid(S)||t.is0(S))throw new Error("y required");if(M==null||!t.isValid(M))throw new Error("z required");this.px=c,this.py=S,this.pz=M,Object.freeze(this)}static fromAffine(c){const{x:S,y:M}=c||{};if(!c||!t.isValid(S)||!t.isValid(M))throw new Error("invalid affine point");if(c instanceof a)throw new Error("projective point not allowed");const U=V=>t.eql(V,t.ZERO);return U(S)&&U(M)?a.ZERO:new a(S,M,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(c){const S=(0,h.FpInvertBatch)(t,c.map(M=>M.pz));return c.map((M,U)=>M.toAffine(S[U])).map(a.fromAffine)}static fromHex(c){const S=a.fromAffine(_((0,o.ensureBytes)("pointHex",c)));return S.assertValidity(),S}static fromPrivateKey(c){return a.BASE.multiply(v(c))}static msm(c,S){return(0,i.pippenger)(a,d,c,S)}_setWindowSize(c){n.setWindowSize(this,c)}assertValidity(){w(this)}hasEvenY(){const{y:c}=this.toAffine();if(t.isOdd)return!t.isOdd(c);throw new Error("Field doesn't support isOdd")}equals(c){T(c);const{px:S,py:M,pz:U}=this,{px:V,py:D,pz:G}=c,W=t.eql(t.mul(S,G),t.mul(V,U)),Y=t.eql(t.mul(M,G),t.mul(D,U));return W&&Y}negate(){return new a(this.px,t.neg(this.py),this.pz)}double(){const{a:c,b:S}=m,M=t.mul(S,j),{px:U,py:V,pz:D}=this;let G=t.ZERO,W=t.ZERO,Y=t.ZERO,F=t.mul(U,U),se=t.mul(V,V),K=t.mul(D,D),Z=t.mul(U,V);return Z=t.add(Z,Z),Y=t.mul(U,D),Y=t.add(Y,Y),G=t.mul(c,Y),W=t.mul(M,K),W=t.add(G,W),G=t.sub(se,W),W=t.add(se,W),W=t.mul(G,W),G=t.mul(Z,G),Y=t.mul(M,Y),K=t.mul(c,K),Z=t.sub(F,K),Z=t.mul(c,Z),Z=t.add(Z,Y),Y=t.add(F,F),F=t.add(Y,F),F=t.add(F,K),F=t.mul(F,Z),W=t.add(W,F),K=t.mul(V,D),K=t.add(K,K),F=t.mul(K,Z),G=t.sub(G,F),Y=t.mul(K,se),Y=t.add(Y,Y),Y=t.add(Y,Y),new a(G,W,Y)}add(c){T(c);const{px:S,py:M,pz:U}=this,{px:V,py:D,pz:G}=c;let W=t.ZERO,Y=t.ZERO,F=t.ZERO;const se=m.a,K=t.mul(m.b,j);let Z=t.mul(S,V),X=t.mul(M,D),re=t.mul(U,G),Q=t.add(S,M),ee=t.add(V,D);Q=t.mul(Q,ee),ee=t.add(Z,X),Q=t.sub(Q,ee),ee=t.add(S,U);let ae=t.add(V,G);return ee=t.mul(ee,ae),ae=t.add(Z,re),ee=t.sub(ee,ae),ae=t.add(M,U),W=t.add(D,G),ae=t.mul(ae,W),W=t.add(X,re),ae=t.sub(ae,W),F=t.mul(se,ee),W=t.mul(K,re),F=t.add(W,F),W=t.sub(X,F),F=t.add(X,F),Y=t.mul(W,F),X=t.add(Z,Z),X=t.add(X,Z),re=t.mul(se,re),ee=t.mul(K,ee),X=t.add(X,re),re=t.sub(Z,re),re=t.mul(se,re),ee=t.add(ee,re),Z=t.mul(X,ee),Y=t.add(Y,Z),Z=t.mul(ae,ee),W=t.mul(Q,W),W=t.sub(W,Z),Z=t.mul(Q,X),F=t.mul(ae,F),F=t.add(F,Z),new a(W,Y,F)}subtract(c){return this.add(c.negate())}is0(){return this.equals(a.ZERO)}wNAF(c){return n.wNAFCached(this,c,a.normalizeZ)}multiplyUnsafe(c){const{endo:S,n:M}=m;(0,o.aInRange)("scalar",c,O,M);const U=a.ZERO;if(c===O)return U;if(this.is0()||c===P)return this;if(!S||n.hasPrecomputes(this))return n.wNAFCachedUnsafe(this,c,a.normalizeZ);let{k1neg:V,k1:D,k2neg:G,k2:W}=S.splitScalar(c),Y=U,F=U,se=this;for(;D>O||W>O;)D&P&&(Y=Y.add(se)),W&P&&(F=F.add(se)),se=se.double(),D>>=P,W>>=P;return V&&(Y=Y.negate()),G&&(F=F.negate()),F=new a(t.mul(F.px,S.beta),F.py,F.pz),Y.add(F)}multiply(c){const{endo:S,n:M}=m;(0,o.aInRange)("scalar",c,P,M);let U,V;if(S){const{k1neg:D,k1:G,k2neg:W,k2:Y}=S.splitScalar(c);let{p:F,f:se}=this.wNAF(G),{p:K,f:Z}=this.wNAF(Y);F=n.constTimeNegate(D,F),K=n.constTimeNegate(W,K),K=new a(t.mul(K.px,S.beta),K.py,K.pz),U=F.add(K),V=se.add(Z)}else{const{p:D,f:G}=this.wNAF(c);U=D,V=G}return a.normalizeZ([U,V])[0]}multiplyAndAddUnsafe(c,S,M){const U=a.BASE,V=(G,W)=>W===O||W===P||!G.equals(U)?G.multiplyUnsafe(W):G.multiply(W),D=V(this,S).add(V(c,M));return D.is0()?void 0:D}toAffine(c){return $(this,c)}isTorsionFree(){const{h:c,isTorsionFree:S}=m;if(c===P)return!0;if(S)return S(a,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:c,clearCofactor:S}=m;return c===P?this:S?S(a,this):this.multiplyUnsafe(m.h)}toRawBytes(c=!0){return(0,o.abool)("isCompressed",c),this.assertValidity(),b(a,this,c)}toHex(c=!0){return(0,o.abool)("isCompressed",c),(0,o.bytesToHex)(this.toRawBytes(c))}}a.BASE=new a(m.Gx,m.Gy,t.ONE),a.ZERO=new a(t.ZERO,t.ONE,t.ZERO);const{endo:I,nBitLength:r}=m,n=(0,i.wNAF)(a,I?Math.ceil(r/2):r);return{CURVE:m,ProjectivePoint:a,normPrivateKeyToScalar:v,weierstrassEquation:H,isWithinCurveOrder:p}}function C(u){const m=(0,i.validateBasic)(u);return(0,o.validateObject)(m,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...m})}function z(u){const m=C(u),{Fp:t,n:d,nByteLength:b,nBitLength:_}=m,H=t.BYTES+1,E=2*t.BYTES+1;function x(K){return(0,h.mod)(K,d)}function A(K){return(0,h.invert)(K,d)}const{ProjectivePoint:p,normPrivateKeyToScalar:v,weierstrassEquation:T,isWithinCurveOrder:$}=q({...m,toBytes(K,Z,X){const re=Z.toAffine(),Q=t.toBytes(re.x),ee=o.concatBytes;return(0,o.abool)("isCompressed",X),X?ee(Uint8Array.from([Z.hasEvenY()?2:3]),Q):ee(Uint8Array.from([4]),Q,t.toBytes(re.y))},fromBytes(K){const Z=K.length,X=K[0],re=K.subarray(1);if(Z===H&&(X===2||X===3)){const Q=(0,o.bytesToNumberBE)(re);if(!(0,o.inRange)(Q,P,t.ORDER))throw new Error("Point is not on curve");const ee=T(Q);let ae;try{ae=t.sqrt(ee)}catch(_e){const we=_e instanceof Error?": "+_e.message:"";throw new Error("Point is not on curve"+we)}const pe=(ae&P)===P;return(X&1)===1!==pe&&(ae=t.neg(ae)),{x:Q,y:ae}}else if(Z===E&&X===4){const Q=t.fromBytes(re.subarray(0,t.BYTES)),ee=t.fromBytes(re.subarray(t.BYTES,2*t.BYTES));return{x:Q,y:ee}}else{const Q=H,ee=E;throw new Error("invalid Point, expected length of "+Q+", or uncompressed "+ee+", got "+Z)}}});function w(K){const Z=d>>P;return K>Z}function a(K){return w(K)?x(-K):K}const I=(K,Z,X)=>(0,o.bytesToNumberBE)(K.slice(Z,X));class r{constructor(Z,X,re){(0,o.aInRange)("r",Z,P,d),(0,o.aInRange)("s",X,P,d),this.r=Z,this.s=X,re!=null&&(this.recovery=re),Object.freeze(this)}static fromCompact(Z){const X=b;return Z=(0,o.ensureBytes)("compactSignature",Z,X*2),new r(I(Z,0,X),I(Z,X,2*X))}static fromDER(Z){const{r:X,s:re}=e.DER.toSig((0,o.ensureBytes)("DER",Z));return new r(X,re)}assertValidity(){}addRecoveryBit(Z){return new r(this.r,this.s,Z)}recoverPublicKey(Z){const{r:X,s:re,recovery:Q}=this,ee=U((0,o.ensureBytes)("msgHash",Z));if(Q==null||![0,1,2,3].includes(Q))throw new Error("recovery id invalid");const ae=Q===2||Q===3?X+m.n:X;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const pe=Q&1?"03":"02",Ue=p.fromHex(pe+B(ae,t.BYTES)),_e=A(ae),we=x(-ee*_e),Ze=x(re*_e),Me=p.BASE.multiplyAndAddUnsafe(Ue,we,Ze);if(!Me)throw new Error("point at infinify");return Me.assertValidity(),Me}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new r(this.r,x(-this.s),this.recovery):this}toDERRawBytes(){return(0,o.hexToBytes)(this.toDERHex())}toDERHex(){return e.DER.hexFromSig(this)}toCompactRawBytes(){return(0,o.hexToBytes)(this.toCompactHex())}toCompactHex(){const Z=b;return B(this.r,Z)+B(this.s,Z)}}const n={isValidPrivateKey(K){try{return v(K),!0}catch{return!1}},normPrivateKeyToScalar:v,randomPrivateKey:()=>{const K=(0,h.getMinHashLength)(m.n);return(0,h.mapHashToField)(m.randomBytes(K),m.n)},precompute(K=8,Z=p.BASE){return Z._setWindowSize(K),Z.multiply(BigInt(3)),Z}};function s(K,Z=!0){return p.fromPrivateKey(K).toRawBytes(Z)}function c(K){if(typeof K=="bigint")return!1;if(K instanceof p)return!0;const X=(0,o.ensureBytes)("key",K).length,re=t.BYTES,Q=re+1,ee=2*re+1;if(!(m.allowedPrivateKeyLengths||b===Q))return X===Q||X===ee}function S(K,Z,X=!0){if(c(K)===!0)throw new Error("first arg must be private key");if(c(Z)===!1)throw new Error("second arg must be public key");return p.fromHex(Z).multiply(v(K)).toRawBytes(X)}const M=m.bits2int||function(K){if(K.length>8192)throw new Error("input is too large");const Z=(0,o.bytesToNumberBE)(K),X=K.length*8-_;return X>0?Z>>BigInt(X):Z},U=m.bits2int_modN||function(K){return x(M(K))},V=(0,o.bitMask)(_);function D(K){return(0,o.aInRange)("num < 2^"+_,K,O,V),(0,o.numberToBytesBE)(K,b)}function G(K,Z,X=W){if(["recovered","canonical"].some(ke=>ke in X))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:Q}=m;let{lowS:ee,prehash:ae,extraEntropy:pe}=X;ee==null&&(ee=!0),K=(0,o.ensureBytes)("msgHash",K),f(X),ae&&(K=(0,o.ensureBytes)("prehashed msgHash",re(K)));const Ue=U(K),_e=v(Z),we=[D(_e),D(Ue)];if(pe!=null&&pe!==!1){const ke=pe===!0?Q(t.BYTES):pe;we.push((0,o.ensureBytes)("extraEntropy",ke))}const Ze=(0,o.concatBytes)(...we),Me=Ue;function kt(ke){const We=M(ke);if(!$(We))return;const Nt=A(We),tt=p.BASE.multiply(We).toAffine(),Ne=x(tt.x);if(Ne===O)return;const rt=x(Nt*x(Me+Ne*_e));if(rt===O)return;let nt=(tt.x===Ne?0:2)|Number(tt.y&P),Fe=rt;return ee&&w(rt)&&(Fe=a(rt),nt^=1),new r(Ne,Fe,nt)}return{seed:Ze,k2sig:kt}}const W={lowS:m.lowS,prehash:!1},Y={lowS:m.lowS,prehash:!1};function F(K,Z,X=W){const{seed:re,k2sig:Q}=G(K,Z,X),ee=m;return(0,o.createHmacDrbg)(ee.hash.outputLen,ee.nByteLength,ee.hmac)(re,Q)}p.BASE._setWindowSize(8);function se(K,Z,X,re=Y){var nt;const Q=K;Z=(0,o.ensureBytes)("msgHash",Z),X=(0,o.ensureBytes)("publicKey",X);const{lowS:ee,prehash:ae,format:pe}=re;if(f(re),"strict"in re)throw new Error("options.strict was renamed to lowS");if(pe!==void 0&&pe!=="compact"&&pe!=="der")throw new Error("format must be compact or der");const Ue=typeof Q=="string"||(0,o.isBytes)(Q),_e=!Ue&&!pe&&typeof Q=="object"&&Q!==null&&typeof Q.r=="bigint"&&typeof Q.s=="bigint";if(!Ue&&!_e)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let we,Ze;try{if(_e&&(we=new r(Q.r,Q.s)),Ue){try{pe!=="compact"&&(we=r.fromDER(Q))}catch(Fe){if(!(Fe instanceof e.DER.Err))throw Fe}!we&&pe!=="der"&&(we=r.fromCompact(Q))}Ze=p.fromHex(X)}catch{return!1}if(!we||ee&&we.hasHighS())return!1;ae&&(Z=m.hash(Z));const{r:Me,s:kt}=we,ke=U(Z),We=A(kt),Nt=x(ke*We),tt=x(Me*We),Ne=(nt=p.BASE.multiplyAndAddUnsafe(Ze,Nt,tt))==null?void 0:nt.toAffine();return Ne?x(Ne.x)===Me:!1}return{CURVE:m,getPublicKey:s,getSharedSecret:S,sign:F,verify:se,ProjectivePoint:p,Signature:r,utils:n}}function N(u,m){const t=u.ORDER;let d=O;for(let w=t-P;w%L===O;w/=L)d+=P;const b=d,_=L<<b-P-P,H=_*L,E=(t-P)/H,x=(E-P)/L,A=H-P,p=_,v=u.pow(m,E),T=u.pow(m,(E+P)/L);let $=(w,a)=>{let I=v,r=u.pow(a,A),n=u.sqr(r);n=u.mul(n,a);let s=u.mul(w,n);s=u.pow(s,x),s=u.mul(s,r),r=u.mul(s,a),n=u.mul(s,w);let c=u.mul(n,r);s=u.pow(c,p);let S=u.eql(s,u.ONE);r=u.mul(n,T),s=u.mul(c,I),n=u.cmov(r,n,S),c=u.cmov(s,c,S);for(let M=b;M>P;M--){let U=M-L;U=L<<U-P;let V=u.pow(c,U);const D=u.eql(V,u.ONE);r=u.mul(n,I),I=u.mul(I,I),V=u.mul(c,I),n=u.cmov(r,n,D),c=u.cmov(V,c,D)}return{isValid:S,value:n}};if(u.ORDER%k===j){const w=(u.ORDER-j)/k,a=u.sqrt(u.neg(m));$=(I,r)=>{let n=u.sqr(r);const s=u.mul(I,r);n=u.mul(n,s);let c=u.pow(n,w);c=u.mul(c,s);const S=u.mul(c,a),M=u.mul(u.sqr(c),r),U=u.eql(M,I);let V=u.cmov(S,c,U);return{isValid:U,value:V}}}return $}function y(u,m){if((0,h.validateField)(u),!u.isValid(m.A)||!u.isValid(m.B)||!u.isValid(m.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const t=N(u,m.Z);if(!u.isOdd)throw new Error("Fp.isOdd is not implemented!");return d=>{let b,_,H,E,x,A,p,v;b=u.sqr(d),b=u.mul(b,m.Z),_=u.sqr(b),_=u.add(_,b),H=u.add(_,u.ONE),H=u.mul(H,m.B),E=u.cmov(m.Z,u.neg(_),!u.eql(_,u.ZERO)),E=u.mul(E,m.A),_=u.sqr(H),A=u.sqr(E),x=u.mul(A,m.A),_=u.add(_,x),_=u.mul(_,H),A=u.mul(A,E),x=u.mul(A,m.B),_=u.add(_,x),p=u.mul(b,H);const{isValid:T,value:$}=t(_,A);v=u.mul(b,d),v=u.mul(v,$),p=u.cmov(p,H,T),v=u.cmov(v,$,T);const w=u.isOdd(d)===u.isOdd(v);v=u.cmov(u.neg(v),v,w);const a=(0,h.FpInvertBatch)(u,[E],!0)[0];return p=u.mul(p,a),{x:p,y:v}}}}(Ft)),Ft}var Cr;function Bi(){if(Cr)return ut;Cr=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.getHash=o,ut.createCurve=f;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=Si(),i=qe(),h=jn();function o(g){return{hash:g,hmac:(l,...B)=>(0,e.hmac)(g,l,(0,i.concatBytes)(...B)),randomBytes:i.randomBytes}}function f(g,l){const B=O=>(0,h.weierstrass)({...g,...o(O)});return{...B(l),create:B}}return ut}var ze={},Vr;function _i(){if(Vr)return ze;Vr=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.expand_message_xmd=l,ze.expand_message_xof=B,ze.hash_to_field=O,ze.isogenyMap=P,ze.createHasher=L;const e=$t(),i=wt(),h=i.bytesToNumberBE;function o(j,k){if(g(j),g(k),j<0||j>=1<<8*k)throw new Error("invalid I2OSP input: "+j);const q=Array.from({length:k}).fill(0);for(let C=k-1;C>=0;C--)q[C]=j&255,j>>>=8;return new Uint8Array(q)}function f(j,k){const q=new Uint8Array(j.length);for(let C=0;C<j.length;C++)q[C]=j[C]^k[C];return q}function g(j){if(!Number.isSafeInteger(j))throw new Error("number expected")}function l(j,k,q,C){(0,i.abytes)(j),(0,i.abytes)(k),g(q),k.length>255&&(k=C((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),k)));const{outputLen:z,blockLen:N}=C,y=Math.ceil(q/z);if(q>65535||y>255)throw new Error("expand_message_xmd: invalid lenInBytes");const u=(0,i.concatBytes)(k,o(k.length,1)),m=o(0,N),t=o(q,2),d=new Array(y),b=C((0,i.concatBytes)(m,j,t,o(0,1),u));d[0]=C((0,i.concatBytes)(b,o(1,1),u));for(let H=1;H<=y;H++){const E=[f(b,d[H-1]),o(H+1,1),u];d[H]=C((0,i.concatBytes)(...E))}return(0,i.concatBytes)(...d).slice(0,q)}function B(j,k,q,C,z){if((0,i.abytes)(j),(0,i.abytes)(k),g(q),k.length>255){const N=Math.ceil(2*C/8);k=z.create({dkLen:N}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(k).digest()}if(q>65535||k.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return z.create({dkLen:q}).update(j).update(o(q,2)).update(k).update(o(k.length,1)).digest()}function O(j,k,q){(0,i.validateObject)(q,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:C,k:z,m:N,hash:y,expand:u,DST:m}=q;(0,i.abytes)(j),g(k);const t=typeof m=="string"?(0,i.utf8ToBytes)(m):m,d=C.toString(2).length,b=Math.ceil((d+z)/8),_=k*N*b;let H;if(u==="xmd")H=l(j,t,_,y);else if(u==="xof")H=B(j,t,_,z,y);else if(u==="_internal_pass")H=j;else throw new Error('expand must be "xmd" or "xof"');const E=new Array(k);for(let x=0;x<k;x++){const A=new Array(N);for(let p=0;p<N;p++){const v=b*(p+x*N),T=H.subarray(v,v+b);A[p]=(0,e.mod)(h(T),C)}E[x]=A}return E}function P(j,k){const q=k.map(C=>Array.from(C).reverse());return(C,z)=>{const[N,y,u,m]=q.map(b=>b.reduce((_,H)=>j.add(j.mul(_,C),H))),[t,d]=(0,e.FpInvertBatch)(j,[y,m],!0);return C=j.mul(N,t),z=j.mul(z,j.mul(u,d)),{x:C,y:z}}}function L(j,k,q){if(typeof k!="function")throw new Error("mapToCurve() must be defined");function C(N){return j.fromAffine(k(N))}function z(N){const y=N.clearCofactor();return y.equals(j.ZERO)?j.ZERO:(y.assertValidity(),y)}return{defaults:q,hashToCurve(N,y){const u=O(N,2,{...q,DST:q.DST,...y}),m=C(u[0]),t=C(u[1]);return z(m.add(t))},encodeToCurve(N,y){const u=O(N,1,{...q,DST:q.encodeDST,...y});return z(C(u[0]))},mapToCurve(N){if(!Array.isArray(N))throw new Error("expected array of bigints");for(const y of N)if(typeof y!="bigint")throw new Error("expected array of bigints");return z(C(N))}}}return ze}var Dr;function Tn(){return Dr||(Dr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const i=En(),h=qe(),o=Bi(),f=_i(),g=$t(),l=wt(),B=jn(),O=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),P=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),L=BigInt(0),j=BigInt(1),k=BigInt(2),q=(a,I)=>(a+I/k)/I;function C(a){const I=O,r=BigInt(3),n=BigInt(6),s=BigInt(11),c=BigInt(22),S=BigInt(23),M=BigInt(44),U=BigInt(88),V=a*a*a%I,D=V*V*a%I,G=(0,g.pow2)(D,r,I)*D%I,W=(0,g.pow2)(G,r,I)*D%I,Y=(0,g.pow2)(W,k,I)*V%I,F=(0,g.pow2)(Y,s,I)*Y%I,se=(0,g.pow2)(F,c,I)*F%I,K=(0,g.pow2)(se,M,I)*se%I,Z=(0,g.pow2)(K,U,I)*K%I,X=(0,g.pow2)(Z,M,I)*se%I,re=(0,g.pow2)(X,r,I)*D%I,Q=(0,g.pow2)(re,S,I)*F%I,ee=(0,g.pow2)(Q,n,I)*V%I,ae=(0,g.pow2)(ee,k,I);if(!z.eql(z.sqr(ae),a))throw new Error("Cannot find square root");return ae}const z=(0,g.Field)(O,void 0,void 0,{sqrt:C});e.secp256k1=(0,o.createCurve)({a:L,b:BigInt(7),Fp:z,n:P,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:a=>{const I=P,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-j*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),c=r,S=BigInt("0x100000000000000000000000000000000"),M=q(c*a,I),U=q(-n*a,I);let V=(0,g.mod)(a-M*r-U*s,I),D=(0,g.mod)(-M*n-U*c,I);const G=V>S,W=D>S;if(G&&(V=I-V),W&&(D=I-D),V>S||D>S)throw new Error("splitScalar: Endomorphism failed, k="+a);return{k1neg:G,k1:V,k2neg:W,k2:D}}}},i.sha256);const N={};function y(a,...I){let r=N[a];if(r===void 0){const n=(0,i.sha256)(Uint8Array.from(a,s=>s.charCodeAt(0)));r=(0,l.concatBytes)(n,n),N[a]=r}return(0,i.sha256)((0,l.concatBytes)(r,...I))}const u=a=>a.toRawBytes(!0).slice(1),m=a=>(0,l.numberToBytesBE)(a,32),t=a=>(0,g.mod)(a,O),d=a=>(0,g.mod)(a,P),b=(()=>e.secp256k1.ProjectivePoint)(),_=(a,I,r)=>b.BASE.multiplyAndAddUnsafe(a,I,r);function H(a){let I=e.secp256k1.utils.normPrivateKeyToScalar(a),r=b.fromPrivateKey(I);return{scalar:r.hasEvenY()?I:d(-I),bytes:u(r)}}function E(a){(0,l.aInRange)("x",a,j,O);const I=t(a*a),r=t(I*a+BigInt(7));let n=C(r);n%k!==L&&(n=t(-n));const s=new b(a,n,j);return s.assertValidity(),s}const x=l.bytesToNumberBE;function A(...a){return d(x(y("BIP0340/challenge",...a)))}function p(a){return H(a).bytes}function v(a,I,r=(0,h.randomBytes)(32)){const n=(0,l.ensureBytes)("message",a),{bytes:s,scalar:c}=H(I),S=(0,l.ensureBytes)("auxRand",r,32),M=m(c^x(y("BIP0340/aux",S))),U=y("BIP0340/nonce",M,s,n),V=d(x(U));if(V===L)throw new Error("sign failed: k is zero");const{bytes:D,scalar:G}=H(V),W=A(D,s,n),Y=new Uint8Array(64);if(Y.set(D,0),Y.set(m(d(G+W*c)),32),!T(Y,n,s))throw new Error("sign: Invalid signature produced");return Y}function T(a,I,r){const n=(0,l.ensureBytes)("signature",a,64),s=(0,l.ensureBytes)("message",I),c=(0,l.ensureBytes)("publicKey",r,32);try{const S=E(x(c)),M=x(n.subarray(0,32));if(!(0,l.inRange)(M,j,O))return!1;const U=x(n.subarray(32,64));if(!(0,l.inRange)(U,j,P))return!1;const V=A(m(M),u(S),s),D=_(S,U,d(-V));return!(!D||!D.hasEvenY()||D.toAffine().x!==M)}catch{return!1}}e.schnorr=(()=>({getPublicKey:p,sign:v,verify:T,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:E,pointToBytes:u,numberToBytesBE:l.numberToBytesBE,bytesToNumberBE:l.bytesToNumberBE,taggedHash:y,mod:g.mod}}))();const $=(()=>(0,f.isogenyMap)(z,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(a=>a.map(I=>BigInt(I)))))(),w=(()=>(0,B.mapToCurveSimpleSWU)(z,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:z.create(BigInt("-11"))}))();e.secp256k1_hasher=(()=>(0,f.createHasher)(e.secp256k1.ProjectivePoint,a=>{const{x:I,y:r}=w(z.create(a[0]));return $(I,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:z.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256}))(),e.hashToCurve=(()=>e.secp256k1_hasher.hashToCurve)(),e.encodeToCurve=(()=>e.secp256k1_hasher.encodeToCurve)()}(Wt)),Wt}var ft={},Gt={},de={},xe={},ne={};const Ln=Cn(Ei);var dt={},Ye={},lt={},Kr;function Ai(){return Kr||(Kr=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.version=void 0,lt.version="0.1.1"),lt}var Zr;function Pi(){if(Zr)return Ye;Zr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.getUrl=i,Ye.getVersion=h,Ye.prettyPrint=o;const e=Ai();function i(f){return f}function h(){return e.version}function o(f){if(!f)return"";const g=Object.entries(f).map(([B,O])=>O===void 0||O===!1?null:[B,O]).filter(Boolean),l=g.reduce((B,[O])=>Math.max(B,O.length),0);return g.map(([B,O])=>` ${`${B}:`.padEnd(l+1)} ${O}`).join(`
|
|
3
|
+
`)}return Ye}var Wr;function Pe(){if(Wr)return dt;Wr=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.BaseError=void 0;const e=Pi();class i extends Error{static setStaticOptions(f){i.prototype.docsOrigin=f.docsOrigin,i.prototype.showVersion=f.showVersion,i.prototype.version=f.version}constructor(f,g={}){const l=(()=>{var q;if(g.cause instanceof i){if(g.cause.details)return g.cause.details;if(g.cause.shortMessage)return g.cause.shortMessage}return g.cause&&"details"in g.cause&&typeof g.cause.details=="string"?g.cause.details:(q=g.cause)!=null&&q.message?g.cause.message:g.details})(),B=(()=>g.cause instanceof i&&g.cause.docsPath||g.docsPath)(),O=g.docsOrigin??i.prototype.docsOrigin,P=`${O}${B??""}`,L=!!(g.version??i.prototype.showVersion),j=g.version??i.prototype.version,k=[f||"An error occurred.",...g.metaMessages?["",...g.metaMessages]:[],...l||B||L?["",l?`Details: ${l}`:void 0,B?`See: ${P}`:void 0,L?`Version: ${j}`:void 0]:[]].filter(q=>typeof q=="string").join(`
|
|
4
|
+
`);super(k,g.cause?{cause:g.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=g.cause,this.details=l,this.docs=P,this.docsOrigin=O,this.docsPath=B,this.shortMessage=f,this.showVersion=L,this.version=j}walk(f){return h(this,f)}}dt.BaseError=i,Object.defineProperty(i,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${(0,e.getVersion)()}`}}),i.setStaticOptions(i.defaultStaticOptions);function h(o,f){return f!=null&&f(o)?o:o&&typeof o=="object"&&"cause"in o&&o.cause?h(o.cause,f):f?null:o}return dt}var te={},Yt={},Fr;function Mn(){return Fr||(Fr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeMap=void 0,e.assertSize=h,e.assertStartOffset=o,e.assertEndOffset=f,e.charCodeToBase16=g,e.pad=l,e.trim=B;const i=Re();function h(O,P){if(i.size(O)>P)throw new i.SizeOverflowError({givenSize:i.size(O),maxSize:P})}function o(O,P){if(typeof P=="number"&&P>0&&P>i.size(O)-1)throw new i.SliceOffsetOutOfBoundsError({offset:P,position:"start",size:i.size(O)})}function f(O,P,L){if(typeof P=="number"&&typeof L=="number"&&i.size(O)!==L-P)throw new i.SliceOffsetOutOfBoundsError({offset:L,position:"end",size:i.size(O)})}e.charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(O){if(O>=e.charCodeMap.zero&&O<=e.charCodeMap.nine)return O-e.charCodeMap.zero;if(O>=e.charCodeMap.A&&O<=e.charCodeMap.F)return O-(e.charCodeMap.A-10);if(O>=e.charCodeMap.a&&O<=e.charCodeMap.f)return O-(e.charCodeMap.a-10)}function l(O,P={}){const{dir:L,size:j=32}=P;if(j===0)return O;if(O.length>j)throw new i.SizeExceedsPaddingSizeError({size:O.length,targetSize:j,type:"Bytes"});const k=new Uint8Array(j);for(let q=0;q<j;q++){const C=L==="right";k[C?q:j-q-1]=O[C?q:O.length-q-1]}return k}function B(O,P={}){const{dir:L="left"}=P;let j=O,k=0;for(let q=0;q<j.length-1&&j[L==="left"?q:j.length-q-1].toString()==="0";q++)k++;return j=L==="left"?j.slice(k):j.slice(0,j.length-k),j}}(Yt)),Yt}var $e={},Gr;function zn(){if(Gr)return $e;Gr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.assertSize=i,$e.assertStartOffset=h,$e.assertEndOffset=o,$e.pad=f,$e.trim=g;const e=Se();function i(l,B){if(e.size(l)>B)throw new e.SizeOverflowError({givenSize:e.size(l),maxSize:B})}function h(l,B){if(typeof B=="number"&&B>0&&B>e.size(l)-1)throw new e.SliceOffsetOutOfBoundsError({offset:B,position:"start",size:e.size(l)})}function o(l,B,O){if(typeof B=="number"&&typeof O=="number"&&e.size(l)!==O-B)throw new e.SliceOffsetOutOfBoundsError({offset:O,position:"end",size:e.size(l)})}function f(l,B={}){const{dir:O,size:P=32}=B;if(P===0)return l;const L=l.replace("0x","");if(L.length>P*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(L.length/2),targetSize:P,type:"Hex"});return`0x${L[O==="right"?"padEnd":"padStart"](P*2,"0")}`}function g(l,B={}){const{dir:O="left"}=B;let P=l.replace("0x",""),L=0;for(let j=0;j<P.length-1&&P[O==="left"?j:P.length-j-1].toString()==="0";j++)L++;return P=O==="left"?P.slice(L):P.slice(0,P.length-L),P==="0"?"0x":O==="right"&&P.length%2===1?`0x${P}0`:`0x${P}`}return $e}var ht={},Yr;function qt(){if(Yr)return ht;Yr=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.parse=i,ht.stringify=h;const e="#__bigint";function i(o,f){return JSON.parse(o,(g,l)=>{const B=l;return typeof B=="string"&&B.endsWith(e)?BigInt(B.slice(0,-e.length)):typeof f=="function"?f(g,B):B})}function h(o,f,g){return JSON.stringify(o,(l,B)=>typeof f=="function"?f(l,B):typeof B=="bigint"?B.toString()+e:B,g)}return ht}var Xr;function Se(){if(Xr)return te;Xr=1,Object.defineProperty(te,"__esModule",{value:!0}),te.SizeExceedsPaddingSizeError=te.SliceOffsetOutOfBoundsError=te.SizeOverflowError=te.InvalidLengthError=te.InvalidHexValueError=te.InvalidHexTypeError=te.InvalidHexBooleanError=te.IntegerOutOfRangeError=void 0,te.assert=O,te.concat=P,te.from=L,te.fromBoolean=j,te.fromBytes=k,te.fromNumber=q,te.fromString=C,te.isEqual=z,te.padLeft=N,te.padRight=y,te.random=u,te.slice=m,te.size=t,te.trimLeft=d,te.trimRight=b,te.toBigInt=_,te.toBoolean=H,te.toBytes=E,te.toNumber=x,te.toString=A,te.validate=p;const e=Ln,i=Re(),h=Pe(),o=Mn(),f=zn(),g=qt(),l=new TextEncoder,B=Array.from({length:256},(s,c)=>c.toString(16).padStart(2,"0"));function O(s,c={}){const{strict:S=!1}=c;if(!s)throw new $(s);if(typeof s!="string")throw new $(s);if(S&&!/^0x[0-9a-fA-F]*$/.test(s))throw new w(s);if(!s.startsWith("0x"))throw new w(s)}function P(...s){return`0x${s.reduce((c,S)=>c+S.replace("0x",""),"")}`}function L(s){return s instanceof Uint8Array?k(s):Array.isArray(s)?k(new Uint8Array(s)):s}function j(s,c={}){const S=`0x${Number(s)}`;return typeof c.size=="number"?(f.assertSize(S,c.size),N(S,c.size)):S}function k(s,c={}){let S="";for(let U=0;U<s.length;U++)S+=B[s[U]];const M=`0x${S}`;return typeof c.size=="number"?(f.assertSize(M,c.size),y(M,c.size)):M}function q(s,c={}){const{signed:S,size:M}=c,U=BigInt(s);let V;M?S?V=(1n<<BigInt(M)*8n-1n)-1n:V=2n**(BigInt(M)*8n)-1n:typeof s=="number"&&(V=BigInt(Number.MAX_SAFE_INTEGER));const D=typeof V=="bigint"&&S?-V-1n:0;if(V&&U>V||U<D){const Y=typeof s=="bigint"?"n":"";throw new v({max:V?`${V}${Y}`:void 0,min:`${D}${Y}`,signed:S,size:M,value:`${s}${Y}`})}const W=`0x${(S&&U<0?BigInt.asUintN(M*8,BigInt(U)):U).toString(16)}`;return M?N(W,M):W}function C(s,c={}){return k(l.encode(s),c)}function z(s,c){return(0,e.equalBytes)(i.fromHex(s),i.fromHex(c))}function N(s,c){return f.pad(s,{dir:"left",size:c})}function y(s,c){return f.pad(s,{dir:"right",size:c})}function u(s){return k(i.random(s))}function m(s,c,S,M={}){const{strict:U}=M;f.assertStartOffset(s,c);const V=`0x${s.replace("0x","").slice((c??0)*2,(S??s.length)*2)}`;return U&&f.assertEndOffset(V,c,S),V}function t(s){return Math.ceil((s.length-2)/2)}function d(s){return f.trim(s,{dir:"left"})}function b(s){return f.trim(s,{dir:"right"})}function _(s,c={}){const{signed:S}=c;c.size&&f.assertSize(s,c.size);const M=BigInt(s);if(!S)return M;const U=(s.length-2)/2,V=(1n<<BigInt(U)*8n)-1n,D=V>>1n;return M<=D?M:M-V-1n}function H(s,c={}){c.size&&f.assertSize(s,c.size);const S=d(s);if(S==="0x")return!1;if(S==="0x1")return!0;throw new T(s)}function E(s,c={}){return i.fromHex(s,c)}function x(s,c={}){const{signed:S,size:M}=c;return Number(!S&&!M?s:_(s,c))}function A(s,c={}){const{size:S}=c;let M=i.fromHex(s);return S&&(o.assertSize(M,S),M=i.trimRight(M)),new TextDecoder().decode(M)}function p(s,c={}){const{strict:S=!1}=c;try{return O(s,{strict:S}),!0}catch{return!1}}class v extends h.BaseError{constructor({max:c,min:S,signed:M,size:U,value:V}){super(`Number \`${V}\` is not in safe${U?` ${U*8}-bit`:""}${M?" signed":" unsigned"} integer range ${c?`(\`${S}\` to \`${c}\`)`:`(above \`${S}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}te.IntegerOutOfRangeError=v;class T extends h.BaseError{constructor(c){super(`Hex value \`"${c}"\` is not a valid boolean.`,{metaMessages:['The hex value must be `"0x0"` (false) or `"0x1"` (true).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexBooleanError"})}}te.InvalidHexBooleanError=T;class $ extends h.BaseError{constructor(c){super(`Value \`${typeof c=="object"?g.stringify(c):c}\` of type \`${typeof c}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}te.InvalidHexTypeError=$;class w extends h.BaseError{constructor(c){super(`Value \`${c}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}te.InvalidHexValueError=w;class a extends h.BaseError{constructor(c){super(`Hex value \`"${c}"\` is an odd length (${c.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}te.InvalidLengthError=a;class I extends h.BaseError{constructor({givenSize:c,maxSize:S}){super(`Size cannot exceed \`${S}\` bytes. Given size: \`${c}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}te.SizeOverflowError=I;class r extends h.BaseError{constructor({offset:c,position:S,size:M}){super(`Slice ${S==="start"?"starting":"ending"} at offset \`${c}\` is out-of-bounds (size: \`${M}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}te.SliceOffsetOutOfBoundsError=r;class n extends h.BaseError{constructor({size:c,targetSize:S,type:M}){super(`${M.charAt(0).toUpperCase()}${M.slice(1).toLowerCase()} size (\`${c}\`) exceeds padding size (\`${S}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}return te.SizeExceedsPaddingSizeError=n,te}var Jr;function Re(){if(Jr)return ne;Jr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.SizeExceedsPaddingSizeError=ne.SliceOffsetOutOfBoundsError=ne.SizeOverflowError=ne.InvalidBytesTypeError=ne.InvalidBytesBooleanError=void 0,ne.assert=O,ne.concat=P,ne.from=L,ne.fromArray=j,ne.fromBoolean=k,ne.fromHex=q,ne.fromNumber=C,ne.fromString=z,ne.isEqual=N,ne.padLeft=y,ne.padRight=u,ne.random=m,ne.size=t,ne.slice=d,ne.toBigInt=b,ne.toBoolean=_,ne.toHex=H,ne.toNumber=E,ne.toString=x,ne.trimLeft=A,ne.trimRight=p,ne.validate=v;const e=Ln,i=Pe(),h=Se(),o=Mn(),f=zn(),g=qt(),l=new TextDecoder,B=new TextEncoder;function O(r){if(!(r instanceof Uint8Array)){if(!r)throw new $(r);if(typeof r!="object")throw new $(r);if(!("BYTES_PER_ELEMENT"in r))throw new $(r);if(r.BYTES_PER_ELEMENT!==1||r.constructor.name!=="Uint8Array")throw new $(r)}}function P(...r){let n=0;for(const c of r)n+=c.length;const s=new Uint8Array(n);for(let c=0,S=0;c<r.length;c++){const M=r[c];s.set(M,S),S+=M.length}return s}function L(r){return r instanceof Uint8Array?r:typeof r=="string"?q(r):j(r)}function j(r){return r instanceof Uint8Array?r:new Uint8Array(r)}function k(r,n={}){const{size:s}=n,c=new Uint8Array(1);return c[0]=Number(r),typeof s=="number"?(o.assertSize(c,s),y(c,s)):c}function q(r,n={}){const{size:s}=n;let c=r;s&&(f.assertSize(r,s),c=h.padRight(r,s));let S=c.slice(2);S.length%2&&(S=`0${S}`);const M=S.length/2,U=new Uint8Array(M);for(let V=0,D=0;V<M;V++){const G=o.charCodeToBase16(S.charCodeAt(D++)),W=o.charCodeToBase16(S.charCodeAt(D++));if(G===void 0||W===void 0)throw new i.BaseError(`Invalid byte sequence ("${S[D-2]}${S[D-1]}" in "${S}").`);U[V]=G<<4|W}return U}function C(r,n){const s=h.fromNumber(r,n);return q(s)}function z(r,n={}){const{size:s}=n,c=B.encode(r);return typeof s=="number"?(o.assertSize(c,s),u(c,s)):c}function N(r,n){return(0,e.equalBytes)(r,n)}function y(r,n){return o.pad(r,{dir:"left",size:n})}function u(r,n){return o.pad(r,{dir:"right",size:n})}function m(r){return crypto.getRandomValues(new Uint8Array(r))}function t(r){return r.length}function d(r,n,s,c={}){const{strict:S}=c;o.assertStartOffset(r,n);const M=r.slice(n,s);return S&&o.assertEndOffset(M,n,s),M}function b(r,n={}){const{size:s}=n;typeof s<"u"&&o.assertSize(r,s);const c=h.fromBytes(r,n);return h.toBigInt(c,n)}function _(r,n={}){const{size:s}=n;let c=r;if(typeof s<"u"&&(o.assertSize(c,s),c=A(c)),c.length>1||c[0]>1)throw new T(c);return!!c[0]}function H(r,n={}){return h.fromBytes(r,n)}function E(r,n={}){const{size:s}=n;typeof s<"u"&&o.assertSize(r,s);const c=h.fromBytes(r,n);return h.toNumber(c,n)}function x(r,n={}){const{size:s}=n;let c=r;return typeof s<"u"&&(o.assertSize(c,s),c=p(c)),l.decode(c)}function A(r){return o.trim(r,{dir:"left"})}function p(r){return o.trim(r,{dir:"right"})}function v(r){try{return O(r),!0}catch{return!1}}class T extends i.BaseError{constructor(n){super(`Bytes value \`${n}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}ne.InvalidBytesBooleanError=T;class $ extends i.BaseError{constructor(n){super(`Value \`${typeof n=="object"?g.stringify(n):n}\` of type \`${typeof n}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}ne.InvalidBytesTypeError=$;class w extends i.BaseError{constructor({givenSize:n,maxSize:s}){super(`Size cannot exceed \`${s}\` bytes. Given size: \`${n}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}ne.SizeOverflowError=w;class a extends i.BaseError{constructor({offset:n,position:s,size:c}){super(`Slice ${s==="start"?"starting":"ending"} at offset \`${n}\` is out-of-bounds (size: \`${c}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}ne.SliceOffsetOutOfBoundsError=a;class I extends i.BaseError{constructor({size:n,targetSize:s,type:c}){super(`${c.charAt(0).toUpperCase()}${c.slice(1).toLowerCase()} size (\`${n}\`) exceeds padding size (\`${s}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}return ne.SizeExceedsPaddingSizeError=I,ne}var Xe={},mt={},Qr;function Oi(){if(Qr)return mt;Qr=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.LruMap=void 0;class e extends Map{constructor(h){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=h}get(h){const o=super.get(h);return super.has(h)&&o!==void 0&&(this.delete(h),super.set(h,o)),o}set(h,o){if(super.set(h,o),this.maxSize&&this.size>this.maxSize){const f=this.keys().next().value;f&&this.delete(f)}return this}}return mt.LruMap=e,mt}var en;function Hi(){if(en)return Xe;en=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.checksum=void 0,Xe.clear=h;const e=Oi(),i={checksum:new e.LruMap(8192)};Xe.checksum=i.checksum;function h(){for(const o of Object.values(i))o.clear()}return Xe}var De={},tn;function $n(){if(tn)return De;tn=1,Object.defineProperty(De,"__esModule",{value:!0}),De.keccak256=g,De.ripemd160=l,De.sha256=B,De.validate=O;const e=ri(),i=Kn(),h=Dn(),o=Re(),f=Se();function g(P,L={}){const{as:j=typeof P=="string"?"Hex":"Bytes"}=L,k=(0,i.keccak_256)(o.from(P));return j==="Bytes"?k:f.fromBytes(k)}function l(P,L={}){const{as:j=typeof P=="string"?"Hex":"Bytes"}=L,k=(0,e.ripemd160)(o.from(P));return j==="Bytes"?k:f.fromBytes(k)}function B(P,L={}){const{as:j=typeof P=="string"?"Hex":"Bytes"}=L,k=(0,h.sha256)(o.from(P));return j==="Bytes"?k:f.fromBytes(k)}function O(P){return f.validate(P)&&f.size(P)===32}return De}var me={},rn;function qn(){if(rn)return me;rn=1,Object.defineProperty(me,"__esModule",{value:!0}),me.InvalidSerializedSizeError=me.InvalidUncompressedPrefixError=me.InvalidCompressedPrefixError=me.InvalidPrefixError=me.InvalidError=void 0,me.assert=f,me.compress=g,me.from=l,me.fromBytes=B,me.fromHex=O,me.toBytes=P,me.toHex=L,me.validate=j;const e=Re(),i=Pe(),h=Se(),o=qt();function f(y,u={}){const{compressed:m}=u,{prefix:t,x:d,y:b}=y;if(m===!1||typeof d=="bigint"&&typeof b=="bigint"){if(t!==4)throw new q({prefix:t,cause:new z});return}if(m===!0||typeof d=="bigint"&&typeof b>"u"){if(t!==3&&t!==2)throw new q({prefix:t,cause:new C});return}throw new k({publicKey:y})}function g(y){const{x:u,y:m}=y;return{prefix:m%2n===0n?2:3,x:u}}function l(y){const u=(()=>{if(h.validate(y))return O(y);if(e.validate(y))return B(y);const{prefix:m,x:t,y:d}=y;return typeof t=="bigint"&&typeof d=="bigint"?{prefix:m??4,x:t,y:d}:{prefix:m,x:t}})();return f(u),u}function B(y){return O(h.fromBytes(y))}function O(y){if(y.length!==132&&y.length!==130&&y.length!==68)throw new N({publicKey:y});if(y.length===130){const t=BigInt(h.slice(y,0,32)),d=BigInt(h.slice(y,32,64));return{prefix:4,x:t,y:d}}if(y.length===132){const t=Number(h.slice(y,0,1)),d=BigInt(h.slice(y,1,33)),b=BigInt(h.slice(y,33,65));return{prefix:t,x:d,y:b}}const u=Number(h.slice(y,0,1)),m=BigInt(h.slice(y,1,33));return{prefix:u,x:m}}function P(y,u={}){return e.fromHex(L(y,u))}function L(y,u={}){f(y);const{prefix:m,x:t,y:d}=y,{includePrefix:b=!0}=u;return h.concat(b?h.fromNumber(m,{size:1}):"0x",h.fromNumber(t,{size:32}),typeof d=="bigint"?h.fromNumber(d,{size:32}):"0x")}function j(y,u={}){try{return f(y,u),!0}catch{return!1}}class k extends i.BaseError{constructor({publicKey:u}){super(`Value \`${o.stringify(u)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}me.InvalidError=k;class q extends i.BaseError{constructor({prefix:u,cause:m}){super(`Prefix "${u}" is invalid.`,{cause:m}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}me.InvalidPrefixError=q;class C extends i.BaseError{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}me.InvalidCompressedPrefixError=C;class z extends i.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}me.InvalidUncompressedPrefixError=z;class N extends i.BaseError{constructor({publicKey:u}){super(`Value \`${u}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${h.size(h.from(u))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}return me.InvalidSerializedSizeError=N,me}var nn;function tr(){if(nn)return xe;nn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.InvalidChecksumError=xe.InvalidInputError=xe.InvalidAddressError=void 0,xe.assert=l,xe.checksum=B,xe.from=O,xe.fromPublicKey=P,xe.isEqual=L,xe.validate=j;const e=Re(),i=Hi(),h=Pe(),o=$n(),f=qn(),g=/^0x[a-fA-F0-9]{40}$/;function l(z,N={}){const{strict:y=!0}=N;if(!g.test(z))throw new k({address:z,cause:new q});if(y){if(z.toLowerCase()===z)return;if(B(z)!==z)throw new k({address:z,cause:new C})}}function B(z){if(i.checksum.has(z))return i.checksum.get(z);l(z,{strict:!1});const N=z.substring(2).toLowerCase(),y=o.keccak256(e.fromString(N),{as:"Bytes"}),u=N.split("");for(let t=0;t<40;t+=2)y[t>>1]>>4>=8&&u[t]&&(u[t]=u[t].toUpperCase()),(y[t>>1]&15)>=8&&u[t+1]&&(u[t+1]=u[t+1].toUpperCase());const m=`0x${u.join("")}`;return i.checksum.set(z,m),m}function O(z,N={}){const{checksum:y=!1}=N;return l(z),y?B(z):z}function P(z,N={}){const y=o.keccak256(`0x${f.toHex(z).slice(4)}`).substring(26);return O(`0x${y}`,N)}function L(z,N){return l(z,{strict:!1}),l(N,{strict:!1}),z.toLowerCase()===N.toLowerCase()}function j(z,N={}){const{strict:y=!0}=N??{};try{return l(z,{strict:y}),!0}catch{return!1}}class k extends h.BaseError{constructor({address:N,cause:y}){super(`Address "${N}" is invalid.`,{cause:y}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}xe.InvalidAddressError=k;class q extends h.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}xe.InvalidInputError=q;class C extends h.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}return xe.InvalidChecksumError=C,xe}var le={},R={},sn;function rr(){return sn||(sn=1,Object.defineProperty(R,"__esModule",{value:!0}),R.minInt120=R.minInt112=R.minInt104=R.minInt96=R.minInt88=R.minInt80=R.minInt72=R.minInt64=R.minInt56=R.minInt48=R.minInt40=R.minInt32=R.minInt24=R.minInt16=R.minInt8=R.maxInt256=R.maxInt248=R.maxInt240=R.maxInt232=R.maxInt224=R.maxInt216=R.maxInt208=R.maxInt200=R.maxInt192=R.maxInt184=R.maxInt176=R.maxInt168=R.maxInt160=R.maxInt152=R.maxInt144=R.maxInt136=R.maxInt128=R.maxInt120=R.maxInt112=R.maxInt104=R.maxInt96=R.maxInt88=R.maxInt80=R.maxInt72=R.maxInt64=R.maxInt56=R.maxInt48=R.maxInt40=R.maxInt32=R.maxInt24=R.maxInt16=R.maxInt8=R.integerRegex=R.bytesRegex=R.arrayRegex=void 0,R.maxUint256=R.maxUint248=R.maxUint240=R.maxUint232=R.maxUint224=R.maxUint216=R.maxUint208=R.maxUint200=R.maxUint192=R.maxUint184=R.maxUint176=R.maxUint168=R.maxUint160=R.maxUint152=R.maxUint144=R.maxUint136=R.maxUint128=R.maxUint120=R.maxUint112=R.maxUint104=R.maxUint96=R.maxUint88=R.maxUint80=R.maxUint72=R.maxUint64=R.maxUint56=R.maxUint48=R.maxUint40=R.maxUint32=R.maxUint24=R.maxUint16=R.maxUint8=R.minInt256=R.minInt248=R.minInt240=R.minInt232=R.minInt224=R.minInt216=R.minInt208=R.minInt200=R.minInt192=R.minInt184=R.minInt176=R.minInt168=R.minInt160=R.minInt152=R.minInt144=R.minInt136=R.minInt128=void 0,R.arrayRegex=/^(.*)\[([0-9]*)\]$/,R.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,R.integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,R.maxInt8=2n**(8n-1n)-1n,R.maxInt16=2n**(16n-1n)-1n,R.maxInt24=2n**(24n-1n)-1n,R.maxInt32=2n**(32n-1n)-1n,R.maxInt40=2n**(40n-1n)-1n,R.maxInt48=2n**(48n-1n)-1n,R.maxInt56=2n**(56n-1n)-1n,R.maxInt64=2n**(64n-1n)-1n,R.maxInt72=2n**(72n-1n)-1n,R.maxInt80=2n**(80n-1n)-1n,R.maxInt88=2n**(88n-1n)-1n,R.maxInt96=2n**(96n-1n)-1n,R.maxInt104=2n**(104n-1n)-1n,R.maxInt112=2n**(112n-1n)-1n,R.maxInt120=2n**(120n-1n)-1n,R.maxInt128=2n**(128n-1n)-1n,R.maxInt136=2n**(136n-1n)-1n,R.maxInt144=2n**(144n-1n)-1n,R.maxInt152=2n**(152n-1n)-1n,R.maxInt160=2n**(160n-1n)-1n,R.maxInt168=2n**(168n-1n)-1n,R.maxInt176=2n**(176n-1n)-1n,R.maxInt184=2n**(184n-1n)-1n,R.maxInt192=2n**(192n-1n)-1n,R.maxInt200=2n**(200n-1n)-1n,R.maxInt208=2n**(208n-1n)-1n,R.maxInt216=2n**(216n-1n)-1n,R.maxInt224=2n**(224n-1n)-1n,R.maxInt232=2n**(232n-1n)-1n,R.maxInt240=2n**(240n-1n)-1n,R.maxInt248=2n**(248n-1n)-1n,R.maxInt256=2n**(256n-1n)-1n,R.minInt8=-(2n**(8n-1n)),R.minInt16=-(2n**(16n-1n)),R.minInt24=-(2n**(24n-1n)),R.minInt32=-(2n**(32n-1n)),R.minInt40=-(2n**(40n-1n)),R.minInt48=-(2n**(48n-1n)),R.minInt56=-(2n**(56n-1n)),R.minInt64=-(2n**(64n-1n)),R.minInt72=-(2n**(72n-1n)),R.minInt80=-(2n**(80n-1n)),R.minInt88=-(2n**(88n-1n)),R.minInt96=-(2n**(96n-1n)),R.minInt104=-(2n**(104n-1n)),R.minInt112=-(2n**(112n-1n)),R.minInt120=-(2n**(120n-1n)),R.minInt128=-(2n**(128n-1n)),R.minInt136=-(2n**(136n-1n)),R.minInt144=-(2n**(144n-1n)),R.minInt152=-(2n**(152n-1n)),R.minInt160=-(2n**(160n-1n)),R.minInt168=-(2n**(168n-1n)),R.minInt176=-(2n**(176n-1n)),R.minInt184=-(2n**(184n-1n)),R.minInt192=-(2n**(192n-1n)),R.minInt200=-(2n**(200n-1n)),R.minInt208=-(2n**(208n-1n)),R.minInt216=-(2n**(216n-1n)),R.minInt224=-(2n**(224n-1n)),R.minInt232=-(2n**(232n-1n)),R.minInt240=-(2n**(240n-1n)),R.minInt248=-(2n**(248n-1n)),R.minInt256=-(2n**(256n-1n)),R.maxUint8=2n**8n-1n,R.maxUint16=2n**16n-1n,R.maxUint24=2n**24n-1n,R.maxUint32=2n**32n-1n,R.maxUint40=2n**40n-1n,R.maxUint48=2n**48n-1n,R.maxUint56=2n**56n-1n,R.maxUint64=2n**64n-1n,R.maxUint72=2n**72n-1n,R.maxUint80=2n**80n-1n,R.maxUint88=2n**88n-1n,R.maxUint96=2n**96n-1n,R.maxUint104=2n**104n-1n,R.maxUint112=2n**112n-1n,R.maxUint120=2n**120n-1n,R.maxUint128=2n**128n-1n,R.maxUint136=2n**136n-1n,R.maxUint144=2n**144n-1n,R.maxUint152=2n**152n-1n,R.maxUint160=2n**160n-1n,R.maxUint168=2n**168n-1n,R.maxUint176=2n**176n-1n,R.maxUint184=2n**184n-1n,R.maxUint192=2n**192n-1n,R.maxUint200=2n**200n-1n,R.maxUint208=2n**208n-1n,R.maxUint216=2n**216n-1n,R.maxUint224=2n**224n-1n,R.maxUint232=2n**232n-1n,R.maxUint240=2n**240n-1n,R.maxUint248=2n**248n-1n,R.maxUint256=2n**256n-1n),R}var on;function Ri(){if(on)return le;on=1,Object.defineProperty(le,"__esModule",{value:!0}),le.decodeParameter=l,le.decodeAddress=P,le.decodeArray=L,le.decodeBool=j,le.decodeBytes=k,le.decodeNumber=q,le.decodeTuple=C,le.decodeString=z,le.prepareParameters=N,le.prepareParameter=y,le.encode=u,le.encodeAddress=m,le.encodeArray=t,le.encodeBytes=d,le.encodeBoolean=b,le.encodeNumber=_,le.encodeString=H,le.encodeTuple=E,le.getArrayComponents=x,le.hasDynamicChild=A;const e=nr(),i=tr(),h=Re(),o=Pe(),f=Se(),g=rr();function l(p,v,T){const{checksumAddress:$,staticPosition:w}=T,a=x(v.type);if(a){const[I,r]=a;return L(p,{...v,type:r},{checksumAddress:$,length:I,staticPosition:w})}if(v.type==="tuple")return C(p,v,{checksumAddress:$,staticPosition:w});if(v.type==="address")return P(p,{checksum:$});if(v.type==="bool")return j(p);if(v.type.startsWith("bytes"))return k(p,v,{staticPosition:w});if(v.type.startsWith("uint")||v.type.startsWith("int"))return q(p,v);if(v.type==="string")return z(p,{staticPosition:w});throw new e.InvalidTypeError(v.type)}const B=32,O=32;function P(p,v={}){const{checksum:T=!1}=v,$=p.readBytes(32);return[(a=>T?i.checksum(a):a)(f.fromBytes(h.slice($,-20))),32]}function L(p,v,T){const{checksumAddress:$,length:w,staticPosition:a}=T;if(!w){const n=h.toNumber(p.readBytes(O)),s=a+n,c=s+B;p.setPosition(s);const S=h.toNumber(p.readBytes(B)),M=A(v);let U=0;const V=[];for(let D=0;D<S;++D){p.setPosition(c+(M?D*32:U));const[G,W]=l(p,v,{checksumAddress:$,staticPosition:c});U+=W,V.push(G)}return p.setPosition(a+32),[V,32]}if(A(v)){const n=h.toNumber(p.readBytes(O)),s=a+n,c=[];for(let S=0;S<w;++S){p.setPosition(s+S*32);const[M]=l(p,v,{checksumAddress:$,staticPosition:s});c.push(M)}return p.setPosition(a+32),[c,32]}let I=0;const r=[];for(let n=0;n<w;++n){const[s,c]=l(p,v,{checksumAddress:$,staticPosition:a+I});I+=c,r.push(s)}return[r,I]}function j(p){return[h.toBoolean(p.readBytes(32),{size:32}),32]}function k(p,v,{staticPosition:T}){const[$,w]=v.type.split("bytes");if(!w){const I=h.toNumber(p.readBytes(32));p.setPosition(T+I);const r=h.toNumber(p.readBytes(32));if(r===0)return p.setPosition(T+32),["0x",32];const n=p.readBytes(r);return p.setPosition(T+32),[f.fromBytes(n),32]}return[f.fromBytes(p.readBytes(Number.parseInt(w,10),32)),32]}function q(p,v){const T=v.type.startsWith("int"),$=Number.parseInt(v.type.split("int")[1]||"256",10),w=p.readBytes(32);return[$>48?h.toBigInt(w,{signed:T}):h.toNumber(w,{signed:T}),32]}function C(p,v,T){const{checksumAddress:$,staticPosition:w}=T,a=v.components.length===0||v.components.some(({name:n})=>!n),I=a?[]:{};let r=0;if(A(v)){const n=h.toNumber(p.readBytes(O)),s=w+n;for(let c=0;c<v.components.length;++c){const S=v.components[c];p.setPosition(s+r);const[M,U]=l(p,S,{checksumAddress:$,staticPosition:s});r+=U,I[a?c:S==null?void 0:S.name]=M}return p.setPosition(w+32),[I,32]}for(let n=0;n<v.components.length;++n){const s=v.components[n],[c,S]=l(p,s,{checksumAddress:$,staticPosition:w});I[a?n:s==null?void 0:s.name]=c,r+=S}return[I,r]}function z(p,{staticPosition:v}){const T=h.toNumber(p.readBytes(32)),$=v+T;p.setPosition($);const w=h.toNumber(p.readBytes(32));if(w===0)return p.setPosition(v+32),["",32];const a=p.readBytes(w,32),I=h.toString(h.trimLeft(a));return p.setPosition(v+32),[I,32]}function N({checksumAddress:p,parameters:v,values:T}){const $=[];for(let w=0;w<v.length;w++)$.push(y({checksumAddress:p,parameter:v[w],value:T[w]}));return $}function y({checksumAddress:p=!1,parameter:v,value:T}){const $=v,w=x($.type);if(w){const[a,I]=w;return t(T,{checksumAddress:p,length:a,parameter:{...$,type:I}})}if($.type==="tuple")return E(T,{checksumAddress:p,parameter:$});if($.type==="address")return m(T,{checksum:p});if($.type==="bool")return b(T);if($.type.startsWith("uint")||$.type.startsWith("int")){const a=$.type.startsWith("int"),[,,I="256"]=g.integerRegex.exec($.type)??[];return _(T,{signed:a,size:Number(I)})}if($.type.startsWith("bytes"))return d(T,{type:$.type});if($.type==="string")return H(T);throw new e.InvalidTypeError($.type)}function u(p){let v=0;for(let a=0;a<p.length;a++){const{dynamic:I,encoded:r}=p[a];I?v+=32:v+=f.size(r)}const T=[],$=[];let w=0;for(let a=0;a<p.length;a++){const{dynamic:I,encoded:r}=p[a];I?(T.push(f.fromNumber(v+w,{size:32})),$.push(r),w+=f.size(r)):T.push(r)}return f.concat(...T,...$)}function m(p,v){const{checksum:T=!1}=v;return i.assert(p,{strict:T}),{dynamic:!1,encoded:f.padLeft(p.toLowerCase())}}function t(p,v){const{checksumAddress:T,length:$,parameter:w}=v,a=$===null;if(!Array.isArray(p))throw new e.InvalidArrayError(p);if(!a&&p.length!==$)throw new e.ArrayLengthMismatchError({expectedLength:$,givenLength:p.length,type:`${w.type}[${$}]`});let I=!1;const r=[];for(let n=0;n<p.length;n++){const s=y({checksumAddress:T,parameter:w,value:p[n]});s.dynamic&&(I=!0),r.push(s)}if(a||I){const n=u(r);if(a){const s=f.fromNumber(r.length,{size:32});return{dynamic:!0,encoded:r.length>0?f.concat(s,n):s}}if(I)return{dynamic:!0,encoded:n}}return{dynamic:!1,encoded:f.concat(...r.map(({encoded:n})=>n))}}function d(p,{type:v}){const[,T]=v.split("bytes"),$=f.size(p);if(!T){let w=p;return $%32!==0&&(w=f.padRight(w,Math.ceil((p.length-2)/2/32)*32)),{dynamic:!0,encoded:f.concat(f.padLeft(f.fromNumber($,{size:32})),w)}}if($!==Number.parseInt(T,10))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(T,10),value:p});return{dynamic:!1,encoded:f.padRight(p)}}function b(p){if(typeof p!="boolean")throw new o.BaseError(`Invalid boolean value: "${p}" (type: ${typeof p}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:f.padLeft(f.fromBoolean(p))}}function _(p,{signed:v,size:T}){if(typeof T=="number"){const $=2n**(BigInt(T)-(v?1n:0n))-1n,w=v?-$-1n:0n;if(p>$||p<w)throw new f.IntegerOutOfRangeError({max:$.toString(),min:w.toString(),signed:v,size:T/8,value:p.toString()})}return{dynamic:!1,encoded:f.fromNumber(p,{size:32,signed:v})}}function H(p){const v=f.fromString(p),T=Math.ceil(f.size(v)/32),$=[];for(let w=0;w<T;w++)$.push(f.padRight(f.slice(v,w*32,(w+1)*32)));return{dynamic:!0,encoded:f.concat(f.padRight(f.fromNumber(f.size(v),{size:32})),...$)}}function E(p,v){const{checksumAddress:T,parameter:$}=v;let w=!1;const a=[];for(let I=0;I<$.components.length;I++){const r=$.components[I],n=Array.isArray(p)?I:r.name,s=y({checksumAddress:T,parameter:r,value:p[n]});a.push(s),s.dynamic&&(w=!0)}return{dynamic:w,encoded:w?u(a):f.concat(...a.map(({encoded:I})=>I))}}function x(p){const v=p.match(/^(.*)\[(\d+)?\]$/);return v?[v[2]?Number(v[2]):null,v[1]]:void 0}function A(p){var $;const{type:v}=p;if(v==="string"||v==="bytes"||v.endsWith("[]"))return!0;if(v==="tuple")return($=p.components)==null?void 0:$.some(A);const T=x(p.type);return!!(T&&A({...p,type:T[1]}))}return le}var He={},an;function kn(){if(an)return He;an=1,Object.defineProperty(He,"__esModule",{value:!0}),He.RecursiveReadLimitExceededError=He.PositionOutOfBoundsError=He.NegativeOffsetError=void 0,He.create=h;const e=Pe(),i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new g({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(l){if(l<0||l>this.bytes.length-1)throw new f({length:this.bytes.length,position:l})},decrementPosition(l){if(l<0)throw new o({offset:l});const B=this.position-l;this.assertPosition(B),this.position=B},getReadCount(l){return this.positionReadCount.get(l||this.position)||0},incrementPosition(l){if(l<0)throw new o({offset:l});const B=this.position+l;this.assertPosition(B),this.position=B},inspectByte(l){const B=l??this.position;return this.assertPosition(B),this.bytes[B]},inspectBytes(l,B){const O=B??this.position;return this.assertPosition(O+l-1),this.bytes.subarray(O,O+l)},inspectUint8(l){const B=l??this.position;return this.assertPosition(B),this.bytes[B]},inspectUint16(l){const B=l??this.position;return this.assertPosition(B+1),this.dataView.getUint16(B)},inspectUint24(l){const B=l??this.position;return this.assertPosition(B+2),(this.dataView.getUint16(B)<<8)+this.dataView.getUint8(B+2)},inspectUint32(l){const B=l??this.position;return this.assertPosition(B+3),this.dataView.getUint32(B)},pushByte(l){this.assertPosition(this.position),this.bytes[this.position]=l,this.position++},pushBytes(l){this.assertPosition(this.position+l.length-1),this.bytes.set(l,this.position),this.position+=l.length},pushUint8(l){this.assertPosition(this.position),this.bytes[this.position]=l,this.position++},pushUint16(l){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,l),this.position+=2},pushUint24(l){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,l>>8),this.dataView.setUint8(this.position+2,l&255),this.position+=3},pushUint32(l){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,l),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const l=this.inspectByte();return this.position++,l},readBytes(l,B){this.assertReadLimit(),this._touch();const O=this.inspectBytes(l);return this.position+=B??l,O},readUint8(){this.assertReadLimit(),this._touch();const l=this.inspectUint8();return this.position+=1,l},readUint16(){this.assertReadLimit(),this._touch();const l=this.inspectUint16();return this.position+=2,l},readUint24(){this.assertReadLimit(),this._touch();const l=this.inspectUint24();return this.position+=3,l},readUint32(){this.assertReadLimit(),this._touch();const l=this.inspectUint32();return this.position+=4,l},get remaining(){return this.bytes.length-this.position},setPosition(l){const B=this.position;return this.assertPosition(l),this.position=l,()=>this.position=B},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const l=this.getReadCount();this.positionReadCount.set(this.position,l+1),l>0&&this.recursiveReadCount++}};function h(l,{recursiveReadLimit:B=8192}={}){const O=Object.create(i);return O.bytes=l,O.dataView=new DataView(l.buffer,l.byteOffset,l.byteLength),O.positionReadCount=new Map,O.recursiveReadLimit=B,O}class o extends e.BaseError{constructor({offset:B}){super(`Offset \`${B}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}He.NegativeOffsetError=o;class f extends e.BaseError{constructor({length:B,position:O}){super(`Position \`${O}\` is out of bounds (\`0 < position < ${B}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}He.PositionOutOfBoundsError=f;class g extends e.BaseError{constructor({count:B,limit:O}){super(`Recursive read limit of \`${O}\` exceeded (recursive read count: \`${B}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}return He.RecursiveReadLimitExceededError=g,He}var cn;function nr(){if(cn)return de;cn=1,Object.defineProperty(de,"__esModule",{value:!0}),de.InvalidTypeError=de.InvalidArrayError=de.LengthMismatchError=de.BytesSizeMismatchError=de.ArrayLengthMismatchError=de.ZeroDataError=de.DataSizeTooSmallError=void 0,de.decode=O,de.encode=P,de.encodePacked=L,de.format=j,de.from=k;const e=ei(),i=tr(),h=Re(),o=Pe(),f=Se(),g=Ri(),l=kn(),B=rr();function O(t,d,b={}){const{as:_="Array",checksumAddress:H=!1}=b,E=typeof d=="string"?h.fromHex(d):d,x=l.create(E);if(h.size(E)===0&&t.length>0)throw new C;if(h.size(E)&&h.size(E)<32)throw new q({data:typeof d=="string"?d:f.fromBytes(d),parameters:t,size:h.size(E)});let A=0;const p=_==="Array"?[]:{};for(let v=0;v<t.length;++v){const T=t[v];x.setPosition(A);const[$,w]=g.decodeParameter(x,T,{checksumAddress:H,staticPosition:0});A+=w,_==="Array"?p.push($):p[T.name??v]=$}return p}function P(t,d,b){const{checksumAddress:_=!1}=b??{};if(t.length!==d.length)throw new y({expectedLength:t.length,givenLength:d.length});const H=g.prepareParameters({checksumAddress:_,parameters:t,values:d}),E=g.encode(H);return E.length===0?"0x":E}function L(t,d){if(t.length!==d.length)throw new y({expectedLength:t.length,givenLength:d.length});const b=[];for(let _=0;_<t.length;_++){const H=t[_],E=d[_];b.push(L.encode(H,E))}return f.concat(...b)}(function(t){function d(b,_,H=!1){if(b==="address"){const p=_;return i.assert(p),f.padLeft(p.toLowerCase(),H?32:0)}if(b==="string")return f.fromString(_);if(b==="bytes")return _;if(b==="bool")return f.padLeft(f.fromBoolean(_),H?32:1);const E=b.match(B.integerRegex);if(E){const[p,v,T="256"]=E,$=Number.parseInt(T,10)/8;return f.fromNumber(_,{size:H?32:$,signed:v==="int"})}const x=b.match(B.bytesRegex);if(x){const[p,v]=x;if(Number.parseInt(v,10)!==(_.length-2)/2)throw new N({expectedSize:Number.parseInt(v,10),value:_});return f.padRight(_,H?32:0)}const A=b.match(B.arrayRegex);if(A&&Array.isArray(_)){const[p,v]=A,T=[];for(let $=0;$<_.length;$++)T.push(d(v,_[$],!0));return T.length===0?"0x":f.concat(...T)}throw new m(b)}t.encode=d})(L||(de.encodePacked=L={}));function j(t){return e.formatAbiParameters(t)}function k(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?e.parseAbiParameters(t):t}class q extends o.BaseError{constructor({data:d,parameters:b,size:_}){super(`Data size of ${_} bytes is too small for given parameters.`,{metaMessages:[`Params: (${e.formatAbiParameters(b)})`,`Data: ${d} (${_} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}de.DataSizeTooSmallError=q;class C extends o.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}de.ZeroDataError=C;class z extends o.BaseError{constructor({expectedLength:d,givenLength:b,type:_}){super(`Array length mismatch for type \`${_}\`. Expected: \`${d}\`. Given: \`${b}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}de.ArrayLengthMismatchError=z;class N extends o.BaseError{constructor({expectedSize:d,value:b}){super(`Size of bytes "${b}" (bytes${f.size(b)}) does not match expected size (bytes${d}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}de.BytesSizeMismatchError=N;class y extends o.BaseError{constructor({expectedLength:d,givenLength:b}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${d}`,`Given length (values): ${b}`].join(`
|
|
5
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}de.LengthMismatchError=y;class u extends o.BaseError{constructor(d){super(`Value \`${d}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}de.InvalidArrayError=u;class m extends o.BaseError{constructor(d){super(`Type \`${d}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}return de.InvalidTypeError=m,de}var un;function Ui(){return un||(un=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidWrappedSignatureError=e.universalSignatureValidatorAbi=e.universalSignatureValidatorBytecode=e.magicBytes=void 0,e.assert=f,e.from=g,e.unwrap=l,e.wrap=B,e.validate=O;const i=nr(),h=Pe(),o=Se();e.magicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",e.universalSignatureValidatorBytecode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",e.universalSignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function f(L){if(o.slice(L,-32)!==e.magicBytes)throw new P(L)}function g(L){return typeof L=="string"?l(L):L}function l(L){f(L);const[j,k,q]=i.decode(i.from("address, bytes, bytes"),L);return{data:k,signature:q,to:j}}function B(L){const{data:j,signature:k,to:q}=L;return o.concat(i.encode(i.from("address, bytes, bytes"),[q,j,k]),e.magicBytes)}function O(L){try{return f(L),!0}catch{return!1}}class P extends h.BaseError{constructor(j){super(`Value \`${j}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=P}(Gt)),Gt}var fn;function ki(){return fn||(fn=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.SignatureErc6492=void 0,ft.SignatureErc6492=Ui()),ft}var bt={},Xt={},Ee={},Be={},dn;function ji(){if(dn)return Be;dn=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.toBytes=f,Be.toHex=g,Be.to=l,Be.decodeRlpCursor=B,Be.readLength=O,Be.readList=P,Be.from=L,Be.fromBytes=j,Be.fromHex=k;const e=Re(),i=Pe(),h=Se(),o=kn();function f(y){return l(y,"Bytes")}function g(y){return l(y,"Hex")}function l(y,u){const m=u??(typeof y=="string"?"Hex":"Bytes"),t=(()=>{if(typeof y=="string"){if(y.length>3&&y.length%2!==0)throw new h.InvalidLengthError(y);return e.fromHex(y)}return y})(),d=o.create(t,{recursiveReadLimit:Number.POSITIVE_INFINITY});return B(d,m)}function B(y,u="Hex"){if(y.bytes.length===0)return u==="Hex"?h.fromBytes(y.bytes):y.bytes;const m=y.readByte();if(m<128&&y.decrementPosition(1),m<192){const d=O(y,m,128),b=y.readBytes(d);return u==="Hex"?h.fromBytes(b):b}const t=O(y,m,192);return P(y,t,u)}function O(y,u,m){if(m===128&&u<128)return 1;if(u<=m+55)return u-m;if(u===m+55+1)return y.readUint8();if(u===m+55+2)return y.readUint16();if(u===m+55+3)return y.readUint24();if(u===m+55+4)return y.readUint32();throw new i.BaseError("Invalid RLP prefix")}function P(y,u,m){const t=y.position,d=[];for(;y.position-t<u;)d.push(B(y,m));return d}function L(y,u){const{as:m}=u,t=q(y),d=o.create(new Uint8Array(t.length));return t.encode(d),m==="Hex"?h.fromBytes(d.bytes):d.bytes}function j(y,u={}){const{as:m="Bytes"}=u;return L(y,{as:m})}function k(y,u={}){const{as:m="Hex"}=u;return L(y,{as:m})}function q(y){return Array.isArray(y)?C(y.map(u=>q(u))):z(y)}function C(y){const u=y.reduce((d,b)=>d+b.length,0),m=N(u);return{length:(()=>u<=55?1+u:1+m+u)(),encode(d){u<=55?d.pushByte(192+u):(d.pushByte(192+55+m),m===1?d.pushUint8(u):m===2?d.pushUint16(u):m===3?d.pushUint24(u):d.pushUint32(u));for(const{encode:b}of y)b(d)}}}function z(y){const u=typeof y=="string"?e.fromHex(y):y,m=N(u.length);return{length:(()=>u.length===1&&u[0]<128?1:u.length<=55?1+u.length:1+m+u.length)(),encode(d){u.length===1&&u[0]<128?d.pushBytes(u):u.length<=55?(d.pushByte(128+u.length),d.pushBytes(u)):(d.pushByte(128+55+m),m===1?d.pushUint8(u.length):m===2?d.pushUint16(u.length):m===3?d.pushUint24(u.length):d.pushUint32(u.length),d.pushBytes(u))}}}function N(y){if(y<=255)return 1;if(y<=65535)return 2;if(y<=16777215)return 3;if(y<=4294967295)return 4;throw new i.BaseError("Length is too large.")}return Be}var ie={},ln;function Nn(){if(ln)return ie;ln=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.InvalidVError=ie.InvalidYParityError=ie.InvalidSError=ie.InvalidRError=ie.MissingPropertiesError=ie.InvalidSerializedSizeError=void 0,ie.assert=l,ie.fromBytes=B,ie.fromHex=O,ie.extract=P,ie.from=L,ie.fromDerBytes=j,ie.fromDerHex=k,ie.fromLegacy=q,ie.fromRpc=C,ie.fromTuple=z,ie.toBytes=N,ie.toHex=y,ie.toDerBytes=u,ie.toDerHex=m,ie.toLegacy=t,ie.toRpc=d,ie.toTuple=b,ie.validate=_,ie.vToYParity=H,ie.yParityToV=E;const e=Tn(),i=Re(),h=Pe(),o=Se(),f=qt(),g=rr();function l(w,a={}){const{recovered:I}=a;if(typeof w.r>"u")throw new A({signature:w});if(typeof w.s>"u")throw new A({signature:w});if(I&&typeof w.yParity>"u")throw new A({signature:w});if(w.r<0n||w.r>g.maxUint256)throw new p({value:w.r});if(w.s<0n||w.s>g.maxUint256)throw new v({value:w.s});if(typeof w.yParity=="number"&&w.yParity!==0&&w.yParity!==1)throw new T({value:w.yParity})}function B(w){return O(o.fromBytes(w))}function O(w){if(w.length!==130&&w.length!==132)throw new x({signature:w});const a=BigInt(o.slice(w,0,32)),I=BigInt(o.slice(w,32,64)),r=(()=>{const n=+`0x${w.slice(130)}`;if(!Number.isNaN(n))try{return H(n)}catch{throw new T({value:n})}})();return typeof r>"u"?{r:a,s:I}:{r:a,s:I,yParity:r}}function P(w){if(!(typeof w.r>"u")&&!(typeof w.s>"u"))return L(w)}function L(w){const a=(()=>typeof w=="string"?O(w):w instanceof Uint8Array?B(w):typeof w.r=="string"?C(w):w.v?q(w):{r:w.r,s:w.s,...typeof w.yParity<"u"?{yParity:w.yParity}:{}})();return l(a),a}function j(w){return k(o.fromBytes(w))}function k(w){const{r:a,s:I}=e.secp256k1.Signature.fromDER(o.from(w).slice(2));return{r:a,s:I}}function q(w){return{r:w.r,s:w.s,yParity:H(w.v)}}function C(w){const a=(()=>{const I=w.v?Number(w.v):void 0;let r=w.yParity?Number(w.yParity):void 0;if(typeof I=="number"&&typeof r!="number"&&(r=H(I)),typeof r!="number")throw new T({value:w.yParity});return r})();return{r:BigInt(w.r),s:BigInt(w.s),yParity:a}}function z(w){const[a,I,r]=w;return L({r:I==="0x"?0n:BigInt(I),s:r==="0x"?0n:BigInt(r),yParity:a==="0x"?0:Number(a)})}function N(w){return i.fromHex(y(w))}function y(w){l(w);const a=w.r,I=w.s;return o.concat(o.fromNumber(a,{size:32}),o.fromNumber(I,{size:32}),typeof w.yParity=="number"?o.fromNumber(E(w.yParity),{size:1}):"0x")}function u(w){return new e.secp256k1.Signature(w.r,w.s).toDERRawBytes()}function m(w){return`0x${new e.secp256k1.Signature(w.r,w.s).toDERHex()}`}function t(w){return{r:w.r,s:w.s,v:E(w.yParity)}}function d(w){const{r:a,s:I,yParity:r}=w;return{r:o.fromNumber(a,{size:32}),s:o.fromNumber(I,{size:32}),yParity:r===0?"0x0":"0x1"}}function b(w){const{r:a,s:I,yParity:r}=w;return[r?"0x01":"0x",a===0n?"0x":o.trimLeft(o.fromNumber(a)),I===0n?"0x":o.trimLeft(o.fromNumber(I))]}function _(w,a={}){try{return l(w,a),!0}catch{return!1}}function H(w){if(w===0||w===27)return 0;if(w===1||w===28)return 1;if(w>=35)return w%2===0?1:0;throw new $({value:w})}function E(w){if(w===0)return 27;if(w===1)return 28;throw new T({value:w})}class x extends h.BaseError{constructor({signature:a}){super(`Value \`${a}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${o.size(o.from(a))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}ie.InvalidSerializedSizeError=x;class A extends h.BaseError{constructor({signature:a}){super(`Signature \`${f.stringify(a)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}ie.MissingPropertiesError=A;class p extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}ie.InvalidRError=p;class v extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}ie.InvalidSError=v;class T extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}ie.InvalidYParityError=T;class $ extends h.BaseError{constructor({value:a}){super(`Value \`${a}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}return ie.InvalidVError=$,ie}var hn;function Ti(){if(hn)return Ee;hn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.from=f,Ee.fromRpc=g,Ee.fromRpcList=l,Ee.fromTuple=B,Ee.fromTupleList=O,Ee.getSignPayload=P,Ee.hash=L,Ee.toRpc=j,Ee.toRpcList=k,Ee.toTuple=q,Ee.toTupleList=C;const e=$n(),i=Se(),h=ji(),o=Nn();function f(z,N={}){return typeof z.chainId=="string"?g(z):{...z,...N.signature}}function g(z){const{address:N,chainId:y,nonce:u}=z,m=o.extract(z);return{address:N,chainId:Number(y),nonce:BigInt(u),...m}}function l(z){return z.map(g)}function B(z){const[N,y,u,m,t,d]=z;let b={address:y,chainId:N==="0x"?0:Number(N),nonce:u==="0x"?0n:BigInt(u)};return m&&t&&d&&(b={...b,...o.fromTuple([m,t,d])}),f(b)}function O(z){const N=[];for(const y of z)N.push(B(y));return N}function P(z){return L(z,{presign:!0})}function L(z,N={}){const{presign:y}=N;return e.keccak256(i.concat("0x05",h.fromHex(q(y?{address:z.address,chainId:z.chainId,nonce:z.nonce}:z))))}function j(z){const{address:N,chainId:y,nonce:u,...m}=z;return{address:N,chainId:i.fromNumber(y),nonce:i.fromNumber(u),...o.toRpc(m)}}function k(z){return z.map(j)}function q(z){const{address:N,chainId:y,nonce:u}=z,m=o.extract(z);return[y?i.fromNumber(y):"0x",N,u?i.fromNumber(u):"0x",...m?o.toTuple(m):[]]}function C(z){if(!z||z.length===0)return[];const N=[];for(const y of z)N.push(q(y));return N}return Ee}var Ie={},Ke={},mn;function Li(){if(mn)return Ke;mn=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.extraEntropy=void 0,Ke.setExtraEntropy=e,Ke.extraEntropy=!1;function e(i){Ke.extraEntropy=i}return Ke}var bn;function Mi(){if(bn)return Ie;bn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.noble=void 0,Ie.createKeyPair=l,Ie.getPublicKey=B,Ie.getSharedSecret=O,Ie.randomPrivateKey=P,Ie.recoverAddress=L,Ie.recoverPublicKey=j,Ie.sign=k,Ie.verify=q;const e=Tn(),i=tr(),h=Re(),o=Se(),f=Li(),g=qn();Ie.noble=e.secp256k1;function l(C={}){const{as:z="Hex"}=C,N=P({as:z}),y=B({privateKey:N});return{privateKey:N,publicKey:y}}function B(C){const{privateKey:z}=C,N=e.secp256k1.ProjectivePoint.fromPrivateKey(o.from(z).slice(2));return g.from(N)}function O(C){const{as:z="Hex",privateKey:N,publicKey:y}=C,t=e.secp256k1.ProjectivePoint.fromHex(g.toHex(y).slice(2)).multiply(e.secp256k1.utils.normPrivateKeyToScalar(o.from(N).slice(2))).toRawBytes(!0);return z==="Hex"?o.fromBytes(t):t}function P(C={}){const{as:z="Hex"}=C,N=e.secp256k1.utils.randomPrivateKey();return z==="Hex"?o.fromBytes(N):N}function L(C){return i.fromPublicKey(j(C))}function j(C){const{payload:z,signature:N}=C,{r:y,s:u,yParity:m}=N,d=new e.secp256k1.Signature(BigInt(y),BigInt(u)).addRecoveryBit(m).recoverPublicKey(o.from(z).substring(2));return g.from(d)}function k(C){const{extraEntropy:z=f.extraEntropy,hash:N,payload:y,privateKey:u}=C,{r:m,s:t,recovery:d}=e.secp256k1.sign(h.from(y),h.from(u),{extraEntropy:typeof z=="boolean"?z:o.from(z).slice(2),lowS:!0,...N?{prehash:!0}:{}});return{r:m,s:t,yParity:d}}function q(C){const{address:z,hash:N,payload:y,publicKey:u,signature:m}=C;return z?i.isEqual(z,L({payload:y,signature:m})):e.secp256k1.verify(m,h.from(y),g.toBytes(u),...N?[{prehash:!0,lowS:!0}]:[])}return Ie}var yn;function zi(){return yn||(yn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidWrappedSignatureError=e.suffixParameters=e.magicBytes=void 0,e.assert=B,e.from=O,e.unwrap=P,e.wrap=L,e.validate=j;const i=nr(),h=Ti(),o=Pe(),f=Se(),g=Mi(),l=Nn();e.magicBytes="0x8010801080108010801080108010801080108010801080108010801080108010",e.suffixParameters=i.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function B(q){if(typeof q=="string"){if(f.slice(q,-32)!==e.magicBytes)throw new k(q)}else l.assert(q.authorization)}function O(q){return typeof q=="string"?P(q):q}function P(q){B(q);const C=f.toNumber(f.slice(q,-64,-32)),z=f.slice(q,-C-64,-64),N=f.slice(q,0,-C-64),[y,u,m]=i.decode(e.suffixParameters,z);return{authorization:h.from({address:y.delegation,chainId:Number(y.chainId),nonce:y.nonce,yParity:y.yParity,r:y.r,s:y.s}),signature:N,...m&&m!=="0x"?{data:m,to:u}:{}}}function L(q){const{data:C,signature:z}=q;B(q);const N=g.recoverAddress({payload:h.getSignPayload(q.authorization),signature:l.from(q.authorization)}),y=i.encode(e.suffixParameters,[{...q.authorization,delegation:q.authorization.address,chainId:BigInt(q.authorization.chainId)},q.to??N,C??"0x"]),u=f.fromNumber(f.size(y),{size:32});return f.concat(z,y,u,e.magicBytes)}function j(q){try{return B(q),!0}catch{return!1}}class k extends o.BaseError{constructor(C){super(`Value \`${C}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=k}(Xt)),Xt}var pn;function Ni(){return pn||(pn=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.SignatureErc8010=void 0,bt.SignatureErc8010=zi()),bt}var yt={},pt={},gn;function $i(){if(gn)return pt;gn=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.fromRpc=i,pt.toRpc=h;const e=Se();function i(o){return{...o,amount:BigInt(o.amount),index:Number(o.index),validatorIndex:Number(o.validatorIndex)}}function h(o){return{address:o.address,amount:e.fromNumber(o.amount),index:e.fromNumber(o.index),validatorIndex:e.fromNumber(o.validatorIndex)}}return pt}var xn;function Ci(){if(xn)return yt;xn=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.fromRpc=h,yt.toRpc=o;const e=Se(),i=$i();function h(f){return{...f.baseFeePerGas&&{baseFeePerGas:BigInt(f.baseFeePerGas)},...f.blobBaseFee&&{blobBaseFee:BigInt(f.blobBaseFee)},...f.feeRecipient&&{feeRecipient:f.feeRecipient},...f.gasLimit&&{gasLimit:BigInt(f.gasLimit)},...f.number&&{number:BigInt(f.number)},...f.prevRandao&&{prevRandao:BigInt(f.prevRandao)},...f.time&&{time:BigInt(f.time)},...f.withdrawals&&{withdrawals:f.withdrawals.map(i.fromRpc)}}}function o(f){return{...typeof f.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(f.baseFeePerGas)},...typeof f.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(f.blobBaseFee)},...typeof f.feeRecipient=="string"&&{feeRecipient:f.feeRecipient},...typeof f.gasLimit=="bigint"&&{gasLimit:e.fromNumber(f.gasLimit)},...typeof f.number=="bigint"&&{number:e.fromNumber(f.number)},...typeof f.prevRandao=="bigint"&&{prevRandao:e.fromNumber(f.prevRandao)},...typeof f.time=="bigint"&&{time:e.fromNumber(f.time)},...f.withdrawals&&{withdrawals:f.withdrawals.map(i.toRpc)}}}return yt}export{li as A,ui as B,zt as C,pi as D,Lt as E,Pn as F,er as G,vi as H,ei as a,Tn as b,Dn as c,Ci as d,ri as e,Ni as f,tr as g,Pe as h,$n as i,Se as j,nr as k,ki as l,qe as m,yi as n,ai as o,Hn as p,oi as q,Kn as r,si as s,En as t,Si as u,xi as v,hi as w,ni as x,Un as y,Rn as z};
|