PageSourceSearch

https://ledgerroom.vercel.app/_next/static/chunks/5851-534fcd35f1ff647f.js

js ledgerroom.vercel.app collected 2026-10-03 05:48:45 UTC 65,856 bytes, 1 lines download raw bytes

vendor: 7,990 bytes, line 1
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5851],{58710:(t,e,r)=>{r.d(e,{c:()=>eT});let i="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function n(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function o(t){if(!Number.isSafeInteger(t)||t<0)throw Error("positive integer expected, got "+t)}function s(t,...e){if(!n(t))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error("Uint8Array expected of length "+e+", got length="+t.length)}function a(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.createHasher");o(t.outputLen),o(t.blockLen)}function l(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function f(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function h(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function c(t,e){return t<<32-e|t>>>e}function u(t,e){return t<<e|t>>>32-e>>>0}let d="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,p=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function b(t){if(s(t),d)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=p[t[r]];return e}let y={_0:48,_9:57,A:65,F:70,a:97,f:102};function g(t){return t>=y._0&&t<=y._9?t-y._0:t>=y.A&&t<=y.F?t-(y.A-10):t>=y.a&&t<=y.f?t-(y.a-10):void 0}function x(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);if(d)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw Error("hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(r);for(let e=0,n=0;e<r;e++,n+=2){let r=g(t.charCodeAt(n)),o=g(t.charCodeAt(n+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[n]+t[n+1])+'" at index '+n);i[e]=16*r+o}return i}function w(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function m(t){return"string"==typeof t&&(t=w(t)),s(t),t}function E(...t){let e=0;for(let r=0;r<t.length;r++){let i=t[r];s(i),e+=i.length}let r=new Uint8Array(e);for(let e=0,i=0;e<t.length;e++){let n=t[e];r.set(n,i),i+=n.length}return r}class v{}function B(t){let e=e=>t().update(m(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function A(t=32){if(i&&"function"==typeof i.getRandomValues)return i.getRandomValues(new Uint8Array(t));if(i&&"function"==typeof i.randomBytes)return Uint8Array.from(i.randomBytes(t));throw Error("crypto.getRandomValues must be defined")}let C=BigInt(0),I=BigInt(1);function O(t,e=""){if("boolean"!=typeof t)throw Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t);return t}function U(t,e,r=""){let i=n(t),o=t?.length,s=void 0!==e;if(!i||s&&o!==e)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(i?`length=${o}`:`type=${typeof t}`));return t}function S(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function T(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?C:BigInt("0x"+t)}function H(t){return s(t),T(b(Uint8Array.from(t).reverse()))}function K(t,e){return x(t.toString(16).padStart(2*e,"0"))}function R(t,e){return K(t,e).reverse()}function N(t,e,r){let i;if("string"==typeof e)try{i=x(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(n(e))i=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let o=i.length;if("number"==typeof r&&o!==r)throw Error(t+" of length "+r+" expected, got "+o);return i}let L=t=>"bigint"==typeof t&&C<=t;function k(t){let e;for(e=0;t>C;t>>=I,e+=1);return e}let F=t=>(I<<BigInt(t))-I;function q(t,e,r={}){if(!t||"object"!=typeof t)throw Error("expected valid options object");function i(e,r,i){let n=t[e];if(i&&void 0===n)return;let o=typeof n;if(o!==r||null===n)throw Error(`param "${e}" is invalid: expected ${r}, got ${o}`)}Object.entries(e).forEach(([t,e])=>i(t,e,!1)),Object.entries(r).forEach(([t,e])=>i(t,e,!0))}function P(t){let e=new WeakMap;return(r,...i)=>{let n=e.get(r);if(void 0!==n)return n;let o=t(r,...i);return e.set(r,o),o}}let D=BigInt(0),V=BigInt(1),$=BigInt(2),_=BigInt(3),Z=BigInt(4),j=BigInt(5),M=BigInt(7),G=BigInt(8),z=BigInt(9),Y=BigInt(16);function J(t,e){let r=t%e;return r>=D?r:e+r}function W(t,e,r){let i=t;for(;e-- >D;)i*=i,i%=r;return i}function X(t,e){if(t===D)throw Error("invert: expected non-zero number");if(e<=D)throw Error("invert: expected positive modulus, got "+e);let r=J(t,e),i=e,n=D,o=V,s=V,a=D;for(;r!==D;){let t=i/r,e=i%r,l=n-s*t,f=o-a*t;i=r,r=e,n=s,o=a,s=l,a=f}if(i!==V)throw Error("invert: does not exist");return J(n,e)}function Q(t,e,r){if(!t.eql(t.sqr(e),r))throw Error("Cannot find square root")}function tt(t,e){let r=(t.ORDER+V)/Z,i=t.pow(e,r);return Q(t,i,e),i}function te(t,e){let r=(t.ORDER-j)/G,i=t.mul(e,$),n=t.pow(i,r),o=t.mul(e,n),s=t.mul(t.mul(o,$),n),a=t.mul(o,t.sub(s,t.ONE));return Q(t,a,e),a}function tr(t){if(t<_)throw Error("sqrt is not defined for small field");let e=t-V,r=0;for(;e%$===D;)e/=$,r++;let i=$,n=ta(t);for(;1===to(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return tt;let o=n.pow(i,e),s=(e+V)/$;return function(t,i){if(t.is0(i))return i;if(1!==to(t,i))throw Error("Cannot find square root");let n=r,a=t.mul(t.ONE,o),l=t.pow(i,e),f=t.pow(i,s);for(;!t.eql(l,t.ONE);){if(t.is0(l))return t.ZERO;let e=1,r=t.sqr(l);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===n)throw Error("Cannot find square root");let i=V<<BigInt(n-e-1),o=t.pow(a,i);n=e,a=t.sqr(o),l=t.mul(l,a),f=t.mul(f,o)}return f}}let ti=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tn(t,e,r=!1){let i=Array(e.length).fill(r?t.ZERO:void 0),n=e.reduce((e,r,n)=>t.is0(r)?e:(i[n]=e,t.mul(e,r)),t.ONE),o=t.inv(n);return e.reduceRight((e,r,n)=>t.is0(r)?e:(i[n]=t.mul(e,i[n]),t.mul(e,r)),o),i}function to(t,e){let r=(t.ORDER-V)/$,i=t.pow(e,r),n=t.eql(i,t.ONE),o=t.eql(i,t.ZERO),s=t.eql(i,t.neg(t.ONE));if(!n&&!o&&!s)throw Error("invalid Legendre symbol result");return n?1:o?0:-1}function ts(t,e){void 0!==e&&o(e);let r=void 0!==e?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function ta(t,e,r=!1,i={}){let n,o,s,a;if(t<=D)throw Error("invalid field: expected ORDER > 0, got "+t);let l=!1;if("object"==typeof e&&null!=e){if(i.sqrt||r)throw Error("cannot specify opts in two arguments");e.BITS&&(o=e.BITS),e.sqrt&&(s=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(l=e.modFromBytes),a=e.allowedLengths}else"number"==typeof e&&(o=e),i.sqrt&&(s=i.sqrt);let{nBitLength:f,nByteLength:h}=ts(t,o);if(h>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let c=Object.freeze({ORDER:t,isLE:r,BITS:f,BYTES:h,MASK:F(f),ZERO:D,ONE:V,allowedLengths:a,create:e=>J(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return D<=e&&e<t},is0:t=>t===D,isValidNot0:t=>!c.is0(t)&&c.isValid(t),isOdd:t=>(t&V)===V,neg:e=>J(-e,t),eql:(t,e)=>t===e,sqr:e=>J(e*e,t),add:(e,r)=>J(e+r,t),sub:(e,r)=>J(e-r,t),mul:(e,r)=>J(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<D)throw Error("invalid exponent, negatives unsupported");if(r===D)return t.ONE;if(r===V)return e;let i=t.ONE,n=e;for(;r>D;)r&V&&(i=t.mul(i,n)),n=t.sqr(n),r>>=V;return i})(c,t,e),div:(e,r)=>J(e*X(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>X(e,t),sqrt:s||(e=>(n||(n=t%Z===_?tt:t%G===j?te:t%Y===z?function(t){let e=ta(t),r=tr(t),i=r(e,e.neg(e.ONE)),n=r(e,i),o=r(e,e.neg(i)),s=(t+M)/Y;return(t,e)=>{let r=t.pow(e,s),a=t.mul(r,i),l=t.mul(r,n),f=t.mul(r,o),h=t.eql(t.sqr(a),e),c=t.eql(t.sqr(l),e);r=t.cmov(r,a,h),a=t.cmov(f,l,c);let u=t.eql(t.sqr(a),e),d=t.cmov(r,a,u);return Q(t,d,e),d}}(t):tr(t)),n(c,e))),toBytes:t=>r?R(t,h):K(t,h),fromBytes:(e,i=!0)=>
1{if(a){if(!a.includes(e.length)||e.length>h)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);let t=new Uint8Array(h);t.set(e,r?0:t.length-e.length),e=t}if(e.length!==h)throw Error("Field.fromBytes: expected "+h+" bytes, got "+e.length);let n=r?H(e):T(b(e));if(l&&(n=J(n,t)),!i&&!c.isValid(n))throw Error("invalid field element: outside of range 0..ORDER");return n},invertBatch:t=>tn(c,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(c)}function tl(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function tf(t){let e=tl(t);return e+Math.ceil(e/2)}class th extends v{constructor(t,e,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=h(this.buffer)}update(t){l(this),s(t=m(t));let{view:e,buffer:r,blockLen:i}=this,n=t.length;for(let o=0;o<n;){let s=Math.min(i-this.pos,n-o);if(s===i){let e=h(t);for(;i<=n-o;o+=i)this.process(e,o);continue}r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){l(this);s(t);let e=this.outputLen;if(t.length<e)throw Error("digestInto() expects output buffer of length at least "+e);this.finished=!0;let{buffer:r,view:i,blockLen:n,isLE:o}=this,{pos:a}=this;r[a++]=128,f(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(i,0),a=0);for(let t=a;t<n;t++)r[t]=0;!function(t,e,r,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),a=Number(r&o),l=4*!!i,f=4*!i;t.setUint32(e+l,s,i),t.setUint32(e+f,a,i)}(i,n-8,BigInt(8*this.length),o),this.process(i,0);let c=h(t),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=u/4,p=this.get();if(d>p.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<d;t++)c.setUint32(4*t,p[t],o)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=s,i%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}let tc=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),tu=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),td=BigInt(0x100000000-1),tp=BigInt(32),tb=(t,e,r)=>t>>>r,ty=(t,e,r)=>t<<32-r|e>>>r,tg=(t,e,r)=>t>>>r|e<<32-r,tx=(t,e,r)=>t<<32-r|e>>>r,tw=(t,e,r)=>t<<64-r|e>>>r-32,tm=(t,e,r)=>t>>>r-32|e<<64-r;function tE(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/0x100000000|0)|0,l:0|n}}let tv=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),tB=(t,e,r,i)=>e+r+i+(t/0x100000000|0)|0,tA=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),tC=(t,e,r,i,n)=>e+r+i+n+(t/0x100000000|0)|0,tI=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),tO=(t,e,r,i,n,o)=>e+r+i+n+o+(t/0x100000000|0)|0,tU=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),tS=new Uint32Array(64);class tT extends th{constructor(t=32){super(64,t,8,!1),this.A=0|tc[0],this.B=0|tc[1],this.C=0|tc[2],this.D=0|tc[3],this.E=0|tc[4],this.F=0|tc[5],this.G=0|tc[6],this.H=0|tc[7]}get(){let{A:t,B:e,C:r,D:i,E:n,F:o,G:s,H:a}=this;return[t,e,r,i,n,o,s,a]}set(t,e,r,i,n,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)tS[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=tS[t-15],r=tS[t-2],i=c(e,7)^c(e,18)^e>>>3,n=c(r,17)^c(r,19)^r>>>10;tS[t]=n+tS[t-7]+i+tS[t-16]|0}let{A:r,B:i,C:n,D:o,E:s,F:a,G:l,H:f}=this;for(let t=0;t<64;t++){var h,u,d,p;let e=f+(c(s,6)^c(s,11)^c(s,25))+((h=s)&a^~h&l)+tU[t]+tS[t]|0,b=(c(r,2)^c(r,13)^c(r,22))+((u=r)&(d=i)^u&(p=n)^d&p)|0;f=l,l=a,a=s,s=o+e|0,o=n,n=i,i=r,r=e+b|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(r,i,n,o,s,a,l,f)}
1roundClean(){f(tS)}destroy(){this.set(0,0,0,0,0,0,0,0),f(this.buffer)}}let tH=function(t,e=!1){let r=t.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=function(t,e=!1){return e?{h:Number(t&td),l:Number(t>>tp&td)}:{h:0|Number(t>>tp&td),l:0|Number(t&td)}}(t[o],e);[i[o],n[o]]=[r,s]}return[i,n]}(["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","0xf40e3585
15771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),tK=tH[0],tR=tH[1],tN=new Uint32Array(80),tL=new Uint32Array(80);class tk extends th{constructor(t=64){super(128,t,16,!1),this.Ah=0|tu[0],this.Al=0|tu[1],this.Bh=0|tu[2],this.Bl=0|tu[3],this.Ch=0|tu[4],this.Cl=0|tu[5],this.Dh=0|tu[6],this.Dl=0|tu[7],this.Eh=0|tu[8],this.El=0|tu[9],this.Fh=0|tu[10],this.Fl=0|tu[11],this.Gh=0|tu[12],this.Gl=0|tu[13],this.Hh=0|tu[14],this.Hl=0|tu[15]}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:a,Eh:l,El:f,Fh:h,Fl:c,Gh:u,Gl:d,Hh:p,Hl:b}=this;return[t,e,r,i,n,o,s,a,l,f,h,c,u,d,p,b]}set(t,e,r,i,n,o,s,a,l,f,h,c,u,d,p,b){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|l,this.El=0|f,this.Fh=0|h,this.Fl=0|c,this.Gh=0|u,this.Gl=0|d,this.Hh=0|p,this.Hl=0|b}process(t,e){for(let r=0;r<16;r++,e+=4)tN[r]=t.getUint32(e),tL[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|tN[t-15],r=0|tL[t-15],i=tg(e,r,1)^tg(e,r,8)^tb(e,r,7),n=tx(e,r,1)^tx(e,r,8)^ty(e,r,7),o=0|tN[t-2],s=0|tL[t-2],a=tg(o,s,19)^tw(o,s,61)^tb(o,s,6),l=tA(n,tx(o,s,19)^tm(o,s,61)^ty(o,s,6),tL[t-7],tL[t-16]),f=tC(l,i,a,tN[t-7],tN[t-16]);tN[t]=0|f,tL[t]=0|l}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:a,Dh:l,Dl:f,Eh:h,El:c,Fh:u,Fl:d,Gh:p,Gl:b,Hh:y,Hl:g}=this;for(let t=0;t<80;t++){let e=tg(h,c,14)^tg(h,c,18)^tw(h,c,41),x=tx(h,c,14)^tx(h,c,18)^tm(h,c,41),w=h&u^~h&p,m=tI(g,x,c&d^~c&b,tR[t],tL[t]),E=tO(m,y,e,w,tK[t],tN[t]),v=0|m,B=tg(r,i,28)^tw(r,i,34)^tw(r,i,39),A=tx(r,i,28)^tm(r,i,34)^tm(r,i,39),C=r&n^r&s^n&s,I=i&o^i&a^o&a;y=0|p,g=0|b,p=0|u,b=0|d,u=0|h,d=0|c,({h:h,l:c}=tE(0|l,0|f,0|E,0|v)),l=0|s,f=0|a,s=0|n,a=0|o,n=0|r,o=0|i;let O=tv(v,A,I);r=tB(O,E,B,C),i=0|O}({h:r,l:i}=tE(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=tE(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:a}=tE(0|this.Ch,0|this.Cl,0|s,0|a)),({h:l,l:f}=tE(0|this.Dh,0|this.Dl,0|l,0|f)),({h:h,l:c}=tE(0|this.Eh,0|this.El,0|h,0|c)),({h:u,l:d}=tE(0|this.Fh,0|this.Fl,0|u,0|d)),({h:p,l:b}=tE(0|this.Gh,0|this.Gl,0|p,0|b)),({h:y,l:g}=tE(0|this.Hh,0|this.Hl,0|y,0|g)),this.set(r,i,n,o,s,a,l,f,h,c,u,d,p,b,y,g)}roundClean(){f(tN,tL)}destroy(){f(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let tF=B(()=>new tT),tq=B(()=>new tk);class tP extends v{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,a(t);let r=m(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let t=0;t<n.length;t++)n[t]^=54;this.iHash.update(n),this.oHash=t.create();for(let t=0;t<n.length;t++)n[t]^=106;this.oHash.update(n),f(n)}update(t){return l(this),this.iHash.update(t),this}digestInto(t){l(this),s(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let tD=(t,e,r)=>new tP(t,e).update(r).digest();tD.create=(t,e)=>new tP(t,e);let tV=BigInt(0),t$=BigInt(1);function t_(t,e){let r=e.negate();return t?r:e}function tZ(t,e){let r=tn(t.Fp,e.map(t=>t.Z));return e.map((e,i)=>t.fromAffine(e.toAffine(r[i])))}function tj(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function tM(t,e){tj(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1),n=2**t;return{windows:r,windowSize:i,mask:F(t),maxNumber:n,shiftBy:BigInt(t)}}function tG(t,e,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:s}=r,a=Number(t&n),l=t>>s;a>i&&(a-=o,l+=t$);let f=e*i,h=f+Math.abs(a)-1,c=0===a;return{nextN:l,offset:h,isZero:c,isNeg:a<0,isNegF:e%2!=0,offsetF:f}}let tz=new WeakMap,tY=new WeakMap;function tJ(t){return tY.get(t)||1}
vendor: 8,738 bytes, line 1
1function tW(t){if(t!==tV)throw Error("invalid wNAF")}class tX{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,r=this.ZERO){let i=t;for(;e>tV;)e&t$&&(r=r.add(i)),i=i.double(),e>>=t$;return r}precomputeWindow(t,e){let{windows:r,windowSize:i}=tM(e,this.bits),n=[],o=t,s=o;for(let t=0;t<r;t++){s=o,n.push(s);for(let t=1;t<i;t++)s=s.add(o),n.push(s);o=s.double()}return n}wNAF(t,e,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let i=this.ZERO,n=this.BASE,o=tM(t,this.bits);for(let t=0;t<o.windows;t++){let{nextN:s,offset:a,isZero:l,isNeg:f,isNegF:h,offsetF:c}=tG(r,t,o);r=s,l?n=n.add(t_(h,e[c])):i=i.add(t_(f,e[a]))}return tW(r),{p:i,f:n}}wNAFUnsafe(t,e,r,i=this.ZERO){let n=tM(t,this.bits);for(let t=0;t<n.windows&&r!==tV;t++){let{nextN:o,offset:s,isZero:a,isNeg:l}=tG(r,t,n);if(r=o,!a){let t=e[s];i=i.add(l?t.negate():t)}}return tW(r),i}getPrecomputes(t,e,r){let i=tz.get(e);return i||(i=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(i=r(i)),tz.set(e,i))),i}cached(t,e,r){let i=tJ(t);return this.wNAF(i,this.getPrecomputes(i,t,r),e)}unsafe(t,e,r,i){let n=tJ(t);return 1===n?this._unsafeLadder(t,e,i):this.wNAFUnsafe(n,this.getPrecomputes(n,t,r),e,i)}createCache(t,e){tj(e,this.bits),tY.set(t,e),tz.delete(t)}hasCache(t){return 1!==tJ(t)}}function tQ(t,e,r){if(!e)return ta(t,{isLE:r});if(e.ORDER!==t)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return q(e,ti.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),e}let t0=(t,e)=>(t+(t>=0?e:-e)/t5)/e;function t1(t){if(!["compact","recovered","der"].includes(t))throw Error('Signature format must be "compact", "recovered", or "der"');return t}function t2(t,e){let r={};for(let i of Object.keys(e))r[i]=void 0===t[i]?e[i]:t[i];return O(r.lowS,"lowS"),O(r.prehash,"prehash"),void 0!==r.format&&t1(r.format),r}class t8 extends Error{constructor(t=""){super(t)}}let t4={Err:t8,_tlv:{encode:(t,e)=>{let{Err:r}=t4;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let i=e.length/2,n=S(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?S(n.length/2|128):"";return S(t)+o+n+e},decode(t,e){let{Err:r}=t4,i=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new r("tlv.decode: wrong tlv");let n=e[i++],o=0;if(128&n){let t=127&n;if(!t)throw new r("tlv.decode(long): indefinite length not supported");if(t>4)throw new r("tlv.decode(long): byte length is too big");let s=e.subarray(i,i+t);if(s.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of s)o=o<<8|t;if(i+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=n;let s=e.subarray(i,i+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(i+o)}}},_int:{encode(t){let{Err:e}=t4;if(t<t3)throw new e("integer: negative integers are not allowed");let r=S(t);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=t4;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return T(b(t))}},toSig(t){let{Err:e,_int:r,_tlv:i}=t4,n=N("signature",t),{v:o,l:s}=i.decode(48,n);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:l}=i.decode(2,o),{v:f,l:h}=i.decode(2,l);if(h.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(f)}},hexFromSig(t){let{_tlv:e,_int:r}=t4,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s));return e.encode(48,i+n)}},t3=BigInt(0),t6=BigInt(1),t5=BigInt(2),t7=BigInt(3),t9=BigInt(4);function et(t,e){let r,{BYTES:i}=t;if("bigint"==typeof e)r=e;else{let n=N("private key",e);try{r=t.fromBytes(n)}catch(t){throw Error(`invalid private key: expected ui8a of size ${i}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw Error("invalid private key: out of range [1..N-1]");return r}function ee(t){return Uint8Array.of(t?2:3)}function er(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}let ei={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},en={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},eo=BigInt(2),es=ta(ei.p,{sqrt:function(t){let e=ei.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),f=t*t*t%e,h=f*f*t%e,c=W(h,r,e)*h%e,u=W(c,r,e)*h%e,d=W(u,eo,e)*f%e,p=W(d,n,e)*d%e,b=W(p,o,e)*p%e,y=W(b,a,e)*b%e,g=W(y,l,e)*y%e,x=W(g,a,e)*b%e,w=W(x,r,e)*h%e,m=W(w,s,e)*p%e,E=W(m,i,e)*f%e,v=W(E,eo,e);if(!es.eql(es.sqr(v),t))throw Error("Cannot find square root");return v}}),ea=function(t,e){let r=e=>(function(t){let{CURVE:e,curveOpts:r,hash:i,ecdsaOpts:o}=function(t){let{CURVE:e,curveOpts:r}=function(t){let e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp,i=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0,n={Fp:r,Fn:ta(e.n,{BITS:t.nBitLength,allowedLengths:i,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:n}}(t),i={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:r,hash:t.hash,ecdsaOpts:i}}(t),s=function(t,e,r={}){a(e),q(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let i=r.randomBytes||A,o=r.hmac||((t,...r)=>tD(e,t,E(...r))),{Fp:s,Fn:l}=t,{ORDER:f,BITS:h}=l,{keygen:c,getPublicKey:u,getSharedSecret:d,utils:p,lengths:y}=function(t,e={}){let{Fn:r}=t,i=e.randomBytes||A,n=Object.assign(er(t.Fp,r),{seed:tf(r.ORDER)});function o(t){try{return!!et(r,t)}catch(t){return!1}}function s(t=i(n.seed)){return function(t,e,r=!1){let i=t.length,n=tl(e),o=tf(e);if(i<16||i<o||i>1024)throw Error("expected "+o+"-1024 bytes of input, got "+i);let s=J(r?H(t):T(b(t)),e-V)+V;return r?R(s,n):K(s,n)}(U(t,n.seed,"seed"),r.ORDER)}function a(e,i=!0){return t.BASE.multiply(et(r,e)).toBytes(i)}function l(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;let{secretKey:i,publicKey:o,publicKeyUncompressed:s}=n;if(r.allowedLengths||i===o)return;let a=N("key",e).length;return a===o||a===s}return Object.freeze({getPublicKey:a,getSharedSecret:function(e,i,n=!0){if(!0===l(e))throw Error("first arg must be private key");if(!1===l(i))throw Error("second arg must be public key");let o=et(r,e);return t.fromHex(i).multiply(o).toBytes(n)},keygen:function(t){let e=s(t);return{secretKey:e,publicKey:a(e)}},Point:t,utils:{isValidSecretKey:o,isValidPublicKey:function(e,r){let{publicKey:i,publicKeyUncompressed:o}=n;try{let n=e.length;if(!0===r&&n!==i||!1===r&&n!==o)return!1;return!!t.fromBytes(e)}catch(t){return!1}},randomSecretKey:s,isValidPrivateKey:o,randomPrivateKey:s,normPrivateKeyToScalar:t=>et(r,t),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)},lengths:n})}(t,r),g={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},w="compact";function m(t,e){if(!l.isValidNot0(e))throw Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class v{constructor(t,e,r){this.r=m("r",t),this.s=m("s",e),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(t,e=w){let r;if(!function(t,e){t1(e);let r=y.signature;U(t,"compact"===e?r:"recovered"===e?r+1:void 0,`${e} signature`)}(t,e),"der"===e){let{r:e,s:r}=t4.toSig(U(t));return new v(e,r)}"recovered"===e&&(r=t[0],e="compact",t=t.subarray(1));let i=l.BYTES,n=t.subarray(0,i),o=t.subarray(i,2*i);return new v(l.fromBytes(n),l.fromBytes(o),r)}static fromHex(t,e){return this.fromBytes(x(t),e)}addRecoveryBit(t){return new v(this.r,this.s,t)}recoverPublicKey(e){let r=s.ORDER,{r:i,s:n,recovery:o}=this;if(null==o||![0,1,2,3].includes(o))throw Error("recovery id invalid");if(f*t5<r&&o>1)throw Error("recovery id is ambiguous for h>1 curve");let a=2===o||3===o?i+f:i;
vendor: 4,340 bytes, line 1
1if(!s.isValid(a))throw Error("recovery id 2 or 3 invalid");let h=s.toBytes(a),c=t.fromBytes(E(ee((1&o)==0),h)),u=l.inv(a),d=C(N("msgHash",e)),p=l.create(-d*u),b=l.create(n*u),y=t.BASE.multiplyUnsafe(p).add(c.multiplyUnsafe(b));if(y.is0())throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>f>>t6}toBytes(t=w){if(t1(t),"der"===t)return x(t4.hexFromSig(this));let e=l.toBytes(this.r),r=l.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw Error("recovery bit must be present");return E(Uint8Array.of(this.recovery),e,r)}return E(e,r)}toHex(t){return b(this.toBytes(t))}assertValidity(){}static fromCompact(t){return v.fromBytes(N("sig",t),"compact")}static fromDER(t){return v.fromBytes(N("sig",t),"der")}normalizeS(){return this.hasHighS()?new v(this.r,l.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return b(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return b(this.toBytes("compact"))}}let B=r.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=T(b(t)),r=8*t.length-h;return r>0?e>>BigInt(r):e},C=r.bits2int_modN||function(t){return l.create(B(t))},I=F(h);function O(t){return!function(t,e,r,i){if(!(L(e)&&L(r)&&L(i))||!(r<=e)||!(e<i))throw Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}("num < 2^"+h,t,t3,I),l.toBytes(t)}function S(t,r){return U(t,void 0,"message"),r?U(e(t),void 0,"prehashed message"):t}return Object.freeze({keygen:c,getPublicKey:u,getSharedSecret:d,utils:p,lengths:y,Point:t,sign:function(r,n,s={}){let{seed:a,k2sig:h}=function(e,r,n){if(["recovered","canonical"].some(t=>t in n))throw Error("sign() legacy options not supported");let{lowS:o,prehash:s,extraEntropy:a}=t2(n,g),h=C(e=S(e,s)),c=et(l,r),u=[O(c),O(h)];if(null!=a&&!1!==a){let t=!0===a?i(y.secretKey):a;u.push(N("extraEntropy",t))}return{seed:E(...u),k2sig:function(e){let r=B(e);if(!l.isValidNot0(r))return;let i=l.inv(r),n=t.BASE.multiply(r).toAffine(),s=l.create(n.x);if(s===t3)return;let a=l.create(i*l.create(h+s*c));if(a===t3)return;let u=2*(n.x!==s)|Number(n.y&t6),d=a;return o&&a>f>>t6&&(d=l.neg(a),u^=1),new v(s,d,u)}}}(r=N("message",r),n,s);return(function(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let i=t=>new Uint8Array(t),n=t=>Uint8Array.of(t),o=i(t),s=i(t),a=0,l=()=>{o.fill(1),s.fill(0),a=0},f=(...t)=>r(s,o,...t),h=(t=i(0))=>{s=f(n(0),t),o=f(),0!==t.length&&(s=f(n(1),t),o=f())},c=()=>{if(a++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(o=f()).slice();r.push(e),t+=o.length}return E(...r)};return(t,e)=>{let r;for(l(),h(t);!(r=e(c()));)h();return l(),r}})(e.outputLen,l.BYTES,o)(a,h)},verify:function(e,r,i,o={}){let{lowS:s,prehash:a,format:f}=t2(o,g);if(i=N("publicKey",i),r=S(N("message",r),a),"strict"in o)throw Error("options.strict was renamed to lowS");let h=void 0===f?function(t){let e,r="string"==typeof t||n(t),i=!r&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!r&&!i)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(i)e=new v(t.r,t.s);else if(r){try{e=v.fromBytes(N("sig",t),"der")}catch(t){if(!(t instanceof t4.Err))throw t}if(!e)try{e=v.fromBytes(N("sig",t),"compact")}catch(t){return!1}}return!!e&&e}(e):v.fromBytes(N("sig",e),f);if(!1===h)return!1;try{let e=t.fromBytes(i);if(s&&h.hasHighS())return!1;let{r:n,s:o}=h,a=C(r),f=l.inv(o),c=l.create(a*f),u=l.create(n*f),d=t.BASE.multiplyUnsafe(c).add(e.multiplyUnsafe(u));if(d.is0())return!1;return l.create(d.x)===n}catch(t){return!1}},recoverPublicKey:function(t,e,r={}){let{prehash:i}=t2(r,g);return e=S(e,i),v.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:v,hash:e})}(function(t,e={}){let r=function(t,e,r={},i){if(void 0===i&&(i="edwards"===t),!e||"object"!=typeof e)throw Error(`expected valid ${t} CURVE object`);for(let t of["p","n","h"]){let r=e[t];if(!("bigint"==typeof r&&r>tV))throw Error(`CURVE.${t} must be positive bigint`)}let n=tQ(e.p,r.Fp,i),o=tQ(e.n,r.Fn,i);for(let r of["Gx","Gy","a","weierstrass"===t?"b":"d"])if(!n.isValid(e[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);
vendor: 5,248 bytes, line 1
1return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:n,Fn:o}}("weierstrass",t,e),{Fp:i,Fn:n}=r,o=r.CURVE,{h:s,n:a}=o;q(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:l}=e;if(l&&(!i.is0(o.a)||"bigint"!=typeof l.beta||!Array.isArray(l.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let f=er(i,n);function h(){if(!i.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let c=e.toBytes||function(t,e,r){let{x:n,y:o}=e.toAffine(),s=i.toBytes(n);return(O(r,"isCompressed"),r)?(h(),E(ee(!i.isOdd(o)),s)):E(Uint8Array.of(4),s,i.toBytes(o))},u=e.fromBytes||function(t){U(t,void 0,"Point");let{publicKey:e,publicKeyUncompressed:r}=f,n=t.length,o=t[0],s=t.subarray(1);if(n===e&&(2===o||3===o)){let t,e=i.fromBytes(s);if(!i.isValid(e))throw Error("bad point: is not on curve, wrong x");let r=d(e);try{t=i.sqrt(r)}catch(t){throw Error("bad point: is not on curve, sqrt error"+(t instanceof Error?": "+t.message:""))}return h(),(1&o)==1!==i.isOdd(t)&&(t=i.neg(t)),{x:e,y:t}}if(n===r&&4===o){let t=i.BYTES,e=i.fromBytes(s.subarray(0,t)),r=i.fromBytes(s.subarray(t,2*t));if(!p(e,r))throw Error("bad point: is not on curve");return{x:e,y:r}}throw Error(`bad point: got length ${n}, expected compressed=${e} or uncompressed=${r}`)};function d(t){let e=i.sqr(t),r=i.mul(e,t);return i.add(i.add(r,i.mul(t,o.a)),o.b)}function p(t,e){let r=i.sqr(e),n=d(t);return i.eql(r,n)}if(!p(o.Gx,o.Gy))throw Error("bad curve params: generator point");let y=i.mul(i.pow(o.a,t7),t9),g=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(y,g)))throw Error("bad curve params: a or b");function x(t,e,r=!1){if(!i.isValid(e)||r&&i.is0(e))throw Error(`bad point coordinate ${t}`);return e}function w(t){if(!(t instanceof C))throw Error("ProjectivePoint expected")}function m(t){if(!l||!l.basises)throw Error("no endo");return function(t,e,r){let[[i,n],[o,s]]=e,a=t0(s*t,r),l=t0(-n*t,r),f=t-a*i-l*o,h=-a*n-l*s,c=f<t3,u=h<t3;c&&(f=-f),u&&(h=-h);let d=F(Math.ceil(k(r)/2))+t6;if(f<t3||f>=d||h<t3||h>=d)throw Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:c,k1:f,k2neg:u,k2:h}}(t,l.basises,n.ORDER)}let v=P((t,e)=>{let{X:r,Y:n,Z:o}=t;if(i.eql(o,i.ONE))return{x:r,y:n};let s=t.is0();null==e&&(e=s?i.ONE:i.inv(o));let a=i.mul(r,e),l=i.mul(n,e),f=i.mul(o,e);if(s)return{x:i.ZERO,y:i.ZERO};if(!i.eql(f,i.ONE))throw Error("invZ was invalid");return{x:a,y:l}}),B=P(t=>{if(t.is0()){if(e.allowInfinityPoint&&!i.is0(t.Y))return;throw Error("bad point: ZERO")}let{x:r,y:n}=t.toAffine();if(!i.isValid(r)||!i.isValid(n))throw Error("bad point: x or y not field elements");if(!p(r,n))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function A(t,e,r,n,o){return r=new C(i.mul(r.X,t),r.Y,r.Z),e=t_(n,e),r=t_(o,r),e.add(r)}class C{constructor(t,e,r){this.X=x("x",t),this.Y=x("y",e,!0),this.Z=x("z",r),Object.freeze(this)}static CURVE(){return o}static fromAffine(t){let{x:e,y:r}=t||{};if(!t||!i.isValid(e)||!i.isValid(r))throw Error("invalid affine point");if(t instanceof C)throw Error("projective point not allowed");return i.is0(e)&&i.is0(r)?C.ZERO:new C(e,r,i.ONE)}static fromBytes(t){let e=C.fromAffine(u(U(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return C.fromBytes(N("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return S.createCache(this,t),e||this.multiply(t7),this}assertValidity(){B(this)}hasEvenY(){let{y:t}=this.toAffine();if(!i.isOdd)throw Error("Field doesn't support isOdd");return!i.isOdd(t)}equals(t){w(t);let{X:e,Y:r,Z:n}=this,{X:o,Y:s,Z:a}=t,l=i.eql(i.mul(e,a),i.mul(o,n)),f=i.eql(i.mul(r,a),i.mul(s,n));return l&&f}negate(){return new C(this.X,i.neg(this.Y),this.Z)}double(){let{a:t,b:e}=o,r=i.mul(e,t7),{X:n,Y:s,Z:a}=this,l=i.ZERO,f=i.ZERO,h=i.ZERO,c=i.mul(n,n),u=i.mul(s,s),d=i.mul(a,a),p=i.mul(n,s);return p=i.add(p,p),h=i.mul(n,a),h=i.add(h,h),l=i.mul(t,h),f=i.mul(r,d),f=i.add(l,f),l=i.sub(u,f),f=i.add(u,f),f=i.mul(l,f),l=i.mul(p,l),h=i.mul(r,h),d=i.mul(t,d),p=i.sub(c,d),p=i.mul(t,p),p=i.add(p,h),h=i.add(c,c),c=i.add(h,c),c=i.add(c,d),c=i.mul(c,p),f=i.add(f,c),d=i.mul(s,a),d=i.add(d,d),c=i.mul(d,p),l=i.sub(l,c),h=i.mul(d,u),h=i.add(h,h),new C(l,f,h=i.add(h,h))}add(t){w(t);let{X:e,Y:r,Z:n}=this,{X:s,Y:a,Z:l}=t,f=i.ZERO,h=i.ZERO,c=i.ZERO,u=o.a,d=i.mul(o.b,t7),p=i.mul(e,s),b=i.mul(r,a),y=i.mul(n,l),g=i.add(e,r),x=i.add(s,a);g=i.mul(g,x),x=i.add(p,b),g=i.sub(g,x),x=i.add(e,n);let m=i.add(s,l);return x=i.mul(x,m),m=i.add(p,y),x=i.sub(x,m),m=i.add(r,n),f=i.add(a,l),m=i.mul(m,f),f=i.add(b,y),m=i.sub(m,f),c=i.mul(u,x),f=i.mul(d,y),c=i.add(f,c),f=i.sub(b,c),c=i.add(b,c),h=i.mul(f,c),b=i.add(p,p),b=i.add(b,p),y=i.mul(u,y),x=i.mul(d,x),b=i.add(b,y),y=i.sub(p,y),y=i.mul(u,y),x=i.add(x,y),p=i.mul(b,x),h=i.add(h,p),p=i.mul(m,x),f=i.mul(g,f),f=i.sub(f,p),p=i.mul(g,b),c=i.mul(m,c),new C(f,h,c=i.add(c,p))}subtract(t){return this.add(t.negate())}is0(){return this.equals(C.ZERO)}multiply(t){let r,i,{endo:o}=e;if(!n.isValidNot0(t))throw Error("invalid scalar: out of range");let s=t=>S.cached(this,t,t=>tZ(C,t));
1if(o){let{k1neg:e,k1:n,k2neg:a,k2:l}=m(t),{p:f,f:h}=s(n),{p:c,f:u}=s(l);i=h.add(u),r=A(o.beta,f,c,e,a)}else{let{p:e,f:n}=s(t);r=e,i=n}return tZ(C,[r,i])[0]}multiplyUnsafe(t){let{endo:r}=e;if(!n.isValid(t))throw Error("invalid scalar: out of range");if(t===t3||this.is0())return C.ZERO;if(t===t6)return this;if(S.hasCache(this))return this.multiply(t);if(!r)return S.unsafe(this,t);{let{k1neg:e,k1:i,k2neg:n,k2:o}=m(t),{p1:s,p2:a}=function(t,e,r,i){let n=e,o=t.ZERO,s=t.ZERO;for(;r>tV||i>tV;)r&t$&&(o=o.add(n)),i&t$&&(s=s.add(n)),n=n.double(),r>>=t$,i>>=t$;return{p1:o,p2:s}}(C,this,i,o);return A(r.beta,s,a,e,n)}}multiplyAndAddUnsafe(t,e,r){let i=this.multiplyUnsafe(e).add(t.multiplyUnsafe(r));return i.is0()?void 0:i}toAffine(t){return v(this,t)}isTorsionFree(){let{isTorsionFree:t}=e;return s===t6||(t?t(C,this):S.unsafe(this,a).is0())}clearCofactor(){let{clearCofactor:t}=e;return s===t6?this:t?t(C,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(t=!0){return O(t,"isCompressed"),this.assertValidity(),c(C,this,t)}toHex(t=!0){return b(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return tZ(C,t)}static msm(t,e){return function(t,e,r,i){if(!Array.isArray(r))throw Error("array expected");r.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)});if(!Array.isArray(i))throw Error("array of scalars expected");i.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)});let n=r.length,o=i.length;if(n!==o)throw Error("arrays of points and scalars must have equal length");let s=t.ZERO,a=k(BigInt(n)),l=1;a>12?l=a-3:a>4?l=a-2:a>0&&(l=2);let f=F(l),h=Array(Number(f)+1).fill(s),c=Math.floor((e.BITS-1)/l)*l,u=s;for(let t=c;t>=0;t-=l){h.fill(s);for(let e=0;e<o;e++){let n=Number(i[e]>>BigInt(t)&f);h[n]=h[n].add(r[e])}let e=s;for(let t=h.length-1,r=s;t>0;t--)r=r.add(h[t]),e=e.add(r);if(u=u.add(e),0!==t)for(let t=0;t<l;t++)u=u.double()}return u}(C,n,t,e)}static fromPrivateKey(t){return C.BASE.multiply(et(n,t))}}C.BASE=new C(o.Gx,o.Gy,i.ONE),C.ZERO=new C(i.ZERO,i.ONE,i.ZERO),C.Fp=i,C.Fn=n;let I=n.BITS,S=new tX(C,e.endo?Math.ceil(I/2):I);return C.BASE.precompute(8),C}(e,r),i,o),l=s.Point;return Object.assign({},s,{ProjectivePoint:l,CURVE:Object.assign({},t,ts(l.Fn.ORDER,l.Fn.BITS))})})({...t,hash:e});return{...r(e),create:r}}({...ei,Fp:es,lowS:!0,endo:en},tF),el=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),ef=Uint8Array.from(Array(16).fill(0).map((t,e)=>e)),eh=ef.map(t=>(9*t+5)%16),ec=(()=>{let t=[[ef],[eh]];for(let e=0;e<4;e++)for(let r of t)r.push(r[e].map(t=>el[t]));return t})(),eu=ec[0],ed=ec[1],ep=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),eb=eu.map((t,e)=>t.map(t=>ep[e][t])),ey=ed.map((t,e)=>t.map(t=>ep[e][t])),eg=Uint32Array.from([0,0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xa953fd4e]),ex=Uint32Array.from([0x50a28be6,0x5c4dd124,0x6d703ef3,0x7a6d76e9,0]);function ew(t,e,r,i){return 0===t?e^r^i:1===t?e&r|~e&i:2===t?(e|~r)^i:3===t?e&i|r&~i:e^(r|~i)}let em=new Uint32Array(16);class eE extends th{constructor(){super(64,20,8,!0),this.h0=0x67452301,this.h1=-0x10325477,this.h2=-0x67452302,this.h3=0x10325476,this.h4=-0x3c2d1e10}get(){let{h0:t,h1:e,h2:r,h3:i,h4:n}=this;return[t,e,r,i,n]}set(t,e,r,i,n){this.h0=0|t,this.h1=0|e,this.h2=0|r,this.h3=0|i,this.h4=0|n}process(t,e){for(let r=0;r<16;r++,e+=4)em[r]=t.getUint32(e,!0);let r=0|this.h0,i=r,n=0|this.h1,o=n,s=0|this.h2,a=s,l=0|this.h3,f=l,h=0|this.h4,c=h;for(let t=0;t<5;t++){let e=4-t,d=eg[t],p=ex[t],b=eu[t],y=ed[t],g=eb[t],x=ey[t];for(let e=0;e<16;e++){let i=u(r+ew(t,n,s,l)+em[b[e]]+d,g[e])+h|0;r=h,h=l,l=0|u(s,10),s=n,n=i}for(let t=0;t<16;t++){let r=u(i+ew(e,o,a,f)+em[y[t]]+p,x[t])+c|0;i=c,c=f,f=0|u(a,10),a=o,o=r}}this.set(this.h1+s+f|0,this.h2+l+c|0,this.h3+h+i|0,this.h4+r+o|0,this.h0+n+a|0)}roundClean(){f(em)}destroy(){this.destroyed=!0,f(this.buffer),this.set(0,0,0,0,0)}}let ev=B(()=>new eE);var eB=r(42461);let eA=ea.ProjectivePoint,eC=(0,eB.rg)(tF);function eI(t){return s(t),BigInt("0x"+(0===t.length?"0":b(t)))}let eO=w("Bitcoin seed"),eU={private:0x488ade4,public:0x488b21e},eS=t=>{if(!Number.isSafeInteger(t)||t<0||t>0x100000000-1)throw Error("invalid number, should be from 0 to 2**32-1, got "+t);let e=new Uint8Array(4);return h(e).setUint32(0,t,!1),e};class eT{get fingerprint(){if(!this.pubHash)throw Error("No publicKey set!");return h(this.pubHash).getUint32(0,!1)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let t=this.privateKey;if(!t)throw Error("No private key");return eC.encode(this.serialize(this.versions.private,E(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw Error("No public key");return eC.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,e=eU){if(s(t),8*t.length<128||8*t.length>512)throw Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+t.length);let r=tD(tq,eO,t);return new eT({versions:e,chainCode:r.slice(32),privateKey:r.slice(0,32)})}static fromExtendedKey(t,e=eU){let r=eC.decode(t),i=h(r),n=i.getUint32(0,!1),o={versions:e,depth:r[4],parentFingerprint:i.getUint32(5,!1),index:i.getUint32(9,!1),chainCode:r.slice(13,45)},s=r.slice(45),a=0===s[0];if(n!==e[a?"private":"public"])throw Error("Version mismatch");return new eT(a?{...o,privateKey:s.slice(1)}:{...o,publicKey:s})}static fromJSON(t){return eT.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||"object"!=typeof t)throw Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||eU,this.depth=t.depth||0,this.chainCode=t.chainCode||null,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw Error("HDKey: zero depth with 
1non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!ea.utils.isValidPrivateKey(t.privateKey))throw Error("Invalid private key");this.privKey="bigint"==typeof t.privateKey?t.privateKey:eI(t.privateKey),this.privKeyBytes=function(t){if("bigint"!=typeof t)throw Error("bigint expected");return x(t.toString(16).padStart(64,"0"))}(this.privKey),this.pubKey=ea.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=eA.fromHex(t.publicKey).toRawBytes(!0);else throw Error("HDKey: no public or private key provided");this.pubHash=ev(tF(this.pubKey))}derive(t){if(!/^[mM]'?/.test(t))throw Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;let e=t.replace(/^[mM]'?\//,"").split("/"),r=this;for(let t of e){let e=/^(\d+)('?)$/.exec(t),i=e&&e[1];if(!e||3!==e.length||"string"!=typeof i)throw Error("invalid child index: "+t);let n=+i;if(!Number.isSafeInteger(n)||n>=0x80000000)throw Error("Invalid index");"'"===e[2]&&(n+=0x80000000),r=r.deriveChild(n)}return r}deriveChild(t){if(!this.pubKey||!this.chainCode)throw Error("No publicKey or chainCode set");let e=eS(t);if(t>=0x80000000){let t=this.privateKey;if(!t)throw Error("Could not derive hardened child key");e=E(new Uint8Array([0]),t,e)}else e=E(this.pubKey,e);let r=tD(tq,this.chainCode,e),i=eI(r.slice(0,32)),n=r.slice(32);if(!ea.utils.isValidPrivateKey(i))throw Error("Tweak bigger than curve order");let o={versions:this.versions,chainCode:n,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){let t=J(this.privKey+i,ea.CURVE.n);if(!ea.utils.isValidPrivateKey(t))throw Error("The tweak was out of range or the resulted private key is invalid");o.privateKey=t}else{let t=eA.fromHex(this.pubKey).add(eA.fromPrivateKey(i));if(t.equals(eA.ZERO))throw Error("The tweak was equal to negative P, which made the result key invalid");o.publicKey=t.toRawBytes(!0)}return new eT(o)}catch(e){return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw Error("No privateKey set!");return s(t,32),ea.sign(t,this.privKey).toCompactRawBytes()}verify(t,e){let r;if(s(t,32),s(e,64),!this.publicKey)throw Error("No publicKey set!");try{r=ea.Signature.fromCompact(e)}catch(t){return!1}return ea.verify(r,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,e){if(!this.chainCode)throw Error("No chainCode set");return s(e,33),E(eS(t),new Uint8Array([this.depth]),eS(this.parentFingerprint),eS(this.index),this.chainCode,e)}}},72707:(t,e,r)=>{function i(t){if(!Number.isSafeInteger(t)||t<0)throw Error("positive integer expected, got "+t)}function n(t,...e){if(!(t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error("Uint8Array expected of length "+e+", got length="+t.length)}function o(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.createHasher");i(t.outputLen),i(t.blockLen)}function s(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function a(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function l(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function f(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function h(t){return"string"==typeof t&&(t=f(t)),n(t),t}function c(t){return"string"==typeof t&&(t=f(t)),n(t),t}r.d(e,{kw:()=>D});class u{}class d extends u{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,o(t);let r=h(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?t.create().update(r).digest():r);for(let t=0;t<n.length;t++)n[t]^=54;this.iHash.update(n),this.oHash=t.create();for(let t=0;t<n.length;t++)n[t]^=106;this.oHash.update(n),a(n)}update(t){return s(this),this.iHash.update(t),this}digestInto(t){s(this),n(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let p=(t,e,r)=>new d(t,e).update(r).digest();p.create=(t,e)=>new d(t,e);class b extends u{constructor(t,e,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=l(this.buffer)}update(t){s(this),n(t=h(t));let{view:e,buffer:r,blockLen:i}=this,o=t.length;for(let n=0;n<o;){let s=Math.min(i-this.pos,o-n);if(s===i){let e=l(t);for(;i<=o-n;n+=i)this.process(e,n);continue}r.set(t.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===i&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){s(this);n(t);let e=this.outputLen;if(t.length<e)throw Error("digestInto() expects output buffer of length at least "+e);this.finished=!0;let{buffer:r,view:i,blockLen:o,isLE:f}=this,{pos:h}=this;r[h++]=128,a(this.buffer.subarray(h)),this.padOffset>o-h&&(this.process(i,0),h=0);for(let t=h;t<o;t++)r[t]=0;!function(t,e,r,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),a=Number(r&o),l=4*!!i,f=4*!i;t.setUint32(e+l,s,i),t.setUint32(e+f,a,i)}(i,o-8,BigInt(8*this.length),f),this.process(i,0);let c=l(t),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=u/4,p=this.get();if(d>p.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<d;t++)c.setUint32(4*t,p[t],f)}
1digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=s,i%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}let y=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),g=BigInt(0x100000000-1),x=BigInt(32),w=(t,e,r)=>t>>>r,m=(t,e,r)=>t<<32-r|e>>>r,E=(t,e,r)=>t>>>r|e<<32-r,v=(t,e,r)=>t<<32-r|e>>>r,B=(t,e,r)=>t<<64-r|e>>>r-32,A=(t,e,r)=>t>>>r-32|e<<64-r;function C(t,e,r,i){let n=(e>>>0)+(i>>>0);return{h:t+r+(n/0x100000000|0)|0,l:0|n}}let I=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),O=(t,e,r,i)=>e+r+i+(t/0x100000000|0)|0,U=(t,e,r,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0),S=(t,e,r,i,n)=>e+r+i+n+(t/0x100000000|0)|0,T=(t,e,r,i,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(i>>>0)+(n>>>0),H=(t,e,r,i,n,o)=>e+r+i+n+o+(t/0x100000000|0)|0,K=function(t,e=!1){let r=t.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=function(t,e=!1){return e?{h:Number(t&g),l:Number(t>>x&g)}:{h:0|Number(t>>x&g),l:0|Number(t&g)}}(t[o],e);[i[o],n[o]]=[r,s]}return[i,n]}(["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","0xf40e3585
15771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),R=K[0],N=K[1],L=new Uint32Array(80),k=new Uint32Array(80);class F extends b{constructor(t=64){super(128,t,16,!1),this.Ah=0|y[0],this.Al=0|y[1],this.Bh=0|y[2],this.Bl=0|y[3],this.Ch=0|y[4],this.Cl=0|y[5],this.Dh=0|y[6],this.Dl=0|y[7],this.Eh=0|y[8],this.El=0|y[9],this.Fh=0|y[10],this.Fl=0|y[11],this.Gh=0|y[12],this.Gl=0|y[13],this.Hh=0|y[14],this.Hl=0|y[15]}get(){let{Ah:t,Al:e,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:a,Eh:l,El:f,Fh:h,Fl:c,Gh:u,Gl:d,Hh:p,Hl:b}=this;return[t,e,r,i,n,o,s,a,l,f,h,c,u,d,p,b]}set(t,e,r,i,n,o,s,a,l,f,h,c,u,d,p,b){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|l,this.El=0|f,this.Fh=0|h,this.Fl=0|c,this.Gh=0|u,this.Gl=0|d,this.Hh=0|p,this.Hl=0|b}process(t,e){for(let r=0;r<16;r++,e+=4)L[r]=t.getUint32(e),k[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|L[t-15],r=0|k[t-15],i=E(e,r,1)^E(e,r,8)^w(e,r,7),n=v(e,r,1)^v(e,r,8)^m(e,r,7),o=0|L[t-2],s=0|k[t-2],a=E(o,s,19)^B(o,s,61)^w(o,s,6),l=U(n,v(o,s,19)^A(o,s,61)^m(o,s,6),k[t-7],k[t-16]),f=S(l,i,a,L[t-7],L[t-16]);L[t]=0|f,k[t]=0|l}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:a,Dh:l,Dl:f,Eh:h,El:c,Fh:u,Fl:d,Gh:p,Gl:b,Hh:y,Hl:g}=this;for(let t=0;t<80;t++){let e=E(h,c,14)^E(h,c,18)^B(h,c,41),x=v(h,c,14)^v(h,c,18)^A(h,c,41),w=h&u^~h&p,m=T(g,x,c&d^~c&b,N[t],k[t]),U=H(m,y,e,w,R[t],L[t]),S=0|m,K=E(r,i,28)^B(r,i,34)^B(r,i,39),F=v(r,i,28)^A(r,i,34)^A(r,i,39),q=r&n^r&s^n&s,P=i&o^i&a^o&a;y=0|p,g=0|b,p=0|u,b=0|d,u=0|h,d=0|c,({h:h,l:c}=C(0|l,0|f,0|U,0|S)),l=0|s,f=0|a,s=0|n,a=0|o,n=0|r,o=0|i;let D=I(S,F,P);r=O(D,U,K,q),i=0|D}({h:r,l:i}=C(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=C(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:a}=C(0|this.Ch,0|this.Cl,0|s,0|a)),({h:l,l:f}=C(0|this.Dh,0|this.Dl,0|l,0|f)),({h:h,l:c}=C(0|this.Eh,0|this.El,0|h,0|c)),({h:u,l:d}=C(0|this.Fh,0|this.Fl,0|u,0|d)),({h:p,l:b}=C(0|this.Gh,0|this.Gl,0|p,0|b)),({h:y,l:g}=C(0|this.Hh,0|this.Hl,0|y,0|g)),this.set(r,i,n,o,s,a,l,f,h,c,u,d,p,b,y,g)}roundClean(){a(L,k)}destroy(){a(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let q=function(t){let e=e=>t().update(h(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}(()=>new F);function P(t){if("string"!=typeof t)throw TypeError("invalid mnemonic type: "+typeof t);return t.normalize("NFKD")}function D(t,e=""){return function(t,e,r,n){var s;let f,{c:h,dkLen:u,DK:d,PRF:b,PRFSalt:y}=function(t,e,r,n){o(t);let{c:s,dkLen:a,asyncTick:l}=function(t,e){if(void 0!==e&&"[object Object]"!==({}).toString.call(e))throw Error("options should be object or undefined");return Object.assign(t,e)}({dkLen:32,asyncTick:10},n);if(i(s),i(a),i(l),s<1)throw Error("iterations (c) should be >= 1");let f=c(e),h=c(r),u=new Uint8Array(a),d=p.create(t,f),b=d._cloneInto().update(h);return{c:s,dkLen:a,asyncTick:l,DK:u,PRF:d,PRFSalt:b}}(t,e,r,n),g=new Uint8Array(4),x=l(g),w=new Uint8Array(b.outputLen);for(let t=1,e=0;e<u;t++,e+=b.outputLen){let r=d.subarray(e,e+b.outputLen);x.setInt32(0,t,!1),(f=y._cloneInto(f)).update(g).digestInto(w),r.set(w.subarray(0,r.length));for(let t=1;t<h;t++){b._cloneInto(f).update(w).digestInto(w);for(let t=0;t<r.length;t++)r[t]^=w[t]}}return s=f,b.destroy(),y.destroy(),s&&s.destroy(),a(w),d}(q,function(t){let e=P(t),r=e.split(" ");if(![12,15,18,21,24].includes(r.length))throw Error("Invalid mnemonic");return{nfkd:e,words:r}}(t).nfkd,P("mnemonic"+e),{c:2048,dkLen:64})}},99410:(t,e,r)=>{r.d(e,{zL:()=>A});var i,n=r(22248),o=r(26311),s=r(15438),a=r(10734),l=r(28813),f=r(84437),h=r(58190);!function(t){t[t.ClarityAbiTypeUInt128=1]="ClarityAbiTypeUInt128",t[t.ClarityAbiTypeInt128=2]="ClarityAbiTypeInt128",t[t.ClarityAbiTypeBool=3]="ClarityAbiTypeBool",t[t.ClarityAbiTypePrincipal=4]="ClarityAbiTypePrincipal",t[t.ClarityAbiTypeNone=5]="ClarityAbiTypeNone",t[t.ClarityAbiTypeBuffer=6]="ClarityAbiTypeBuffer",t[t.ClarityAbiTypeResponse=7]="ClarityAbiTypeResponse",t[t.ClarityAbiTypeOptional=8]="ClarityAbiTypeOptional",t[t.ClarityAbiTypeTuple=9]="ClarityAbiTypeTuple",t[t.ClarityAbiTypeList=10]="ClarityAbiTypeList",t[t.ClarityAbiTypeStringAscii=11]="ClarityAbiTypeStringAscii",t[t.ClarityAbiTypeStringUtf8=12]="ClarityAbiTypeStringUtf8",t[t.ClarityAbiTypeTraitReference=13]="ClarityAbiTypeTraitReference"}(i||(i={}));let c=t=>void 0!==t["string-ascii"],u=t=>void 0!==t["string-utf8"];var d=r(25003),p=r(69608),b=r(98012),y=r(19026),g=r(19554);class x{constructor(t){this.transaction=t,this.sigHash=t.signBegin(),this.originDone=!1,this.checkOversign=!0,this.checkOverlap=!0;let e=t.auth.spendingCondition;if(e&&!(0,s.I4)(e)){if(e.fields.filter(t=>t.contents.type===g.$.MessageSignature).length>=e.signaturesRequired)throw Error("SpendingCondition has more signatures than are expected");e.fields.forEach(r=>{if(r.contents.type!==g.$.MessageSignature)return;let i=r.contents,n=(0,s.Jr)(this.sigHash,t.auth.authType,e.fee,e.nonce,a.G5.Compressed,i.data);(0,s.pi)(e.hashMode)||(this.sigHash=n.nextSigHash)})}}static createSponsorSigner(t,e){if(t.auth.authType!=a.hT.Sponsored)throw new y.uJ("Cannot add sponsor to non-sponsored transaction");let r=(0,h.mg)(t);r.setSponsor(e);let i=r.verifyOrigin(),n=new this(r);return n.originDone=!0,n.sigHash=i,n.checkOversign=!0,n.checkOverlap=!0,n}signOrigin(t){if(this.checkOverlap&&this.originDone)throw new y.uJ("Cannot sign origin after sponsor key");if(void 0===this.transaction.auth)throw new y.uJ('"transaction.auth" is undefined');if(void 0===this.transaction.auth.spendingCondition)throw new y.uJ('"transaction.auth.spendingCondition" is undefined');let e=this.transaction.auth.spendingCondition;if((e.hashMode===a.ct.P2SH||e.hashMode===a.ct.P2WSH)&&this.checkOversign&&e.fields.filter(t=>t.contents.type===g.$.MessageSignature).length>=e.signaturesRequired)throw Error("Origin would have too many signatures");let r=this.transaction.signNextOrigin(this.sigHash,t);((0,s.I4)(this.transaction.auth.spendingCondition)||(0,s.Ir)(this.transaction.auth.spendingCondition.hashMode))&&(this.sigHash=r)}appendOrigin(t){let e="object"==typeof t&&"type"in t?t:(0,p.uC)(t);if(this.checkOverlap&&this.originDone)throw Error("Cannot append public key to origin after sponsor key");if(void 0===this.transaction.auth)throw Error('"transaction.auth" is undefined');if(void 0===this.transaction.auth.spendingCondition)throw Error('"transaction.auth.spendingCondition" is undefined');this.transaction.appendPubkey(e)}signSponsor(t){if(void 0===this.transaction.auth)throw new y.uJ('"transaction.auth" is undefined');if(this.transaction.auth.authType!==a.hT.Sponsored)throw new y.uJ('"transaction.auth.authType" is not AuthType.Sponsored');let e=this.transaction.signNextSponsor(this.sigHash,t);this.sigHash=e,this.originDone=!0}getTxInComplete(){return(0,h.mg)(this.transaction)}resume(t){this.transaction=(0,h.mg)(t),this.sigHash=t.signBegin()}}var w=r(31843),m=r(98101),E=r(30115),v=r(10934);async function B(t){let e=Object.assign({fee:BigInt(0),nonce:BigInt(0),network:n.nG,postConditionMode:a.FN.Deny,sponsored:!1},t);e.network=(0,n.hu)(e.network),e.client=Object.assign({},(0,n.Up)(e.network),e.client),e.postConditionMode=(0,b.HI)(e.postConditionMode);let r=(0,m.tT)(e.contractAddress,e.contractName,e.functionName,e.functionArgs);if(e?.validateWithAbi){let t;if("boolean"==typeof e.validateWithAbi)if(e?.network)t=await (0,d.dN)({...e});else throw Error("Network option must be provided in order to validate with ABI");else t=e.validateWithAbi;!function(t,e){let r=e.functions.filter(e=>e.name===t.functionName.content);if(1===r.length){let e=r[0].args;if(t.functionArgs.length!==e.length)throw Error(`Clarity function expects ${e.length} argument(s) but received ${t.functionArgs.length}`);for(let r=0;r<t.functionArgs.length;r++){let n=t.functionArgs[r],o=e[r];if(!function t(e,r){let n=function(t){if("string"==typeof t)if("uint128"===t)return{id:i.ClarityAbiTypeUInt128,type:t};else if("int128"===t)return{id:i.ClarityAbiTypeInt128,type:t};else if("bool"===t)return{id:i.ClarityAbiTypeBool,type:t};else if("principal"===t)return{id:i.ClarityAbiTypePrincipal,type:t};else if("trait_reference"===t)return{id:i.ClarityAbiTypeTraitReference,type:t};else if("none"===t)return{id:i.ClarityAbiTypeNone,type:t};else throw Error(`Unexpected Clarity ABI type primitive: ${JSON.stringify(t)}`);if(void 0!==t.buffer)return{id:i.ClarityAbiTypeBuffer,type:t};if(void 0!==t.response)return{id:i.ClarityAbiTypeResponse,type:t};if(void 0!==t.optional)return{id:i.ClarityAbiTypeOptional,type:t};else if(void 0!==t.tuple)return{id:i.ClarityAbiTypeTuple,type:t};else if(void 0!==t.list)return{id:i.ClarityAbiTypeList,type:t};else if(c(t))return{id:i.ClarityAbiTypeStringAscii,type:t};else if(u(t))return{id:i.ClarityAbiTypeStringUtf8,type:t};else throw Error(`Unexpected Clarity ABI type: ${JSON.stringify(t)}`)}(r);switch(e.type){case l.dl.BoolTrue:case l.dl.BoolFalse:return n.id===i.ClarityAbiTypeBool;case l.dl.Int:return n.id===i.ClarityAbiTypeInt128;case l.dl.UInt:return n.id===i.ClarityAbiTypeUInt128;
1case l.dl.Buffer:return n.id===i.ClarityAbiTypeBuffer&&n.type.buffer.length>=Math.ceil(e.value.length/2);case l.dl.StringASCII:return n.id===i.ClarityAbiTypeStringAscii&&n.type["string-ascii"].length>=e.value.length;case l.dl.StringUTF8:return n.id===i.ClarityAbiTypeStringUtf8&&n.type["string-utf8"].length>=e.value.length;case l.dl.OptionalNone:return n.id===i.ClarityAbiTypeNone||n.id===i.ClarityAbiTypeOptional;case l.dl.OptionalSome:return n.id===i.ClarityAbiTypeOptional&&t(e.value,n.type.optional);case l.dl.ResponseErr:return n.id===i.ClarityAbiTypeResponse&&t(e.value,n.type.response.error);case l.dl.ResponseOk:return n.id===i.ClarityAbiTypeResponse&&t(e.value,n.type.response.ok);case l.dl.PrincipalContract:return n.id===i.ClarityAbiTypePrincipal||n.id===i.ClarityAbiTypeTraitReference;case l.dl.PrincipalStandard:return n.id===i.ClarityAbiTypePrincipal;case l.dl.List:return n.id==i.ClarityAbiTypeList&&n.type.list.length>=e.value.length&&e.value.every(e=>t(e,n.type.list.type));case l.dl.Tuple:if(n.id!=i.ClarityAbiTypeTuple)return!1;{let r=(0,h.mg)(e.value);for(let e=0;e<n.type.tuple.length;e++){let i=n.type.tuple[e],o=i.name,s=r[o];if(!s||!t(s,i.type))return!1;delete r[o]}return!0}default:return!1}}(n,o.type)){let e=r+1;throw Error(`Clarity function \`${t.functionName.content}\` expects argument ${e} to be of type ${function t(e){if("string"==typeof e)return"int128"===e?"int":"uint128"===e?"uint":e;if(void 0!==e.buffer)return`(buff ${e.buffer.length})`;if(c(e))return`(string-ascii ${e["string-ascii"].length})`;if(u(e))return`(string-utf8 ${e["string-utf8"].length})`;else if(void 0!==e.response)return`(response ${t(e.response.ok)} ${t(e.response.error)})`;else if(void 0!==e.optional)return`(optional ${t(e.optional)})`;else if(void 0!==e.tuple)return`(tuple ${e.tuple.map(e=>`(${e.name} ${t(e.type)})`).join(" ")})`;else if(void 0!==e.list)return`(list ${e.list.length} ${t(e.list.type)})`;else throw Error(`Type string unsupported for Clarity type: ${JSON.stringify(e)}`)}(o.type)}, not ${(0,f.P2)(n)}`)}}return}if(0===r.length)throw Error(`ABI doesn't contain a function with the name ${t.functionName.content}`);throw Error(`Malformed ABI. Contains multiple functions with the name ${t.functionName.content}`)}(r,t)}let y=null;if("publicKey"in e)y=(0,s.v_)(a.ct.P2PKH,e.publicKey,e.nonce,e.fee);else{let t=e.useNonSequentialMultiSig?a.ct.P2SHNonSequential:a.ct.P2SH,r=e.address?C(e.publicKeys.map(p.ru),e.numSignatures,t,(0,m.FR)(e.address).hash160):e.publicKeys.map(p.ru);y=(0,s.o5)(t,e.numSignatures,r,e.nonce,e.fee)}let g=e.sponsored?(0,s.km)(y):(0,s.Kz)(y),x=(e.postConditions??[]).map(t=>"string"==typeof t?(0,E.I_)(t):"string"==typeof t.type?(0,b._)(t):t),v=(0,m.lU)(x),B=new w.$f({transactionVersion:e.network.transactionVersion,chainId:e.network.chainId,auth:g,payload:r,postConditions:v,postConditionMode:e.postConditionMode});if(void 0===t.fee||null===t.fee){let t=await (0,d.tL)({transaction:B,...e});B.setFee(t)}if(void 0===t.nonce||null===t.nonce){let t=e.network.addressVersion.singleSig,r=(0,o.bJ)(t,B.auth.spendingCondition.signer),i=await (0,d.QQ)({address:r,...e});B.setNonce(i)}return B}async function A(t){if("senderKey"in t){let e=(0,p.Ti)(t.senderKey),r=(0,h.cJ)(t,"senderKey"),i=await B({publicKey:e,...r}),n=t.senderKey;return new x(i).signOrigin(n),i}{let e=(0,h.cJ)(t,"signerKeys"),r=await B(e);return function(t,e,r,i){if((0,s.I4)(t.auth.spendingCondition))throw Error("Transaction is not a multi-sig transaction");let n=new x(t);for(let o of i?C(e,t.auth.spendingCondition.signaturesRequired,t.auth.spendingCondition.hashMode,(0,m.FR)(i).hash160):e){let t=r.find(t=>(0,p.Ti)(t)===o);t?n.signOrigin(t):n.appendOrigin(o)}}(r,t.publicKeys.map(p.ru).slice(),t.signerKeys.map(p.xr),t.address),r}}function C(t,e,r,i){if((0,v.Uw)(0,r,e,t.map(p.uC)).hash160===i)return t;let n=t.slice().sort();if((0,v.Uw)(0,r,e,n.map(p.uC)).hash160===i)return n;throw Error("Failed to find matching multi-sig address given public-keys.")}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.