PageSourceSearch

https://zauth.inc/_next/static/chunks/1u3ek0cekd6r0.js

js zauth.inc collected 2026-10-08 01:58:26 UTC 331,934 bytes, 7 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14303,70525,9361,44314,26539,70948,10588,33795,80355,38340,85098,t=>{"use strict";let e="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function r(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function n(t){if(!Number.isSafeInteger(t)||t<0)throw Error("positive integer expected, got "+t)}function i(t,...e){if(!r(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 o(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 s(t,e){i(t);let r=e.outputLen;if(t.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function a(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function u(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function l(t,e){return t<<32-e|t>>>e}let f=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?t=>t:function(t){for(let r=0;r<t.length;r++){var e;t[r]=(e=t[r])<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}return t},c="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,h=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function d(t){if(i(t),c)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=h[t[r]];return e}function p(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function g(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);if(c)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 n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){let r=p(t.charCodeAt(i)),o=p(t.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[i]+t[i+1])+'" at index '+i);n[e]=16*r+o}return n}function y(t){if("string"!=typeof t)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function m(t){return"string"==typeof t&&(t=y(t)),i(t),t}function b(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];i(n),e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let i=t[e];r.set(i,n),n+=i.length}return r}class w{}function v(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 x(t=32){if(e&&"function"==typeof e.getRandomValues)return e.getRandomValues(new Uint8Array(t));if(e&&"function"==typeof e.randomBytes)return Uint8Array.from(e.randomBytes(t));throw Error("crypto.getRandomValues must be defined")}t.s(["Hash",0,w,"abytes",0,i,"aexists",0,o,"ahash",0,function(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.createHasher");n(t.outputLen),n(t.blockLen)},"anumber",0,n,"aoutput",0,s,"bytesToHex",0,d,"clean",0,a,"concatBytes",0,b,"createHasher",0,v,"createView",0,u,"createXOFer",0,function(t){let e=(e,r)=>t(r).update(m(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},"hexToBytes",0,g,"isBytes",0,r,"randomBytes",0,x,"rotr",0,l,"swap32IfBE",0,f,"toBytes",0,m,"u32",0,function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},"utf8ToBytes",0,y],70525);class S extends w{constructor(t,e,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(t),this.view=u(this.buffer)}update(t){o(this),i(t=m(t));let{view:e,buffer:r,blockLen:n}=this,s=t.length;for(let i=0;i<s;){let o=Math.min(n-this.pos,s-i);if(o===n){let e=u(t);for(;n<=s-i;i+=n)this.process(e,i);continue}r.set(t.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){o(this),s(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:n,isLE:i}=this,{pos:l}=this;e[l++]=128,a(this.buffer.subarray(l)),this.padOffset>n-l&&(this.process(r,0),l=0);for(let t=l;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>i&o),a=Number(r&o),u=4*!!n,l=4*!n;t.setUint32(e+u,s,n),t.setUint32(e+l,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);let f=u(t),c=this.outputLen;if(c%4)throw Error("_sha2: outputLen should be aligned to 32bit");let h=c/4,d=this.get();if(h>d.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<h;t++)f.setUint32(4*t,d[t],i)}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:n,finished:i,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=i,t.length=n,t.pos=s,n%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}
1let E=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),B=Uint32Array.from([0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]),k=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),A=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),I=BigInt(0x100000000-1),_=BigInt(32);function M(t,e=!1){let r=t.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=function(t,e=!1){return e?{h:Number(t&I),l:Number(t>>_&I)}:{h:0|Number(t>>_&I),l:0|Number(t&I)}}(t[o],e);[n[o],i[o]]=[r,s]}return[n,i]}let T=(t,e,r)=>t>>>r,U=(t,e,r)=>t<<32-r|e>>>r,O=(t,e,r)=>t>>>r|e<<32-r,R=(t,e,r)=>t<<32-r|e>>>r,L=(t,e,r)=>t<<64-r|e>>>r-32,P=(t,e,r)=>t>>>r-32|e<<64-r;function C(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/0x100000000|0)|0,l:0|i}}let N=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),q=(t,e,r,n)=>e+r+n+(t/0x100000000|0)|0,z=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),W=(t,e,r,n,i)=>e+r+n+i+(t/0x100000000|0)|0,F=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),D=(t,e,r,n,i,o)=>e+r+n+i+o+(t/0x100000000|0)|0;t.s(["add",0,C,"add3H",0,q,"add3L",0,N,"add4H",0,W,"add4L",0,z,"add5H",0,D,"add5L",0,F,"rotlBH",0,(t,e,r)=>e<<r-32|t>>>64-r,"rotlBL",0,(t,e,r)=>t<<r-32|e>>>64-r,"rotlSH",0,(t,e,r)=>t<<r|e>>>32-r,"rotlSL",0,(t,e,r)=>e<<r|t>>>32-r,"rotrBH",0,L,"rotrBL",0,P,"rotrSH",0,O,"rotrSL",0,R,"shrSH",0,T,"shrSL",0,U,"split",0,M],9361);let j=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]),K=new Uint32Array(64);class $ extends S{constructor(t=32){super(64,t,8,!1),this.A=0|E[0],this.B=0|E[1],this.C=0|E[2],this.D=0|E[3],this.E=0|E[4],this.F=0|E[5],this.G=0|E[6],this.H=0|E[7]}get(){let{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)K[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=K[t-15],r=K[t-2],n=l(e,7)^l(e,18)^e>>>3,i=l(r,17)^l(r,19)^r>>>10;K[t]=i+K[t-7]+n+K[t-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:u,H:f}=this;for(let t=0;t<64;t++){var c,h,d,p;let e=f+(l(s,6)^l(s,11)^l(s,25))+((c=s)&a^~c&u)+j[t]+K[t]|0,g=(l(r,2)^l(r,13)^l(r,22))+((h=r)&(d=n)^h&(p=i)^d&p)|0;f=u,u=a,a=s,s=o+e|0,o=i,i=n,n=r,r=e+g|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,n,i,o,s,a,u,f)}roundClean(){a(K)}destroy(){this.set(0,0,0,0,0,0,0,0),a(this.buffer)}}class H extends ${constructor(){super(28),this.A=0|B[0],this.B=0|B[1],this.C=0|B[2],this.D=0|B[3],this.E=0|B[4],this.F=0|B[5],this.G=0|B[6],this.H=0|B[7]}}let V=M(["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","0
1xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Z=V[0],G=V[1],Y=new Uint32Array(80),X=new Uint32Array(80);class J extends S{constructor(t=64){super(128,t,16,!1),this.Ah=0|A[0],this.Al=0|A[1],this.Bh=0|A[2],this.Bl=0|A[3],this.Ch=0|A[4],this.Cl=0|A[5],this.Dh=0|A[6],this.Dl=0|A[7],this.Eh=0|A[8],this.El=0|A[9],this.Fh=0|A[10],this.Fl=0|A[11],this.Gh=0|A[12],this.Gl=0|A[13],this.Hh=0|A[14],this.Hl=0|A[15]}get(){let{Ah:t,Al:e,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:u,El:l,Fh:f,Fl:c,Gh:h,Gl:d,Hh:p,Hl:g}=this;return[t,e,r,n,i,o,s,a,u,l,f,c,h,d,p,g]}set(t,e,r,n,i,o,s,a,u,l,f,c,h,d,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|l,this.Fh=0|f,this.Fl=0|c,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|g}process(t,e){for(let r=0;r<16;r++,e+=4)Y[r]=t.getUint32(e),X[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|Y[t-15],r=0|X[t-15],n=O(e,r,1)^O(e,r,8)^T(e,r,7),i=R(e,r,1)^R(e,r,8)^U(e,r,7),o=0|Y[t-2],s=0|X[t-2],a=O(o,s,19)^L(o,s,61)^T(o,s,6),u=z(i,R(o,s,19)^P(o,s,61)^U(o,s,6),X[t-7],X[t-16]),l=W(u,n,a,Y[t-7],Y[t-16]);Y[t]=0|l,X[t]=0|u}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:u,Dl:l,Eh:f,El:c,Fh:h,Fl:d,Gh:p,Gl:g,Hh:y,Hl:m}=this;for(let t=0;t<80;t++){let e=O(f,c,14)^O(f,c,18)^L(f,c,41),b=R(f,c,14)^R(f,c,18)^P(f,c,41),w=f&h^~f&p,v=F(m,b,c&d^~c&g,G[t],X[t]),x=D(v,y,e,w,Z[t],Y[t]),S=0|v,E=O(r,n,28)^L(r,n,34)^L(r,n,39),B=R(r,n,28)^P(r,n,34)^P(r,n,39),k=r&i^r&s^i&s,A=n&o^n&a^o&a;y=0|p,m=0|g,p=0|h,g=0|d,h=0|f,d=0|c,({h:f,l:c}=C(0|u,0|l,0|x,0|S)),u=0|s,l=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let I=N(S,B,A);r=q(I,x,E,k),n=0|I}({h:r,l:n}=C(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=C(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=C(0|this.Ch,0|this.Cl,0|s,0|a)),({h:u,l:l}=C(0|this.Dh,0|this.Dl,0|u,0|l)),({h:f,l:c}=C(0|this.Eh,0|this.El,0|f,0|c)),({h:h,l:d}=C(0|this.Fh,0|this.Fl,0|h,0|d)),({h:p,l:g}=C(0|this.Gh,0|this.Gl,0|p,0|g)),({h:y,l:m}=C(0|this.Hh,0|this.Hl,0|y,0|m)),this.set(r,n,i,o,s,a,u,l,f,c,h,d,p,g,y,m)}roundClean(){a(Y,X)}destroy(){a(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let Q=v(()=>new $),tt=v(()=>new H),te=v(()=>new J);t.s(["SHA224",0,H,"SHA256",0,$,"sha224",0,tt,"sha256",0,Q,"sha512",0,te],44314);let tr=BigInt(0),tn=BigInt(1);function ti(t,e=""){if("boolean"!=typeof t)throw Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t);return t}function to(t,e,n=""){let i=r(t),o=t?.length,s=void 0!==e;if(!i||s&&o!==e)throw Error((n&&`"${n}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(i?`length=${o}`:`type=${typeof t}`));return t}function ts(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?tr:BigInt("0x"+t)}function ta(t){return ts(d(t))}function tu(t){return i(t),ts(d(Uint8Array.from(t).reverse()))}function tl(t,e){return g(t.toString(16).padStart(2*e,"0"))}function tf(t,e){return tl(t,e).reverse()}function tc(t,e,n){let i;if("string"==typeof e)try{i=g(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(r(e))i=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let o=i.length;if("number"==typeof n&&o!==n)throw Error(t+" of length "+n+" expected, got "+o);return i}function th(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r}function td(t){return Uint8Array.from(t)}let tp=t=>"bigint"==typeof t&&tr<=t;function tg(t,e,r){return tp(t)&&tp(e)&&tp(r)&&e<=t&&t<r}function ty(t,e,r,n){if(!tg(e,r,n))throw Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function tm(t){let e;for(e=0;t>tr;t>>=tn,e+=1);return e}let tb=t=>(tn<<BigInt(t))-tn;function tw(t){return"function"==typeof t&&Number.isSafeInteger(t.outputLen)}function tv(t,e,r={}){if(!t||"object"!=typeof t)throw Error("expected valid options object");function n(e,r,n){let i=t[e];if(n&&void 0===i)return;let o=typeof i;if(o!==r||null===i)throw Error(`param "${e}
1" is invalid: expected ${r}, got ${o}`)}Object.entries(e).forEach(([t,e])=>n(t,e,!1)),Object.entries(r).forEach(([t,e])=>n(t,e,!0))}let tx=()=>{throw Error("not implemented")};function tS(t){let e=new WeakMap;return(r,...n)=>{let i=e.get(r);if(void 0!==i)return i;let o=t(r,...n);return e.set(r,o),o}}t.s(["_abool2",0,ti,"_abytes2",0,to,"_validateObject",0,tv,"aInRange",0,ty,"bitLen",0,tm,"bitMask",0,tb,"bytesToNumberBE",0,ta,"bytesToNumberLE",0,tu,"copyBytes",0,td,"createHmacDrbg",0,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 n=t=>new Uint8Array(t),i=n(t),o=n(t),s=0,a=()=>{i.fill(1),o.fill(0),s=0},u=(...t)=>r(o,i,...t),l=(t=n(0))=>{o=u(Uint8Array.of(0),t),i=u(),0!==t.length&&(o=u(Uint8Array.of(1),t),i=u())},f=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(i=u()).slice();r.push(e),t+=i.length}return b(...r)};return(t,e)=>{let r;for(a(),l(t);!(r=e(f()));)l();return a(),r}},"ensureBytes",0,tc,"equalBytes",0,th,"inRange",0,tg,"isHash",0,tw,"memoized",0,tS,"notImplemented",0,tx,"numberToBytesBE",0,tl,"numberToBytesLE",0,tf,"numberToHexUnpadded",0,function(t){let e=t.toString(16);return 1&e.length?"0"+e:e}],26539);let tE=BigInt(0),tB=BigInt(1),tk=BigInt(2),tA=BigInt(3),tI=BigInt(4),t_=BigInt(5),tM=BigInt(7),tT=BigInt(8),tU=BigInt(9),tO=BigInt(16);function tR(t,e){let r=t%e;return r>=tE?r:e+r}function tL(t,e,r){let n=t;for(;e-- >tE;)n*=n,n%=r;return n}function tP(t,e){if(t===tE)throw Error("invert: expected non-zero number");if(e<=tE)throw Error("invert: expected positive modulus, got "+e);let r=tR(t,e),n=e,i=tE,o=tB,s=tB,a=tE;for(;r!==tE;){let t=n/r,e=n%r,u=i-s*t,l=o-a*t;n=r,r=e,i=s,o=a,s=u,a=l}if(n!==tB)throw Error("invert: does not exist");return tR(i,e)}function tC(t,e,r){if(!t.eql(t.sqr(e),r))throw Error("Cannot find square root")}function tN(t,e){let r=(t.ORDER+tB)/tI,n=t.pow(e,r);return tC(t,n,e),n}function tq(t,e){let r=(t.ORDER-t_)/tT,n=t.mul(e,tk),i=t.pow(n,r),o=t.mul(e,i),s=t.mul(t.mul(o,tk),i),a=t.mul(o,t.sub(s,t.ONE));return tC(t,a,e),a}function tz(t){if(t<tA)throw Error("sqrt is not defined for small field");let e=t-tB,r=0;for(;e%tk===tE;)e/=tk,r++;let n=tk,i=tH(t);for(;1===tK(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return tN;let o=i.pow(n,e),s=(e+tB)/tk;return function(t,n){if(t.is0(n))return n;if(1!==tK(t,n))throw Error("Cannot find square root");let i=r,a=t.mul(t.ONE,o),u=t.pow(n,e),l=t.pow(n,s);for(;!t.eql(u,t.ONE);){if(t.is0(u))return t.ZERO;let e=1,r=t.sqr(u);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===i)throw Error("Cannot find square root");let n=tB<<BigInt(i-e-1),o=t.pow(a,n);i=e,a=t.sqr(o),u=t.mul(u,a),l=t.mul(l,o)}return l}}let tW=(t,e)=>(tR(t,e)&tB)===tB,tF=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tD(t){return tv(t,tF.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}function tj(t,e,r=!1){let n=Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((e,r,i)=>t.is0(r)?e:(n[i]=e,t.mul(e,r)),t.ONE),o=t.inv(i);return e.reduceRight((e,r,i)=>t.is0(r)?e:(n[i]=t.mul(e,n[i]),t.mul(e,r)),o),n}function tK(t,e){let r=(t.ORDER-tB)/tk,n=t.pow(e,r),i=t.eql(n,t.ONE),o=t.eql(n,t.ZERO),s=t.eql(n,t.neg(t.ONE));if(!i&&!o&&!s)throw Error("invalid Legendre symbol result");return i?1:o?0:-1}function t$(t,e){void 0!==e&&n(e);let r=void 0!==e?e:t.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function tH(t,e,r=!1,n={}){let i,o,s,a;if(t<=tE)throw Error("invalid field: expected ORDER > 0, got "+t);let u=!1;if("object"==typeof e&&null!=e){if(n.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&&(u=e.modFromBytes),a=e.allowedLengths}else"number"==typeof e&&(o=e),n.sqrt&&(s=n.sqrt);let{nBitLength:l,nByteLength:f}=t$(t,o);if(f>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let c=Object.freeze({ORDER:t,isLE:r,BITS:l,BYTES:f,MASK:tb(l),ZERO:tE,ONE:tB,allowedLengths:a,create:e=>tR(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return tE<=e&&e<t},is0:t=>t===tE,isValidNot0:t=>!c.is0(t)&&c.isValid(t),isOdd:t=>(t&tB)===tB,neg:e=>tR(-e,t),eql:(t,e)=>t===e,sqr:e=>tR(e*e,t),add:(e,r)=>tR(e+r,t),sub:(e,r)=>tR(e-r,t),mul:(e,r)=>tR(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<tE)throw Error("invalid exponent, negatives unsupported");if(r===tE)return t.ONE;if(r===tB)return e;let n=t.ONE,i=e;for(;r>tE;)r&tB&&(n=t.mul(n,i)),i=t.sqr(i),r>>=tB;return n})(c,t,e),div:(e,r)=>tR(e*tP(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>tP(e,t),sqrt:s||(e=>(i||(i=function(t){if(t%tI===tA)return tN;if(t%tT===t_)return tq;if(t%tO===tU){let e,r,n,i,o,s;return e=tH(t),n=(r=tz(t))(e,e.neg(e.ONE)),i=r(e,n),o=r(e,e.neg(n)),s=(t+tM)/tO,(t,e)=>{let r=t.pow(e,s),a=t.mul(r,n),u=t.mul(r,i),l=t.mul(r,o),f=t.eql(t.sqr(a),e),c=t.eql(t.sqr(u),e);r=t.cmov(r,a,f),a=t.cmov(l,u,c);let h=t.eql(t.sqr(a),e),d=t.cmov(r,a,h);return tC(t,d,e),d}}return tz(t)}(t)),i(c,e))),toBytes:t=>r?tf(t,f):tl(t,f),fromBytes:(e,n=!0)=>
vendor: 4,465 bytes, line 1
1{if(a){if(!a.includes(e.length)||e.length>f)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);let t=new Uint8Array(f);t.set(e,r?0:t.length-e.length),e=t}if(e.length!==f)throw Error("Field.fromBytes: expected "+f+" bytes, got "+e.length);let i=r?tu(e):ta(e);if(u&&(i=tR(i,t)),!n&&!c.isValid(i))throw Error("invalid field element: outside of range 0..ORDER");return i},invertBatch:t=>tj(c,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(c)}function tV(t,e){if(!t.isOdd)throw Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}function tZ(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function tG(t){let e=tZ(t);return e+Math.ceil(e/2)}t.s(["Field",0,tH,"FpInvertBatch",0,tj,"FpSqrtEven",0,tV,"getMinHashLength",0,tG,"isNegativeLE",0,tW,"mapHashToField",0,function(t,e,r=!1){let n=t.length,i=tZ(e),o=tG(e);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let s=tR(r?tu(t):ta(t),e-tB)+tB;return r?tf(s,i):tl(s,i)},"mod",0,tR,"nLength",0,t$,"pow2",0,tL,"validateField",0,tD],70948);let tY=BigInt(0),tX=BigInt(1);function tJ(t,e){let r=e.negate();return t?r:e}function tQ(t,e){let r=tj(t.Fp,e.map(t=>t.Z));return e.map((e,n)=>t.fromAffine(e.toAffine(r[n])))}function t0(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function t1(t,e){t0(t,e);let r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t;return{windows:r,windowSize:n,mask:tb(t),maxNumber:i,shiftBy:BigInt(t)}}function t2(t,e,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=r,a=Number(t&i),u=t>>s;a>n&&(a-=o,u+=tX);let l=e*n,f=l+Math.abs(a)-1,c=0===a;return{nextN:u,offset:f,isZero:c,isNeg:a<0,isNegF:e%2!=0,offsetF:l}}let t6=new WeakMap,t8=new WeakMap;function t3(t){return t8.get(t)||1}function t5(t){if(t!==tY)throw Error("invalid wNAF")}class t4{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 n=t;for(;e>tY;)e&tX&&(r=r.add(n)),n=n.double(),e>>=tX;return r}precomputeWindow(t,e){let{windows:r,windowSize:n}=t1(e,this.bits),i=[],o=t,s=o;for(let t=0;t<r;t++){s=o,i.push(s);for(let t=1;t<n;t++)s=s.add(o),i.push(s);o=s.double()}return i}wNAF(t,e,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let n=this.ZERO,i=this.BASE,o=t1(t,this.bits);for(let t=0;t<o.windows;t++){let{nextN:s,offset:a,isZero:u,isNeg:l,isNegF:f,offsetF:c}=t2(r,t,o);r=s,u?i=i.add(tJ(f,e[c])):n=n.add(tJ(l,e[a]))}return t5(r),{p:n,f:i}}wNAFUnsafe(t,e,r,n=this.ZERO){let i=t1(t,this.bits);for(let t=0;t<i.windows&&r!==tY;t++){let{nextN:o,offset:s,isZero:a,isNeg:u}=t2(r,t,i);if(r=o,!a){let t=e[s];n=n.add(u?t.negate():t)}}return t5(r),n}getPrecomputes(t,e,r){let n=t6.get(e);return n||(n=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(n=r(n)),t6.set(e,n))),n}cached(t,e,r){let n=t3(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)}unsafe(t,e,r,n){let i=t3(t);return 1===i?this._unsafeLadder(t,e,n):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),e,n)}createCache(t,e){t0(e,this.bits),t8.set(t,e),t6.delete(t)}hasCache(t){return 1!==t3(t)}}function t9(t,e,r,n){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(n))throw Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)});let i=r.length,o=n.length;if(i!==o)throw Error("arrays of points and scalars must have equal length");let s=t.ZERO,a=tm(BigInt(i)),u=1;a>12?u=a-3:a>4?u=a-2:a>0&&(u=2);let l=tb(u),f=Array(Number(l)+1).fill(s),c=Math.floor((e.BITS-1)/u)*u,h=s;for(let t=c;t>=0;t-=u){f.fill(s);for(let e=0;e<o;e++){let i=Number(n[e]>>BigInt(t)&l);f[i]=f[i].add(r[e])}let e=s;for(let t=f.length-1,r=s;t>0;t--)r=r.add(f[t]),e=e.add(r);if(h=h.add(e),0!==t)for(let t=0;t<u;t++)h=h.double()}return h}function t7(t,e,r){if(!e)return tH(t,{isLE:r});if(e.ORDER!==t)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return tD(e),e}function et(t,e,r={},n){if(void 0===n&&(n="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>tY))throw Error(`CURVE.${t} must be positive bigint`)}let i=t7(e.p,r.Fp,n),o=t7(e.n,r.Fn,n);for(let r of["Gx","Gy","a","weierstrass"===t?"b":"d"])if(!i.isValid(e[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);
1return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:i,Fn:o}}t.s(["_createCurveFields",0,et,"mulEndoUnsafe",0,function(t,e,r,n){let i=e,o=t.ZERO,s=t.ZERO;for(;r>tY||n>tY;)r&tX&&(o=o.add(i)),n&tX&&(s=s.add(i)),i=i.double(),r>>=tX,n>>=tX;return{p1:o,p2:s}},"negateCt",0,tJ,"normalizeZ",0,tQ,"pippenger",0,t9,"wNAF",0,t4],10588);let ee=BigInt(0),er=BigInt(1),en=BigInt(2),ei=BigInt(8);class eo{constructor(t){this.ep=t}static fromBytes(t){tx()}static fromHex(t){tx()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return d(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,e){return this.init(this.ep.precompute(t,e))}toRawBytes(){return this.toBytes()}}function es(t,e){if(ea(t),ea(e),t<0||t>=1<<8*e)throw Error("invalid I2OSP input: "+t);let r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=255&t,t>>>=8;return new Uint8Array(r)}function ea(t){if(!Number.isSafeInteger(t))throw Error("number expected")}function eu(t){if(!r(t)&&"string"!=typeof t)throw Error("DST must be Uint8Array or string");return"string"==typeof t?y(t):t}function el(t,e,r,n){i(t),ea(r),(e=eu(e)).length>255&&(e=n(b(y("H2C-OVERSIZE-DST-"),e)));let{outputLen:o,blockLen:s}=n,a=Math.ceil(r/o);if(r>65535||a>255)throw Error("expand_message_xmd: invalid lenInBytes");let u=b(e,es(e.length,1)),l=es(0,s),f=es(r,2),c=Array(a),h=n(b(l,t,f,es(0,1),u));c[0]=n(b(h,es(1,1),u));for(let t=1;t<=a;t++){let e=[function(t,e){let r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}(h,c[t-1]),es(t+1,1),u];c[t]=n(b(...e))}return b(...c).slice(0,r)}function ef(t,e,r){let n;tv(r,{p:"bigint",m:"number",k:"number",hash:"function"});let{p:o,k:s,m:a,hash:u,expand:l,DST:f}=r;if(!tw(r.hash))throw Error("expected valid hash");i(t),ea(e);let c=Math.ceil((o.toString(2).length+s)/8),h=e*a*c;if("xmd"===l)n=el(t,f,h,u);else if("xof"===l)n=function(t,e,r,n,o){if(i(t),ea(r),(e=eu(e)).length>255){let t=Math.ceil(2*n/8);e=o.create({dkLen:t}).update(y("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(t).update(es(r,2)).update(e).update(es(e.length,1)).digest()}(t,f,h,s,u);else if("_internal_pass"===l)n=t;else throw Error('expand must be "xmd" or "xof"');let d=Array(e);for(let t=0;t<e;t++){let e=Array(a);for(let r=0;r<a;r++){let i=c*(r+t*a),s=n.subarray(i,i+c);e[r]=tR(ta(s),o)}d[t]=e}return d}let ec=y("HashToScalar-");function eh(t,e,r){if("function"!=typeof e)throw Error("mapToCurve() must be defined");function n(r){return t.fromAffine(e(r))}function i(e){let r=e.clearCofactor();return r.equals(t.ZERO)?t.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(t,e){let o=ef(t,2,Object.assign({},r,e)),s=n(o[0]),a=n(o[1]);return i(s.add(a))},encodeToCurve(t,e){let o=r.encodeDST?{DST:r.encodeDST}:{};return i(n(ef(t,1,Object.assign({},r,o,e))[0]))},mapToCurve(t){if(!Array.isArray(t))throw Error("expected array of bigints");for(let e of t)if("bigint"!=typeof e)throw Error("expected array of bigints");return i(n(t))},hashToScalar:(e,n)=>ef(e,1,Object.assign({},r,{p:t.Fn.ORDER,m:1,DST:ec},n))[0][0]}}t.s(["_DST_scalar",0,ec,"createHasher",0,eh,"expand_message_xmd",0,el,"isogenyMap",0,function(t,e){let r=e.map(t=>Array.from(t).reverse());return(e,n)=>{let[i,o,s,a]=r.map(r=>r.reduce((r,n)=>t.add(t.mul(r,e),n))),[u,l]=tj(t,[o,a],!0);return e=t.mul(i,u),n=t.mul(n,t.mul(s,l)),{x:e,y:n}}}],33795),BigInt(0),BigInt(1),BigInt(2);let ed=BigInt(0),ep=BigInt(1),eg=BigInt(2),ey=BigInt(3),em=BigInt(5),eb=BigInt(8),ew=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),ev={p:ew,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:eb,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},ex=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function eS(t,e){var r;let n,i,o,s,a,u,l,f,c,h,d,p,g,y,m=tR(e*e*e,ew),b=(r=t*tR(m*m*e,ew),n=BigInt(10),i=BigInt(20),o=BigInt(40),s=BigInt(80),u=tL(a=r*r%ew*r%ew,eg,ew)*a%ew,l=tL(u,ep,ew)*r%ew,f=tL(l,em,ew)*l%ew,c=tL(f,n,ew)*f%ew,h=tL(c,i,ew)*c%ew,d=tL(h,o,ew)*h%ew,p=tL(d,s,ew)*d%ew,g=tL(p,s,ew)*d%ew,y=tL(g,n,ew)*f%ew,{pow_p_5_8:tL(y,eg,ew)*r%ew,b2:a}).pow_p_5_8,w=tR(t*m*b,ew),v=tR(e*w*w,ew),x=w,S=tR(w*ex,ew),E=v===t,B=v===tR(-t,ew),k=v===tR(-t*ex,ew);
1return E&&(w=x),(B||k)&&(w=S),tW(w,ew)&&(w=tR(-w,ew)),{isValid:E||B,value:w}}let eE=tH(ev.p,{isLE:!0}),eB=tH(ev.n,{isLE:!0}),ek=function(t){let e,n,i,o,{CURVE:s,curveOpts:a,hash:u,eddsaOpts:l}=(e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n={Fp:t.Fp,Fn:tH(e.n,t.nBitLength,!0),uvRatio:t.uvRatio},i={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve},{CURVE:e,curveOpts:n,hash:t.hash,eddsaOpts:i}),f=function(t,e,n={}){if("function"!=typeof e)throw Error('"hash" function param is required');tv(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});let{prehash:i}=n,{BASE:o,Fp:s,Fn:a}=t,u=n.randomBytes||x,l=n.adjustScalarBytes||(t=>t),f=n.domain||((t,e,r)=>{if(ti(r,"phflag"),e.length||r)throw Error("Contexts/pre-hash are not supported");return t});function c(t){return a.create(tu(t))}function h(t){var r;let n,i,s,a,u,{head:f,prefix:h,scalar:d}=(r=tc("private key",r=t,n=m.secretKey),s=l((i=tc("hashed private key",e(r),2*n)).slice(0,n)),a=i.slice(n,2*n),u=c(s),{head:s,prefix:a,scalar:u}),p=o.multiply(d),g=p.toBytes();return{head:f,prefix:h,scalar:d,point:p,pointBytes:g}}function d(t){return h(t).pointBytes}function p(t=Uint8Array.of(),...r){return c(e(f(b(...r),tc("context",t),!!i)))}let g={zip215:!0},y=s.BYTES,m={secretKey:y,publicKey:y,signature:2*y,seed:y};function w(t=u(m.seed)){return to(t,m.seed,"seed")}let v={getExtendedPublicKey:h,randomSecretKey:w,isValidSecretKey:function(t){return r(t)&&t.length===a.BYTES},isValidPublicKey:function(e,r){try{return!!t.fromBytes(e,r)}catch(t){return!1}},toMontgomery(e){let{y:r}=t.fromBytes(e),n=m.publicKey,i=32===n;if(!i&&57!==n)throw Error("only defined for 25519 and 448");let o=i?s.div(er+r,er-r):s.div(r-er,r+er);return s.toBytes(o)},toMontgomerySecret(t){let r=m.secretKey;return to(t,r),l(e(t.subarray(0,r))).subarray(0,r)},randomPrivateKey:w,precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};return Object.freeze({keygen:function(t){let e=v.randomSecretKey(t);return{secretKey:e,publicKey:d(e)}},getPublicKey:d,sign:function(t,e,r={}){t=tc("message",t),i&&(t=i(t));let{prefix:n,scalar:s,pointBytes:u}=h(e),l=p(r.context,n,t),f=o.multiply(l).toBytes(),c=p(r.context,f,u,t),d=a.create(l+c*s);if(!a.isValid(d))throw Error("sign failed: invalid s");return to(b(f,a.toBytes(d)),m.signature,"result")},verify:function(e,r,n,s=g){let a,u,l,{context:f,zip215:c}=s,h=m.signature;e=tc("signature",e,h),r=tc("message",r),n=tc("publicKey",n,m.publicKey),void 0!==c&&ti(c,"zip215"),i&&(r=i(r));let d=h/2,y=e.subarray(0,d),b=tu(e.subarray(d,h));try{a=t.fromBytes(n,c),u=t.fromBytes(y,c),l=o.multiplyUnsafe(b)}catch(t){return!1}if(!c&&a.isSmallOrder())return!1;let w=p(f,u.toBytes(),a.toBytes(),r);return u.add(a.multiplyUnsafe(w)).subtract(l).clearCofactor().is0()},utils:v,Point:t,lengths:m})}(function(t,e={}){var r,n;let i,o,s,a,u,l=et("edwards",t,e,e.FpFnLE),{Fp:f,Fn:c}=l,h=l.CURVE,{h:p}=h;tv(e,{},{uvRatio:"function"});let g=en<<BigInt(8*c.BYTES)-er,y=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:f.sqrt(f.div(t,e))}}catch(t){return{isValid:!1,value:ee}}});if(r=h.Gx,n=h.Gy,i=f.sqr(r),o=f.sqr(n),s=f.add(f.mul(h.a,i),o),a=f.add(f.ONE,f.mul(h.d,f.mul(i,o))),!f.eql(s,a))throw Error("bad curve params: generator point");function m(t,e,r=!1){return ty("coordinate "+t,e,r?er:ee,g),e}function b(t){if(!(t instanceof x))throw Error("ExtendedPoint expected")}let w=tS((t,e)=>{let r,n,{X:i,Y:o,Z:s}=t,a=t.is0();null==e&&(e=a?ei:f.inv(s));let u=(r=i*e,f.create(r)),l=(n=o*e,f.create(n)),c=f.mul(s,e);if(a)return{x:ee,y:er};if(c!==er)throw Error("invZ was invalid");return{x:u,y:l}}),v=tS(t=>{let e,r,n,i,o,s,a,u,l,c,d,p,{a:g,d:y}=h;if(t.is0())throw Error("bad point: ZERO");let{X:m,Y:b,Z:w,T:v}=t,x=(e=m*m,f.create(e)),S=(r=b*b,f.create(r)),E=(n=w*w,f.create(n)),B=(i=E*E,f.create(i));if(a=E*(o=x*g,s=f.create(o)+S,f.create(s)),f.create(a)!==(c=B+(l=y*(u=x*S,f.create(u)),f.create(l)),f.create(c)))throw Error("bad point: equation left != right (1)");if(d=m*b,f.create(d)!==(p=w*v,f.create(p)))throw Error("bad point: equation left != right (2)");return!0});class x{constructor(t,e,r,n){this.X=m("x",t),this.Y=m("y",e),this.Z=m("z",r,!0),this.T=m("t",n),Object.freeze(this)}static CURVE(){return h}static fromAffine(t){let e;if(t instanceof x)throw Error("extended point not allowed");let{x:r,y:n}=t||{};return m("x",r),m("y",n),new x(r,n,er,(e=r*n,f.create(e)))}static fromBytes(t,e=!1){let r,n,i,o,s=f.BYTES,{a,d:u}=h;t=td(to(t,s,"point")),ti(e,"zip215");let l=td(t),c=t[s-1];l[s-1]=-129&c;let d=tu(l);ty("point.y",d,ee,e?g:f.ORDER);let p=(r=d*d,f.create(r)),{isValid:m,value:b}=y((n=p-er,f.create(n)),(i=u*p-a,f.create(i)));if(!m)throw Error("bad point: invalid y coordinate");let w=(b&er)===er,v=(128&c)!=0;
1if(!e&&b===ee&&v)throw Error("bad point: x=0 and x_0=1");return v!==w&&(o=-b,b=f.create(o)),x.fromAffine({x:b,y:d})}static fromHex(t,e=!1){return x.fromBytes(tc("point",t),e)}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(en),this}assertValidity(){v(this)}equals(t){let e,r,n,i;b(t);let{X:o,Y:s,Z:a}=this,{X:u,Y:l,Z:c}=t,h=(e=o*c,f.create(e)),d=(r=u*a,f.create(r)),p=(n=s*c,f.create(n)),g=(i=l*a,f.create(i));return h===d&&p===g}is0(){return this.equals(x.ZERO)}negate(){let t,e;return new x((t=-this.X,f.create(t)),this.Y,this.Z,(e=-this.T,f.create(e)))}double(){let t,e,r,n,i,o,s,a,u,l,c,{a:d}=h,{X:p,Y:g,Z:y}=this,m=(t=p*p,f.create(t)),b=(e=g*g,f.create(e)),w=(n=en*(r=y*y,f.create(r)),f.create(n)),v=(i=d*m,f.create(i)),S=p+g,E=(o=S*S,s=f.create(o)-m-b,f.create(s)),B=v+b,k=B-w,A=v-b,I=(a=E*k,f.create(a)),_=(u=B*A,f.create(u)),M=(l=E*A,f.create(l));return new x(I,_,(c=k*B,f.create(c)),M)}add(t){let e,r,n,i,o,s,a,u,l,c;b(t);let{a:d,d:p}=h,{X:g,Y:y,Z:m,T:w}=this,{X:v,Y:S,Z:E,T:B}=t,k=(e=g*v,f.create(e)),A=(r=y*S,f.create(r)),I=(n=w*p*B,f.create(n)),_=(i=m*E,f.create(i)),M=(o=(g+y)*(v+S)-k-A,f.create(o)),T=_-I,U=_+I,O=(s=A-d*k,f.create(s)),R=(a=M*T,f.create(a)),L=(u=U*O,f.create(u)),P=(l=M*O,f.create(l));return new x(R,L,(c=T*U,f.create(c)),P)}subtract(t){return this.add(t.negate())}multiply(t){if(!c.isValidNot0(t))throw Error("invalid scalar: expected 1 <= sc < curve.n");let{p:e,f:r}=S.cached(this,t,t=>tQ(x,t));return tQ(x,[e,r])[0]}multiplyUnsafe(t,e=x.ZERO){if(!c.isValid(t))throw Error("invalid scalar: expected 0 <= sc < curve.n");return t===ee?x.ZERO:this.is0()||t===er?this:S.unsafe(this,t,t=>tQ(x,t),e)}isSmallOrder(){return this.multiplyUnsafe(p).is0()}isTorsionFree(){return S.unsafe(this,h.n).is0()}toAffine(t){return w(this,t)}clearCofactor(){return p===er?this:this.multiplyUnsafe(p)}toBytes(){let{x:t,y:e}=this.toAffine(),r=f.toBytes(e);return r[r.length-1]|=t&er?128:0,r}toHex(){return d(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(t){return tQ(x,t)}static msm(t,e){return t9(x,c,t,e)}_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}x.BASE=new x(h.Gx,h.Gy,er,(u=h.Gx*h.Gy,f.create(u))),x.ZERO=new x(ee,er,er,ee),x.Fp=f,x.Fn=c;let S=new t4(x,c.BITS);return x.BASE.precompute(8),x}(s,a),u,l);return o=f.Point,Object.assign({},f,{ExtendedPoint:o,CURVE:t,nBitLength:o.Fn.BITS,nByteLength:o.Fn.BYTES})}({...ev,Fp:eE,hash:te,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:eS}),eA=(ew+ey)/eb,eI=eE.pow(eg,eA),e_=eE.sqrt(eE.neg(eE.ONE)),eM=tV(eE,eE.neg(BigInt(486664)));eh(ek.Point,t=>(function(t){let e,r,n,i,o,s,a,u,l,f,c,h,d,p,g,y,m,b,w,v,x,S,E,{xMn:B,xMd:k,yMn:A,yMd:I}=(e=(ew-em)/eb,r=BigInt(486662),n=eE.sqr(t),n=eE.mul(n,eg),i=eE.add(n,eE.ONE),o=eE.neg(r),s=eE.sqr(i),a=eE.mul(s,i),u=eE.mul(n,r),u=eE.mul(u,o),u=eE.add(u,s),u=eE.mul(u,o),l=eE.sqr(a),s=eE.sqr(l),l=eE.mul(l,a),l=eE.mul(l,u),s=eE.mul(s,l),f=eE.pow(s,e),f=eE.mul(f,l),c=eE.mul(f,e_),s=eE.sqr(f),s=eE.mul(s,a),h=eE.eql(s,u),d=eE.cmov(c,f,h),p=eE.mul(o,n),g=eE.mul(f,t),g=eE.mul(g,eI),y=eE.mul(g,e_),m=eE.mul(u,n),s=eE.sqr(g),s=eE.mul(s,a),b=eE.eql(s,m),w=eE.cmov(y,g,b),s=eE.sqr(d),s=eE.mul(s,a),v=eE.eql(s,u),x=eE.cmov(p,o,v),S=eE.cmov(w,d,v),E=eE.isOdd(S),{xMn:x,xMd:i,yMn:S=eE.cmov(S,eE.neg(S),v!==E),yMd:ep}),_=eE.mul(B,I);_=eE.mul(_,eM);let M=eE.mul(k,A),T=eE.sub(B,k),U=eE.add(B,k),O=eE.mul(M,U),R=eE.eql(O,eE.ZERO);_=eE.cmov(_,eE.ZERO,R),M=eE.cmov(M,eE.ONE,R),T=eE.cmov(T,eE.ONE,R),U=eE.cmov(U,eE.ONE,R);let[L,P]=tj(eE,[M,U],!0);return{x:eE.mul(_,L),y:eE.mul(T,P)}})(t[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:ew,m:1,k:128,expand:"xmd",hash:te});let eT=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),eU=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),eO=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),eR=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),eL=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),eP=t=>ek.Point.Fp.create(tu(t)&eL);function eC(t){let e,r,n,i,o,s,a,u,l,f,c,h,d,p,g,{d:y}=ev,m=(e=ex*t*t,eE.create(e)),b=(r=(m+ep)*eO,eE.create(r)),w=BigInt(-1),v=(i=(w-y*m)*(n=m+y,eE.create(n)),eE.create(i)),{isValid:x,value:S}=eS(b,v),E=(o=S*t,eE.create(o));tW(E,ew)||(s=-E,E=eE.create(s)),x||(S=E),x||(w=m);let B=(a=w*(m-ep)*eR-v,eE.create(a)),k=S*S,A=(u=(S+S)*v,eE.create(u)),I=(l=B*eT,eE.create(l)),_=(f=ep-k,eE.create(f)),M=(c=ep+k,eE.create(c));return new ek.Point((h=A*M,eE.create(h)),(d=_*I,eE.create(d)),(p=I*M,eE.create(p)),(g=A*_,eE.create(g)))}class eN extends eo{constructor(t){super(t)}static fromAffine(t){return new eN(ek.Point.fromAffine(t))}assertSame(t){if(!(t instanceof eN))throw Error("RistrettoPoint expected")}init(t){return new eN(t)}static hashToCurve(t){var e;let r,n;return i(e=tc("ristrettoHash",t,64),64),r=eC(eP(e.subarray(0,32))),n=eC(eP(e.subarray(32,64))),new eN(r.add(n))}static fromBytes(t){let e,r,n,o,s,a,u,l,f,c,h,d,p;i(t,32);let{a:g,d:y}=ev,m=eP(t);if(!th(eE.toBytes(m),t)||tW(m,ew))throw Error("invalid ristretto255 encoding 1");let b=(e=m*m,eE.create(e)),w=(r=ep+g*b,eE.create(r)),v=(n=ep-g*b,eE.create(n)),x=(o=w*w,eE.create(o)),S=(s=v*v,eE.create(s)),E=(a=g*y*x-S,eE.create(a)),{isValid:B,value:k}=(u=E*S,eS(ep,eE.create(u))),A=(l=k*v,eE.create(l)),I=(f=k*A*E,eE.create(f)),_=(c=(m+m)*A,eE.create(c));tW(_,ew)&&(h=-_,_=eE.create(h));let M=(d=w*I,eE.create(d)),T=(p=_*M,eE.create(p));if(!B||tW(T,ew)||M===ed)throw Error("invalid ristretto255 encoding 2");return new eN(new ek.Point(_,M,ep,T))}static fromHex(t){return eN.fromBytes(tc("ristrettoHex",t,32))}static msm(t,e){return t9(eN,ek.Point.Fn,t,e)}toBytes(){let t,e,r,n,i,o,s,a,u,l,f,c,h,{X:d,Y:p,Z:g,T:y}=this.ep,m=(t=g+p,r=eE.create(t)*(e=g-p,eE.create(e)),eE.create(r)),b=(n=d*p,eE.create(n)),{value:w}=(o=m*(i=b*b,eE.create(i)),eS(ep,eE.create(o))),v=(s=w*m,eE.create(s)),x=(a=w*b,eE.create(a)),S=(u=v*x*y,eE.create(u));if(tW(y*S,ew)){let t,e,r=(t=p*ex,eE.create(t)),n=(e=d*ex,eE.create(e));d=r,p=n,h=eE.create(v*eU)}else h=x;tW(d*S,ew)&&(l=-p,p=eE.create(l));let E=(f=(g-p)*h,eE.create(f));return tW(E,ew)&&(c=-E,E=eE.create(c)),eE.toBytes(E)}equals(t){let e,r,n,i;
1this.assertSame(t);let{X:o,Y:s}=this.ep,{X:a,Y:u}=t.ep,l=(e=o*u,eE.create(e)===(r=s*a,eE.create(r))),f=(n=s*u,eE.create(n)===(i=o*a,eE.create(i)));return l||f}is0(){return this.equals(eN.ZERO)}}function eq([t,e]){return`${t}=${function t(e){return Array.isArray(e)?"%5B"+e.map(t).join("%2C%20")+"%5D":"bigint"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}(e)}`}eN.BASE=new eN(ek.Point.BASE),eN.ZERO=new eN(ek.Point.ZERO),eN.Fp=eE,eN.Fn=eB,t.s(["ed25519",0,ek],14303),t.s(["sha256",0,Q],80355);var ez,eW=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,n;if(e){const{cause:t,...i}=e;t&&(n={cause:t}),Object.keys(i).length>0&&(r=i)}super(function(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${btoa(Object.entries(e).map(eq).join("&"))}'`),`${r}\``}}(t,r),n),this.context={__code:t,...r},this.name="SolanaError"}};function eF(t){return"fixedSize"in t&&"number"==typeof t.fixedSize}var eD=((ez=eD||{})[ez.Little=0]="Little",ez[ez.Big=1]="Big",ez);function ej(t){return t?.endian!==1}var eK=(t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,e,r)=>t.setBigUint64(0,BigInt(e),r),size:8}).size,write(t,r,n){e.range&&function(t,e,r,n){if(n<e||n>r)throw new eW(8078011,{codecDescription:t,max:r,min:e,value:n})}(e.name,e.range[0],e.range[1],t);let i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,ej(e.config)),r.set(new Uint8Array(i),n),n+e.size}},encode:t=>{let e=new Uint8Array("fixedSize"in r?r.fixedSize:r.getSizeFromValue(t));return r.write(t,e,0),e}})};t.s(["getU64Codec",0,(t={})=>(function(t,e){if(eF(t)!==eF(e))throw new eW(8078004);if(eF(t)&&eF(e)&&t.fixedSize!==e.fixedSize)throw new eW(8078005,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!eF(t)&&!eF(e)&&t.maxSize!==e.maxSize)throw new eW(8078006,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}})(eK(t),((t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,get:(t,e)=>t.getBigUint64(0,e),name:"u64",size:8}).size,read(t,r=0){var n,i,o;let s,a;!function(t,e,r=0){if(e.length-r<=0)throw new eW(8078e3,{codecDescription:t})}(e.name,t,r),function(t,e,r,n=0){let i=r.length-n;if(i<e)throw new eW(8078001,{bytesLength:i,codecDescription:t,expected:e})}(e.name,e.size,t,r);let u=new DataView((n=t,i=r,o=e.size,s=n.byteOffset+(i??0),a=o??n.byteLength,n.buffer.slice(s,s+a)));return[e.get(u,ej(e.config)),r+e.size]}},decode:(t,e=0)=>r.read(t,e)[0]})})(t)),"getU64Encoder",0,eK],38340);class e$ extends TypeError{constructor(t,e){let r;const{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function eH(t){return"object"==typeof t&&null!=t}function eV(t){return eH(t)&&!Array.isArray(t)}function eZ(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function*eG(t,e,r,n){var i;for(let o of(eH(i=t)&&"function"==typeof i[Symbol.iterator]||(t=[t]),t)){let t=function(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});let{path:i,branch:o}=e,{type:s}=r,{refinement:a,message:u=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${eZ(n)}\``}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:u}}(o,e,r,n);t&&(yield t)}}function*eY(t,e,r={}){let{path:n=[],branch:i=[t],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i,mask:s};o&&(t=e.coercer(t,a));let u="valid";for(let n of e.validator(t,a))n.explanation=r.message,u="not_valid",yield[n,void 0];for(let[l,f,c]of e.entries(t,a))for(let e of eY(f,c,{path:void 0===l?n:[...n,l],branch:void 0===l?i:[...i,f],coerce:o,mask:s,message:r.message}))e[0]?(u=null!=e[0].refinement?"not_refined":"not_valid",yield[e[0],void 0]):o&&(f=e[1],void 0===l?t=f:t instanceof Map?t.set(l,f):t instanceof Set?t.add(f):eH(t)&&(void 0!==f||l in t)&&(t[l]=f));
1if("not_valid"!==u)for(let n of e.refiner(t,a))n.explanation=r.message,u="not_refined",yield[n,void 0];"valid"===u&&(yield[void 0,t])}class eX{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,n?this.validator=(t,e)=>eG(n(t,e),e,this,t):this.validator=()=>[],i?this.refiner=(t,e)=>eG(i(t,e),e,this,t):this.refiner=()=>[]}assert(t,e){return eJ(t,this,e)}create(t,e){return eQ(t,this,e)}is(t){var e,r;return e=t,r=this,!e0(e,r)[0]}mask(t,e){var r=t,n=this,i=e;let o=e0(r,n,{coerce:!0,mask:!0,message:i});if(!o[0])return o[1];throw o[0]}validate(t,e={}){return e0(t,this,e)}}function eJ(t,e,r){let n=e0(t,e,{message:r});if(n[0])throw n[0]}function eQ(t,e,r){let n=e0(t,e,{coerce:!0,message:r});if(!n[0])return n[1];throw n[0]}function e0(t,e,r={}){let n=eY(t,e,r),i=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(n);return i[0]?[new e$(i[0],function*(){for(let t of n)t[0]&&(yield t[0])}),void 0]:[void 0,i[1]]}function e1(t,e){return new eX({type:t,schema:null,validator:e})}t.s(["any",0,function(){return e1("any",()=>!0)},"array",0,function(t){return new eX({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(let[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${eZ(t)}`})},"assert",0,eJ,"boolean",0,function(){return e1("boolean",t=>"boolean"==typeof t)},"coerce",0,function(t,e,r){return new eX({...t,coercer:(n,i)=>e0(n,e)[0]?t.coercer(n,i):t.coercer(r(n,i),i)})},"create",0,eQ,"instance",0,function(t){return e1("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${eZ(e)}`)},"literal",0,function(t){let e=eZ(t),r=typeof t;return new eX({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${eZ(r)}`})},"nullable",0,function(t){return new eX({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})},"number",0,function(){return e1("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${eZ(t)}`)},"optional",0,function(t){return new eX({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})},"record",0,function(t,e){return new eX({type:"record",schema:null,*entries(r){if(eH(r))for(let n in r){let i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>eV(t)||`Expected an object, but received: ${eZ(t)}`,coercer:t=>eV(t)?{...t}:t})},"string",0,function(){return e1("string",t=>"string"==typeof t||`Expected a string, but received: ${eZ(t)}`)},"tuple",0,function(t){let e=e1("never",()=>!1);return new eX({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${eZ(t)}`,coercer:t=>Array.isArray(t)?t.slice():t})},"type",0,function(t){let e=Object.keys(t);return new eX({type:"type",schema:t,*entries(r){if(eH(r))for(let n of e)yield[n,r[n],t[n]]},validator:t=>eV(t)||`Expected an object, but received: ${eZ(t)}`,coercer:t=>eV(t)?{...t}:t})},"union",0,function(t){let e=t.map(t=>t.type).join(" | ");return new eX({type:"union",schema:null,coercer(e,r){for(let n of t){let[t,i]=n.validate(e,{coerce:!0,mask:r.mask});if(!t)return i}return e},validator(r,n){let i=[];for(let e of t){let[...t]=eY(r,e,n),[o]=t;if(!o[0])return[];for(let[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${eZ(r)}`,...i]}})},"unknown",0,function(){return e1("unknown",()=>!0)}],85098)},44610,(t,e,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.s16=r.s8=r.nu64be=r.u48be=r.u40be=r.u32be=r.u24be=r.u16be=r.nu64=r.u48=r.u40=r.u32=r.u24=r.u16=r.u8=r.offset=r.greedy=r.Constant=r.UTF8=r.CString=r.Blob=r.Boolean=r.BitField=r.BitStructure=r.VariantLayout=r.Union=r.UnionLayoutDiscriminator=r.UnionDiscriminator=r.Structure=r.Sequence=r.DoubleBE=r.Double=r.FloatBE=r.Float=r.NearInt64BE=r.NearInt64=r.NearUInt64BE=r.NearUInt64=r.IntBE=r.Int=r.UIntBE=r.UInt=r.OffsetLayout=r.GreedyCount=r.ExternalLayout=r.bindConstructorLayout=r.nameWithProperty=r.Layout=r.uint8ArrayToBuffer=r.checkUint8Array=void 0,r.constant=r.utf8=r.cstr=r.blob=r.unionLayoutDiscriminator=r.union=r.seq=r.bits=r.struct=r.f64be=r.f64=r.f32be=r.f32=r.ns64be=r.s48be=r.s40be=r.s32be=r.s24be=r.s16be=r.ns64=r.s48=r.s40=r.s32=r.s24=void 0;let n=t.r(43943);function i(t){if(!(t instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function o(t){return i(t),n.Buffer.from(t.buffer,t.byteOffset,t.length)}r.checkUint8Array=i,r.uint8ArrayToBuffer=o;class s{constructor(t,e){if(!Number.isInteger(t))throw TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function a(t,e){return e.property?t+"["+e.property+"]":t}r.Layout=s,r.nameWithProperty=a,r.bindConstructorLayout=function(t,e){if("function"!=typeof t)throw TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw Error("Class is already bound to a layout");if(!(e&&e instanceof s))throw TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw Error("layout is already bound to a constructor");
1t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(t,"decode",{value:(t,r)=>e.decode(t,r),writable:!0})};class u extends s{isCount(){throw Error("ExternalLayout is abstract")}}r.ExternalLayout=u;class l extends u{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){return i(t),Math.floor((t.length-e)/this.elementSpan)}encode(t,e,r){return 0}}r.GreedyCount=l;class f extends u{constructor(t,e=0,r){if(!(t instanceof s))throw TypeError("layout must be a Layout");if(!Number.isInteger(e))throw TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof c||this.layout instanceof h}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}}r.OffsetLayout=f;class c extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntLE(t,r,this.span),this.span}}r.UInt=c;class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntBE(t,r,this.span),this.span}}r.UIntBE=h;class d extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeIntLE(t,r,this.span),this.span}}r.Int=d;class p extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeIntBE(t,r,this.span),this.span}}function g(t){let e=Math.floor(t/0x100000000);return{hi32:e,lo32:t-0x100000000*e}}function y(t,e){return 0x100000000*t+e}r.IntBE=p;class m extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return y(r.readUInt32LE(e+4),n)}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}r.NearUInt64=m;class b extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return y(r.readUInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeUInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}r.NearUInt64BE=b;class w extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return y(r.readInt32LE(e+4),n)}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}r.NearInt64=w;class v extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t);return y(r.readInt32BE(e),r.readUInt32BE(e+4))}encode(t,e,r=0){let n=g(t),i=o(e);return i.writeInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}r.NearInt64BE=v;class x extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatLE(e)}encode(t,e,r=0){return o(e).writeFloatLE(t,r),4}}r.Float=x;class S extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatBE(e)}encode(t,e,r=0){return o(e).writeFloatBE(t,r),4}}r.FloatBE=S;class E extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleLE(e)}encode(t,e,r=0){return o(e).writeDoubleLE(t,r),8}}r.Double=E;class B extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleBE(e)}encode(t,e,r=0){return o(e).writeDoubleBE(t,r),8}}r.DoubleBE=B;class k extends s{constructor(t,e,r){if(!(t instanceof s))throw TypeError("elementLayout must be a Layout");if(!(e instanceof u&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;e instanceof u||!(0<t.span)||(n=e*t.span),super(n,r),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof u&&(n=n.decode(t,e)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(t,e+r),++i}return r}decode(t,e=0){let r=[],n=0,i=this.count;for(i instanceof u&&(i=i.decode(t,e));n<i;)r.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),n+=1;return r}encode(t,e,r=0){let n=this.elementLayout,i=t.reduce((t,i)=>t+n.encode(i,e,r+t),0);return this.count instanceof u&&this.count.encode(t.length,e,r),i}}r.Sequence=k;class A extends s{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((t,e)=>t&&e instanceof s,!0)))throw TypeError("fields must be array of Layout instances");for(const n of("boolean"==typeof e&&void 0===r&&(r=e,e=void 0),t))if(0>
1n.span&&void 0===n.property)throw Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=t.reduce((t,e)=>t+e.getSpan(),0)}catch(t){}super(n,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{let i=n.getSpan(t,e);return e+=i,r+i},0)}catch(t){throw RangeError("indeterminate span")}return r}decode(t,e=0){i(t);let r=this.makeDestinationObject();for(let n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(t,e)),e+=n.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){let n=r,i=0,o=0;for(let n of this.fields){let s=n.span;if(o=0<s?s:0,void 0!==n.property){let i=t[n.property];void 0!==i&&(o=n.encode(i,e,r),0>s&&(s=n.getSpan(e,r)))}i=r,r+=s}return i+o-n}fromArray(t){let e=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<t.length&&(e[r.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw TypeError("property must be string");let e=0;for(let r of this.fields){if(r.property===t)return e;0>r.span?e=-1:0<=e&&(e+=r.span)}}}r.Structure=A;class I{constructor(t){this.property=t}decode(t,e){throw Error("UnionDiscriminator is abstract")}encode(t,e,r){throw Error("UnionDiscriminator is abstract")}}r.UnionDiscriminator=I;class _ extends I{constructor(t,e){if(!(t instanceof u&&t.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}}r.UnionLayoutDiscriminator=_;class M extends s{constructor(t,e,r){let n;if(t instanceof c||t instanceof h)n=new _(new f(t));else if(t instanceof u&&t.isCount())n=new _(t);else if(t instanceof I)n=t;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===e&&(e=null),!(null===e||e instanceof s))throw TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let i=-1;e&&0<=(i=e.span)&&(t instanceof c||t instanceof h)&&(i+=n.layout.span),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=t instanceof c||t instanceof h,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let r=this.getVariant(t,e);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw Error("unable to infer src variant")}decode(t,e=0){let r,n=this.discriminator,i=n.decode(t,e),o=this.registry[i];if(void 0===o){let o=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),(r=this.makeDestinationObject())[n.property]=i,r[o.property]=o.decode(t,e+s)}else r=o.decode(t,e);return r}encode(t,e,r=0){let n=this.getSourceVariant(t);if(void 0===n){let n=this.discriminator,i=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=n.layout.span),n.encode(t[n.property],e,r),o+i.encode(t[i.property],e,r+o)}return n.encode(t,e,r)}addVariant(t,e,r){let n=new T(this,t,e,r);return this.registry[t]=n,n}getVariant(t,e=0){let r;return r=t instanceof Uint8Array?this.discriminator.decode(t,e):t,this.registry[r]}}r.Union=M;class T extends s{constructor(t,e,r,n){if(!(t instanceof M))throw TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof s))throw TypeError("layout must be a Layout");
1if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof n)throw TypeError("variant must have a String property")}let i=t.span;0>t.span&&0<=(i=r?r.span:0)&&t.usesPrefixDiscriminator&&(i+=t.discriminator.layout.span),super(i,n),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(t,e+r)),r+n}decode(t,e=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let i=n;if(this.layout&&(this.layout.encode(t[this.property],e,r+n),i+=this.layout.getSpan(e,r+n),0<=this.union.span&&i>this.union.span))throw Error("encoded variant overruns containing union");return i}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function U(t){return 0>t&&(t+=0x100000000),t}r.VariantLayout=T;class O extends s{constructor(t,e,r){if(!(t instanceof c||t instanceof h))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===r&&(r=e,e=!1),4<t.span)throw RangeError("word cannot exceed 32 bits");super(t.span,r),this.word=t,this.msb=!!e,this.fields=[];let n=0;this._packedSetValue=function(t){return n=U(t),this},this._packedGetValue=function(){return n}}decode(t,e=0){let r=this.makeDestinationObject(),n=this.word.decode(t,e);for(let e of(this._packedSetValue(n),this.fields))void 0!==e.property&&(r[e.property]=e.decode(t));return r}encode(t,e,r=0){let n=this.word.decode(e,r);for(let e of(this._packedSetValue(n),this.fields))if(void 0!==e.property){let r=t[e.property];void 0!==r&&e.encode(r)}return this.word.encode(this._packedGetValue(),e,r)}addField(t,e){let r=new R(this,t,e);return this.fields.push(r),r}addBoolean(t){let e=new L(this,t);return this.fields.push(e),e}fieldFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}}r.BitStructure=O;class R{constructor(t,e,r){if(!(t instanceof O))throw TypeError("container must be a BitStructure");if(!Number.isInteger(e)||0>=e)throw TypeError("bits must be positive integer");const n=8*t.span,i=t.fields.reduce((t,e)=>t+e.bits,0);if(e+i>n)throw Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=0xffffffff),this.start=i,this.container.msb&&(this.start=n-i-e),this.wordMask=U(this.valueMask<<this.start),this.property=r}decode(t,e){return U(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==U(t&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=U(t<<this.start);this.container._packedSetValue(U(e&~this.wordMask)|r)}}r.BitField=R;class L extends R{constructor(t,e){super(t,1,e)}decode(t,e){return!!super.decode(t,e)}encode(t){"boolean"==typeof t&&(t*=1),super.encode(t)}}r.Boolean=L;class P extends s{constructor(t,e){if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof u||(r=t),super(r,e),this.length=t}getSpan(t,e){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),o(t).slice(e,e+r)}encode(t,e,r){let n=this.length;if(this.length instanceof u&&(n=t.length),!(t instanceof Uint8Array&&n===t.length))throw TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>e.length)throw RangeError("encoding overruns Uint8Array");let i=o(t);return o(e).write(i.toString("hex"),r,n,"hex"),this.length instanceof u&&this.length.encode(n,e,r),n}}r.Blob=P;class C extends s{constructor(t){super(-1,t)}getSpan(t,e=0){i(t);let r=e;for(;r<t.length&&0!==t[r];)r+=1;return 1+r-e}decode(t,e=0){let r=this.getSpan(t,e);return o(t).slice(e,e+r-1).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let i=n.Buffer.from(t,"utf8"),s=i.length;if(r+s>e.length)throw RangeError("encoding overruns Buffer");let a=o(e);return i.copy(a,r),a[r+s]=0,s+1}}r.CString=C;class N extends s{constructor(t,e){if("string"==typeof t&&void 0===e&&(e=t,t=void 0),void 0===t)t=-1;else if(!Number.isInteger(t))throw TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return i(t),t.length-e}decode(t,e=0){let r=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpan<r)throw RangeError("text length exceeds maxSpan");return o(t).slice(e,e+r).toString("utf-8")}encode(t,e,r=0){"string"!=typeof t&&(t=String(t));let i=n.Buffer.from(t,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw RangeError("text length exceeds maxSpan");if(r+s>e.length)throw RangeError("encoding overruns Buffer");return i.copy(o(e),r),s}}r.UTF8=N;class q extends s{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,r){return 0}}r.Constant=q,r.greedy=(t,e)=>new l(t,e),r.offset=(t,e,r)=>new f(t,e,r),r.u8=t=>new c(1,t),r.u16=t=>new c(2,t),r.u24=t=>new c(3,t),r.u32=t=>new c(4,t),r.u40=t=>new c(5,t),r.u48=t=>new c(6,t),r.nu64=t=>new m(t),r.u16be=t=>new h(2,t),r.u24be=t=>new h(3,t),r.u32be=t=>new h(4,t),r.u40be=t=>new h(5,t),r.u48be=t=>new h(6,t),r.nu64be=t=>new b(t),r.s8=t=>new d(1,t),r.s16=t=>new d(2,t),r.s24=t=>new d(3,t),r.s32=t=>new d(4,t),r.s40=t=>new d(5,t),r.s48=t=>new d(6,t),r.ns64=t=>new w(t),r.s16be=t=>new p(2,t),r.s24be=t=>new p(3,t),r.s32be=t=>new p(4,t),r.s40be=t=>new p(5,t),r.s48be=t=>new p(6,t),r.ns64be=t=>new v(t),r.f32=t=>new x(t),r.f32be=t=>new S(t),r.f64=t=>new E(t),r.f64be=t=>new B(t),r.struct=(t,e,r)=>new A(t,e,r),r.bits=(t,e,r)=>new O(t,e,r),r.seq=(t,e,r)=>new k(t,e,r),r.union=(t,e,r)=>new M(t,e,r),r.unionLayoutDiscriminator=(t,e)=>new _(t,e),r.blob=(t,e)=>new P(t,e),r.cstr=t=>new C(t),r.utf8=(t,e)=>new N(t,e),r.constant=(t,e)=>new q(t,e)},27261,t=>{"use strict";let e;var r,n,i,o,s,a,u=t.i(43943),l=t.i(14303),f=t.i(16853),c=t.i(35030),h=t.i(80355),d=t.i(54119),p=t.i(44610),g=t.i(38340),y=t.i(85098),m=t.i(78217);t.i(95932);var b=t.i(78492),b=b,w=class extends b.default{socket;constructor(t,e){super(),this.socket=new window.WebSocket(t,e.protocols),this.socket.onopen=()=>
vendor: 4,387 bytes, line 1
1this.emit("open"),this.socket.onmessage=t=>this.emit("message",t.data),this.socket.onerror=t=>this.emit("error",t),this.socket.onclose=t=>{this.emit("close",t.code,t.reason)}}send(t,e,r){let n=r||e;try{this.socket.send(t),n()}catch(t){n(t)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,r){this.socket.addEventListener(t,e,r)}},v=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},x=class extends b.default{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:r=!0,reconnect:n=!0,reconnect_interval:i=1e3,max_reconnects:o=5,...s}={},a,u){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=r,this.ready=!1,this.reconnect=n,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=o,this.rest_options=s,this.current_reconnects=0,this.generate_request_id=a||(()=>"number"==typeof this.rpc_id?++this.rpc_id:Number(this.rpc_id)+1),u?this.dataPack=u:this.dataPack=new v,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,r,n){return n||"object"!=typeof r||(n=r,r=null),new Promise((i,o)=>{if(!this.ready)return o(Error("socket not ready"));let s=this.generate_request_id(t,e);this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e||void 0,id:s}),n,t=>{if(t)return o(t);this.queue[s]={promise:[i,o]},r&&(this.queue[s].timeout=setTimeout(()=>{delete this.queue[s],o(Error("reply timeout"))},r))})})}async login(t){let e=await this.call("rpc.login",t);if(!e)throw Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((r,n)=>{if(!this.ready)return n(Error("socket not ready"));this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e}),t=>{if(t)return n(t);r()})})}async subscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.on",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.off",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket&&this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}getCurrentReconnects(){return this.current_reconnects}getMaxReconnects(){return this.max_reconnects}isReconnecting(){return void 0!==this.reconnect_timer_id}willReconnect(){return this.reconnect&&(0===this.max_reconnects||this.current_reconnects<this.max_reconnects)}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:t})=>{t instanceof ArrayBuffer&&(t=u.Buffer.from(t).toString());try{t=this.dataPack.decode(t)}catch(t){return}if(t.notification&&this.listeners(t.notification).length){if(!Object.keys(t.params).length)return this.emit(t.notification);let e=[t.notification];if(t.params.constructor===Object)e.push(t.params);else for(let r=0;r<t.params.length;r++)e.push(t.params[r]);return Promise.resolve().then(()=>{this.emit.apply(this,e)})}if(!this.queue[t.id])return t.method?Promise.resolve().then(()=>{this.emit(t.method,t?.params)}):void 0;"error"in t=="result"in t&&this.queue[t.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[t.id].timeout&&clearTimeout(this.queue[t.id].timeout),t.error?this.queue[t.id].promise[1](t.error):this.queue[t.id].promise[0](t.result),delete this.queue[t.id]}),this.socket.addEventListener("error",t=>this.emit("error",t)),this.socket.addEventListener("close",({code:r,reason:n})=>{this.ready&&setTimeout(()=>
vendor: 22,368 bytes, line 1
1this.emit("close",r,n),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)?this.reconnect_timer_id=setTimeout(()=>this._connect(t,e),this.reconnect_interval):this.reconnect&&this.max_reconnects>0&&this.current_reconnects>=this.max_reconnects&&setTimeout(()=>this.emit("max_reconnects_reached",r,n),1))})}},S=t.i(9361),E=t.i(70525);let B=BigInt(0),k=BigInt(1),A=BigInt(2),I=BigInt(7),_=BigInt(256),M=BigInt(113),T=[],U=[],O=[];for(let t=0,e=k,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],T.push(2*(5*n+r)),U.push((t+1)*(t+2)/2%64);let i=B;for(let t=0;t<7;t++)(e=(e<<k^(e>>I)*M)%_)&A&&(i^=k<<(k<<BigInt(t))-k);O.push(i)}let R=(0,S.split)(O,!0),L=R[0],P=R[1],C=(t,e,r)=>r>32?(0,S.rotlBH)(t,e,r):(0,S.rotlSH)(t,e,r),N=(t,e,r)=>r>32?(0,S.rotlBL)(t,e,r):(0,S.rotlSL)(t,e,r);class q extends E.Hash{constructor(t,e,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=i,(0,E.anumber)(r),!(0<t&&t<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,E.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,E.swap32IfBE)(this.state32),function(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){let n=(e+8)%10,i=(e+2)%10,o=r[i],s=r[i+1],a=C(o,s,1)^r[n],u=N(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=u}let e=t[2],i=t[3];for(let r=0;r<24;r++){let n=U[r],o=C(e,i,n),s=N(e,i,n),a=T[r];e=t[a],i=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=L[n],t[1]^=P[n]}(0,E.clean)(r)}(this.state32,this.rounds),(0,E.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(t){(0,E.aexists)(this),t=(0,E.toBytes)(t),(0,E.abytes)(t);let{blockLen:e,state:r}=this,n=t.length;for(let i=0;i<n;){let o=Math.min(e-this.pos,n-i);for(let e=0;e<o;e++)r[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,(128&e)!=0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){(0,E.aexists)(this,!1),(0,E.abytes)(t),this.finish();let e=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,E.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,E.aoutput)(t,this),this.finished)throw Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,E.clean)(this.state)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return t||(t=new q(e,r,n,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}}let z=(0,E.createHasher)(()=>new q(136,1,32));var W=t.i(44314),F=E;class D extends F.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,F.ahash)(t);const r=(0,F.toBytes)(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;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),(0,F.clean)(i)}update(t){return(0,F.aexists)(this),this.iHash.update(t),this}digestInto(t){(0,F.aexists)(this),(0,F.abytes)(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:n,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=n,t.destroyed=i,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 j=(t,e,r)=>new D(t,e).update(r).digest();j.create=(t,e)=>new D(t,e);var K=t.i(26539),$=t.i(10588),H=t.i(70948);let V=(t,e)=>(t+(t>=0?e:-e)/Q)/e;function Z(t){if(!["compact","recovered","der"].includes(t))throw Error('Signature format must be "compact", "recovered", or "der"');return t}function G(t,e){let r={};for(let n of Object.keys(e))r[n]=void 0===t[n]?e[n]:t[n];return(0,K._abool2)(r.lowS,"lowS"),(0,K._abool2)(r.prehash,"prehash"),void 0!==r.format&&Z(r.format),r}let Y={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(t,e)=>{let{Err:r}=Y;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let n=e.length/2,i=(0,K.numberToHexUnpadded)(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?(0,K.numberToHexUnpadded)(i.length/2|128):"";return(0,K.numberToHexUnpadded)(t)+o+i+e},decode(t,e){let{Err:r}=Y,n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");let i=e[n++],o=0;if(128&i){let t=127&i;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(n,n+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(n+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let s=e.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(n+o)}}},_int:{encode(t){let{Err:e}=Y;if(t<X)throw new e("integer: negative integers are not allowed");let r=(0,K.numberToHexUnpadded)(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}=Y;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(0,K.bytesToNumberBE)(t)}},toSig(t){let{Err:e,_int:r,_tlv:n}=Y,i=(0,K.ensureBytes)("signature",t),{v:o,l:s}=n.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:u}=n.decode(2,o),{v:l,l:f}=n.decode(2,u);if(f.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(t){let{_tlv:e,_int:r}=Y,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s));return e.encode(48,n+i)}},X=BigInt(0),J=BigInt(1),Q=BigInt(2),tt=BigInt(3),te=BigInt(4);function tr(t,e){let r,{BYTES:n}=t;if("bigint"==typeof e)r=e;else{let i=(0,K.ensureBytes)("private key",e);try{r=t.fromBytes(i)}catch(t){throw Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw Error("invalid private key: out of range [1..N-1]");return r}function tn(t){return Uint8Array.of(t?2:3)}function ti(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}var to=t.i(33795);let ts={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},ta={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},tu=BigInt(0),tl=BigInt(2),tf=(0,H.Field)(ts.p,{sqrt:function(t){let e=ts.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),u=BigInt(88),l=t*t*t%e,f=l*l*t%e,c=(0,H.pow2)(f,r,e)*f%e,h=(0,H.pow2)(c,r,e)*f%e,d=(0,H.pow2)(h,tl,e)*l%e,p=(0,H.pow2)(d,i,e)*d%e,g=(0,H.pow2)(p,o,e)*p%e,y=(0,H.pow2)(g,a,e)*g%e,m=(0,H.pow2)(y,u,e)*y%e,b=(0,H.pow2)(m,a,e)*g%e,w=(0,H.pow2)(b,r,e)*f%e,v=(0,H.pow2)(w,s,e)*p%e,x=(0,H.pow2)(v,n,e)*l%e,S=(0,H.pow2)(x,tl,e);if(!tf.eql(tf.sqr(S),t))throw Error("Cannot find square root");return S}}),tc=(r={...ts,Fp:tf,lowS:!0,endo:ta},n=W.sha256,{...(e=t=>(function(t){let e,{CURVE:r,curveOpts:n,hash:i,ecdsaOpts:o}=function(t){let e,r,n,i,{CURVE:o,curveOpts:s}=(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,n=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0,i={Fp:r,Fn:(0,H.Field)(e.n,{BITS:t.nBitLength,allowedLengths:n,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes},{CURVE:e,curveOpts:i}),a={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:o,curveOpts:s,hash:t.hash,ecdsaOpts:a}}(t),s=function(t,e,r={}){(0,E.ahash)(e),(0,K._validateObject)(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let n=r.randomBytes||E.randomBytes,i=r.hmac||((t,...r)=>j(e,t,(0,E.concatBytes)(...r))),{Fp:o,Fn:s}=t,{ORDER:a,BITS:u}=s,{keygen:l,getPublicKey:f,getSharedSecret:c,utils:h,lengths:d}=function(t,e={}){let{Fn:r}=t,n=e.randomBytes||E.randomBytes,i=Object.assign(ti(t.Fp,r),{seed:(0,H.getMinHashLength)(r.ORDER)});function o(t){try{return!!tr(r,t)}catch(t){return!1}}function s(t=n(i.seed)){return(0,H.mapHashToField)((0,K._abytes2)(t,i.seed,"seed"),r.ORDER)}function a(e,n=!0){return t.BASE.multiply(tr(r,e)).toBytes(n)}function u(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;let{secretKey:n,publicKey:o,publicKeyUncompressed:s}=i;if(r.allowedLengths||n===o)return;let a=(0,K.ensureBytes)("key",e).length;return a===o||a===s}return Object.freeze({getPublicKey:a,getSharedSecret:function(e,n,i=!0){if(!0===u(e))throw Error("first arg must be private key");if(!1===u(n))throw Error("second arg must be public key");let o=tr(r,e);return t.fromHex(n).multiply(o).toBytes(i)},keygen:function(t){let e=s(t);return{secretKey:e,publicKey:a(e)}},Point:t,utils:{isValidSecretKey:o,isValidPublicKey:function(e,r){let{publicKey:n,publicKeyUncompressed:o}=i;try{let i=e.length;if(!0===r&&i!==n||!1===r&&i!==o)return!1;return!!t.fromBytes(e)}catch(t){return!1}},randomSecretKey:s,isValidPrivateKey:o,randomPrivateKey:s,normPrivateKeyToScalar:t=>tr(r,t),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)},lengths:i})}(t,r),p={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},g="compact";function y(t,e){if(!s.isValidNot0(e))throw Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class m{constructor(t,e,r){this.r=y("r",t),this.s=y("s",e),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(t,e=g){var r,n;let i,o;if(r=t,Z(n=e),o=d.signature,(0,K._abytes2)(r,"compact"===n?o:"recovered"===n?o+1:void 0,`${n} signature`),"der"===e){let{r:e,s:r}=Y.toSig((0,K._abytes2)(t));return new m(e,r)}"recovered"===e&&(i=t[0],e="compact",t=t.subarray(1));let a=s.BYTES,u=t.subarray(0,a),l=t.subarray(a,2*a);return new m(s.fromBytes(u),s.fromBytes(l),i)}static fromHex(t,e){return this.fromBytes((0,E.hexToBytes)(t),e)}addRecoveryBit(t){return new m(this.r,this.s,t)}recoverPublicKey(e){let r=o.ORDER,{r:n,s:i,recovery:u}=this;if(null==u||![0,1,2,3].includes(u))throw Error("recovery id invalid");if(a*Q<r&&u>1)throw Error("recovery id is ambiguous for h>1 curve");let l=2===u||3===u?n+a:n;if(!o.isValid(l))throw Error("recovery id 2 or 3 invalid");let f=o.toBytes(l),c=t.fromBytes((0,E.concatBytes)(tn((1&u)==0),f)),h=s.inv(l),d=w((0,K.ensureBytes)("msgHash",e)),p=s.create(-d*h),g=s.create(i*h),y=t.BASE.multiplyUnsafe(p).add(c.multiplyUnsafe(g));if(y.is0())throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>a>>J}toBytes(t=g){if(Z(t),"der"===t)return(0,E.hexToBytes)(Y.hexFromSig(this));let e=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw Error("recovery bit must be present");return(0,E.concatBytes)(Uint8Array.of(this.recovery),e,r)}return(0,E.concatBytes)(e,r)}toHex(t){return(0,E.bytesToHex)(this.toBytes(t))}assertValidity(){}static fromCompact(t){return m.fromBytes((0,K.ensureBytes)("sig",t),"compact")}static fromDER(t){return m.fromBytes((0,K.ensureBytes)("sig",t),"der")}normalizeS(){return this.hasHighS()?new m(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,E.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,E.bytesToHex)(this.toBytes("compact"))}}let b=r.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=(0,K.bytesToNumberBE)(t),r=8*t.length-u;return r>0?e>>BigInt(r):e},w=r.bits2int_modN||function(t){return s.create(b(t))},v=(0,K.bitMask)(u);function x(t){return(0,K.aInRange)("num < 2^"+u,t,X,v),s.toBytes(t)}function S(t,r){return(0,K._abytes2)(t,void 0,"message"),r?(0,K._abytes2)(e(t),void 0,"prehashed message"):t}return Object.freeze({keygen:l,getPublicKey:f,getSharedSecret:c,utils:h,lengths:d,Point:t,sign:function(r,o,u={}){let{seed:l,k2sig:f}=function(e,r,i){if(["recovered","canonical"].some(t=>t in i))throw Error("sign() legacy options not supported");let{lowS:o,prehash:u,extraEntropy:l}=G(i,p),f=w(e=S(e,u)),c=tr(s,r),h=[x(c),x(f)];if(null!=l&&!1!==l){let t=!0===l?n(d.secretKey):l;h.push((0,K.ensureBytes)("extraEntropy",t))}return{seed:(0,E.concatBytes)(...h),k2sig:function(e){let r=b(e);if(!s.isValidNot0(r))return;let n=s.inv(r),i=t.BASE.multiply(r).toAffine(),u=s.create(i.x);if(u===X)return;let l=s.create(n*s.create(f+u*c));if(l===X)return;let h=2*(i.x!==u)|Number(i.y&J),d=l;return o&&l>a>>J&&(d=s.neg(l),h^=1),new m(u,d,h)}}}(r=(0,K.ensureBytes)("message",r),o,u);return(0,K.createHmacDrbg)(e.outputLen,s.BYTES,i)(l,f)},verify:function(e,r,n,i={}){let{lowS:o,prehash:a,format:u}=G(i,p);if(n=(0,K.ensureBytes)("publicKey",n),r=S((0,K.ensureBytes)("message",r),a),"strict"in i)throw Error("options.strict was renamed to lowS");let l=void 0===u?function(t){let e,r="string"==typeof t||(0,E.isBytes)(t),n=!r&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!r&&!n)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(n)e=new m(t.r,t.s);else if(r){try{e=m.fromBytes((0,K.ensureBytes)("sig",t),"der")}catch(t){if(!(t instanceof Y.Err))throw t}if(!e)try{e=m.fromBytes((0,K.ensureBytes)("sig",t),"compact")}catch(t){return!1}}return!!e&&e}(e):m.fromBytes((0,K.ensureBytes)("sig",e),u);if(!1===l)return!1;try{let e=t.fromBytes(n);if(o&&l.hasHighS())return!1;let{r:i,s:a}=l,u=w(r),f=s.inv(a),c=s.create(u*f),h=s.create(i*f),d=t.BASE.multiplyUnsafe(c).add(e.multiplyUnsafe(h));if(d.is0())return!1;return s.create(d.x)===i}catch(t){return!1}},recoverPublicKey:function(t,e,r={}){let{prehash:n}=G(r,p);return e=S(e,n),m.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:m,hash:e})}(function(t,e={}){let r=(0,$._createCurveFields)("weierstrass",t,e),{Fp:n,Fn:i}=r,o=r.CURVE,{h:s,n:a}=o;(0,K._validateObject)(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:u}=e;if(u&&(!n.is0(o.a)||"bigint"!=typeof u.beta||!Array.isArray(u.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let l=ti(n,i);function f(){if(!n.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let c=e.toBytes||function(t,e,r){let{x:i,y:o}=e.toAffine(),s=n.toBytes(i);if((0,K._abool2)(r,"isCompressed"),!r)return(0,E.concatBytes)(Uint8Array.of(4),s,n.toBytes(o));{f();let t=!n.isOdd(o);return(0,E.concatBytes)(tn(t),s)}},h=e.fromBytes||function(t){(0,K._abytes2)(t,void 0,"Point");let{publicKey:e,publicKeyUncompressed:r}=l,i=t.length,o=t[0],s=t.subarray(1);if(i===e&&(2===o||3===o)){let t,e=n.fromBytes(s);if(!n.isValid(e))throw Error("bad point: is not on curve, wrong x");let r=d(e);try{t=n.sqrt(r)}catch(t){throw Error("bad point: is not on curve, sqrt error"+(t instanceof Error?": "+t.message:""))}return f(),(1&o)==1!==n.isOdd(t)&&(t=n.neg(t)),{x:e,y:t}}if(i===r&&4===o){let t=n.BYTES,e=n.fromBytes(s.subarray(0,t)),r=n.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 ${i}, expected compressed=${e} or uncompressed=${r}`)};function d(t){let e=n.sqr(t),r=n.mul(e,t);return n.add(n.add(r,n.mul(t,o.a)),o.b)}function p(t,e){let r=n.sqr(e),i=d(t);return n.eql(r,i)}if(!p(o.Gx,o.Gy))throw Error("bad curve params: generator point");let g=n.mul(n.pow(o.a,tt),te),y=n.mul(n.sqr(o.b),BigInt(27));if(n.is0(n.add(g,y)))throw Error("bad curve params: a or b");function m(t,e,r=!1){if(!n.isValid(e)||r&&n.is0(e))throw Error(`bad point coordinate ${t}`);return e}function b(t){if(!(t instanceof B))throw Error("ProjectivePoint expected")}function w(t){if(!u||!u.basises)throw Error("no endo");return function(t,e,r){let[[n,i],[o,s]]=e,a=V(s*t,r),u=V(-i*t,r),l=t-a*n-u*o,f=-a*i-u*s,c=l<X,h=f<X;c&&(l=-l),h&&(f=-f);let d=(0,K.bitMask)(Math.ceil((0,K.bitLen)(r)/2))+J;if(l<X||l>=d||f<X||f>=d)throw Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:c,k1:l,k2neg:h,k2:f}}(t,u.basises,i.ORDER)}let v=(0,K.memoized)((t,e)=>{let{X:r,Y:i,Z:o}=t;if(n.eql(o,n.ONE))return{x:r,y:i};let s=t.is0();null==e&&(e=s?n.ONE:n.inv(o));let a=n.mul(r,e),u=n.mul(i,e),l=n.mul(o,e);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(l,n.ONE))throw Error("invZ was invalid");return{x:a,y:u}}),x=(0,K.memoized)(t=>{if(t.is0()){if(e.allowInfinityPoint&&!n.is0(t.Y))return;throw Error("bad point: ZERO")}let{x:r,y:i}=t.toAffine();if(!n.isValid(r)||!n.isValid(i))throw Error("bad point: x or y not field elements");if(!p(r,i))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function S(t,e,r,i,o){return r=new B(n.mul(r.X,t),r.Y,r.Z),e=(0,$.negateCt)(i,e),r=(0,$.negateCt)(o,r),e.add(r)}class B{constructor(t,e,r){this.X=m("x",t),this.Y=m("y",e,!0),this.Z=m("z",r),Object.freeze(this)}static CURVE(){return o}static fromAffine(t){let{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw Error("invalid affine point");if(t instanceof B)throw Error("projective point not allowed");return n.is0(e)&&n.is0(r)?B.ZERO:new B(e,r,n.ONE)}static fromBytes(t){let e=B.fromAffine(h((0,K._abytes2)(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return B.fromBytes((0,K.ensureBytes)("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return A.createCache(this,t),e||this.multiply(tt),this}assertValidity(){x(this)}hasEvenY(){let{y:t}=this.toAffine();if(!n.isOdd)throw Error("Field doesn't support isOdd");return!n.isOdd(t)}equals(t){b(t);let{X:e,Y:r,Z:i}=this,{X:o,Y:s,Z:a}=t,u=n.eql(n.mul(e,a),n.mul(o,i)),l=n.eql(n.mul(r,a),n.mul(s,i));return u&&l}negate(){return new B(this.X,n.neg(this.Y),this.Z)}double(){let{a:t,b:e}=o,r=n.mul(e,tt),{X:i,Y:s,Z:a}=this,u=n.ZERO,l=n.ZERO,f=n.ZERO,c=n.mul(i,i),h=n.mul(s,s),d=n.mul(a,a),p=n.mul(i,s);return p=n.add(p,p),f=n.mul(i,a),f=n.add(f,f),u=n.mul(t,f),l=n.mul(r,d),l=n.add(u,l),u=n.sub(h,l),l=n.add(h,l),l=n.mul(u,l),u=n.mul(p,u),f=n.mul(r,f),d=n.mul(t,d),p=n.sub(c,d),p=n.mul(t,p),p=n.add(p,f),f=n.add(c,c),c=n.add(f,c),c=n.add(c,d),c=n.mul(c,p),l=n.add(l,c),d=n.mul(s,a),d=n.add(d,d),c=n.mul(d,p),u=n.sub(u,c),f=n.mul(d,h),f=n.add(f,f),new B(u,l,f=n.add(f,f))}add(t){b(t);let{X:e,Y:r,Z:i}=this,{X:s,Y:a,Z:u}=t,l=n.ZERO,f=n.ZERO,c=n.ZERO,h=o.a,d=n.mul(o.b,tt),p=n.mul(e,s),g=n.mul(r,a),y=n.mul(i,u),m=n.add(e,r),w=n.add(s,a);m=n.mul(m,w),w=n.add(p,g),m=n.sub(m,w),w=n.add(e,i);let v=n.add(s,u);return w=n.mul(w,v),v=n.add(p,y),w=n.sub(w,v),v=n.add(r,i),l=n.add(a,u),v=n.mul(v,l),l=n.add(g,y),v=n.sub(v,l),c=n.mul(h,w),l=n.mul(d,y),c=n.add(l,c),l=n.sub(g,c),c=n.add(g,c),f=n.mul(l,c),g=n.add(p,p),g=n.add(g,p),y=n.mul(h,y),w=n.mul(d,w),g=n.add(g,y),y=n.sub(p,y),y=n.mul(h,y),w=n.add(w,y),p=n.mul(g,w),f=n.add(f,p),p=n.mul(v,w),l=n.mul(m,l),l=n.sub(l,p),p=n.mul(m,g),c=n.mul(v,c),new B(l,f,c=n.add(c,p))}subtract(t){return this.add(t.negate())}is0(){return this.equals(B.ZERO)}multiply(t){let r,n,{endo:o}=e;if(!i.isValidNot0(t))throw Error("invalid scalar: out of range");let s=t=>A.cached(this,t,t=>(0,$.normalizeZ)(B,t));if(o){let{k1neg:e,k1:i,k2neg:a,k2:u}=w(t),{p:l,f:f}=s(i),{p:c,f:h}=s(u);n=f.add(h),r=S(o.beta,l,c,e,a)}else{let{p:e,f:i}=s(t);r=e,n=i}return(0,$.normalizeZ)(B,[r,n])[0]}multiplyUnsafe(t){let{endo:r}=e;if(!i.isValid(t))throw Error("invalid scalar: out of range");if(t===X||this.is0())return B.ZERO;if(t===J)return this;if(A.hasCache(this))return this.multiply(t);if(!r)return A.unsafe(this,t);{let{k1neg:e,k1:n,k2neg:i,k2:o}=w(t),{p1:s,p2:a}=(0,$.mulEndoUnsafe)(B,this,n,o);return S(r.beta,s,a,e,i)}}multiplyAndAddUnsafe(t,e,r){let n=this.multiplyUnsafe(e).add(t.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(t){return v(this,t)}isTorsionFree(){let{isTorsionFree:t}=e;return s===J||(t?t(B,this):A.unsafe(this,a).is0())}clearCofactor(){let{clearCofactor:t}=e;return s===J?this:t?t(B,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(t=!0){return(0,K._abool2)(t,"isCompressed"),this.assertValidity(),c(B,this,t)}toHex(t=!0){return(0,E.bytesToHex)(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)}
1_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return(0,$.normalizeZ)(B,t)}static msm(t,e){return(0,$.pippenger)(B,i,t,e)}static fromPrivateKey(t){return B.BASE.multiply(tr(i,t))}}B.BASE=new B(o.Gx,o.Gy,n.ONE),B.ZERO=new B(n.ZERO,n.ONE,n.ZERO),B.Fp=n,B.Fn=i;let k=i.BITS,A=new $.wNAF(B,e.endo?Math.ceil(k/2):k);return B.BASE.precompute(8),B}(r,n),i,o);return e=s.Point,Object.assign({},s,{ProjectivePoint:e,CURVE:Object.assign({},t,(0,H.nLength)(e.Fn.ORDER,e.Fn.BITS))})})({...r,hash:t}))(n),create:e});tc.Point;K.bytesToNumberBE;let th=(0,to.isogenyMap)(tf,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(t=>BigInt(t)))),td=function(t,e){(0,H.validateField)(t);let{A:r,B:n,Z:i}=e;if(!t.isValid(r)||!t.isValid(n)||!t.isValid(i))throw Error("mapToCurveSimpleSWU: invalid opts");let o=function(t,e){let r=t.ORDER,n=X;for(let t=r-J;t%Q===X;t/=Q)n+=J;let i=n,o=Q<<i-J-J,s=o*Q,a=(r-J)/s,u=(a-J)/Q,l=s-J,f=t.pow(e,a),c=t.pow(e,(a+J)/Q),h=(e,r)=>{let n=f,s=t.pow(r,l),a=t.sqr(s);a=t.mul(a,r);let h=t.mul(e,a);h=t.pow(h,u),h=t.mul(h,s),s=t.mul(h,r),a=t.mul(h,e);let d=t.mul(a,s);h=t.pow(d,o);let p=t.eql(h,t.ONE);s=t.mul(a,c),h=t.mul(d,n),a=t.cmov(s,a,p),d=t.cmov(h,d,p);for(let e=i;e>J;e--){let r=e-Q;r=Q<<r-J;let i=t.pow(d,r),o=t.eql(i,t.ONE);s=t.mul(a,n),n=t.mul(n,n),i=t.mul(d,n),a=t.cmov(s,a,o),d=t.cmov(i,d,o)}return{isValid:p,value:a}};if(t.ORDER%te===tt){let r=(t.ORDER-tt)/te,n=t.sqrt(t.neg(e));h=(e,i)=>{let o=t.sqr(i),s=t.mul(e,i);o=t.mul(o,s);let a=t.pow(o,r);a=t.mul(a,s);let u=t.mul(a,n),l=t.mul(t.sqr(a),i),f=t.eql(l,e),c=t.cmov(u,a,f);return{isValid:f,value:c}}}return h}(t,i);if(!t.isOdd)throw Error("Field does not have .isOdd()");return e=>{let s,a,u,l,f,c,h,d;s=t.sqr(e),s=t.mul(s,i),a=t.sqr(s),a=t.add(a,s),u=t.add(a,t.ONE),u=t.mul(u,n),l=t.cmov(i,t.neg(a),!t.eql(a,t.ZERO)),l=t.mul(l,r),a=t.sqr(u),c=t.sqr(l),f=t.mul(c,r),a=t.add(a,f),a=t.mul(a,u),c=t.mul(c,l),f=t.mul(c,n),a=t.add(a,f),h=t.mul(s,u);let{isValid:p,value:g}=o(a,c);d=t.mul(s,e),d=t.mul(d,g),h=t.cmov(h,u,p),d=t.cmov(d,g,p);let y=t.isOdd(e)===t.isOdd(d);d=t.cmov(t.neg(d),d,y);let m=(0,H.FpInvertBatch)(t,[l],!0)[0];return{x:h=t.mul(h,m),y:d}}}(tf,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:tf.create(BigInt("-11"))});(0,to.createHasher)(tc.Point,t=>{let{x:e,y:r}=td(tf.create(t[0]));return th(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:tf.ORDER,m:1,k:128,expand:"xmd",hash:W.sha256}),l.ed25519.utils.randomPrivateKey;let tp=()=>{let t=l.ed25519.utils.randomPrivateKey(),e=tg(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},tg=l.ed25519.getPublicKey;function ty(t){try{return l.ed25519.ExtendedPoint.fromHex(t),!0}catch{return!1}}let tm=(t,e)=>l.ed25519.sign(t,e.slice(0,32)),tb=l.ed25519.verify,tw=t=>u.Buffer.isBuffer(t)?t:t instanceof Uint8Array?u.Buffer.from(t.buffer,t.byteOffset,t.byteLength):u.Buffer.from(t);class tv{constructor(t){Object.assign(this,t)}encode(){return u.Buffer.from((0,d.serialize)(tx,this))}static decode(t){return(0,d.deserialize)(tx,this,t)}
vendor: 36,324 bytes, lines 1-7
1static decodeUnchecked(t){return(0,d.deserializeUnchecked)(tx,this,t)}}let tx=new Map,tS=1;class tE extends tv{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=c.default.decode(t);if(32!=e.length)throw Error("Invalid public key input");this._bn=new f.default(e)}else this._bn=new f.default(t);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let t=new tE(tS);return tS+=1,new tE(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return c.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(u.Buffer);if(32===t.length)return t;let e=u.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){let n=u.Buffer.concat([t.toBuffer(),u.Buffer.from(e),r.toBuffer()]);return new tE((0,h.sha256)(n))}static createProgramAddressSync(t,e){let r=u.Buffer.alloc(0);t.forEach(function(t){if(t.length>32)throw TypeError("Max seed length exceeded");r=u.Buffer.concat([r,tw(t)])}),r=u.Buffer.concat([r,e.toBuffer(),u.Buffer.from("ProgramDerivedAddress")]);let n=(0,h.sha256)(r);if(ty(n))throw Error("Invalid seeds, address must fall off the curve");return new tE(n)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,n=255;for(;0!=n;){try{let i=t.concat(u.Buffer.from([n]));r=this.createProgramAddressSync(i,e)}catch(t){if(t instanceof TypeError)throw t;n--;continue}return[r,n]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return ty(new tE(t).toBytes())}}tE.default=new tE("11111111111111111111111111111111"),tx.set(tE,{kind:"struct",fields:[["_bn","u256"]]}),new tE("BPFLoader1111111111111111111111111111111111");class tB extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(tB.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class tk extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(tk.prototype,"name",{value:"TransactionExpiredTimeoutError"});class tA extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(tA.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class tI{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments())if(t<e.length)return e[t];else t-=e.length}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw Error("Account index overflow encountered during compilation");let e=new Map;this.keySegments().flat().forEach((t,r)=>{e.set(t.toBase58(),r)});let r=t=>{let r=e.get(t.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return t.map(t=>({programIdIndex:r(t.programId),accountKeyIndexes:t.keys.map(t=>r(t.pubkey)),data:t.data}))}}let t_=(t="publicKey")=>p.blob(32,t),tM=(t="string")=>{let e=p.struct([p.u32("length"),p.u32("lengthPadding"),p.blob(p.offset(p.u32(),-8),"chars")],t),r=e.decode.bind(e),n=e.encode.bind(e);return e.decode=(t,e)=>r(t,e).chars.toString(),e.encode=(t,e,r)=>n({chars:u.Buffer.from(t,"utf8")},e,r),e.alloc=t=>p.u32().span+p.u32().span+u.Buffer.from(t,"utf8").length,e};function tT(t){let e=0,r=0;for(;;){let n=t.shift();if(e|=(127&n)<<7*r,r+=1,(128&n)==0)break}return e}function tU(t,e){let r=e;for(;;){let e=127&r;if(0==(r>>=7)){t.push(e);break}e|=128,t.push(e)}}function tO(t,e){if(!t)throw Error(e||"Assertion failed")}class tR{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let r=new Map,n=t=>{let e=t.toBase58(),n=r.get(e);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(e,n)),n},i=n(e);for(let e of(i.isSigner=!0,i.isWritable=!0,t))for(let t of(n(e.programId).isInvoked=!0,e.keys)){let e=n(t.pubkey);e.isSigner||=t.isSigner,e.isWritable||=t.isWritable}return new tR(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];tO(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,t])=>t.isSigner&&t.isWritable),r=t.filter(([,t])=>t.isSigner&&!t.isWritable),n=t.filter(([,t])=>!t.isSigner&&t.isWritable),i=t.filter(([,t])=>!t.isSigner&&!t.isWritable),o={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{tO(e.length>0,"Expected at least one writable signer key");let[t]=e[0];tO(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map(([t])=>new tE(t)),...r.map(([t])=>new tE(t)),...n.map(([t])=>new tE(t)),...i.map(([t])=>new tE(t))]]}extractTableLookup(t){let[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&t.isWritable),[n,i]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&!t.isWritable);if(0!==e.length||0!==n.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(t,e){let r=[],n=[];for(let[i,o]of this.keyMetaMap.entries())if(e(o)){let e=new tE(i),o=t.findIndex(t=>t.equals(e));o>=0&&(tO(o<256,"Max lookup table index exceeded"),r.push(o),n.push(e),this.keyMetaMap.delete(i))}return[r,n]}}let tL="Reached end of buffer unexpectedly";function tP(t){if(0===t.length)throw Error(tL);return t.shift()}function tC(t,...e){let[r]=e;if(2===e.length?r+(e[1]??0)>t.length:r>=t.length)throw Error(tL);return t.splice(...e)}class tN{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(t=>new tE(t)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:c.default.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new tI(this.staticAccountKeys)}static compile(t){let[e,r]=tR.compile(t.instructions,t.payerKey).getMessageComponents(),n=new tI(r).compileInstructions(t.instructions).map(t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:c.default.encode(t.data)}));return new tN({header:e,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:n})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures;if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return t-e<r}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((t,e)=>!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];tU(e,t);let r=this.instructions.map(t=>{let{accounts:e,programIdIndex:r}=t,n=Array.from(c.default.decode(t.data)),i=[];tU(i,e.length);let o=[];return tU(o,n.length),{programIdIndex:r,keyIndicesCount:u.Buffer.from(i),keyIndices:e,dataLength:u.Buffer.from(o),data:n}}),n=[];tU(n,r.length);let i=u.Buffer.alloc(1232);u.Buffer.from(n).copy(i);let o=n.length;r.forEach(t=>{let e=p.struct([p.u8("programIdIndex"),p.blob(t.keyIndicesCount.length,"keyIndicesCount"),p.seq(p.u8("keyIndex"),t.keyIndices.length,"keyIndices"),p.blob(t.dataLength.length,"dataLength"),p.seq(p.u8("userdatum"),t.data.length,"data")]).encode(t,i,o);o+=e}),i=i.slice(0,o);let s=p.struct([p.blob(1,"numRequiredSignatures"),p.blob(1,"numReadonlySignedAccounts"),p.blob(1,"numReadonlyUnsignedAccounts"),p.blob(e.length,"keyCount"),p.seq(t_("key"),t,"keys"),t_("recentBlockhash")]),a={numRequiredSignatures:u.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:u.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:u.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:u.Buffer.from(e),keys:this.accountKeys.map(t=>tw(t.toBytes())),recentBlockhash:c.default.decode(this.recentBlockhash)},l=u.Buffer.alloc(2048),f=s.encode(a,l);return i.copy(l,f),l.slice(0,f+i.length)}static from(t){let e=[...t],r=tP(e);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let n=tP(e),i=tP(e),o=tT(e),s=[];for(let t=0;t<o;t++){let t=tC(e,0,32);s.push(new tE(u.Buffer.from(t)))}let a=tC(e,0,32),l=tT(e),f=[];for(let t=0;t<l;t++){let t=tP(e),r=tT(e),n=tC(e,0,r),i=tT(e),o=tC(e,0,i),s=c.default.encode(u.Buffer.from(o));f.push({programIdIndex:t,accounts:n,data:s})}return new tN({header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:c.default.encode(u.Buffer.from(a)),accountKeys:s,instructions:f})}}class tq{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(let e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new tI(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(t>=r)return t-r<this.addressTableLookups.reduce((t,e)=>t+e.writableIndexes.length,0);if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let n=r-e-this.header.numReadonlyUnsignedAccounts;return t-e<n}}resolveAddressTableLookups(t){let e={writable:[],readonly:[]};for(let r of this.addressTableLookups){let n=t.find(t=>t.key.equals(r.accountKey));if(!n)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let t of r.writableIndexes)if(t<n.state.addresses.length)e.writable.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`);for(let t of r.readonlyIndexes)if(t<n.state.addresses.length)e.readonly.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`)}return e}static compile(t){let e=tR.compile(t.instructions,t.payerKey),r=[],n={writable:[],readonly:[]};for(let i of t.addressLookupTableAccounts||[]){let t=e.extractTableLookup(i);if(void 0!==t){let[e,{writable:i,readonly:o}]=t;r.push(e),n.writable.push(...i),n.readonly.push(...o)}}let[i,o]=e.getMessageComponents(),s=new tI(o,n).compileInstructions(t.instructions);return new tq({header:i,staticAccountKeys:o,recentBlockhash:t.recentBlockhash,compiledInstructions:s,addressTableLookups:r})}serialize(){let t=[];tU(t,this.staticAccountKeys.length);let e=this.serializeInstructions(),r=[];tU(r,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),i=[];tU(i,this.addressTableLookups.length);let o=p.struct([p.u8("prefix"),p.struct([p.u8("numRequiredSignatures"),p.u8("numReadonlySignedAccounts"),p.u8("numReadonlyUnsignedAccounts")],"header"),p.blob(t.length,"staticAccountKeysLength"),p.seq(t_(),this.staticAccountKeys.length,"staticAccountKeys"),t_("recentBlockhash"),p.blob(r.length,"instructionsLength"),p.blob(e.length,"serializedInstructions"),p.blob(i.length,"addressTableLookupsLength"),p.blob(n.length,"serializedAddressTableLookups")]),s=new Uint8Array(1232),a=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(t=>t.toBytes()),recentBlockhash:c.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},s);return s.slice(0,a)}serializeInstructions(){let t=0,e=new Uint8Array(1232);for(let r of this.compiledInstructions){let n=[];tU(n,r.accountKeyIndexes.length);let i=[];tU(i,r.data.length);let o=p.struct([p.u8("programIdIndex"),p.blob(n.length,"encodedAccountKeyIndexesLength"),p.seq(p.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),p.blob(i.length,"encodedDataLength"),p.blob(r.data.length,"data")]);t+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0,e=new Uint8Array(1232);for(let r of this.addressTableLookups){let n=[];tU(n,r.writableIndexes.length);let i=[];tU(i,r.readonlyIndexes.length);let o=p.struct([t_("accountKey"),p.blob(n.length,"encodedWritableIndexesLength"),p.seq(p.u8(),r.writableIndexes.length,"writableIndexes"),p.blob(i.length,"encodedReadonlyIndexesLength"),p.seq(p.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t],r=tP(e),n=127&r;tO(r!==n,"Expected versioned message but received legacy message"),tO(0===n,`Expected versioned message with version 0 but found version ${n}`);let i={numRequiredSignatures:tP(e),numReadonlySignedAccounts:tP(e),numReadonlyUnsignedAccounts:tP(e)},o=[],s=tT(e);for(let t=0;t<s;t++)o.push(new tE(tC(e,0,32)));let a=c.default.encode(tC(e,0,32)),u=tT(e),l=[];for(let t=0;t<u;t++){let t=tP(e),r=tT(e),n=tC(e,0,r),i=tT(e),o=new Uint8Array(tC(e,0,i));l.push({programIdIndex:t,accountKeyIndexes:n,data:o})}let f=tT(e),h=[];for(let t=0;t<f;t++){let t=new tE(tC(e,0,32)),r=tT(e),n=tC(e,0,r),i=tT(e),o=tC(e,0,i);h.push({accountKey:t,writableIndexes:n,readonlyIndexes:o})}return new tq({header:i,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:l,addressTableLookups:h})}}let tz={deserializeMessageVersion(t){let e=t[0],r=127&e;return r===e?"legacy":r},deserialize:t=>{let e=tz.deserializeMessageVersion(t);if("legacy"===e)return tN.from(t);if(0===e)return tq.deserialize(t);throw Error(`Transaction message version ${e} deserialization is not supported`)}},tW=((i={})[i.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",i[i.PROCESSED=1]="PROCESSED",i[i.TIMED_OUT=2]="TIMED_OUT",i[i.NONCE_INVALID=3]="NONCE_INVALID",i),tF=u.Buffer.alloc(64).fill(0);class tD{constructor(t){this.keys=void 0,this.programId=void 0,this.data=u.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class tj{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!t)return;if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{const{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(0===t.length)throw Error("No instructions");return t.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new tD(t))}),this}compileMessage(){let t,e,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let t=0;t<e.length;t++)if(void 0===e[t].programId)throw Error(`Transaction instruction index ${t} has undefined program id`);let n=[],i=[];e.forEach(t=>{t.keys.forEach(t=>{i.push({...t})});let e=t.programId.toString();n.includes(e)||n.push(e)}),n.forEach(t=>{i.push({pubkey:new tE(t),isSigner:!1,isWritable:!1})});let o=[];i.forEach(t=>{let e=t.pubkey.toString(),r=o.findIndex(t=>t.pubkey.toString()===e);r>-1?(o[r].isWritable=o[r].isWritable||t.isWritable,o[r].isSigner=o[r].isSigner||t.isSigner):o.push(t)}),o.sort(function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let s=o.findIndex(t=>t.pubkey.equals(r));if(s>-1){let[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let t of this.signatures){let e=o.findIndex(e=>e.pubkey.equals(t.publicKey));if(e>-1)o[e].isSigner||(o[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw Error(`unknown signer: ${t.publicKey.toString()}`)}let a=0,u=0,l=0,f=[],h=[];o.forEach(({pubkey:t,isSigner:e,isWritable:r})=>{e?(f.push(t.toString()),a+=1,r||(u+=1)):(h.push(t.toString()),r||(l+=1))});let d=f.concat(h),p=e.map(t=>{let{data:e,programId:r}=t;return{programIdIndex:d.indexOf(r.toString()),accounts:t.keys.map(t=>d.indexOf(t.pubkey.toString())),data:c.default.encode(e)}});return p.forEach(t=>{tO(t.programIdIndex>=0),t.accounts.forEach(t=>tO(t>=0))}),new tN({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:l},accountKeys:d,recentBlockhash:t,instructions:p})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((t,r)=>e[r].equals(t.publicKey))?t:(this.signatures=e.map(t=>({signature:null,publicKey:t})),t)}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw Error("No signers");let e=new Set;this.signatures=t.filter(t=>{let r=t.toString();return!e.has(r)&&(e.add(r),!0)}).map(t=>({signature:null,publicKey:t}))}sign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}this.signatures=r.map(t=>({signature:null,publicKey:t.publicKey}));let n=this._compile();this._partialSign(n,...r)}partialSign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}let n=this._compile();this._partialSign(n,...r)}_partialSign(t,...e){let r=t.serialize();e.forEach(t=>{let e=tm(r,t.secretKey);this._addSignature(t.publicKey,tw(e))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){tO(64===e.length);let r=this.signatures.findIndex(e=>t.equals(e.publicKey));if(r<0)throw Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=u.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let r={};for(let{signature:n,publicKey:i}of this.signatures)null===n?e&&(r.missing||=[]).push(i):tb(n,t,i.toBytes())||(r.invalid||=[]).push(i);return r.invalid||r.missing?r:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),n=this.serializeMessage();if(r){let t=this._getMessageSignednessErrors(n,e);if(t){let e="Signature verification failed.";throw t.invalid&&(e+=`
2Invalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map(t=>t.toBase58()).join("`, `")}\`].`),t.missing&&(e+=`
3Missing signature for public key${1===t.missing.length?"":"(s)"} [\`${t.missing.map(t=>t.toBase58()).join("`, `")}\`].`),Error(e)}}return this._serialize(n)}_serialize(t){let{signatures:e}=this,r=[];tU(r,e.length);let n=r.length+64*e.length+t.length,i=u.Buffer.alloc(n);return tO(e.length<256),u.Buffer.from(r).copy(i,0),e.forEach(({signature:t},e)=>{null!==t&&(tO(64===t.length,"signature has invalid length"),u.Buffer.from(t).copy(i,r.length+64*e))}),t.copy(i,r.length+64*e.length),tO(i.length<=1232,`Transaction too large: ${i.length} > 1232`),i}get keys(){return tO(1===this.instructions.length),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return tO(1===this.instructions.length),this.instructions[0].programId}get data(){return tO(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t],r=tT(e),n=[];for(let t=0;t<r;t++){let t=tC(e,0,64);n.push(c.default.encode(u.Buffer.from(t)))}return tj.populate(tN.from(e),n)}static populate(t,e=[]){let r=new tj;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),e.forEach((e,n)=>{let i={signature:e==c.default.encode(tF)?null:c.default.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)}),t.instructions.forEach(e=>{let n=e.accounts.map(e=>{let n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some(t=>t.publicKey.toString()===n.toString())||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}});r.instructions.push(new tD({keys:n,programId:t.accountKeys[e.programIdIndex],data:c.default.decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}}let tK=new tE("SysvarC1ock11111111111111111111111111111111");new tE("SysvarEpochSchedu1e111111111111111111111111"),new tE("Sysvar1nstructions1111111111111111111111111");let t$=new tE("SysvarRecentB1ockHashes11111111111111111111"),tH=new tE("SysvarRent111111111111111111111111111111111");new tE("SysvarRewards111111111111111111111111111111"),new tE("SysvarS1otHashes111111111111111111111111111"),new tE("SysvarS1otHistory11111111111111111111111111");let tV=new tE("SysvarStakeHistory1111111111111111111111111");class tZ extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:n}){let i;const o=n?`Logs: 
4${JSON.stringify(n.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(t){case"send":i=`Transaction ${e} resulted in an error. 
5${r}. `+o+s;break;case"simulate":i=`Simulation failed. 
6Message: ${r}. 
7`+o+s;break;default:i=`Unknown action '${(t=>t)(t)}'`}super(i),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=r,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(null==t||"object"!=typeof t||!("then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,r)=>{t.getTransaction(this.signature).then(t=>{if(t&&t.meta&&t.meta.logMessages){let r=t.meta.logMessages;this.transactionLogs=r,e(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}class tG extends Error{constructor({code:t,message:e,data:r},n){super(null!=n?`${n}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=r,this.name="SolanaJSONRPCError"}}async function tY(t,e,r,n){let i,o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},s=await t.sendTransaction(e,r,o);if(null!=e.recentBlockhash&&null!=e.lastValidBlockHeight)i=(await t.confirmTransaction({abortSignal:n?.abortSignal,signature:s,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=e.minNonceContextSlot&&null!=e.nonceInfo){let{nonceInstruction:r}=e.nonceInfo,o=r.keys[0].pubkey;i=(await t.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:o,nonceValue:e.nonceInfo.nonce,signature:s},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),i=(await t.confirmTransaction(s,n&&n.commitment)).value;if(i.err){if(null!=s)throw new tZ({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(i)})`});throw Error(`Transaction ${s} failed (${JSON.stringify(i)})`)}return s}function tX(t){return new Promise(e=>setTimeout(e,t))}function tJ(t,e){let r=t.layout.span>=0?t.layout.span:function t(e,r){let n=e=>{if(e.span>=0)return e.span;if("function"==typeof e.alloc)return e.alloc(r[e.property]);if("count"in e&&"elementLayout"in e){let t=r[e.property];if(Array.isArray(t))return t.length*n(e.elementLayout)}else if("fields"in e)return t({layout:e},r[e.property]);return 0},i=0;return e.layout.fields.forEach(t=>{i+=n(t)}),i}(t,e),n=u.Buffer.alloc(r),i=Object.assign({instruction:t.index},e);return t.layout.encode(i,n),n}let tQ=p.nu64("lamportsPerSignature"),t0=p.struct([p.u32("version"),p.u32("state"),t_("authorizedPubkey"),t_("nonce"),p.struct([tQ],"feeCalculator")]),t1=t0.span;class t2{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){let e=t0.decode(tw(t),0);return new t2({authorizedPubkey:new tE(e.authorizedPubkey),nonce:new tE(e.nonce).toString(),feeCalculator:e.feeCalculator})}}function t6(t){let e=(0,p.blob)(8,t),r=e.decode.bind(e),n=e.encode.bind(e),i=(0,g.getU64Codec)();return e.decode=(t,e)=>{let n=r(t,e);return i.decode(n)},e.encode=(t,e,r)=>n(i.encode(t),e,r),e}let t8=Object.freeze({Create:{index:0,layout:p.struct([p.u32("instruction"),p.ns64("lamports"),p.ns64("space"),t_("programId")])},Assign:{index:1,layout:p.struct([p.u32("instruction"),t_("programId")])},Transfer:{index:2,layout:p.struct([p.u32("instruction"),t6("lamports")])},CreateWithSeed:{index:3,layout:p.struct([p.u32("instruction"),t_("base"),tM("seed"),p.ns64("lamports"),p.ns64("space"),t_("programId")])},AdvanceNonceAccount:{index:4,layout:p.struct([p.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:p.struct([p.u32("instruction"),p.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:p.struct([p.u32("instruction"),t_("authorized")])},AuthorizeNonceAccount:{index:7,layout:p.struct([p.u32("instruction"),t_("authorized")])},Allocate:{index:8,layout:p.struct([p.u32("instruction"),p.ns64("space")])},AllocateWithSeed:{index:9,layout:p.struct([p.u32("instruction"),t_("base"),tM("seed"),p.ns64("space"),t_("programId")])},AssignWithSeed:{index:10,layout:p.struct([p.u32("instruction"),t_("base"),tM("seed"),t_("programId")])},TransferWithSeed:{index:11,layout:p.struct([p.u32("instruction"),t6("lamports"),tM("seed"),t_("programId")])},UpgradeNonceAccount:{index:12,layout:p.struct([p.u32("instruction")])}});class t3{static createAccount(t){let e=tJ(t8.Create,{lamports:t.lamports,space:t.space,programId:tw(t.programId.toBuffer())});return new tD({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,r;return"basePubkey"in t?(e=tJ(t8.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:tw(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]):(e=tJ(t8.Transfer,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new tD({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=tJ(t8.AssignWithSeed,{base:tw(t.basePubkey.toBuffer()),seed:t.seed,programId:tw(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=tJ(t8.Assign,{programId:tw(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new tD({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=tJ(t8.CreateWithSeed,{base:tw(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:tw(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||r.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new tD({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){let e=new tj;"basePubkey"in t&&"seed"in t?e.add(t3.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:t1,programId:this.programId})):e.add(t3.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:t1,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=tJ(t8.InitializeNonceAccount,{authorized:tw(t.authorizedPubkey.toBuffer())});return new tD({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t$,isSigner:!1,isWritable:!1},{pubkey:tH,isSigner:!1,isWritable:!1}],programId:this.programId,data:e})}static nonceAdvance(t){let e=tJ(t8.AdvanceNonceAccount);return new tD({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t$,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceWithdraw(t){let e=tJ(t8.WithdrawNonceAccount,{lamports:t.lamports});return new tD({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:t$,isSigner:!1,isWritable:!1},{pubkey:tH,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){let e=tJ(t8.AuthorizeNonceAccount,{authorized:tw(t.newAuthorizedPubkey.toBuffer())});return new tD({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,r;return"basePubkey"in t?(e=tJ(t8.AllocateWithSeed,{base:tw(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:tw(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=tJ(t8.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new tD({keys:r,programId:this.programId,data:e})}}t3.programId=new tE("11111111111111111111111111111111");class t5{static getMinNumSignatures(t){return 2*(Math.ceil(t/t5.chunkSize)+1+1)}static async load(t,e,r,n,i){{let o=await t.getMinimumBalanceForRentExemption(i.length),s=await t.getAccountInfo(r.publicKey,"confirmed"),a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new tj).add(t3.allocate({accountPubkey:r.publicKey,space:i.length})),s.owner.equals(n)||(a=a||new tj).add(t3.assign({accountPubkey:r.publicKey,programId:n})),s.lamports<o&&(a=a||new tj).add(t3.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports}))}else a=new tj().add(t3.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:i.length,programId:n}));null!==a&&await tY(t,a,[e,r],{commitment:"confirmed"})}let o=p.struct([p.u32("instruction"),p.u32("offset"),p.u32("bytesLength"),p.u32("bytesLengthPadding"),p.seq(p.u8("byte"),p.offset(p.u32(),-8),"bytes")]),s=t5.chunkSize,a=0,l=i,f=[];for(;l.length>0;){let i=l.slice(0,s),c=u.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},c);let h=new tj().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:c});f.push(tY(t,h,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await tX(250),a+=s,l=l.slice(s)}await Promise.all(f);{let i=p.struct([p.u32("instruction")]),o=u.Buffer.alloc(i.span);i.encode({instruction:1},o);let s=new tj().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:tH,isSigner:!1,isWritable:!1}],programId:n,data:o}),a="processed",l=await t.sendTransaction(s,[e,r],{preflightCommitment:a}),{context:f,value:c}=await t.confirmTransaction({signature:l,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},a);if(c.err)throw Error(`Transaction ${l} failed (${JSON.stringify(c)})`);for(;;){try{if(await t.getSlot({commitment:a})>f.slot)break}catch{}await new Promise(t=>setTimeout(t,Math.round(200)))}}return!0}}t5.chunkSize=932,new tE("BPFLoader2111111111111111111111111111111111");var t4=(o=function(){if(a)return s;a=1;var t=Object.prototype.toString,e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};return s=function(r){var n=function r(n,i){var o,s,a,u,l,f,c;if(!0===n)return"true";if(!1===n)return"false";switch(typeof n){case"object":if(null===n)return null;if(n.toJSON&&"function"==typeof n.toJSON)return r(n.toJSON(),i);if("[object Array]"===(c=t.call(n))){for(a="[",s=n.length-1,o=0;o<s;o++)a+=r(n[o],!0)+",";return s>-1&&(a+=r(n[o],!0)),a+"]"}if("[object Object]"!==c)return JSON.stringify(n);for(s=(u=e(n).sort()).length,a="",o=0;o<s;
7)void 0!==(f=r(n[l=u[o]],!1))&&(a&&(a+=","),a+=JSON.stringify(l)+":"+f),o++;return"{"+a+"}";case"function":case"undefined":return i?null:void 0;case"string":return JSON.stringify(n);default:return isFinite(n)?n:null}}(r,!1);if(void 0!==n)return""+n}}())&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;function t9(t){let e=0;for(;t>1;)t/=2,e++;return e}class t7{constructor(t,e,r,n,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=i}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t<this.firstNormalSlot){var e;let r=t9(0===(e=t+32+1)?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,(e|=e>>32)+1))-t9(32)-1,n=this.getSlotsInEpoch(r);return[r,t-(n-32)]}{let e=t-this.firstNormalSlot,r=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+r,e%this.slotsPerEpoch]}}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?(Math.pow(2,t)-1)*32:(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t<this.firstNormalEpoch?Math.pow(2,t+t9(32)):this.slotsPerEpoch}}var et=globalThis.fetch;class ee extends x{constructor(t,e,r){super(t=>{let r=new w(t,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...e});return"socket"in r?this.underlyingSocket=r.socket:this.underlyingSocket=r,r},t,e,r),this.underlyingSocket=void 0}call(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.call(...t):Promise.reject(Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}notify(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.notify(...t):Promise.reject(Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}}class er{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){let t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){let e=function(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw Error("invalid instruction; "+t)}if(r.typeIndex!==t.index)throw Error(`invalid account data; account type mismatch ${r.typeIndex} != ${t.index}`);return r}(en,t),r=t.length-56;tO(r>=0,"lookup table is invalid"),tO(r%32==0,"lookup table is invalid");let{addresses:n}=p.struct([p.seq(t_(),r/32,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new tE(e.authority[0]):void 0,addresses:n.map(t=>new tE(t))}}}let en={index:1,layout:p.struct([p.u32("typeIndex"),t6("deactivationSlot"),p.nu64("lastExtendedSlot"),p.u8("lastExtendedStartIndex"),p.u8(),p.seq(t_(),p.offset(p.u8(),-1),"authority")])},ei=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,eo=(0,y.coerce)((0,y.instance)(tE),(0,y.string)(),t=>new tE(t)),es=(0,y.tuple)([(0,y.string)(),(0,y.literal)("base64")]),ea=(0,y.coerce)((0,y.instance)(u.Buffer),es,t=>u.Buffer.from(t[0],"base64"));function eu(t){let e,r;if("string"==typeof t)e=t;else if(t){let{commitment:n,...i}=t;e=n,r=i}return{commitment:e,config:r}}function el(t){return t.map(t=>"memcmp"in t?{...t,memcmp:{...t.memcmp,encoding:t.memcmp.encoding??"base58"}}:t)}function ef(t){return(0,y.union)([(0,y.type)({jsonrpc:(0,y.literal)("2.0"),id:(0,y.string)(),result:t}),(0,y.type)({jsonrpc:(0,y.literal)("2.0"),id:(0,y.string)(),error:(0,y.type)({code:(0,y.unknown)(),message:(0,y.string)(),data:(0,y.optional)((0,y.any)())})})])}let ec=ef((0,y.unknown)());function eh(t){return(0,y.coerce)(ef(t),ec,e=>"error"in e?e:{...e,result:(0,y.create)(e.result,t)})}function ed(t){return eh((0,y.type)({context:(0,y.type)({slot:(0,y.number)()}),value:t}))}function ep(t){return(0,y.type)({context:(0,y.type)({slot:(0,y.number)()}),value:t})}function eg(t,e){return 0===t?new tq({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new tE(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:c.default.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new tN(e)}let ey=(0,y.type)({foundation:(0,y.number)(),foundationTerm:(0,y.number)(),initial:(0,y.number)(),taper:(0,y.number)(),terminal:(0,y.number)()}),em=eh((0,y.array)((0,y.nullable)((0,y.type)({epoch:(0,y.number)(),effectiveSlot:(0,y.number)(),amount:(0,y.number)(),postBalance:(0,y.number)(),commission:(0,y.optional)((0,y.nullable)((0,y.number)()))})))),eb=(0,y.array)((0,y.type)({slot:(0,y.number)(),prioritizationFee:(0,y.number)()})),ew=(0,y.type)({total:(0,y.number)(),validator:(0,y.number)(),foundation:(0,y.number)(),epoch:(0,y.number)()}),ev=(0,y.type)({epoch:(0,y.number)(),slotIndex:(0,y.number)(),slotsInEpoch:(0,y.number)(),absoluteSlot:(0,y.number)(),blockHeight:(0,y.optional)((0,y.number)()),transactionCount:(0,y.optional)((0,y.number)())}),ex=(0,y.type)({slotsPerEpoch:(0,y.number)(),leaderScheduleSlotOffset:(0,y.number)(),warmup:(0,y.boolean)(),firstNormalEpoch:(0,y.number)(),firstNormalSlot:(0,y.number)()}),eS=(0,y.record)((0,y.string)(),(0,y.array)((0,y.number)())),eE=(0,y.nullable)((0,y.union)([(0,y.type)({}),(0,y.string)()])),eB=(0,y.type)({err:eE}),ek=(0,y.literal)("receivedSignature"),eA=(0,y.type)({"solana-core":(0,y.string)(),"feature-set":(0,y.optional)((0,y.number)())}),eI=(0,y.type)({program:(0,y.string)(),programId:eo,parsed:(0,y.unknown)()}),e_=(0,y.type)({programId:eo,accounts:(0,y.array)(eo),data:(0,y.string)()}),eM=ed((0,y.type)({err:(0,y.nullable)((0,y.union)([(0,y.type)({}),(0,y.string)()])),logs:(0,y.nullable)((0,y.array)((0,y.string)())),accounts:(0,y.optional)((0,y.nullable)((0,y.array)((0,y.nullable)((0,y.type)({executable:(0,y.boolean)(),owner:(0,y.string)(),lamports:(0,y.number)(),data:(0,y.array)((0,y.string)()),rentEpoch:(0,y.optional)((0,y.number)())}))))),unitsConsumed:(0,y.optional)((0,y.number)()),returnData:(0,y.optional)((0,y.nullable)((0,y.type)({programId:(0,y.string)(),data:(0,y.tuple)([(0,y.string)(),(0,y.literal)("base64")])}))),innerInstructions:(0,y.optional)((0,y.nullable)((0,y.array)((0,y.type)({index:(0,y.number)(),instructions:(0,y.array)((0,y.union)([eI,e_]))}))))}
7)),eT=ed((0,y.type)({byIdentity:(0,y.record)((0,y.string)(),(0,y.array)((0,y.number)())),range:(0,y.type)({firstSlot:(0,y.number)(),lastSlot:(0,y.number)()})})),eU=eh(ey),eO=eh(ew),eR=eh(eb),eL=eh(ev),eP=eh(ex),eC=eh(eS),eN=eh((0,y.number)()),eq=ed((0,y.type)({total:(0,y.number)(),circulating:(0,y.number)(),nonCirculating:(0,y.number)(),nonCirculatingAccounts:(0,y.array)(eo)})),ez=(0,y.type)({amount:(0,y.string)(),uiAmount:(0,y.nullable)((0,y.number)()),decimals:(0,y.number)(),uiAmountString:(0,y.optional)((0,y.string)())}),eW=ed((0,y.array)((0,y.type)({address:eo,amount:(0,y.string)(),uiAmount:(0,y.nullable)((0,y.number)()),decimals:(0,y.number)(),uiAmountString:(0,y.optional)((0,y.string)())}))),eF=ed((0,y.array)((0,y.type)({pubkey:eo,account:(0,y.type)({executable:(0,y.boolean)(),owner:eo,lamports:(0,y.number)(),data:ea,rentEpoch:(0,y.number)()})}))),eD=(0,y.type)({program:(0,y.string)(),parsed:(0,y.unknown)(),space:(0,y.number)()}),ej=ed((0,y.array)((0,y.type)({pubkey:eo,account:(0,y.type)({executable:(0,y.boolean)(),owner:eo,lamports:(0,y.number)(),data:eD,rentEpoch:(0,y.number)()})}))),eK=ed((0,y.array)((0,y.type)({lamports:(0,y.number)(),address:eo}))),e$=(0,y.type)({executable:(0,y.boolean)(),owner:eo,lamports:(0,y.number)(),data:ea,rentEpoch:(0,y.number)()}),eH=(0,y.type)({pubkey:eo,account:e$}),eV=(0,y.coerce)((0,y.union)([(0,y.instance)(u.Buffer),eD]),(0,y.union)([es,eD]),t=>Array.isArray(t)?(0,y.create)(t,ea):t),eZ=(0,y.type)({executable:(0,y.boolean)(),owner:eo,lamports:(0,y.number)(),data:eV,rentEpoch:(0,y.number)()}),eG=(0,y.type)({pubkey:eo,account:eZ}),eY=(0,y.type)({state:(0,y.union)([(0,y.literal)("active"),(0,y.literal)("inactive"),(0,y.literal)("activating"),(0,y.literal)("deactivating")]),active:(0,y.number)(),inactive:(0,y.number)()}),eX=eh((0,y.array)((0,y.type)({signature:(0,y.string)(),slot:(0,y.number)(),err:eE,memo:(0,y.nullable)((0,y.string)()),blockTime:(0,y.optional)((0,y.nullable)((0,y.number)()))}))),eJ=eh((0,y.array)((0,y.type)({signature:(0,y.string)(),slot:(0,y.number)(),err:eE,memo:(0,y.nullable)((0,y.string)()),blockTime:(0,y.optional)((0,y.nullable)((0,y.number)()))}))),eQ=(0,y.type)({subscription:(0,y.number)(),result:ep(e$)}),e0=(0,y.type)({pubkey:eo,account:e$}),e1=(0,y.type)({subscription:(0,y.number)(),result:ep(e0)}),e2=(0,y.type)({parent:(0,y.number)(),slot:(0,y.number)(),root:(0,y.number)()}),e6=(0,y.type)({subscription:(0,y.number)(),result:e2}),e8=(0,y.union)([(0,y.type)({type:(0,y.union)([(0,y.literal)("firstShredReceived"),(0,y.literal)("completed"),(0,y.literal)("optimisticConfirmation"),(0,y.literal)("root")]),slot:(0,y.number)(),timestamp:(0,y.number)()}),(0,y.type)({type:(0,y.literal)("createdBank"),parent:(0,y.number)(),slot:(0,y.number)(),timestamp:(0,y.number)()}),(0,y.type)({type:(0,y.literal)("frozen"),slot:(0,y.number)(),timestamp:(0,y.number)(),stats:(0,y.type)({numTransactionEntries:(0,y.number)(),numSuccessfulTransactions:(0,y.number)(),numFailedTransactions:(0,y.number)(),maxTransactionsPerEntry:(0,y.number)()})}),(0,y.type)({type:(0,y.literal)("dead"),slot:(0,y.number)(),timestamp:(0,y.number)(),err:(0,y.string)()})]),e3=(0,y.type)({subscription:(0,y.number)(),result:e8}),e5=(0,y.type)({subscription:(0,y.number)(),result:ep((0,y.union)([eB,ek]))}),e4=(0,y.type)({subscription:(0,y.number)(),result:(0,y.number)()}),e9=(0,y.type)({pubkey:(0,y.string)(),gossip:(0,y.nullable)((0,y.string)()),tpu:(0,y.nullable)((0,y.string)()),rpc:(0,y.nullable)((0,y.string)()),version:(0,y.nullable)((0,y.string)())}),e7=(0,y.type)({votePubkey:(0,y.string)(),nodePubkey:(0,y.string)(),activatedStake:(0,y.number)(),epochVoteAccount:(0,y.boolean)(),epochCredits:(0,y.array)((0,y.tuple)([(0,y.number)(),(0,y.number)(),(0,y.number)()])),commission:(0,y.number)(),lastVote:(0,y.number)(),rootSlot:(0,y.nullable)((0,y.number)())}),rt=eh((0,y.type)({current:(0,y.array)(e7),delinquent:(0,y.array)(e7)})),re=(0,y.union)([(0,y.literal)("processed"),(0,y.literal)("confirmed"),(0,y.literal)("finalized")]),rr=(0,y.type)({slot:(0,y.number)(),confirmations:(0,y.nullable)((0,y.number)()),err:eE,confirmationStatus:(0,y.optional)(re)}),rn=ed((0,y.array)((0,y.nullable)(rr))),ri=eh((0,y.number)()),ro=(0,y.type)({accountKey:eo,writableIndexes:(0,y.array)((0,y.number)()),readonlyIndexes:(0,y.array)((0,y.number)())}),rs=(0,y.type)({signatures:(0,y.array)((0,y.string)()),message:(0,y.type)({accountKeys:(0,y.array)((0,y.string)()),header:(0,y.type)({numRequiredSignatures:(0,y.number)(),numReadonlySignedAccounts:(0,y.number)(),numReadonlyUnsignedAccounts:(0,y.number)()}),instructions:(0,y.array)((0,y.type)({accounts:(0,y.array)((0,y.number)()),data:(0,y.string)(),programIdIndex:(0,y.number)()})),recentBlockhash:(0,y.string)(),addressTableLookups:(0,y.optional)((0,y.array)(ro))})}),ra=(0,y.type)({pubkey:eo,signer:(0,y.boolean)(),writable:(0,y.boolean)(),source:(0,y.optional)((0,y.union)([(0,y.literal)("transaction"),(0,y.literal)("lookupTable")]))}),ru=(0,y.type)({accountKeys:(0,y.array)(ra),signatures:(0,y.array)((0,y.string)())}),rl=(0,y.type)({parsed:(0,y.unknown)(),program:(0,y.string)(),programId:eo}),rf=(0,y.type)({accounts:(0,y.array)(eo),data:(0,y.string)(),programId:eo}),rc=(0,y.union)([rf,rl]),rh=(0,y.union)([(0,y.type)({parsed:(0,y.unknown)(),program:(0,y.string)(),programId:(0,y.string)()}),(0,y.type)({accounts:(0,y.array)((0,y.string)()),data:(0,y.string)(),programId:(0,y.string)()})]),rd=(0,y.coerce)(rc,rh,t=>"accounts"in t?(0,y.create)(t,rf):(0,y.create)(t,rl)),rp=(0,y.type)({signatures:(0,y.array)((0,y.string)()),message:(0,y.type)({accountKeys:(0,y.array)(ra),instructions:(0,y.array)(rd),recentBlockhash:(0,y.string)(),addressTableLookups:(0,y.optional)((0,y.nullable)((0,y.array)(ro)))})}),rg=(0,y.type)({accountIndex:(0,y.number)(),mint:(0,y.string)(),owner:(0,y.optional)((0,y.string)()),programId:(0,y.optional)((0,y.string)()),uiTokenAmount:ez}),ry=(0,y.type)({writable:(0,y.array)(eo),readonly:(0,y.array)(eo)}),rm=(0,y.type)({err:eE,fee:(0,y.number)(),innerInstructions:(0,y.optional)((0,y.nullable)((0,y.array)((0,y.type)({index:(0,y.number)(),instructions:(0,y.array)((0,y.type)({accounts:(0,y.array)((0,y.number)()),data:(0,y.string)(),programIdIndex:(0,y.number)()}))})))),preBalances:(0,y.array)((0,y.number)()),postBalances:(0,y.array)((0,y.number)()),logMessages:(0,y.optional)((0,y.nullable)((0,y.array)((0,y.string)()))),preTokenBalances:(0,y.optional)((0,y.nullable)((0,y.array)(rg))),postTokenBalances:(0,y.optional)((0,y.nullable)((0,y.array)(rg))),loadedAddresses:(0,y.optional)(ry),c
7omputeUnitsConsumed:(0,y.optional)((0,y.number)()),costUnits:(0,y.optional)((0,y.number)())}),rb=(0,y.type)({err:eE,fee:(0,y.number)(),innerInstructions:(0,y.optional)((0,y.nullable)((0,y.array)((0,y.type)({index:(0,y.number)(),instructions:(0,y.array)(rd)})))),preBalances:(0,y.array)((0,y.number)()),postBalances:(0,y.array)((0,y.number)()),logMessages:(0,y.optional)((0,y.nullable)((0,y.array)((0,y.string)()))),preTokenBalances:(0,y.optional)((0,y.nullable)((0,y.array)(rg))),postTokenBalances:(0,y.optional)((0,y.nullable)((0,y.array)(rg))),loadedAddresses:(0,y.optional)(ry),computeUnitsConsumed:(0,y.optional)((0,y.number)()),costUnits:(0,y.optional)((0,y.number)())}),rw=(0,y.union)([(0,y.literal)(0),(0,y.literal)("legacy")]),rv=(0,y.type)({pubkey:(0,y.string)(),lamports:(0,y.number)(),postBalance:(0,y.nullable)((0,y.number)()),rewardType:(0,y.nullable)((0,y.string)()),commission:(0,y.optional)((0,y.nullable)((0,y.number)()))}),rx=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),transactions:(0,y.array)((0,y.type)({transaction:rs,meta:(0,y.nullable)(rm),version:(0,y.optional)(rw)})),rewards:(0,y.optional)((0,y.array)(rv)),blockTime:(0,y.nullable)((0,y.number)()),blockHeight:(0,y.nullable)((0,y.number)())}))),rS=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),rewards:(0,y.optional)((0,y.array)(rv)),blockTime:(0,y.nullable)((0,y.number)()),blockHeight:(0,y.nullable)((0,y.number)())}))),rE=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),transactions:(0,y.array)((0,y.type)({transaction:ru,meta:(0,y.nullable)(rm),version:(0,y.optional)(rw)})),rewards:(0,y.optional)((0,y.array)(rv)),blockTime:(0,y.nullable)((0,y.number)()),blockHeight:(0,y.nullable)((0,y.number)())}))),rB=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),transactions:(0,y.array)((0,y.type)({transaction:rp,meta:(0,y.nullable)(rb),version:(0,y.optional)(rw)})),rewards:(0,y.optional)((0,y.array)(rv)),blockTime:(0,y.nullable)((0,y.number)()),blockHeight:(0,y.nullable)((0,y.number)())}))),rk=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),transactions:(0,y.array)((0,y.type)({transaction:ru,meta:(0,y.nullable)(rb),version:(0,y.optional)(rw)})),rewards:(0,y.optional)((0,y.array)(rv)),blockTime:(0,y.nullable)((0,y.number)()),blockHeight:(0,y.nullable)((0,y.number)())}))),rA=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),rewards:(0,y.optional)((0,y.array)(rv)),blockTime:(0,y.nullable)((0,y.number)()),blockHeight:(0,y.nullable)((0,y.number)())}))),rI=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),transactions:(0,y.array)((0,y.type)({transaction:rs,meta:(0,y.nullable)(rm)})),rewards:(0,y.optional)((0,y.array)(rv)),blockTime:(0,y.nullable)((0,y.number)())}))),r_=eh((0,y.nullable)((0,y.type)({blockhash:(0,y.string)(),previousBlockhash:(0,y.string)(),parentSlot:(0,y.number)(),signatures:(0,y.array)((0,y.string)()),blockTime:(0,y.nullable)((0,y.number)())}))),rM=eh((0,y.nullable)((0,y.type)({slot:(0,y.number)(),meta:(0,y.nullable)(rm),blockTime:(0,y.optional)((0,y.nullable)((0,y.number)())),transaction:rs,version:(0,y.optional)(rw)}))),rT=eh((0,y.nullable)((0,y.type)({slot:(0,y.number)(),transaction:rp,meta:(0,y.nullable)(rb),blockTime:(0,y.optional)((0,y.nullable)((0,y.number)())),version:(0,y.optional)(rw)}))),rU=ed((0,y.type)({blockhash:(0,y.string)(),lastValidBlockHeight:(0,y.number)()})),rO=ed((0,y.boolean)()),rR=(0,y.type)({slot:(0,y.number)(),numTransactions:(0,y.number)(),numSlots:(0,y.number)(),samplePeriodSecs:(0,y.number)()}),rL=eh((0,y.array)(rR)),rP=ed((0,y.nullable)((0,y.type)({feeCalculator:(0,y.type)({lamportsPerSignature:(0,y.number)()})}))),rC=eh((0,y.string)()),rN=eh((0,y.string)()),rq=(0,y.type)({err:eE,logs:(0,y.array)((0,y.string)()),signature:(0,y.string)()}),rz=(0,y.type)({result:ep(rq),subscription:(0,y.number)()}),rW={"solana-client":"js/1.0.0-maintenance"};class rF{constructor(t){this._keypair=void 0,this._keypair=t??tp()}static generate(){return new rF(tp())}static fromSecretKey(t,e){if(64!==t.byteLength)throw Error("bad secret key size");let r=t.slice(32,64);if(!e||!e.skipValidation){let e=tg(t.slice(0,32));for(let t=0;t<32;
vendor: 14,052 bytes, line 7
7t++)if(r[t]!==e[t])throw Error("provided secretKey is invalid")}return new rF({publicKey:r,secretKey:t})}static fromSeed(t){let e=tg(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new rF({publicKey:e,secretKey:r})}get publicKey(){return new tE(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}Object.freeze({CreateLookupTable:{index:0,layout:p.struct([p.u32("instruction"),t6("recentSlot"),p.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:p.struct([p.u32("instruction")])},ExtendLookupTable:{index:2,layout:p.struct([p.u32("instruction"),t6(),p.seq(t_(),p.offset(p.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:p.struct([p.u32("instruction")])},CloseLookupTable:{index:4,layout:p.struct([p.u32("instruction")])}}),new tE("AddressLookupTab1e1111111111111111111111111");let rD=Object.freeze({RequestUnits:{index:0,layout:p.struct([p.u8("instruction"),p.u32("units"),p.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:p.struct([p.u8("instruction"),p.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:p.struct([p.u8("instruction"),p.u32("units")])},SetComputeUnitPrice:{index:3,layout:p.struct([p.u8("instruction"),t6("microLamports")])}});class rj{static requestUnits(t){let e=tJ(rD.RequestUnits,t);return new tD({keys:[],programId:this.programId,data:e})}static requestHeapFrame(t){let e=tJ(rD.RequestHeapFrame,t);return new tD({keys:[],programId:this.programId,data:e})}static setComputeUnitLimit(t){let e=tJ(rD.SetComputeUnitLimit,t);return new tD({keys:[],programId:this.programId,data:e})}static setComputeUnitPrice(t){let e=tJ(rD.SetComputeUnitPrice,{microLamports:BigInt(t.microLamports)});return new tD({keys:[],programId:this.programId,data:e})}}rj.programId=new tE("ComputeBudget111111111111111111111111111111");let rK=p.struct([p.u8("numSignatures"),p.u8("padding"),p.u16("signatureOffset"),p.u16("signatureInstructionIndex"),p.u16("publicKeyOffset"),p.u16("publicKeyInstructionIndex"),p.u16("messageDataOffset"),p.u16("messageDataSize"),p.u16("messageInstructionIndex")]);class r${static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:n,instructionIndex:i}=t;tO(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),tO(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);let o=rK.span,s=o+e.length,a=s+n.length,l=u.Buffer.alloc(a+r.length),f=null==i?65535:i;return rK.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:f,publicKeyOffset:o,publicKeyInstructionIndex:f,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:f},l),l.fill(e,o),l.fill(n,s),l.fill(r,a),new tD({keys:[],programId:r$.programId,data:l})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:n}=t;tO(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{let t=rF.fromSecretKey(e),i=t.publicKey.toBytes(),o=tm(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:o,instructionIndex:n})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}r$.programId=new tE("Ed25519SigVerify111111111111111111111111111"),tc.utils.isValidPrivateKey;let rH=tc.getPublicKey,rV=p.struct([p.u8("numSignatures"),p.u16("signatureOffset"),p.u8("signatureInstructionIndex"),p.u16("ethAddressOffset"),p.u8("ethAddressInstructionIndex"),p.u16("messageDataOffset"),p.u16("messageDataSize"),p.u8("messageInstructionIndex"),p.blob(20,"ethAddress"),p.blob(64,"signature"),p.u8("recoveryId")]);class rZ{static publicKeyToEthAddress(t){tO(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return u.Buffer.from(z(tw(t))).slice(-20)}catch(t){throw Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:n,recoveryId:i,instructionIndex:o}=t;return rZ.createInstructionWithEthAddress({ethAddress:rZ.publicKeyToEthAddress(e),message:r,signature:n,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(t){let e,{ethAddress:r,message:n,signature:i,recoveryId:o,instructionIndex:s=0}=t;tO(20===(e="string"==typeof r?r.startsWith("0x")?u.Buffer.from(r.substr(2),"hex"):u.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${e.length} bytes`);let a=12+e.length,l=a+i.length+1,f=u.Buffer.alloc(rV.span+n.length);return rV.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:l,messageDataSize:n.length,messageInstructionIndex:s,signature:tw(i),ethAddress:tw(e),recoveryId:o},f),f.fill(tw(n),rV.span),new tD({keys:[],programId:rZ.programId,data:f})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:n}=t;tO(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{var i;let t,o=tw(e),s=rH(o,!1).slice(1),[a,l]=(i=u.Buffer.from(z(tw(r))),[(t=tc.sign(i,o)).toCompactRawBytes(),t.recovery]);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:a,recoveryId:l,instructionIndex:n})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}rZ.programId=new tE("KeccakSecp256k11111111111111111111111111111");let rG=new tE("StakeConfig11111111111111111111111111111111");class rY{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}rY.default=new rY(0,0,tE.default);let rX=Object.freeze({Initialize:{index:0,layout:p.struct([p.u32("instruction"),((t="authorized")=>p.struct([t_("staker"),t_("withdrawer")],t))(),((t="lockup")=>p.struct([p.ns64("unixTimestamp"),p.ns64("epoch"),t_("custodian")],t))()])},Authorize:{index:1,layout:p.struct([p.u32("instruction"),t_("newAuthorized"),p.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:p.struct([p.u32("instruction")])},Split:{index:3,layout:p.struct([p.u32("instruction"),p.ns64("lamports")])},Withdraw:{index:4,layout:p.struct([p.u32("instruction"),p.ns64("lamports")])},Deactivate:{index:5,layout:p.struct([p.u32("instruction")])},Merge:{index:7,layout:p.struct([p.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:p.struct([p.u32("instruction"),t_("newAuthorized"),p.u32("stakeAuthorizationType"),tM("authoritySeed"),t_("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class rJ{static initialize(t){let{stakePubkey:e,authorized:r,lockup:n}=t,i=n||rY.default,o=tJ(rX.Initialize,{authorized:{staker:tw(r.staker.toBuffer()),withdrawer:tw(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:tw(i.custodian.toBuffer())}});return new tD({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tH,isSigner:!1,isWritable:!1}],programId:this.programId,data:o})}static createAccountWithSeed(t){let e=new tj;e.add(t3.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(t){let e=new tj;e.add(t3.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:r,votePubkey:n}=t,i=tJ(rX.Delegate);return new tj().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:tK,isSigner:!1,isWritable:!1},{pubkey:tV,isSigner:!1,isWritable:!1},{pubkey:rG,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(t){let{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:o}=t,s=tJ(rX.Authorize,{newAuthorized:tw(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tK,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new tj().add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,u=tJ(rX.AuthorizeWithSeed,{newAuthorized:tw(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:tw(i.toBuffer())}),l=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:tK,isSigner:!1,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),new tj().add({keys:l,programId:this.programId,data:u})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=t,o=tJ(rX.Split,{lamports:i});return new tD({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t,e){let r=new tj;return r.add(t3.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),r.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,basePubkey:o,seed:s,lamports:a}=t,u=new tj;return u.add(t3.allocate({accountPubkey:i,basePubkey:o,seed:s,space:this.space,programId:this.programId})),e&&e>0&&u.add(t3.transfer({fromPubkey:t.authorizedPubkey,toPubkey:i,lamports:e})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,lamports:a}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:n}=t,i=tJ(rX.Merge);return new tj().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:tK,isSigner:!1,isWritable:!1},{pubkey:tV,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:o}=t,s=tJ(rX.Withdraw,{lamports:i}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:tK,isSigner:!1,isWritable:!1},{pubkey:tV,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new tj().add({keys:a,programId:this.programId,data:s})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:r}=t,n=tJ(rX.Deactivate);return new tj().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tK,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}rJ.programId=new tE("Stake11111111111111111111111111111111111111"),rJ.space=200;let rQ=Object.freeze({InitializeAccount:{index:0,layout:p.struct([p.u32("instruction"),((t="voteInit")=>p.struct([t_("nodePubkey"),t_("authorizedVoter"),t_("authorizedWithdrawer"),p.u8("commission")],t))()])},Authorize:{index:1,layout:p.struct([p.u32("instruction"),t_("newAuthorized"),p.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:p.struct([p.u32("instruction"),p.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:p.struct([p.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:p.struct([p.u32("instruction"),((t="voteAuthorizeWithSeedArgs")=>p.struct([p.u32("voteAuthorizationType"),t_("currentAuthorityDerivedKeyOwnerPubkey"),tM("currentAuthorityDerivedKeySeed"),t_("newAuthorized")],t))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class r0{static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:n}=t,i=tJ(rQ.InitializeAccount,{voteInit:{nodePubkey:tw(n.nodePubkey.toBuffer()),authorizedVoter:tw(n.authorizedVoter.toBuffer()),authorizedWithdrawer:tw(n.authorizedWithdrawer.toBuffer()),commission:n.commission}});return new tD({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tH,isSigner:!1,isWritable:!1},{pubkey:tK,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static createAccount(t){let e=new tj;return e.add(t3.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=t,o=tJ(rQ.Authorize,{newAuthorized:tw(n.toBuffer()),voteAuthorizationType:i.index});return new tj().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:tK,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:s}=t,a=tJ(rQ.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:tw(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:tw(i.toBuffer()),voteAuthorizationType:o.index}});return new tj().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:tK,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=t,o=tJ(rQ.Withdraw,{lamports:n});return new tj().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static safeWithdraw(t,e,r){if(t.lamports>e-r)throw Error("Withdraw will leave vote account with insufficient funds.");return r0.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:n}=t,i=tJ(rQ.UpdateValidatorIdentity);return new tj().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}
7r0.programId=new tE("Vote111111111111111111111111111111111111111"),r0.space=3762,new tE("Va1idator1nfo111111111111111111111111111111"),(0,y.type)({name:(0,y.string)(),website:(0,y.optional)((0,y.string)()),details:(0,y.optional)((0,y.string)()),iconUrl:(0,y.optional)((0,y.string)()),keybaseUsername:(0,y.optional)((0,y.string)())}),new tE("Vote111111111111111111111111111111111111111"),p.struct([t_("nodePubkey"),t_("authorizedWithdrawer"),p.u8("commission"),p.nu64(),p.seq(p.struct([p.nu64("slot"),p.u32("confirmationCount")]),p.offset(p.u32(),-8),"votes"),p.u8("rootSlotValid"),p.nu64("rootSlot"),p.nu64(),p.seq(p.struct([p.nu64("epoch"),t_("authorizedVoter")]),p.offset(p.u32(),-8),"authorizedVoters"),p.struct([p.seq(p.struct([t_("authorizedPubkey"),p.nu64("epochOfLastAuthorizedSwitch"),p.nu64("targetEpoch")]),32,"buf"),p.nu64("idx"),p.u8("isEmpty")],"priorVoters"),p.nu64(),p.seq(p.struct([p.nu64("epoch"),p.nu64("credits"),p.nu64("prevCredits")]),p.offset(p.u32(),-8),"epochCredits"),p.struct([p.nu64("slot"),p.nu64("timestamp")],"lastTimestamp")]),t.s(["ComputeBudgetProgram",0,rj,"Connection",0,class{constructor(t,e){let r,n,i,o,s,a;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let t={};return async e=>{let{commitment:r,config:n}=eu(e),i=this._buildArgs([],r,void 0,n),o=t4(i);return t[o]=t[o]??(async()=>{try{let t=await this._rpcRequest("getBlockHeight",i),e=(0,y.create)(t,eh((0,y.number)()));if("error"in e)throw new tG(e.error,"failed to get block height information");return e.result}finally{delete t[o]}})(),await t[o]}})(),e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,r=e.wsEndpoint,n=e.httpHeaders,i=e.fetch,o=e.fetchMiddleware,s=e.disableRetryOnRateLimit,a=e.httpAgent),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=r||function(t){let e=t.match(ei);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);let[r,n,i,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==i?null:parseInt(i.slice(1),10),u=null==a?"":`:${a+1}`;return`${s}//${n}${u}${o}`}(t),this._rpcClient=function(t,e,r,n,i,o){let s,a,u=r||et;return null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),n&&(a=async(t,e)=>{let r=await new Promise((r,i)=>{try{n(t,e,(t,e)=>r([t,e]))}catch(t){i(t)}});return await u(...r)}),new m.default(async(r,n)=>{let o={method:"POST",body:r,agent:s,headers:Object.assign({"Content-Type":"application/json"},e||{},rW)};try{let e,r=5,s=500;for(;(e=a?await a(t,o):await u(t,o),429===e.status&&!0!==i)&&(r-=1,0!==r);){;console.error(`Server responded with ${e.status} ${e.statusText}.  Retrying after ${s}ms delay...`),await tX(s),s*=2}let l=await e.text();e.ok?n(null,l):n(Error(`${e.status} ${e.statusText}: ${l}`))}catch(t){t instanceof Error&&n(t)}},{})}(t,n,i,o,s,a),this._rpcRequest=function(t){return(e,r)=>new Promise((n,i)=>{t.request(e,r,(t,e)=>{t?i(t):n(e)})})}(this._rpcClient),this._rpcBatchRequest=function(t){return e=>new Promise((r,n)=>{0===e.length&&r([]);let i=e.map(e=>t.request(e.methodName,e.args));t.request(i,(t,e)=>{t?n(t):r(e)})})}(this._rpcClient),this._rpcWebSocket=new ee(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgs([t.toBase58()],r,void 0,n),o=await this._rpcRequest("getBalance",i),s=(0,y.create)(o,ed((0,y.number)()));if("error"in s)throw new tG(s.error,`failed to get balance for ${t.toBase58()}`);return s.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then(t=>
7t.value).catch(e=>{throw Error("failed to get balance of account "+t.toBase58()+": "+e)})}async getBlockTime(t){let e=await this._rpcRequest("getBlockTime",[t]),r=(0,y.create)(e,eh((0,y.nullable)((0,y.number)())));if("error"in r)throw new tG(r.error,`failed to get block time for slot ${t}`);return r.result}async getMinimumLedgerSlot(){let t=await this._rpcRequest("minimumLedgerSlot",[]),e=(0,y.create)(t,eh((0,y.number)()));if("error"in e)throw new tG(e.error,"failed to get minimum ledger slot");return e.result}async getFirstAvailableBlock(){let t=await this._rpcRequest("getFirstAvailableBlock",[]),e=(0,y.create)(t,eN);if("error"in e)throw new tG(e.error,"failed to get first available block");return e.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};let r=await this._rpcRequest("getSupply",[e]),n=(0,y.create)(r,eq);if("error"in n)throw new tG(n.error,"failed to get supply");return n.result}async getTokenSupply(t,e){let r=this._buildArgs([t.toBase58()],e),n=await this._rpcRequest("getTokenSupply",r),i=(0,y.create)(n,ed(ez));if("error"in i)throw new tG(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(t,e){let r=this._buildArgs([t.toBase58()],e),n=await this._rpcRequest("getTokenAccountBalance",r),i=(0,y.create)(n,ed(ez));if("error"in i)throw new tG(i.error,"failed to get token account balance");return i.result}
7async getTokenAccountsByOwner(t,e,r){let{commitment:n,config:i}=eu(r),o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});let s=this._buildArgs(o,n,"base64",i),a=await this._rpcRequest("getTokenAccountsByOwner",s),u=(0,y.create)(a,eF);if("error"in u)throw new tG(u.error,`failed to get token accounts owned by account ${t.toBase58()}`);return u.result}async getParsedTokenAccountsByOwner(t,e,r){let n=[t.toBase58()];"mint"in e?n.push({mint:e.mint.toBase58()}):n.push({programId:e.programId.toBase58()});let i=this._buildArgs(n,r,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",i),s=(0,y.create)(o,ej);if("error"in s)throw new tG(s.error,`failed to get token accounts owned by account ${t.toBase58()}`);return s.result}async getLargestAccounts(t){let e={...t,commitment:t&&t.commitment||this.commitment},r=e.filter||e.commitment?[e]:[],n=await this._rpcRequest("getLargestAccounts",r),i=(0,y.create)(n,eK);if("error"in i)throw new tG(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(t,e){let r=this._buildArgs([t.toBase58()],e),n=await this._rpcRequest("getTokenLargestAccounts",r),i=(0,y.create)(n,eW);if("error"in i)throw new tG(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgs([t.toBase58()],r,"base64",n),o=await this._rpcRequest("getAccountInfo",i),s=(0,y.create)(o,ed((0,y.nullable)(e$)));if("error"in s)throw new tG(s.error,`failed to get info about account ${t.toBase58()}`);return s.result}async getParsedAccountInfo(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=await this._rpcRequest("getAccountInfo",i),s=(0,y.create)(o,ed((0,y.nullable)(eZ)));if("error"in s)throw new tG(s.error,`failed to get info about account ${t.toBase58()}`);return s.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(e){throw Error("failed to get info about account "+t.toBase58()+": "+e)}}async getMultipleParsedAccounts(t,e){let{commitment:r,config:n}=eu(e),i=t.map(t=>
7t.toBase58()),o=this._buildArgs([i],r,"jsonParsed",n),s=await this._rpcRequest("getMultipleAccounts",o),a=(0,y.create)(s,ed((0,y.array)((0,y.nullable)(eZ))));if("error"in a)throw new tG(a.error,`failed to get info for accounts ${i}`);return a.result}async getMultipleAccountsInfoAndContext(t,e){let{commitment:r,config:n}=eu(e),i=t.map(t=>t.toBase58()),o=this._buildArgs([i],r,"base64",n),s=await this._rpcRequest("getMultipleAccounts",o),a=(0,y.create)(s,ed((0,y.array)((0,y.nullable)(e$))));if("error"in a)throw new tG(a.error,`failed to get info for accounts ${i}`);return a.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,r){let{commitment:n,config:i}=eu(e),o=this._buildArgs([t.toBase58()],n,void 0,{...i,epoch:null!=r?r:i?.epoch}),s=await this._rpcRequest("getStakeActivation",o),a=(0,y.create)(s,eh(eY));if("error"in a)throw new tG(a.error,`failed to get Stake Activation ${t.toBase58()}`);return a.result}async getProgramAccounts(t,e){let{commitment:r,config:n}=eu(e),{encoding:i,...o}=n||{},s=this._buildArgs([t.toBase58()],r,i||"base64",{...o,...o.filters?{filters:el(o.filters)}:null}),a=await this._rpcRequest("getProgramAccounts",s),u=(0,y.array)(eH),l=!0===o.withContext?(0,y.create)(a,ed(u)):(0,y.create)(a,eh(u));if("error"in l)throw new tG(l.error,`failed to get accounts owned by program ${t.toBase58()}`);return l.result}async getParsedProgramAccounts(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=await this._rpcRequest("getProgramAccounts",i),s=(0,y.create)(o,eh((0,y.array)(eG)));if("error"in s)throw new tG(s.error,`failed to get accounts owned by program ${t.toBase58()}`);return s.result}async confirmTransaction(t,e){let r,n;if("string"==typeof t)r=t;else{if(t.abortSignal?.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{n=c.default.decode(r)}catch(t){throw Error("signature must be base58 encoded: "+r)}return(tO(64===n.length,"signature has invalid length"),"string"==typeof t)?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:e||this.commitment,signature:r}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:e||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise((e,r)=>{null!=t&&(t.aborted?r(t.reason):t.addEventListener("abort",()=>{r(t.reason)}))})}getTransactionConfirmationPromise({commitment:t,signature:e}){let r,n,i=!1;return{abortConfirmation:()=>{n&&(n(),n=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:new Promise((o,s)=>{try{r=this.onSignature(e,(t,e)=>{r=void 0,o({__type:tW.PROCESSED,response:{context:e,value:t}})},t);let a=new Promise(t=>{null==r?t():n=this._onSubscriptionStateChange(r,e=>{"subscribed"===e&&t()})});(async()=>{if(await a,i)return;
vendor: 1,822 bytes, line 7
7let r=await this.getSignatureStatus(e);if(i||null==r)return;let{context:n,value:u}=r;if(null!=u)if(u?.err)s(u.err);else{switch(t){case"confirmed":case"single":case"singleGossip":if("processed"===u.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===u.confirmationStatus||"confirmed"===u.confirmationStatus)return}i=!0,o({__type:tW.PROCESSED,response:{context:n,value:u}})}})()}catch(t){s(t)}})}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:e,lastValidBlockHeight:r,signature:n}}){let i,o=!1,s=new Promise(e=>{let n=async()=>{try{return await this.getBlockHeight(t)}catch(t){return -1}};(async()=>{let t=await n();if(!o){for(;t<=r;)if(await tX(1e3),o||(t=await n(),o))return;e({__type:tW.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:t,signature:n}),l=this.getCancellationPromise(e);try{let t=await Promise.race([l,u,s]);if(t.__type===tW.PROCESSED)i=t.response;else throw new tB(n)}finally{o=!0,a()}return i}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:e,minContextSlot:r,nonceAccountPubkey:n,nonceValue:i,signature:o}}){let s,a=!1,u=new Promise(e=>{let o=i,s=null,u=async()=>{try{let{context:e,value:i}=await this.getNonceAndContext(n,{commitment:t,minContextSlot:r});return s=e.slot,i?.nonce}catch(t){return o}};(async()=>{if(o=await u(),!a)for(;;){if(i!==o)return void e({__type:tW.NONCE_INVALID,slotInWhichNonceDidAdvance:s});if(await tX(2e3),a||(o=await u(),a))return}})()}),{abortConfirmation:l,confirmationPromise:f}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),c=this.getCancellationPromise(e);try{let e=await Promise.race([c,f,u]);if(e.__type===tW.PROCESSED)s=e.response;else{let n;for(;;
7){let t=await this.getSignatureStatus(o);if(null==t)break;if(t.context.slot<(e.slotInWhichNonceDidAdvance??r)){await tX(400);continue}n=t;break}if(n?.value){let e=t||"finalized",{confirmationStatus:r}=n.value;switch(e){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new tA(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new tA(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new tA(o)}s={context:n.context,value:{err:n.value.err}}}else throw new tA(o)}}finally{a=!0,l()}return s}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:e}){let r,n,i=new Promise(e=>{let n=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":n=this._confirmTransactionInitialTimeout||3e4}r=setTimeout(()=>e({__type:tW.TIMED_OUT,timeoutMs:n}),n)}),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:t,signature:e});try{let t=await Promise.race([s,i]);if(t.__type===tW.PROCESSED)n=t.response;else throw new tk(e,t.timeoutMs/1e3)}finally{clearTimeout(r),o()}return n}async getClusterNodes(){let t=await this._rpcRequest("getClusterNodes",[]),e=(0,y.create)(t,eh((0,y.array)(e9)));if("error"in e)throw new tG(e.error,"failed to get cluster nodes");return e.result}async getVoteAccounts(t){let e=this._buildArgs([],t),r=await this._rpcRequest("getVoteAccounts",e),n=(0,y.create)(r,rt);if("error"in n)throw new tG(n.error,"failed to get vote accounts");return n.result}async getSlot(t){let{commitment:e,config:r}=eu(t),n=this._buildArgs([],e,void 0,r),i=await this._rpcRequest("getSlot",n),o=(0,y.create)(i,eh((0,y.number)()));if("error"in o)throw new tG(o.error,"failed to get slot");return o.result}async getSlotLeader(t){let{commitment:e,config:r}=eu(t),n=this._buildArgs([],e,void 0,r),i=await this._rpcRequest("getSlotLeader",n),o=(0,y.create)(i,eh((0,y.string)()));if("error"in o)throw new tG(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(t,e){let r=await this._rpcRequest("getSlotLeaders",[t,e]),n=(0,y.create)(r,eh((0,y.array)(eo)));if("error"in n)throw new tG(n.error,"failed to get slot leaders");return n.result}async getSignatureStatus(t,e){let{context:r,value:n}
7=await this.getSignatureStatuses([t],e);return tO(1===n.length),{context:r,value:n[0]}}async getSignatureStatuses(t,e){let r=[t];e&&r.push(e);let n=await this._rpcRequest("getSignatureStatuses",r),i=(0,y.create)(n,rn);if("error"in i)throw new tG(i.error,"failed to get signature status");return i.result}async getTransactionCount(t){let{commitment:e,config:r}=eu(t),n=this._buildArgs([],e,void 0,r),i=await this._rpcRequest("getTransactionCount",n),o=(0,y.create)(i,eh((0,y.number)()));if("error"in o)throw new tG(o.error,"failed to get transaction count");return o.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){let e=this._buildArgs([],t),r=await this._rpcRequest("getInflationGovernor",e),n=(0,y.create)(r,eU);if("error"in n)throw new tG(n.error,"failed to get inflation");return n.result}async getInflationReward(t,e,r){let{commitment:n,config:i}=eu(r),o=this._buildArgs([t.map(t=>t.toBase58())],n,void 0,{...i,epoch:null!=e?e:i?.epoch}),s=await this._rpcRequest("getInflationReward",o),a=(0,y.create)(s,em);if("error"in a)throw new tG(a.error,"failed to get inflation reward");return a.result}async getInflationRate(){let t=await this._rpcRequest("getInflationRate",[]),e=(0,y.create)(t,eO);if("error"in e)throw new tG(e.error,"failed to get inflation rate");return e.result}async getEpochInfo(t){let{commitment:e,config:r}=eu(t),n=this._buildArgs([],e,void 0,r),i=await this._rpcRequest("getEpochInfo",n),o=(0,y.create)(i,eL);if("error"in o)throw new tG(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){let t=await this._rpcRequest("getEpochSchedule",[]),e=(0,y.create)(t,eP);if("error"in e)throw new tG(e.error,"failed to get epoch schedule");let r=e.result;return new t7(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){let t=await this._rpcRequest("getLeaderSchedule",[]),e=(0,y.create)(t,eC);if("error"in e)throw new tG(e.error,"failed to get leader schedule");return e.result}async getMinimumBalanceForRentExemption(t,e){let r=this._buildArgs([t],e),n=await this._rpcRequest("getMinimumBalanceForRentExemption",r),i=(0,y.create)(n,ri);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(t){let{context:e,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(t);return{context:e,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON:()=>({})}}}}async getRecentPerformanceSamples(t){let e=await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),r=(0,y.create)(e,rL);if("error"in r)throw new tG(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(t,e){let r=this._buildArgs([t],e),n=await this._rpcRequest("getFeeCalculatorForBlockhash",r),i=(0,y.create)(n,rP);if("error"in i)throw new tG(i.error,"failed to get fee calculator");let{context:o,value:s}=i.result;return{context:o,value:null!==s?s.feeCalculator:null}}async getFeeForMessage(t,e){let r=tw(t.serialize()).toString("base64"),n=this._buildArgs([r],e),i=await this._rpcRequest("getFeeForMessage",n),o=(0,y.create)(i,ed((0,y.nullable)((0,y.number)())));if("error"in o)throw new tG(o.error,"failed to get fee for message");if(null===o.result)throw Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(t){let e=t?.lockedWritableAccounts?.map(t=>
7t.toBase58()),r=e?.length?[e]:[],n=await this._rpcRequest("getRecentPrioritizationFees",r),i=(0,y.create)(n,eR);if("error"in i)throw new tG(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(t){let{commitment:e,config:r}=eu(t),n=this._buildArgs([],e,void 0,r),i=await this._rpcRequest("getLatestBlockhash",n),o=(0,y.create)(i,rU);if("error"in o)throw new tG(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgs([t],r,void 0,n),o=await this._rpcRequest("isBlockhashValid",i),s=(0,y.create)(o,rO);if("error"in s)throw new tG(s.error,"failed to determine if the blockhash `"+t+"`is valid");return s.result}async getVersion(){let t=await this._rpcRequest("getVersion",[]),e=(0,y.create)(t,eh(eA));if("error"in e)throw new tG(e.error,"failed to get version");return e.result}async getGenesisHash(){let t=await this._rpcRequest("getGenesisHash",[]),e=(0,y.create)(t,eh((0,y.string)()));if("error"in e)throw new tG(e.error,"failed to get genesis hash");return e.result}async getBlock(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=await this._rpcRequest("getBlock",i);try{switch(n?.transactionDetails){case"accounts":{let t=(0,y.create)(o,rE);if("error"in t)throw t.error;return t.result}case"none":{let t=(0,y.create)(o,rS);if("error"in t)throw t.error;return t.result}default:{let t=(0,y.create)(o,rx);if("error"in t)throw t.error;let{result:e}=t;return e?{...e,transactions:e.transactions.map(({transaction:t,meta:e,version:r})=>({meta:e,transaction:{...t,message:eg(r,t.message)},version:r}))}:null}}}catch(t){throw new tG(t,"failed to get confirmed block")}}async getParsedBlock(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=await this._rpcRequest("getBlock",i);try{switch(n?.transactionDetails){case"accounts":{let t=(0,y.create)(o,rk);if("error"in t)throw t.error;return t.result}case"none":{let t=(0,y.create)(o,rA);if("error"in t)throw t.error;return t.result}default:{let t=(0,y.create)(o,rB);if("error"in t)throw t.error;return t.result}}}catch(t){throw new tG(t,"failed to get block")}}async getBlockProduction(t){let e,r;if("string"==typeof t)r=t;else if(t){let{commitment:n,...i}=t;r=n,e=i}let n=this._buildArgs([],r,"base64",e),i=await this._rpcRequest("getBlockProduction",n),o=(0,y.create)(i,eT);if("error"in o)throw new tG(o.error,"failed to get block production information");return o.result}async getTransaction(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=await this._rpcRequest("getTransaction",i),s=(0,y.create)(o,rM);if("error"in s)throw new tG(s.error,"failed to get transaction");let a=s.result;return a?{...a,transaction:{...a.transaction,message:eg(a.version,a.transaction.message)}}:a}async getParsedTransaction(t,e){let{commitment:r,config:n}=eu(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=await this._rpcRequest("getTransaction",i),s=(0,y.create)(o,rT);if("error"in s)throw new tG(s.error,"failed to get transaction");return s.result}async getParsedTransactions(t,e){let{commitment:r,config:n}=eu(e),i=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n)}));return(await this._rpcBatchRequest(i)).map(t=>{let e=(0,y.create)(t,rT);if("error"in e)throw new tG(e.error,"failed to get transactions");return e.result})}async getTransactions(t,e){let{commitment:r,config:n}=eu(e),i=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,void 0,n)}));return(await this._rpcBatchRequest(i)).map(t=>{let e=(0,y.create)(t,rM);if("error"in e)throw new tG(e.error,"failed to get transactions");let r=e.result;return r?{...r,transaction:{...r.transaction,message:eg(r.version,r.transaction.message)}}:r})}async getConfirmedBlock(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),n=await this._rpcRequest("getBlock",r),i=(0,y.create)(n,rI);if("error"in i)throw new tG(i.error,"failed to get confirmed block");let o=i.result;if(!o)throw Error("Confirmed block "+t+" not found");let s={...o,transactions:o.transactions.map(({transaction:t,meta:e})=>{let r=new tN(t.message);return{meta:e,transaction:{...t,message:r}}})};return{...s,transactions:s.transactions.map(({transaction:t,meta:e})=>({meta:e,transaction:tj.populate(t.message,t.signatures)}))}}async getBlocks(t,e,r){let n=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],r),i=await this._rpcRequest("getBlocks",n),o=(0,y.create)(i,eh((0,y.array)((0,y.number)())));if("error"in o)throw new tG(o.error,"failed to get blocks");return o.result}async getBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetail
7s:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",r),i=(0,y.create)(n,r_);if("error"in i)throw new tG(i.error,"failed to get block");let o=i.result;if(!o)throw Error("Block "+t+" not found");return o}async getConfirmedBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),n=await this._rpcRequest("getBlock",r),i=(0,y.create)(n,r_);if("error"in i)throw new tG(i.error,"failed to get confirmed block");let o=i.result;if(!o)throw Error("Confirmed block "+t+" not found");return o}async getConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),n=await this._rpcRequest("getTransaction",r),i=(0,y.create)(n,rM);if("error"in i)throw new tG(i.error,"failed to get transaction");let o=i.result;if(!o)return o;let s=new tN(o.transaction.message),a=o.transaction.signatures;return{...o,transaction:tj.populate(s,a)}}async getParsedConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),n=await this._rpcRequest("getTransaction",r),i=(0,y.create)(n,rT);if("error"in i)throw new tG(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(t,e){let r=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(t=>{let e=(0,y.create)(t,rT);if("error"in e)throw new tG(e.error,"failed to get confirmed transactions");return e.result})}async getConfirmedSignaturesForAddress(t,e,r){let n={},i=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--e<=0)&&!(e<i);)try{let t=await this.getConfirmedBlockSignatures(e,"finalized");t.signatures.length>0&&(n.until=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}
vendor: 13,763 bytes, line 7
7let o=await this.getSlot("finalized");for(;!("before"in n)&&!(++r>o);)try{let t=await this.getConfirmedBlockSignatures(r);t.signatures.length>0&&(n.before=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}return(await this.getConfirmedSignaturesForAddress2(t,n)).map(t=>t.signature)}async getConfirmedSignaturesForAddress2(t,e,r){let n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=await this._rpcRequest("getConfirmedSignaturesForAddress2",n),o=(0,y.create)(i,eX);if("error"in o)throw new tG(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(t,e,r){let n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=await this._rpcRequest("getSignaturesForAddress",n),o=(0,y.create)(i,eJ);if("error"in o)throw new tG(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(t,e){let{context:r,value:n}=await this.getAccountInfoAndContext(t,e),i=null;return null!==n&&(i=new er({key:t,state:er.deserialize(n.data)})),{context:r,value:i}}async getNonceAndContext(t,e){let{context:r,value:n}=await this.getAccountInfoAndContext(t,e),i=null;return null!==n&&(i=t2.fromAccountData(n.data)),{context:r,value:i}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get nonce for account "+t.toBase58()+": "+e)})}async requestAirdrop(t,e){let r=await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),n=(0,y.create)(r,rC);if("error"in n)throw new tG(n.error,`airdrop to ${t.toBase58()} failed`);return n.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await tX(100);let t=Date.now()-this._blockhashInfo.lastFetch;if(null!==this._blockhashInfo.latestBlockhash&&!(t>=3e4))return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let t=Date.now(),e=this._blockhashInfo.latestBlockhash,r=e?e.blockhash:null;for(let t=0;t<50;t++){let t=await this.getLatestBlockhash("finalized");if(r!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await tX(200)}throw Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){let{commitment:e,config:r}=eu(t),n=this._buildArgs([],e,"base64",r),i=await this._rpcRequest("getStakeMinimumDelegation",n),o=(0,y.create)(i,ed((0,y.number)()));if("error"in o)throw new tG(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(t,e,r){let n;if("message"in t){let n=t.serialize(),i=u.Buffer.from(n).toString("base64");if(Array.isArray(e)||void 0!==r)throw Error("Invalid arguments");let o=e||{};o.encoding="base64","commitment"in o||(o.commitment=this.commitment),e&&"object"==typeof e&&"innerInstructions"in e&&(o.innerInstructions=e.innerInstructions);let s=[i,o],a=await this._rpcRequest("simulateTransaction",s),l=(0,y.create)(a,eM);if("error"in l)throw Error("failed to simulate transaction: "+l.error.message);return l.result}if(t instanceof tj?((n=new tj).feePayer=t.feePayer,n.instructions=t.instructions,n.nonceInfo=t.nonceInfo,n.signatures=t.signatures):(n=tj.populate(t))._message=n._json=void 0,void 0!==e&&!Array.isArray(e))throw Error("Invalid arguments");if(n.nonceInfo&&e)n.sign(...e);else{let t=this._disableBlockhashCaching;for(;;){let r=await this._blockhashWithExpiryBlockHeight(t);if(n.lastValidBlockHeight=r.lastValidBlockHeight,n.recentBlockhash=r.blockhash,!e)break;if(n.sign(...e),!n.signature)throw Error("!signature");let i=n.signature.toString("base64");if(this._blockhashInfo.simulatedSignatures.includes(i)||this._blockhashInfo.transactionSignatures.includes(i))t=!0;else{this._blockhashInfo.simulatedSignatures.push(i);break}}}let i=n._compile(),o=i.serialize(),s=n._serialize(o).toString("base64"),a={encoding:"base64",commitment:this.commitment};r&&(a.accounts={encoding:"base64",addresses:(Array.isArray(r)?r:i.nonProgramIds()).map(t=>t.toBase58())}),e&&(a.sigVerify=!0),e&&"object"==typeof e&&"innerInstructions"in e&&(a.innerInstructions=e.innerInstructions);let l=[s,a],f=await this._rpcRequest("simulateTransaction",l),c=(0,y.create)(f,eM);if("error"in c){let t;if("data"in c.error&&(t=c.error.data.logs)&&Array.isArray(t)){let e="\n    ",r=e+t.join(e);console.error(c.error.message,r)}throw new tZ({action:"simulate",signature:"",transactionMessage:c.error.message,logs:t})}return c.result}async sendTransaction(t,e,r){if("version"in t){if(e&&Array.isArray(e))throw Error("Invalid arguments");let r=t.serialize();return await this.sendRawTransaction(r,e)}if(void 0===e||!Array.isArray(e))throw Error("Invalid arguments");if(t.nonceInfo)t.sign(...e);else{let r=this._disableBlockhashCaching;for(;;){let n=await this._blockhashWithExpiryBlockHeight(r);if(t.lastValidBlockHeight=n.lastValidBlockHeight,t.recentBlockhash=n.blockhash,t.sign(...e),!t.signature)throw Error("!signature");let i=t.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(i))r=!0;else{this._blockhashInfo.transactionSignatures.push(i);break}}}let n=t.serialize();return await this.sendRawTransaction(n,r)}async sendRawTransaction(t,e){let r=tw(t).toString("base64");return await this.sendEncodedTransaction(r,e)}async sendEncodedTransaction(t,e){let r={encoding:"base64"},n=e&&e.skipPreflight,i=!0===n?"processed":e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(r.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(r.minContextSlot=e.minContextSlot),n&&(r.skipPreflight=n),i&&(r.preflightCommitment=i);let o=[t,r],s=await this._rpcRequest("sendTransaction",o),a=(0,y.create)(s,rN);if("error"in a){let t;throw"data"in a.error&&(t=a.error.data.logs),new tZ({action:n?"send":"simulate",signature:"",transactionMessage:a.error.message,logs:t})}return a.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3===t)?this._updateSubscriptions():(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,e])=>{this._setSubscription(t,{...e,state:"pending"})}))}_setSubscription(t,e){let r=this._subscriptionsByHash[t]?.state;if(this._subscriptionsByHash[t]=e,r!==e.state){let r=this._subscriptionStateChangeCallbacksByHash[t];r&&r.forEach(t=>{try{t(e.state)}catch{}})}}_onSubscriptionStateChange(t,e){let r=this._subscriptionHashByClientSubscriptionId[t];if(null==r)return()=>{};let n=this._subscriptionStateChangeCallbacksByHash[r]||=new Set;return n.add(e),()=>{n.delete(e),0===n.size&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}},500));return}if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();let t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async t=>{let r=this._subscriptionsByHash[t];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size){delete this._subscriptionsByHash[t],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],await this._updateSubscriptions();return}await (async()=>{let{args:n,method:i}=r;try{this._setSubscription(t,{...r,state:"subscribing"});let e=await this._rpcWebSocket.call(i,n);this._setSubscription(t,{...r,serverSubscriptionId:e,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[e]=r.callbacks,await this._updateSubscriptions()}catch(o){if(console.error(`Received ${o instanceof Error?"":"JSON-RPC "}error calling \`${i}\``,{args:n,error:o}),!e())return;this._setSubscription(t,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await (async()=>{let{serverSubscriptionId:n,unsubscribeMethod:i}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._setSubscription(t,{...r,state:"unsubscribing"}),this._setSubscription(t,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(i,[n])}catch(n){if(n instanceof Error&&console.error(`${i} error:`,n.message),!e())return;this._setSubscription(t,{...r,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(t,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}}))}_handleServerNotification(t,e){let r=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==r&&r.forEach(t=>{try{t(...e)}catch(t){console.error(t)}})}_wsOnAccountNotification(t){let{result:e,subscription:r}=(0,y.create)(t,eQ);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){let r=this._nextClientSubscriptionId++,n=t4([t.method,e]),i=this._subscriptionsByHash[n];return void 0===i?this._subscriptionsByHash[n]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:i.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[r]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];let e=this._subscriptionsByHash[n];tO(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(t,e,r){let{commitment:n,config:i}=eu(r),o=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",i);return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){let{result:e,subscription:r}=(0,y.create)(t,e1);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,n){let{commitment:i,config:o}=eu(r),s=this._buildArgs([t.toBase58()],i||this._commitment||"finalized","base64",o||(n?{filters:el(n)}:void 0));return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},s)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,r){let n=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],r||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){let{result:e,subscription:r}=(0,y.create)(t,rz);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){let{result:e,subscription:r}=(0,y.create)(t,e6);this._handleServerNotification(r,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){let{result:e,subscription:r}=(0,y.create)(t,e3);this._handleServerNotification(r,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){let r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,r,n){let i=e||this._commitment;if(i||r||n){let e={};r&&(e.encoding=r),i&&(e.commitment=i),n&&(e=Object.assign(e,n)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,r,n){let i=e||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,r,n)}_wsOnSignatureNotification(t){let{result:e,subscription:r}=(0,y.create)(t,e5);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,r){let n=this._buildArgs([t],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(t,r)=>{if("status"===t.type){e(t.result,r);try{this.removeSignatureListener(i)}catch(t){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return i}
7onSignatureWithOptions(t,e,r){let{commitment:n,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([t],n,void 0,i),s=this._makeSubscription({callback:(t,r)=>{e(t,r);try{this.removeSignatureListener(s)}catch(t){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){let{result:e,subscription:r}=(0,y.create)(t,e4);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}},"Keypair",0,rF,"NONCE_ACCOUNT_LENGTH",0,t1,"PUBLIC_KEY_LENGTH",0,32,"PublicKey",0,tE,"SYSVAR_RENT_PUBKEY",0,tH,"SystemProgram",0,t3,"Transaction",0,tj,"TransactionInstruction",0,tD,"VersionedMessage",0,tz,"VersionedTransaction",0,class t{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)tO(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{const e=[];for(let r=0;r<t.header.numRequiredSignatures;r++)e.push(new Uint8Array(64));this.signatures=e}this.message=t}serialize(){let t=this.message.serialize(),e=[];tU(e,this.signatures.length);let r=p.struct([p.blob(e.length,"encodedSignaturesLength"),p.seq(((t="signature")=>p.blob(64,t))(),this.signatures.length,"signatures"),p.blob(t.length,"serializedMessage")]),n=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(e),signatures:this.signatures,serializedMessage:t},n);return n.slice(0,i)}static deserialize(e){let r=[...e],n=[],i=tT(r);for(let t=0;t<i;t++)n.push(new Uint8Array(tC(r,0,64)));return new t(tz.deserialize(new Uint8Array(r)),n)}sign(t){let e=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let n of t){let t=r.findIndex(t=>t.equals(n.publicKey));tO(t>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[t]=tm(e,n.secretKey)}}addSignature(t,e){tO(64===e.byteLength,"Signature must be 64 bytes long");let r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(e=>e.equals(t));tO(r>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=e}},"sendAndConfirmTransaction",0,tY],27261)},13227,(t,e,r)=>{"use strict";var n=t.r(42524).Buffer;e.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=i}var a=t.length,u=t.charAt(0),l=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===u;)i++,r++;for(var s=(t.length-r)*l+1>>>0,f=new Uint8Array(s);r<t.length;){var c=t.charCodeAt(r);if(c>255)return;var h=e[c];if(255===h)return;for(var d=0,p=s-1;(0!==h||d<o)&&-1!==p;p--,d++)h+=a*f[p]>>>0,f[p]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");o=d,r++}for(var g=s-o;g!==s&&0===f[g];)g++;var y=n.allocUnsafe(i+(s-g));y.fill(0,0,i);for(var m=i;g!==s;)y[m++]=f[g++];return y}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var l=(s-o)*f+1>>>0,c=new Uint8Array(l);o!==s;){for(var h=e[o],d=0,p=l-1;(0!==h||d<i)&&-1!==p;p--,d++)h+=256*c[p]>>>0,c[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");i=d,o++}for(var g=l-i;g!==l&&0===c[g];)g++;for(var y=u.repeat(r);g<l;++g)y+=t.charAt(c[g]);return y},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},35030,(t,e,r)=>{e.exports=t.r(13227)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},34582,(t,e,r)=>{"use strict";r.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return(r+n)*3/4-n},r.toByteArray=function(t){var e,r,n=l(t),s=n[0],a=n[1],u=new o((s+a)*3/4-a),f=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(function(t,e,r){for(var i,o=[],s=e;s<r;s+=3)i=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(n[i>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===i?o.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===i&&o.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),o.join("")};for(var n=[],i=[],o="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 69,928 bytes, line 7
7+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}i[45]=62,i[95]=63},38492,(t,e,r)=>{r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,f=-7,c=r?i-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,l=8*o-i-1,f=(1<<l)-1,c=f>>1,h=5960464477539062e-23*(23===i),d=n?0:o-1,p=n?1:-1,g=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+d]=255&s,d+=p,s/=256,l-=8);t[r+d-p]|=128*g}},43943,(t,e,r)=>{"use strict";let n=t.r(34582),i=t.r(38492),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);let r=0|p(n,i),o=s(r),u=o.write(n,i);return u!==r&&(o=o.slice(0,u)),o}if(ArrayBuffer.isView(t)){var o=t;if(N(o,Uint8Array)){let t=new Uint8Array(o);return h(t.buffer,t.byteOffset,t.byteLength)}return c(o)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let u=t.valueOf&&t.valueOf();if(null!=u&&u!==t)return a.from(u,e,r);let l=function(t){if(a.isBuffer(t)){let e=0|d(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(l)return l;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),s(t<0?0:0|d(t))}function c(t){let e=t.length<0?0:0|d(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t,e,r){let n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),n}function d(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(i)return n?-1:L(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=q[t[n]];return i}(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":var o,s,a;return o=this,s=e,a=r,0===s&&a===o.length?n.fromByteArray(o):n.fromByteArray(o.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}(this,e,r);default:if(i)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){var o;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return b(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else -1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(l(t,o+n)!==l(e,n)){r=!1;break}if(r)return o}return -1}function w(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let e=t[i],o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:(192&(r=t[i+1]))==128&&(u=(31&e)<<6|63&r)>127&&(o=u);break;case 3:r=t[i+1],n=t[i+2],(192&r)==128&&(192&n)==128&&(u=(15&e)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}var o=n;let s=o.length;if(s<=4096)return String.fromCharCode.apply(String,o);let a="",u=0;for(;u<s;)a+=String.fromCharCode.apply(String,o.slice(u,u+=4096));return a}function v(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,i,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function S(t,e,r,n,i){T(e,n,i,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function E(t,e,r,n,i){T(e,n,i,t,r,7);let o=Number(e&BigInt(0xffffffff));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function k(t,e,r,n,o){return e*=1,r>>>=0,o||B(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,o){return e*=1,r>>>=0,o||B(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}r.Buffer=a,r.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return f(t)},a.allocUnsafeSlow=function(t){return f(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:+(n<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){let e=t[r];if(N(e,Uint8Array))i+e.length>n.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else if(a.isBuffer(e))e.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=e.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},a.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},a.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},a.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?w(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){let t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,i){if(N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;let o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),f=t.slice(e,r);for(let t=0;t<u;++t)if(l[t]!==f[t]){o=l[t],s=f[t];break}return o<s?-1:+(s<o)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){var i,o,s,a,u,l,f,c;if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let d=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let i;r=Number(r)||0;let o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;let s=e.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){var a;let n=parseInt(e.substr(2*i,2),16);if((a=n)!=a)break;t[r+i]=n}return i}(this,t,e,r);case"utf8":case"utf-8":return i=e,o=r,C(L(t,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return s=e,a=r,C(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,s,a);case"base64":return u=e,l=r,C(P(t),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f=e,c=r,C(function(t,e){let r,n,i=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(t,this.length-f),this,f,c);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=z(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&O(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+0x1000000*this[++t],i=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=z(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&O(t,this.length-8);let n=0x1000000*e+65536*this[++t]+256*this[++t]+this[++t],i=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=z(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&O(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+0x1000000*this[++t])}),a.prototype.readBigInt64BE=z(function(t){U(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&O(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r)}),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,t,e,r,n,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;x(this,t,e,r,n,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigUInt64LE=z(function(t,e=0){return S(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=z(function(t,e=0){return E(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||x(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigInt64LE=z(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=z(function(t,e=0){return E(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},a.prototype.fill=function(t,e,r,n){let i;if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{let o=a.isBuffer(t)?t:a.from(t,n),s=o.length;if(0===s)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};let I={};function _(t,e,r){I[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function M(t){let e="",r=t.length,n=+("-"===t[0]);for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function T(t,e,r,n,i,o){if(t>r||t<e){let n,i="bigint"==typeof e?"n":"";throw n=o>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new I.ERR_OUT_OF_RANGE("value",n,t)}U(i,"offset"),(void 0===n[i]||void 0===n[i+o])&&O(i,n.length-(o+1))}function U(t,e){if("number"!=typeof t)throw new I.ERR_INVALID_ARG_TYPE(e,"number",t)}function O(t,e,r){if(Math.floor(t)!==t)throw U(t,r),new I.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new I.ERR_BUFFER_OUT_OF_BOUNDS;throw new I.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${e}`,t)}_("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),_("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=M(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=M(i)),i+="n"),n+=` It must be ${e}. Received ${i}`},RangeError);let R=/[^+/0-9A-Za-z-_]/g;function L(t,e){let r;e=e||1/0;let n=t.length,i=null,o=[];for(let s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function P(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function C(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let q=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function z(t){return"u"<typeof BigInt?W:t}function W(){throw Error("BigInt not supported")}},16853,(t,e,r)=>{!function(t,e){"use strict";function r(t,e){if(!t)throw Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}t.exports=i,i.BN=i,i.wordSize=26;try{f="u">typeof window&&void 0!==window.Buffer?window.Buffer:void 0}catch(t){}function o(t,e){var n=t.charCodeAt(e);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function s(t,e,r){var n=o(t,r);return r-1>=e&&(n|=o(t,r-1)<<4),n}function a(t,e,n,i){for(var o=0,s=0,a=Math.min(t.length,n),u=e;u<a;u++){var l=t.charCodeAt(u)-48;o*=i,s=l>=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&s<i,"Invalid character"),o+=s}return o}function u(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return 0>t.cmp(e)?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,n):(this._parseBase(t,e,i),"le"===n&&this._initArray(this.toArray(),e,n)))},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<0x4000000?(this.words=[0x3ffffff&t],this.length=1):t<0x10000000000000?(this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff],this.length=2):(r(t<0x20000000000000),this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var i,o,s=0;s<this.length;s++)this.words[s]=0;var a=0;if("be"===n)for(s=t.length-1,i=0;s>=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(s=0,i=0;s<t.length;s+=3)o=t[s]|t[s+1]<<8|t[s+2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);return this._strip()},i.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i<this.length;i++)this.words[i]=0;var o=0,a=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=s(t,e,i)<<o,this.words[a]|=0x3ffffff&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=s(t,e,i)<<o,this.words[a]|=0x3ffffff&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=0x3ffffff;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,l=0,f=r;f<u;f+=n)l=a(t,f,f+n,e),this.imuln(i),this.words[0]+l<0x4000000?this.words[0]+=l:this._iaddn(l);if(0!==s){var c=1;for(l=a(t,f,t.length,e),f=0;f<s;f++)c*=e;this.imuln(c),this.words[0]+l<0x4000000?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){u(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f,c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=0x3ffffff&s,u=s/0x4000000|0;r.words[0]=a;for(var l=1;l<n;l++){for(var f=u>>>26,c=0x3ffffff&u,h=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=h;d++){var p=l-d|0;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/0x4000000|0,c=0x3ffffff&s}r.words[l]=0|c,u=0|f}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}i.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){for(var n="",i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=((a<<i|o)&0xffffff).toString(16);o=a>>>24-i&0xffffff,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],f=d[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(f).toString(t);n=(p=p.idivn(f)).isZero()?g+n:c[l-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},f&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(f,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return r((this.negative|t.negative)==0),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return r((this.negative|t.negative)==0),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return r((this.negative|t.negative)==0),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i<e;i++)this.words[i]=0x3ffffff&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&0x3ffffff>>26-n),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),e?this.words[n]=this.words[n]|1<<i:this.words[n]=this.words[n]&~(1<<i),this._strip()},i.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=0x3ffffff&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=0x3ffffff&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(n=(0|e.words[s])-(0|r.words[s])+o)>>26,this.words[s]=0x3ffffff&n;for(;0!==o&&s<e.length;s++)o=(n=(0|e.words[s])+o)>>26,this.words[s]=0x3ffffff&n;if(0===o&&s<e.length&&e!==this)for(;s<e.length;s++)this.words[s]=e.words[s];return this.length=Math.max(this.length,s),e!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,l=0,f=0|s[0],c=8191&f,h=f>>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,b=y>>>13,w=0|s[3],v=8191&w,x=w>>>13,S=0|s[4],E=8191&S,B=S>>>13,k=0|s[5],A=8191&k,I=k>>>13,_=0|s[6],M=8191&_,T=_>>>13,U=0|s[7],O=8191&U,R=U>>>13,L=0|s[8],P=8191&L,C=L>>>13,N=0|s[9],q=8191&N,z=N>>>13,W=0|a[0],F=8191&W,D=W>>>13,j=0|a[1],K=8191&j,$=j>>>13,H=0|a[2],V=8191&H,Z=H>>>13,G=0|a[3],Y=8191&G,X=G>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],to=8191&ti,ts=ti>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,tf=0|a[8],tc=8191&tf,th=tf>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(c,F);var ty=(l+n|0)+((8191&(i=(i=Math.imul(c,D))+Math.imul(h,F)|0))<<13)|0;l=((o=Math.imul(h,D))+(i>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,n=Math.imul(p,F),i=(i=Math.imul(p,D))+Math.imul(g,F)|0,o=Math.imul(g,D),n=n+Math.imul(c,K)|0;var tm=(l+n|0)+((8191&(i=(i=i+Math.imul(c,$)|0)+Math.imul(h,K)|0))<<13)|0;l=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,n=Math.imul(m,F),i=(i=Math.imul(m,D))+Math.imul(b,F)|0,o=Math.imul(b,D),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(c,V)|0;var tb=(l+n|0)+((8191&(i=(i=i+Math.imul(c,Z)|0)+Math.imul(h,V)|0))<<13)|0;l=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,n=Math.imul(v,F),i=(i=Math.imul(v,D))+Math.imul(x,F)|0,o=Math.imul(x,D),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,Z)|0,n=n+Math.imul(c,Y)|0;var tw=(l+n|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(h,Y)|0))<<13)|0;l=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,n=Math.imul(E,F),i=(i=Math.imul(E,D))+Math.imul(B,F)|0,o=Math.imul(B,D),n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(c,Q)|0;var tv=(l+n|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(h,Q)|0))<<13)|0;l=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,n=Math.imul(A,F),i=(i=Math.imul(A,D))+Math.imul(I,F)|0,o=Math.imul(I,D),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(c,tr)|0;var tx=(l+n|0)+((8191&(i=(i=i+Math.imul(c,tn)|0)+Math.imul(h,tr)|0))<<13)|0;l=((o=o+Math.imul(h,tn)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,n=Math.imul(M,F),i=(i=Math.imul(M,D))+Math.imul(T,F)|0,o=Math.imul(T,D),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(g,tr)|0,o=o+Math.imul(g,tn)|0,n=n+Math.imul(c,to)|0;var tS=(l+n|0)+((8191&(i=(i=i+Math.imul(c,ts)|0)+Math.imul(h,to)|0))<<13)|0;l=((o=o+Math.imul(h,ts)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,n=Math.imul(O,F),i=(i=Math.imul(O,D))+Math.imul(R,F)|0,o=Math.imul(R,D),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(m,tr)|0,i=(i=i+Math.imul(m,tn)|0)+Math.imul(b,tr)|0,o=o+Math.imul(b,tn)|0,n=n+Math.imul(p,to)|0,i=(i=i+Math.imul(p,ts)|0)+Math.imul(g,to)|0,o=o+Math.imul(g,ts)|0,n=n+Math.imul(c,tu)|0;var tE=(l+n|0)+((8191&(i=(i=i+Math.imul(c,tl)|0)+Math.imul(h,tu)|0))<<13)|0;l=((o=o+Math.imul(h,tl)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,n=Math.imul(P,F),i=(i=Math.imul(P,D))+Math.imul(C,F)|0,o=Math.imul(C,D),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(v,tr)|0,i=(i=i+Math.imul(v,tn)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,tn)|0,n=n+Math.imul(m,to)|0,i=(i=i+Math.imul(m,ts)|0)+Math.imul(b,to)|0,o=o+Math.imul(b,ts)|0,n=n+Math.imul(p,tu)|0,i=(i=i+Math.imul(p,tl)|0)+Math.imul(g,tu)|0,o=o+Math.imul(g,tl)|0,n=n+Math.imul(c,tc)|0;var tB=(l+n|0)+((8191&(i=(i=i+Math.imul(c,th)|0)+Math.imul(h,tc)|0))<<13)|0;l=((o=o+Math.imul(h,th)|0)+(i>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,n=Math.imul(q,F),i=(i=Math.imul(q,D))+Math.imul(z,F)|0,o=Math.imul(z,D),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,tr)|0,i=(i=i+Math.imul(E,tn)|0)+Math.imul(B,tr)|0,o=o+Math.imul(B,tn)|0,n=n+Math.imul(v,to)|0,i=(i=i+Math.imul(v,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,n=n+Math.imul(m,tu)|0,i=(i=i+Math.imul(m,tl)|0)+Math.imul(b,tu)|0,o=o+Math.imul(b,tl)|0,n=n+Math.imul(p,tc)|0,i=(i=i+Math.imul(p,th)|0)+Math.imul(g,tc)|0,o=o+Math.imul(g,th)|0,n=n+Math.imul(c,tp)|0;var tk=(l+n|0)+((8191&(i=(i=i+Math.imul(c,tg)|0)+Math.imul(h,tp)|0))<<13)|0;l=((o=o+Math.imul(h,tg)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=0x3ffffff,n=Math.imul(q,K),i=(i=Math.imul(q,$))+Math.imul(z,K)|0,o=Math.imul(z,$),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,tr)|0,i=(i=i+Math.imul(A,tn)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,tn)|0,n=n+Math.imul(E,to)|0,i=(i=i+Math.imul(E,ts)|0)+Math.imul(B,to)|0,o=o+Math.imul(B,ts)|0,n=n+Math.imul(v,tu)|0,i=(i=i+Math.imul(v,tl)|0)+Math.imul(x,tu)|0,o=o+Math.imul(x,tl)|0,n=n+Math.imul(m,tc)|0,i=(i=i+Math.imul(m,th)|0)+Math.imul(b,tc)|0,o=o+Math.imul(b,th)|0,n=n+Math.imul(p,tp)|0;var tA=(l+n|0)+((8191&(i=(i=i+Math.imul(p,tg)|0)+Math.imul(g,tp)|0))<<13)|0;l=((o=o+Math.imul(g,tg)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,n=Math.imul(q,V),i=(i=Math.imul(q,Z))+Math.imul(z,V)|0,o=Math.imul(z,Z),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(M,tr)|0,i=(i=i+Math.imul(M,tn)|0)+Math.imul(T,tr)|0,o=o+Math.imul(T,tn)|0,n=n+Math.imul(A,to)|0,i=(i=i+Math.imul(A,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,n=n+Math.imul(E,tu)|0,i=(i=i+Math.imul(E,tl)|0)+Math.imul(B,tu)|0,o=o+Math.imul(B,tl)|0,n=n+Math.imul(v,tc)|0,i=(i=i+Math.imul(v,th)|0)+Math.imul(x,tc)|0,o=o+Math.imul(x,th)|0,n=n+Math.imul(m,tp)|0;var tI=(l+n|0)+((8191&(i=(i=i+Math.imul(m,tg)|0)+Math.imul(b,tp)|0))<<13)|0;l=((o=o+Math.imul(b,tg)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,n=Math.imul(q,Y),i=(i=Math.imul(q,X))+Math.imul(z,Y)|0,o=Math.imul(z,X),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(O,tr)|0,i=(i=i+Math.imul(O,tn)|0)+Math.imul(R,tr)|0,o=o+Math.imul(R,tn)|0,n=n+Math.imul(M,to)|0,i=(i=i+Math.imul(M,ts)|0)+Math.imul(T,to)|0,o=o+Math.imul(T,ts)|0,n=n+Math.imul(A,tu)|0,i=(i=i+Math.imul(A,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,n=n+Math.imul(E,tc)|0,i=(i=i+Math.imul(E,th)|0)+Math.imul(B,tc)|0,o=o+Math.imul(B,th)|0,n=n+Math.imul(v,tp)|0;var t_=(l+n|0)+((8191&(i=(i=i+Math.imul(v,tg)|0)+Math.imul(x,tp)|0))<<13)|0;l=((o=o+Math.imul(x,tg)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,n=Math.imul(q,Q),i=(i=Math.imul(q,tt))+Math.imul(z,Q)|0,o=Math.imul(z,tt),n=n+Math.imul(P,tr)|0,i=(i=i+Math.imul(P,tn)|0)+Math.imul(C,tr)|0,o=o+Math.imul(C,tn)|0,n=n+Math.imul(O,to)|0,i=(i=i+Math.imul(O,ts)|0)+Math.imul(R,to)|0,o=o+Math.imul(R,ts)|0,n=n+Math.imul(M,tu)|0,i=(i=i+Math.imul(M,tl)|0)+Math.imul(T,tu)|0,o=o+Math.imul(T,tl)|0,n=n+Math.imul(A,tc)|0,i=(i=i+Math.imul(A,th)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,th)|0,n=n+Math.imul(E,tp)|0;var tM=(l+n|0)+((8191&(i=(i=i+Math.imul(E,tg)|0)+Math.imul(B,tp)|0))<<13)|0;l=((o=o+Math.imul(B,tg)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,n=Math.imul(q,tr),i=(i=Math.imul(q,tn))+Math.imul(z,tr)|0,o=Math.imul(z,tn),n=n+Math.imul(P,to)|0,i=(i=i+Math.imul(P,ts)|0)+Math.imul(C,to)|0,o=o+Math.imul(C,ts)|0,n=n+Math.imul(O,tu)|0,i=(i=i+Math.imul(O,tl)|0)+Math.imul(R,tu)|0,o=o+Math.imul(R,tl)|0,n=n+Math.imul(M,tc)|0,i=(i=i+Math.imul(M,th)|0)+Math.imul(T,tc)|0,o=o+Math.imul(T,th)|0,n=n+Math.imul(A,tp)|0;var tT=(l+n|0)+((8191&(i=(i=i+Math.imul(A,tg)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tg)|0)+(i>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,n=Math.imul(q,to),i=(i=Math.imul(q,ts))+Math.imul(z,to)|0,o=Math.imul(z,ts),n=n+Math.imul(P,tu)|0,i=(i=i+Math.imul(P,tl)|0)+Math.imul(C,tu)|0,o=o+Math.imul(C,tl)|0,n=n+Math.imul(O,tc)|0,i=(i=i+Math.imul(O,th)|0)+Math.imul(R,tc)|0,o=o+Math.imul(R,th)|0,n=n+Math.imul(M,tp)|0;var tU=(l+n|0)+((8191&(i=(i=i+Math.imul(M,tg)|0)+Math.imul(T,tp)|0))<<13)|0;l=((o=o+Math.imul(T,tg)|0)+(i>>>13)|0)+(tU>>>26)|0,tU&=0x3ffffff,n=Math.imul(q,tu),i=(i=Math.imul(q,tl))+Math.imul(z,tu)|0,o=Math.imul(z,tl),n=n+Math.imul(P,tc)|0,i=(i=i+Math.imul(P,th)|0)+Math.imul(C,tc)|0,o=o+Math.imul(C,th)|0,n=n+Math.imul(O,tp)|0;var tO=(l+n|0)+((8191&(i=(i=i+Math.imul(O,tg)|0)+Math.imul(R,tp)|0))<<13)|0;l=((o=o+Math.imul(R,tg)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,n=Math.imul(q,tc),i=(i=Math.imul(q,th))+Math.imul(z,tc)|0,o=Math.imul(z,th),n=n+Math.imul(P,tp)|0;var tR=(l+n|0)+((8191&(i=(i=i+Math.imul(P,tg)|0)+Math.imul(C,tp)|0))<<13)|0;l=((o=o+Math.imul(C,tg)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,n=Math.imul(q,tp);var tL=(l+n|0)+((8191&(i=(i=Math.imul(q,tg))+Math.imul(z,tp)|0))<<13)|0;return l=((o=Math.imul(z,tg))+(i>>>13)|0)+(tL>>>26)|0,tL&=0x3ffffff,u[0]=ty,u[1]=tm,u[2]=tb,u[3]=tw,u[4]=tv,u[5]=tx,u[6]=tS,u[7]=tE,u[8]=tB,u[9]=tk,u[10]=tA,u[11]=tI,u[12]=t_,u[13]=tM,u[14]=tT,u[15]=tU,u[16]=tO,u[17]=tR,u[18]=tL,0!==l&&(u[19]=l,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=0x3ffffff&n,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var f=o-l,c=(0|t.words[f])*(0|e.words[l]),h=0x3ffffff&c;s=s+(c/0x4000000|0)|0,a=0x3ffffff&(h=h+a|0),i+=(s=s+(h>>>26)|0)>>>26,s&=0x3ffffff}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(t,e){this.x=t,this.y=e}Math.imul||(g=p),i.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?r=g(this,t,e):n<63?r=p(this,t,e):r=y(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=Array(t),r=i.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),l=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var c=u,h=l,d=0;d<s;d++){var p=r[f+d],g=n[f+d],y=r[f+d+s],m=n[f+d+s],b=c*y-h*m;m=c*m+h*y,y=b,r[f+d]=p+y,n[f+d]=g+m,r[f+d+s]=p-y,n[f+d+s]=g-m,d!==a&&(b=u*c-l*h,h=u*h+l*c,c=b)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=0x3ffffff&i,r=i<0x4000000?0:i/0x4000000|0}return t},m.prototype.convert13b=function(t,e,n,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)n[s]=0;r(0===o),r((-8192&o)==0)},m.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=Array(n),a=Array(n),u=Array(n),l=Array(n),f=Array(n),c=Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,l,n),this.transform(s,o,a,u,n,i),this.transform(l,o,f,c,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*c[d];u[d]=a[d]*c[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=Array(this.length+t.length),y(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var n=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(0x3ffffff&o)+(0x3ffffff&n);n>>=26,n+=(o/0x4000000|0)+(s>>>26),this.words[i]=0x3ffffff&s}return 0!==n&&(this.words[i]=n,this.length++),this.length=0===t?1:this.length,e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,i=(t-n)/26,o=0x3ffffff>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<n;this.words[e]=u|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){r("number"==typeof t&&t>=0);var i=e?(e-e%26)/26:0,o=t%26,s=Math.min((t-o)/26,this.length),a=0x3ffffff^0x3ffffff>>>o<<o;if(i-=s,i=Math.max(0,i),n){for(var u=0;u<s;u++)n.words[u]=this.words[u];n.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return n&&0!==l&&(n.words[n.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;return!(this.length<=n)&&!!(this.words[n]&1<<e)},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)?this:(0!==e&&n++,this.length=Math.min(n,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<<e),0===this.length&&(this.words[0]=0,this.length=1),this._strip())},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return(r("number"==typeof t),r(t<0x4000000),t<0)?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=0x4000000,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,o,s=t.length+n;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+n])+a;var u=(0|t.words[i])*e;o-=0x3ffffff&u,a=(o>>26)-(u/0x4000000|0),this.words[i+n]=0x3ffffff&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=0x3ffffff&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,o=this.clone(),s=t,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),o.iushln(n),a=0|s.words[s.length-1]);var u=o.length-s.length;if("mod"!==e){(r=new i(null)).length=u+1,r.words=Array(r.length);for(var l=0;l<r.length;l++)r.words[l]=0}var f=o.clone()._ishlnsubmul(s,1,u);0===f.negative&&(o=f,r&&(r.words[u]=1));for(var c=u-1;c>=0;c--){var h=(0|o.words[s.length+c])*0x4000000+(0|o.words[s.length+c-1]);for(h=Math.min(h/a|0,0x3ffffff),o._ishlnsubmul(s,h,c);0!==o.negative;)h--,o.negative=0,o._ishlnsubmul(s,1,c),o.isZero()||(o.negative^=1);r&&(r.words[c]=h)}return r&&r._strip(),o._strip(),"div"!==e&&0!==n&&o.iushrn(n),{div:r||null,mod:o}},i.prototype.divmod=function(t,e,n){var o,s,a;return(r(!t.isZero()),this.isZero())?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var n=0x4000000%t,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+0x4000000*n;this.words[i]=o/t|0,n=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),l=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++l;for(var f=n.clone(),c=e.clone();!e.isZero();){for(var h=0,d=1;(e.words[0]&d)==0&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(c)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;(n.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(l)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,n=this,o=t.clone();n=0!==n.negative?n.umod(t):n.clone();for(var s=new i(1),a=new i(0),u=o.clone();n.cmpn(1)>0&&o.cmpn(1)>0;){for(var l=0,f=1;(n.words[0]&f)==0&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,h=1;(o.words[0]&h)==0&&c<26;++c,h<<=1);if(c>0)for(o.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);n.cmp(o)>=0?(n.isub(o),s.isub(a)):(o.isub(n),a.isub(s))}return 0>(e=0===n.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return(1&this.words[0])==0},i.prototype.isOdd=function(){return(1&this.words[0])==1},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];a+=o,o=a>>>26,a&=0x3ffffff,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return -1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=0x3ffffff,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return -1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return -1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return -1===this.cmpn(t)},i.prototype.lt=function(t){return -1===this.cmp(t)},i.prototype.lten=function(t){return 0>=this.cmpn(t)},i.prototype.lte=function(t){return 0>=this.cmp(t)},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new B(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){B.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new i(null);return t.words=Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n)var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},n(v,w),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=0x3ffffff&e,e=64*n+(e/0x4000000|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(x,w),n(S,w),n(E,w),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=(0|t.words[r])*19+e,i=0x3ffffff&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){var e;if(b[t])return b[t];if("k256"===t)e=new v;else if("p224"===t)e=new x;else if("p192"===t)e=new S;else if("p25519"===t)e=new E;else throw Error("Unknown prime "+t);return b[t]=e,e},B.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},B.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},B.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},B.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},B.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},B.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},B.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},B.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},B.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},B.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},B.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},B.prototype.isqr=function(t){return this.imul(t,t.clone())},B.prototype.sqr=function(t){return this.mul(t,t)},B.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,l).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,o),h=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();r(y<p);var m=this.pow(c,new i(1).iushln(p-y-1));h=h.redMul(m),c=m.redSqr(),d=d.redMul(c),p=y}return h},B.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},B.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var o=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var l=e.words[n],f=u-1;f>=0;f--){var c=l>>f&1;if(o!==r[0]&&(o=this.sqr(o)),0===c&&0===s){a=0;continue}s<<=1,s|=c,(4==++a||0===n&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)}u=26}return o},B.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},B.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},n(k,B),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):0>o.cmpn(0)&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,t.e)},17944,(t,e,r)=>{"use strict";var n=t.r(42524).Buffer;e.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;
vendor: 6,020 bytes, line 7
7i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=i}var a=t.length,u=t.charAt(0),l=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===u;)i++,r++;for(var s=(t.length-r)*l+1>>>0,f=new Uint8Array(s);r<t.length;){var c=t.charCodeAt(r);if(c>255)return;var h=e[c];if(255===h)return;for(var d=0,p=s-1;(0!==h||d<o)&&-1!==p;p--,d++)h+=a*f[p]>>>0,f[p]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");o=d,r++}for(var g=s-o;g!==s&&0===f[g];)g++;var y=n.allocUnsafe(i+(s-g));y.fill(0,0,i);for(var m=i;g!==s;)y[m++]=f[g++];return y}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var l=(s-o)*f+1>>>0,c=new Uint8Array(l);o!==s;){for(var h=e[o],d=0,p=l-1;(0!==h||d<i)&&-1!==p;p--,d++)h+=256*c[p]>>>0,c[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw Error("Non-zero carry");i=d,o++}for(var g=l-i;g!==l&&0===c[g];)g++;for(var y=u.repeat(r);g<l;++g)y+=t.charAt(c[g]);return y},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},1262,(t,e,r)=>{e.exports=t.r(17944)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},72766,(t,e,r)=>{"use strict";function n(t,e,r){return e<=t&&t<=r}function i(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){this.tokens=[].slice.call(t)}function s(t,e){if(t)throw TypeError("Decoder error");return e||65533}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.push(t.shift());else this.tokens.push(t)}};var a="utf-8";function u(t,e){if(!(this instanceof u))return new u(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function l(t,e){if(!(this instanceof l))return new l(t,e);if((t=void 0!==t?String(t).toLowerCase():a)!==a)throw Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function f(t){var e=t.fatal,r=0,i=0,o=0,a=128,u=191;this.handler=function(t,l){if(-1===l&&0!==o)return o=0,s(e);if(-1===l)return -1;if(0===o){if(n(l,0,127))return l;if(n(l,194,223))o=1,r=l-192;else if(n(l,224,239))224===l&&(a=160),237===l&&(u=159),o=2,r=l-224;else{if(!n(l,240,244))return s(e);240===l&&(a=144),244===l&&(u=143),o=3,r=l-240}return r<<=6*o,null}if(!n(l,a,u))return r=o=i=0,a=128,u=191,t.prepend(l),s(e);if(a=128,u=191,i+=1,r+=l-128<<6*(o-i),i!==o)return null;var f=r;return r=o=i=0,f}}function c(t){t.fatal,this.handler=function(t,e){if(-1===e)return -1;if(n(e,0,127))return e;n(e,128,2047)?(r=1,i=192):n(e,2048,65535)?(r=2,i=224):n(e,65536,1114111)&&(r=3,i=240);for(var r,i,o=[(e>>6*r)+i];r>0;){var s=e>>6*(r-1);o.push(128|63&s),r-=1}return o}}u.prototype={decode:function(t,e){r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=i(e),this._streaming||(this._decoder=new f({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var r,n,s=new o(r),a=[];!s.endOfStream()&&-1!==(n=this._decoder.handler(s,s.read()));)null!==n&&(Array.isArray(n)?a.push.apply(a,n):a.push(n));if(!this._streaming){do{if(-1===(n=this._decoder.handler(s,s.read())))break;if(null===n)continue;Array.isArray(n)?a.push.apply(a,n):a.push(n)}while(!s.endOfStream())this._decoder=null}!a.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0);for(var u="",l=0;l<a.length;++l){var c=a[l];c<=65535?u+=String.fromCharCode(c):(c-=65536,u+=String.fromCharCode((c>>10)+55296,(1023&c)+56320))}return u}},l.prototype={encode:function(t,e){t=t?String(t):"",e=i(e),this._streaming||(this._encoder=new c(this._options)),this._streaming=!!e.stream;for(var r,n=[],s=new o(function(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var o=e.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,u=1023&s;i.push(65536+(a<<10)+u),n+=1}else i.push(65533)}n+=1}return i}(t));!s.endOfStream()&&-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}},r.TextEncoder=l,r.TextDecoder=u},54119,(t,e,r)=>{"use strict";var n=t.i(67034),i=t.e&&t.e.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=t.e&&t.e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=t.e&&t.e.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;
7a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=t.e&&t.e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},u=t.e&&t.e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.deserializeUnchecked=r.deserialize=r.serialize=r.BinaryReader=r.BinaryWriter=r.BorshError=r.baseDecode=r.baseEncode=void 0;let l=u(t.r(16853)),f=u(t.r(1262)),c=a(t.r(72766)),h=new("function"!=typeof TextDecoder?c.TextDecoder:TextDecoder)("utf-8",{fatal:!0});r.baseEncode=function(t){return"string"==typeof t&&(t=n.Buffer.from(t,"utf8")),f.default.encode(n.Buffer.from(t))},r.baseDecode=function(t){return n.Buffer.from(f.default.decode(t))};class d extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}r.BorshError=d;class p{constructor(){this.buf=n.Buffer.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.Buffer.concat([this.buf,n.Buffer.alloc(1024)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new l.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new l.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new l.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(n.Buffer.from(new l.default(t).toArray("le",64)))}writeBuffer(t){this.buf=n.Buffer.concat([n.Buffer.from(this.buf.subarray(0,this.length)),t,n.Buffer.alloc(1024)]),this.length+=t.length}writeString(t){this.maybeResize();let e=n.Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(n.Buffer.from(t))}writeArray(t,e){for(let r of(this.maybeResize(),this.writeU32(t.length),t))this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}}function g(t,e,r){let n=r.value;r.value=function(...t){try{return n.apply(this,t)}catch(t){if(t instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t.code)>=0)throw new d("Reached the end of buffer when deserializing");throw t}}}r.BinaryWriter=p;class y{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new l.default(t,"le")}readU128(){let t=this.readBuffer(16);return new l.default(t,"le")}readU256(){let t=this.readBuffer(32);return new l.default(t,"le")}readU512(){let t=this.readBuffer(64);return new l.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new d(`Expected buffer length ${t} isn't within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return h.decode(e)}catch(t){throw new d(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),r=[];for(let n=0;n<e;++n)r.push(t());return r}}function m(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e,r,n,i){try{if("string"==typeof n)i[`write${m(n)}`](r);else if(n instanceof Array)if("number"==typeof n[0]){if(r.length!==n[0])throw new d(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);i.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new d(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let e=0;e<n[1];e++)b(t,null,r[e],n[0],i)}else i.writeArray(r,r=>{b(t,e,r,n[0],i)});else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),b(t,e,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach((r,o)=>{b(t,e,o,n.key,i),b(t,e,r,n.value,i)});break;default:throw new d(`FieldType ${n} unrecognized`)}else w(t,r,i)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function w(t,e,r){if("function"==typeof e.borshSerialize)return void e.borshSerialize(r);let n=t.get(e.constructor);if(!n)throw new d(`Class ${e.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,i])=>{b(t,n,e[n],i,r)});else if("enum"===n.kind){let i=e[n.field];for(let o=0;o<n.values.length;++o){let[s,a]=n.values[o];if(s===i){r.writeU8(o),b(t,s,e[s],a,r);break}}}else throw new d(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}function v(t,e,r,n){try{if("string"==typeof r)return n[`read${m(r)}`]();if(r instanceof Array)if("number"==typeof r[0])return n.readFixedArray(r[0]);else{if("number"!=typeof r[1])return n.readArray(()=>
7v(t,e,r[0],n));let i=[];for(let e=0;e<r[1];e++)i.push(v(t,null,r[0],n));return i}if("option"===r.kind){if(n.readU8())return v(t,e,r.type,n);return}if("map"===r.kind){let i=new Map,o=n.readU32();for(let s=0;s<o;s++){let o=v(t,e,r.key,n),s=v(t,e,r.value,n);i.set(o,s)}return i}return x(t,r,n)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function x(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);let n=t.get(e);if(!n)throw new d(`Class ${e.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[i,o]of t.get(e).fields)n[i]=v(t,i,o,r);return new e(n)}if("enum"===n.kind){let i=r.readU8();if(i>=n.values.length)throw new d(`Enum index: ${i} is out of range`);let[o,s]=n.values[i],a=v(t,o,s,r);return new e({[o]:a})}throw new d(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}s([g],y.prototype,"readU8",null),s([g],y.prototype,"readU16",null),s([g],y.prototype,"readU32",null),s([g],y.prototype,"readU64",null),s([g],y.prototype,"readU128",null),s([g],y.prototype,"readU256",null),s([g],y.prototype,"readU512",null),s([g],y.prototype,"readString",null),s([g],y.prototype,"readFixedArray",null),s([g],y.prototype,"readArray",null),r.BinaryReader=y,r.serialize=function(t,e,r=p){let n=new r;return w(t,e,n),n.toArray()},r.deserialize=function(t,e,r,n=y){let i=new n(r),o=x(t,e,i);if(i.offset<r.length)throw new d(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},r.deserializeUnchecked=function(t,e,r,n=y){return x(t,e,new n(r))}},78492,(t,e,r)=>{"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,n,o){if("function"!=typeof r)throw TypeError("The listener must be a function");var a=new s(r,n||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(i=!1)),l.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)n.call(t,e)&&r.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},l.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=Array(o);n<o;n++)s[n]=r[n].fn;return s},l.prototype.listenerCount=function(t){var e=i?i+t:t,r=this._events[e];return r?r.fn?1:r.length:0},l.prototype.emit=function(t,e,r,n,o,s){var a=i?i+t:t;if(!this._events[a])return!1;var u,l,f=this._events[a],c=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),c){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,n),!0;case 5:return f.fn.call(f.context,e,r,n,o),!0;case 6:return f.fn.call(f.context,e,r,n,o,s),!0}for(l=1,u=Array(c-1);l<c;l++)u[l-1]=arguments[l];f.fn.apply(f.context,u)}else{var h,d=f.length;for(l=0;l<d;l++)switch(f[l].once&&this.removeListener(t,f[l].fn,void 0,!0),c){case 1:f[l].fn.call(f[l].context);break;case 2:f[l].fn.call(f[l].context,e);break;case 3:f[l].fn.call(f[l].context,e,r);break;case 4:f[l].fn.call(f[l].context,e,r,n);break;default:if(!u)for(h=1,u=Array(c-1);h<c;h++)u[h-1]=arguments[h];f[l].fn.apply(f[l].context,u)}}return!0},l.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},l.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},l.prototype.removeListener=function(t,e,r,n){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return u(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||n&&!s.once||r&&s.context!==r||u(this,o);else{for(var a=0,l=[],f=s.length;a<f;a++)(s[a].fn!==e||n&&!s[a].once||r&&s[a].context!==r)&&l.push(s[a]);l.length?this._events[o]=1===l.length?l[0]:l:u(this,o)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&u(this,e)):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=i,l.EventEmitter=l,e.exports=l},95932,t=>{"use strict";let e=t.i(78492).default;t.s(["default",0,e])},67034,(t,e,r)=>{var n={872:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],l=new i((s+a)*3/4-a),f=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],l[f++]=e>>16&255,l[f++]=e>>8&255,l[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,l[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,l[f++]=e>>8&255,l[f++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(t,e,n){for(var i,o=[],s=e;s<n;s+=3)i=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===i&&o.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),o.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 18,974 bytes, line 7
7+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(t,e,r){"use strict";var n=r(872),i=r(321),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t){var n=t,i=e;if(("string"!=typeof i||""===i)&&(i="utf8"),!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|d(n,i),u=s(o),l=u.write(n,i);return l!==o&&(u=u.slice(0,l)),u}if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(M(t,ArrayBuffer)||t&&M(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(M(t,SharedArrayBuffer)||t&&M(t.buffer,SharedArrayBuffer)))return function(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),n}(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var f=t.valueOf&&t.valueOf();if(null!=f&&f!==t)return a.from(f,e,r);var p=function(t){if(a.isBuffer(t)){var e=0|h(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),s(t<0?0:0|h(t))}function c(t){for(var e=t.length<0?0:0|h(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}e.Buffer=a,e.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return f(t)},a.allocUnsafeSlow=function(t){return f(t)};function h(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||M(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(t).length;default:if(i)return n?-1:k(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var i,o,s,a=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=T[t[o]];return i}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":return i=this,o=e,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,e,r);default:if(a)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){var o;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length)if(i)return -1;else r=t.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e){if(e&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(t,e,r);else return Uint8Array.prototype.lastIndexOf.call(t,e,r);return m(t,[e],r,n,i)}throw TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else -1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var c=!0,h=0;h<u;h++)if(l(t,o+h)!==l(e,h)){c=!1;break}if(c)return o}return -1}a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),M(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:+(n<r)},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(M(o,Uint8Array)&&(o=a.from(o)),!a.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,i){if(M(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),f=t.slice(e,r),c=0;c<u;++c)if(l[c]!==f[c]){o=l[c],s=f[c];break}return o<s?-1:+(s<o)},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)};function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,l=t[i],f=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:(192&(o=t[i+1]))==128&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],(192&o)==128&&(192&s)==128&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}var h=n,d=h.length;if(d<=4096)return String.fromCharCode.apply(String,h);for(var p="",g=0;g<d;)p+=String.fromCharCode.apply(String,h.slice(g,g+=4096));return p}function w(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function v(t,e,r,n,i,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function x(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function S(t,e,r,n,o){return e*=1,r>>>=0,o||x(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function E(t,e,r,n,o){return e*=1,r>>>=0,o||x(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,a,u,l,f,c,h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var d=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a,u=parseInt(e.substr(2*s,2),16);if((a=u)!=a)break;t[r+s]=u}return s}(this,t,e,r);case"utf8":case"utf-8":return i=e,o=r,_(k(t,this.length-i),this,i,o);case"ascii":return s=e,a=r,_(A(t),this,s,a);case"latin1":case"binary":return function(t,e,r,n){return _(A(e),t,r,n)}(this,t,e,r);case"base64":return u=e,l=r,_(I(t),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f=e,c=r,_(function(t,e){for(var r,n,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(t,this.length-f),this,f,c);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;v(this,t,e,r,i,0)}var o=1,s=0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;v(this,t,e,r,i,0)}var o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);v(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){var i=Math.pow(2,8*r-1);v(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||v(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return S(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return S(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return E(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return E(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var i,o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=a.isBuffer(t)?t:a.from(t,n),u=s.length;
7if(0===u)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};var B=/[^+/0-9A-Za-z-_]/g;function k(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function A(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function I(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function _(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function M(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var T=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},321:function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,f=-7,c=r?i-1:0,h=r?-1:1,d=t[e+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,l=8*o-i-1,f=(1<<l)-1,c=f>>1,h=5960464477539062e-23*(23===i),d=n?0:o-1,p=n?1:-1,g=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+d]=255&s,d+=p,s/=256,l-=8);t[r+d-p]|=128*g}}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}},s=!0;try{n[t](r,r.exports,o),s=!1}finally{s&&delete i[t]}return r.exports}o.ab="/ROOT/node_modules/next/dist/compiled/buffer/",e.exports=o(230)},42524,(t,e,r)=>{var n=t.r(43943),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},30356,t=>{"use strict";t.s([],73326),t.i(73326);var e=t.i(99506);let r=function(t){let r;if(!(0,e.default)(t))throw TypeError("Invalid UUID");return Uint8Array.of((r=parseInt(t.slice(0,8),16))>>>24,r>>>16&255,r>>>8&255,255&r,(r=parseInt(t.slice(9,13),16))>>>8,255&r,(r=parseInt(t.slice(14,18),16))>>>8,255&r,(r=parseInt(t.slice(19,23),16))>>>8,255&r,(r=parseInt(t.slice(24,36),16))/0x10000000000&255,r/0x100000000&255,r>>>24&255,r>>>16&255,r>>>8&255,255&r)};var n=t.i(72408),i=t.i(63358);let o={};function s(t,e,r,n,i,o,a=0){if(t.length<16)throw Error("Random bytes length must be >= 16");if(o){if(a<0||a+16>o.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`)}else o=new Uint8Array(16),a=0;e??=Date.now(),r??=0,n??=(t[8]<<8|t[9])&16383,i??=t.slice(10,16);let u=((0xfffffff&(e+=122192928e5))*1e4+r)%0x100000000;o[a++]=u>>>24&255,o[a++]=u>>>16&255,o[a++]=u>>>8&255,o[a++]=255&u;let l=e/0x100000000*1e4&0xfffffff;o[a++]=l>>>8&255,o[a++]=255&l,o[a++]=l>>>
724&15|16,o[a++]=l>>>16&255,o[a++]=n>>>8|128,o[a++]=255&n;for(let t=0;t<6;++t)o[a++]=i[t];return o}let a=function(t,e,r){let a,u=t?._v6??!1;if(t){let e=Object.keys(t);1===e.length&&"_v6"===e[0]&&(t=void 0)}if(t)a=s(t.random??t.rng?.()??(0,i.default)(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{var l,f,c;let t=Date.now(),n=(0,i.default)();l=o,f=t,c=n,l.msecs??=-1/0,l.nsecs??=0,f===l.msecs?(l.nsecs++,l.nsecs>=1e4&&(l.node=void 0,l.nsecs=0)):f>l.msecs?l.nsecs=0:f<l.msecs&&(l.node=void 0),l.node||(l.node=c.slice(10,16),l.node[0]|=1,l.clockseq=(c[8]<<8|c[9])&16383),l.msecs=f,a=s(n,o.msecs,o.nsecs,u?void 0:o.clockseq,u?void 0:o.node,e,r)}return e??(0,n.unsafeStringify)(a)};function u(t){var e;let i=(e="string"==typeof t?r(t):t,Uint8Array.of((15&e[6])<<4|e[7]>>4&15,(15&e[7])<<4|(240&e[4])>>4,(15&e[4])<<4|(240&e[5])>>4,(15&e[5])<<4|(240&e[0])>>4,(15&e[0])<<4|(240&e[1])>>4,(15&e[1])<<4|(240&e[2])>>4,96|15&e[2],e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]));return"string"==typeof t?(0,n.unsafeStringify)(i):i}function l(t){return(t+64>>>9<<4)+14+1}function f(t,e){let r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function c(t,e,r,n,i,o){var s;return f((s=f(f(e,t),f(n,o)))<<i|s>>>32-i,r)}function h(t,e,r,n,i,o,s){return c(e&r|~e&n,t,e,i,o,s)}function d(t,e,r,n,i,o,s){return c(e&n|r&~n,t,e,i,o,s)}function p(t,e,r,n,i,o,s){return c(e^r^n,t,e,i,o,s)}function g(t,e,r,n,i,o,s){return c(r^(e|~n),t,e,i,o,s)}let y=function(t){var e=function(t,e){let r=new Uint32Array(l(e)).fill(0);r.set(t),r[e>>5]|=128<<e%32,r[r.length-1]=e,t=r;let n=0x67452301,i=-0x10325477,o=-0x67452302,s=0x10325476;for(let e=0;e<t.length;e+=16){let r=n,a=i,u=o,l=s;n=h(n,i,o,s,t[e],7,-0x28955b88),s=h(s,n,i,o,t[e+1],12,-0x173848aa),o=h(o,s,n,i,t[e+2],17,0x242070db),i=h(i,o,s,n,t[e+3],22,-0x3e423112),n=h(n,i,o,s,t[e+4],7,-0xa83f051),s=h(s,n,i,o,t[e+5],12,0x4787c62a),o=h(o,s,n,i,t[e+6],17,-0x57cfb9ed),i=h(i,o,s,n,t[e+7],22,-0x2b96aff),n=h(n,i,o,s,t[e+8],7,0x698098d8),s=h(s,n,i,o,t[e+9],12,-0x74bb0851),o=h(o,s,n,i,t[e+10],17,-42063),i=h(i,o,s,n,t[e+11],22,-0x76a32842),n=h(n,i,o,s,t[e+12],7,0x6b901122),s=h(s,n,i,o,t[e+13],12,-0x2678e6d),o=h(o,s,n,i,t[e+14],17,-0x5986bc72),i=h(i,o,s,n,t[e+15],22,0x49b40821),n=d(n,i,o,s,t[e+1],5,-0x9e1da9e),s=d(s,n,i,o,t[e+6],9,-0x3fbf4cc0),o=d(o,s,n,i,t[e+11],14,0x265e5a51),i=d(i,o,s,n,t[e],20,-0x16493856),n=d(n,i,o,s,t[e+5],5,-0x29d0efa3),s=d(s,n,i,o,t[e+10],9,0x2441453),o=d(o,s,n,i,t[e+15],14,-0x275e197f),i=d(i,o,s,n,t[e+4],20,-0x182c0438),n=d(n,i,o,s,t[e+9],5,0x21e1cde6),s=d(s,n,i,o,t[e+14],9,-0x3cc8f82a),o=d(o,s,n,i,t[e+3],14,-0xb2af279),i=d(i,o,s,n,t[e+8],20,0x455a14ed),n=d(n,i,o,s,t[e+13],5,-0x561c16fb),s=d(s,n,i,o,t[e+2],9,-0x3105c08),o=d(o,s,n,i,t[e+7],14,0x676f02d9),i=d(i,o,s,n,t[e+12],20,-0x72d5b376),n=p(n,i,o,s,t[e+5],4,-378558),s=p(s,n,i,o,t[e+8],11,-0x788e097f),o=p(o,s,n,i,t[e+11],16,0x6d9d6122),i=p(i,o,s,n,t[e+14],23,-0x21ac7f4),n=p(n,i,o,s,t[e+1],4,-0x5b4115bc),s=p(s,n,i,o,t[e+4],11,0x4bdecfa9),o=p(o,s,n,i,t[e+7],16,-0x944b4a0),i=p(i,o,s,n,t[e+10],23,-0x41404390),n=p(n,i,o,s,t[e+13],4,0x289b7ec6),s=p(s,n,i,o,t[e],11,-0x155ed806),o=p(o,s,n,i,t[e+3],16,-0x2b10cf7b),i=p(i,o,s,n,t[e+6],23,0x4881d05),n=p(n,i,o,s,t[e+9],4,-0x262b2fc7),s=p(s,n,i,o,t[e+12],11,-0x1924661b),o=p(o,s,n,i,t[e+15],16,0x1fa27cf8),i=p(i,o,s,n,t[e+2],23,-0x3b53a99b),n=g(n,i,o,s,t[e],6,-0xbd6ddbc),s=g(s,n,i,o,t[e+7],10,0x432aff97),o=g(o,s,n,i,t[e+14],15,-0x546bdc59),i=g(i,o,s,n,t[e+5],21,-0x36c5fc7),n=g(n,i,o,s,t[e+12],6,0x655b59c3),s=g(s,n,i,o,t[e+3],10,-0x70f3336e),o=g(o,s,n,i,t[e+10],15,-1051523),i=g(i,o,s,n,t[e+1],21,-0x7a7ba22f),n=g(n,i,o,s,t[e+8],6,0x6fa87e4f),s=g(s,n,i,o,t[e+15],10,-0x1d31920),o=g(o,s,n,i,t[e+6],15,-0x5cfebcec),i=g(i,o,s,n,t[e+13],21,0x4e0811a1),n=g(n,i,o,s,t[e+4],6,-0x8ac817e),s=g(s,n,i,o,t[e+11],10,-0x42c50dcb),o=g(o,s,n,i,t[e+2],15,0x2ad7d2bb),i=g(i,o,s,n,t[e+9],21,-0x14792c6f),n=f(n,r),i=f(i,a),o=f(o,u),s=f(s,l)}return Uint32Array.of(n,i,o,s)}(function(t){if(0===t.length)return new Uint32Array;let e=new Uint32Array(l(8*t.length)).fill(0);for(let r=0;r<t.length;r++)e[r>>2]|=(255&t[r])<<r%4*8;return e}(t),8*t.length);let r=new Uint8Array(4*e.length);for(let t=0;t<4*e.length;t++)r[t]=e[t>>2]>>>t%4*8&255;return r},m="6ba7b810-9dad-11d1-80b4-00c04fd430c8",b="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function w(t,e,i,o,s,a){let u="string"==typeof i?function(t){let e=new Uint8Array((t=unescape(encodeURIComponent(t))).length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r);return e}(i):i,l="string"==typeof o?r(o):o;if("string"==typeof o&&(o=r(o)),o?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+u.length);if(f.set(l),f.set(u,l.length),(f=e(f))[6]=15&f[6]|t,f[8]=63&f[8]|128,s){if((a??=0)<0||a+16>s.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let t=0;t<16;++t)s[a+t]=f[t];return s}return(0,n.unsafeStringify)(f)}function v(t,e,r,n){return w(48,y,t,e,r,n)}v.DNS=m,v.URL=b;
7var x=t.i(77401);function S(t,e){return t<<e|t>>>32-e}let E=function(t){let e=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],n=new Uint8Array(t.length+1);n.set(t),n[t.length]=128;let i=Math.ceil(((t=n).length/4+2)/16),o=Array(i);for(let e=0;e<i;++e){let r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=t[64*e+4*n]<<24|t[64*e+4*n+1]<<16|t[64*e+4*n+2]<<8|t[64*e+4*n+3];o[e]=r}o[i-1][14]=(t.length-1)*8/0x100000000,o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(t.length-1)*8|0;for(let t=0;t<i;++t){let n=new Uint32Array(80);for(let e=0;e<16;++e)n[e]=o[t][e];for(let t=16;t<80;++t)n[t]=S(n[t-3]^n[t-8]^n[t-14]^n[t-16],1);let i=r[0],s=r[1],a=r[2],u=r[3],l=r[4];for(let t=0;t<80;++t){let r=Math.floor(t/20),o=S(i,5)+function(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}(r,s,a,u)+l+e[r]+n[t]>>>0;l=u,u=a,a=S(s,30)>>>0,s=i,i=o}r[0]=r[0]+i>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+a>>>0,r[3]=r[3]+u>>>0,r[4]=r[4]+l>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])};function B(t,e,r,n){return w(80,E,t,e,r,n)}B.DNS=m,B.URL=b;let k={};function A(t,e,r,n,i=0){if(t.length<16)throw Error("Random bytes length must be >= 16");if(n){if(i<0||i+16>n.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`)}else n=new Uint8Array(16),i=0;return e??=Date.now(),r??=127*t[6]<<24|t[7]<<16|t[8]<<8|t[9],n[i++]=e/0x10000000000&255,n[i++]=e/0x100000000&255,n[i++]=e/0x1000000&255,n[i++]=e/65536&255,n[i++]=e/256&255,n[i++]=255&e,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|3&t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i++]=t[15],n}t.s(["MAX",0,"ffffffff-ffff-ffff-ffff-ffffffffffff","NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,r,"stringify",()=>n.default,"v1",0,a,"v1ToV6",0,u,"v3",0,v,"v4",()=>x.default,"v5",0,B,"v6",0,function(t,e,r){r??=0;let i=a({...t??={},_v6:!0},new Uint8Array(16));if(i=u(i),e){if(r<0||r+16>e.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;t++)e[r+t]=i[t];return e}return(0,n.unsafeStringify)(i)},"v6ToV1",0,function(t){var e;let i=(e="string"==typeof t?r(t):t,Uint8Array.of((15&e[3])<<4|e[4]>>4&15,(15&e[4])<<4|(240&e[5])>>4,(15&e[5])<<4|15&e[6],e[7],(15&e[1])<<4|(240&e[2])>>4,(15&e[2])<<4|(240&e[3])>>4,16|(240&e[0])>>4,(15&e[0])<<4|(240&e[1])>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]));return"string"==typeof t?(0,n.unsafeStringify)(i):i},"v7",0,function(t,e,r){let o;if(t)o=A(t.random??t.rng?.()??(0,i.default)(),t.msecs,t.seq,e,r);else{var s,a,u;let t=Date.now(),n=(0,i.default)();s=k,a=t,u=n,s.msecs??=-1/0,s.seq??=0,a>s.msecs?(s.seq=u[6]<<23|u[7]<<16|u[8]<<8|u[9],s.msecs=a):(s.seq=s.seq+1|0,0===s.seq&&s.msecs++),o=A(n,k.msecs,k.seq,e,r)}return e??(0,n.unsafeStringify)(o)},"validate",()=>e.default,"version",0,function(t){if(!(0,e.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}],30356)},43173,(t,e,r)=>{"use strict";let n=t.r(30356).v4;e.exports=function(t,e,r,i){if("string"!=typeof t)throw TypeError(t+" must be a string");let o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw TypeError(o+" must be 1 or 2");let s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw TypeError(e+" must be an object, array or omitted");s.params=e}return void 0===r?s.id=("function"==typeof i.generator?i.generator:function(){return n()})(s,i):2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r,s}},78217,(t,e,r)=>{"use strict";let n=t.r(30356).v4,i=t.r(43173),o=function(t,e){if(!(this instanceof o))return new o(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return n()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};e.exports=o,o.prototype.request=function(t,e,r,n){let o,s=this,a=null,u=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&u)throw TypeError("JSON-RPC 1.0 does not support batching");let l=!u&&t&&"object"==typeof t&&"function"==typeof e;if(u||l)n=e,a=t;else{"function"==typeof r&&(n=r,r=void 0);let o="function"==typeof n;try{a=i(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(o)return void n(t);throw t}if(!o)return a}try{o=JSON.stringify(a,this.options.replacer)}catch(t){n(t);return}return this.callServer(o,function(t,e){s._parseResponse(t,e,n)}),a},o.prototype._parseResponse=function(t,e,r){let n;if(t)return void r(t);if(!e)return void r();try{n=JSON.parse(e,this.options.reviver)}catch(t){r(t);return}if(3===r.length)if(!Array.isArray(n))return void r(null,n.error,n.result);else{let t=function(t){return void 0!==t.error};r(null,n.filter(t),n.filter(function(e){return!t(e)}));return}r(null,n)}},99506,72408,63358,77401,t=>{"use strict";let e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,r=function(t){return"string"==typeof t&&e.test(t)};t.s(["default",0,r],99506);let n=[];for(let t=0;t<256;++t)n.push((t+256).toString(16).slice(1));function i(t,e=0){return(n[t[e+0]]+n[t[e+1]]+n[t[e+2]]+n[t[e+3]]+"-"+n[t[e+4]]+n[t[e+5]]+"-"+n[t[e+6]]+n[t[e+7]]+"-"+n[t[e+8]]+n[t[e+9]]+"-"+n[t[e+10]]+n[t[e+11]]+n[t[e+12]]+n[t[e+13]]+n[t[e+14]]+n[t[e+15]]).toLowerCase()}t.s(["default",0,function(t,e=0){let n=i(t,e);
7if(!r(n))throw TypeError("Stringified UUID is invalid");return n},"unsafeStringify",0,i],72408);let o=new Uint8Array(16);function s(){return crypto.getRandomValues(o)}t.s(["default",0,s],63358),t.s(["default",0,function(t,e,r){return e||t||!crypto.randomUUID?function(t,e,r){let n=(t=t||{}).random??t.rng?.()??s();if(n.length<16)throw Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return i(n)}(t,e,r):crypto.randomUUID()}],77401)}]);

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.