bsv2 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/bsv2.mjs +11157 -26263
  2. package/dist/bsv2.umd.js +5 -20
  3. package/package.json +1 -1
package/dist/bsv2.umd.js CHANGED
@@ -1,28 +1,13 @@
1
- (function(We,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(We=typeof globalThis<"u"?globalThis:We||self,et(We.bsv2={}))})(this,function(We){"use strict";var et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ar(M){return M&&M.__esModule&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M}function Gl(M){if(Object.prototype.hasOwnProperty.call(M,"__esModule"))return M;var a=M.default;if(typeof a=="function"){var c=function o(){return this instanceof o?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};c.prototype=a.prototype}else c={};return Object.defineProperty(c,"__esModule",{value:!0}),Object.keys(M).forEach(function(o){var x=Object.getOwnPropertyDescriptor(M,o);Object.defineProperty(c,o,x.get?x:{enumerable:!0,get:function(){return M[o]}})}),c}var Hi,ho;function Wl(){if(ho)return Hi;ho=1,Hi=M;function M(a){this._tables[0][0][0]||this._precompute();var c,o,x,n=this._tables[0][4],g=this._tables[1],y=a.length,b=1;if(y!==4&&y!==6&&y!==8)throw new Error("invalid aes key size");this._key=[o=a.slice(0),x=[]];for(var v=y;v<4*y+28;v++)c=o[v-1],(v%y===0||y===8&&v%y===4)&&(c=n[c>>>24]<<24^n[c>>16&255]<<16^n[c>>8&255]<<8^n[c&255],v%y===0&&(c=c<<8^c>>>24^b<<24,b=b<<1^(b>>7)*283)),o[v]=o[v-y]^c;for(var d=0;v;d++,v--)c=o[d&3?v:v-4],v<=4||d<4?x[d]=c:x[d]=g[0][n[c>>>24]]^g[1][n[c>>16&255]]^g[2][n[c>>8&255]]^g[3][n[c&255]]}return M.prototype={encrypt:function(a){return this._crypt(a,0)},decrypt:function(a){return this._crypt(a,1)},_tables:[[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)]],_precompute:function(){var a=this._tables[0],c=this._tables[1],o=a[4],x=c[4],n,g,y,b=new Uint8Array(256),v=new Uint8Array(256),d,w,_,E,B,A;for(n=0;n<256;n++)v[(b[n]=n<<1^(n>>7)*283)^n]=n;for(g=y=0;!o[g];g^=d||1,y=v[y]||1)for(E=y^y<<1^y<<2^y<<3^y<<4,E=E>>8^E&255^99,o[g]=E,x[E]=g,_=b[w=b[d=b[g]]],A=_*16843009^w*65537^d*257^g*16843008,B=b[E]*257^E*16843008,n=0;n<4;n++)a[n][g]=B=B<<24^B>>>8,c[n][E]=A=A<<24^A>>>8},_crypt:function(a,c){if(a.length!==4)throw new Error("invalid aes block size");var o=this._key[c],x=a[0]^o[0],n=a[c?3:1]^o[1],g=a[2]^o[2],y=a[c?1:3]^o[3],b,v,d,w=o.length/4-2,_,E=4,B=new Uint32Array(4),A=this._tables[c],P=A[0],I=A[1],k=A[2],F=A[3],q=A[4];for(_=0;_<w;_++)b=P[x>>>24]^I[n>>16&255]^k[g>>8&255]^F[y&255]^o[E],v=P[n>>>24]^I[g>>16&255]^k[y>>8&255]^F[x&255]^o[E+1],d=P[g>>>24]^I[y>>16&255]^k[x>>8&255]^F[n&255]^o[E+2],y=P[y>>>24]^I[x>>16&255]^k[n>>8&255]^F[g&255]^o[E+3],E+=4,x=b,n=v,g=d;for(_=0;_<4;_++)B[c?3&-_:_]=q[x>>>24]<<24^q[n>>16&255]<<16^q[g>>8&255]<<8^q[y&255]^o[E++],b=x,x=n,n=g,g=y,y=b;return B}},Hi}var Yl=Wl();const Ki=Ar(Yl);var ri={exports:{}},zi={},uo;function Nt(){return uo||(uo=1,function(M){Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var a={},c={};c.byteLength=d,c.toByteArray=_,c.fromByteArray=A;for(var o=[],x=[],n=typeof Uint8Array<"u"?Uint8Array:Array,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=0,b=g.length;y<b;++y)o[y]=g[y],x[g.charCodeAt(y)]=y;x[45]=62,x[95]=63;function v(k){var F=k.length;if(F%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var q=k.indexOf("=");q===-1&&(q=F);var L=q===F?0:4-q%4;return[q,L]}function d(k){var F=v(k),q=F[0],L=F[1];return(q+L)*3/4-L}function w(k,F,q){return(F+q)*3/4-q}function _(k){var F,q=v(k),L=q[0],V=q[1],ee=new n(w(k,L,V)),ne=0,J=V>0?L-4:L,ue;for(ue=0;ue<J;ue+=4)F=x[k.charCodeAt(ue)]<<18|x[k.charCodeAt(ue+1)]<<12|x[k.charCodeAt(ue+2)]<<6|x[k.charCodeAt(ue+3)],ee[ne++]=F>>16&255,ee[ne++]=F>>8&255,ee[ne++]=F&255;return V===2&&(F=x[k.charCodeAt(ue)]<<2|x[k.charCodeAt(ue+1)]>>4,ee[ne++]=F&255),V===1&&(F=x[k.charCodeAt(ue)]<<10|x[k.charCodeAt(ue+1)]<<4|x[k.charCodeAt(ue+2)]>>2,ee[ne++]=F>>8&255,ee[ne++]=F&255),ee}function E(k){return o[k>>18&63]+o[k>>12&63]+o[k>>6&63]+o[k&63]}function B(k,F,q){for(var L,V=[],ee=F;ee<q;ee+=3)L=(k[ee]<<16&16711680)+(k[ee+1]<<8&65280)+(k[ee+2]&255),V.push(E(L));return V.join("")}function A(k){for(var F,q=k.length,L=q%3,V=[],ee=16383,ne=0,J=q-L;ne<J;ne+=ee)V.push(B(k,ne,ne+ee>J?J:ne+ee));return L===1?(F=k[q-1],V.push(o[F>>2]+o[F<<4&63]+"==")):L===2&&(F=(k[q-2]<<8)+k[q-1],V.push(o[F>>10]+o[F>>4&63]+o[F<<2&63]+"=")),V.join("")}var P={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */P.read=function(k,F,q,L,V){var ee,ne,J=V*8-L-1,ue=(1<<J)-1,m=ue>>1,e=-7,r=q?V-1:0,i=q?-1:1,f=k[F+r];for(r+=i,ee=f&(1<<-e)-1,f>>=-e,e+=J;e>0;ee=ee*256+k[F+r],r+=i,e-=8);for(ne=ee&(1<<-e)-1,ee>>=-e,e+=L;e>0;ne=ne*256+k[F+r],r+=i,e-=8);if(ee===0)ee=1-m;else{if(ee===ue)return ne?NaN:(f?-1:1)*(1/0);ne=ne+Math.pow(2,L),ee=ee-m}return(f?-1:1)*ne*Math.pow(2,ee-L)},P.write=function(k,F,q,L,V,ee){var ne,J,ue,m=ee*8-V-1,e=(1<<m)-1,r=e>>1,i=V===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=L?0:ee-1,h=L?1:-1,l=F<0||F===0&&1/F<0?1:0;for(F=Math.abs(F),isNaN(F)||F===1/0?(J=isNaN(F)?1:0,ne=e):(ne=Math.floor(Math.log(F)/Math.LN2),F*(ue=Math.pow(2,-ne))<1&&(ne--,ue*=2),ne+r>=1?F+=i/ue:F+=i*Math.pow(2,1-r),F*ue>=2&&(ne++,ue/=2),ne+r>=e?(J=0,ne=e):ne+r>=1?(J=(F*ue-1)*Math.pow(2,V),ne=ne+r):(J=F*Math.pow(2,r-1)*Math.pow(2,V),ne=0));V>=8;k[q+f]=J&255,f+=h,J/=256,V-=8);for(ne=ne<<V|J,m+=V;m>0;k[q+f]=ne&255,f+=h,ne/=256,m-=8);k[q+f-h]|=l*128};/*!
1
+ (function(ge,He){typeof exports=="object"&&typeof module<"u"?He(exports):typeof define=="function"&&define.amd?define(["exports"],He):(ge=typeof globalThis<"u"?globalThis:ge||self,He(ge.bsv2={}))})(this,function(ge){"use strict";var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function pf(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var a=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return n[r]}})}),t}var Fr,ma;function bf(){if(ma)return Fr;ma=1,Fr=n;function n(e){this._tables[0][0][0]||this._precompute();var t,r,a,i=this._tables[0][4],u=this._tables[1],c=e.length,h=1;if(c!==4&&c!==6&&c!==8)throw new Error("invalid aes key size");this._key=[r=e.slice(0),a=[]];for(var f=c;f<4*c+28;f++)t=r[f-1],(f%c===0||c===8&&f%c===4)&&(t=i[t>>>24]<<24^i[t>>16&255]<<16^i[t>>8&255]<<8^i[t&255],f%c===0&&(t=t<<8^t>>>24^h<<24,h=h<<1^(h>>7)*283)),r[f]=r[f-c]^t;for(var o=0;f;o++,f--)t=r[o&3?f:f-4],f<=4||o<4?a[o]=t:a[o]=u[0][i[t>>>24]]^u[1][i[t>>16&255]]^u[2][i[t>>8&255]]^u[3][i[t&255]]}return n.prototype={encrypt:function(e){return this._crypt(e,0)},decrypt:function(e){return this._crypt(e,1)},_tables:[[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)]],_precompute:function(){var e=this._tables[0],t=this._tables[1],r=e[4],a=t[4],i,u,c,h=new Uint8Array(256),f=new Uint8Array(256),o,v,w,A,B,x;for(i=0;i<256;i++)f[(h[i]=i<<1^(i>>7)*283)^i]=i;for(u=c=0;!r[u];u^=o||1,c=f[c]||1)for(A=c^c<<1^c<<2^c<<3^c<<4,A=A>>8^A&255^99,r[u]=A,a[A]=u,w=h[v=h[o=h[u]]],x=w*16843009^v*65537^o*257^u*16843008,B=h[A]*257^A*16843008,i=0;i<4;i++)e[i][u]=B=B<<24^B>>>8,t[i][A]=x=x<<24^x>>>8},_crypt:function(e,t){if(e.length!==4)throw new Error("invalid aes block size");var r=this._key[t],a=e[0]^r[0],i=e[t?3:1]^r[1],u=e[2]^r[2],c=e[t?1:3]^r[3],h,f,o,v=r.length/4-2,w,A=4,B=new Uint32Array(4),x=this._tables[t],U=x[0],P=x[1],k=x[2],L=x[3],T=x[4];for(w=0;w<v;w++)h=U[a>>>24]^P[i>>16&255]^k[u>>8&255]^L[c&255]^r[A],f=U[i>>>24]^P[u>>16&255]^k[c>>8&255]^L[a&255]^r[A+1],o=U[u>>>24]^P[c>>16&255]^k[a>>8&255]^L[i&255]^r[A+2],c=U[c>>>24]^P[a>>16&255]^k[i>>8&255]^L[u&255]^r[A+3],A+=4,a=h,i=f,u=o;for(w=0;w<4;w++)B[t?3&-w:w]=T[a>>>24]<<24^T[i>>16&255]<<16^T[u>>8&255]<<8^T[c&255]^r[A++],h=a,a=i,i=u,u=c,c=h;return B}},Fr}var mf=bf();const Lr=$t(mf);var dr={exports:{}},Ur={},ya;function Jt(){return ya||(ya=1,function(n){Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e={},t={};t.byteLength=o,t.toByteArray=w,t.fromByteArray=x;for(var r=[],a=[],i=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,h=u.length;c<h;++c)r[c]=u[c],a[u.charCodeAt(c)]=c;a[45]=62,a[95]=63;function f(k){var L=k.length;if(L%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var T=k.indexOf("=");T===-1&&(T=L);var I=T===L?0:4-T%4;return[T,I]}function o(k){var L=f(k),T=L[0],I=L[1];return(T+I)*3/4-I}function v(k,L,T){return(L+T)*3/4-T}function w(k){var L,T=f(k),I=T[0],F=T[1],j=new i(v(k,I,F)),W=0,Z=F>0?I-4:I,ne;for(ne=0;ne<Z;ne+=4)L=a[k.charCodeAt(ne)]<<18|a[k.charCodeAt(ne+1)]<<12|a[k.charCodeAt(ne+2)]<<6|a[k.charCodeAt(ne+3)],j[W++]=L>>16&255,j[W++]=L>>8&255,j[W++]=L&255;return F===2&&(L=a[k.charCodeAt(ne)]<<2|a[k.charCodeAt(ne+1)]>>4,j[W++]=L&255),F===1&&(L=a[k.charCodeAt(ne)]<<10|a[k.charCodeAt(ne+1)]<<4|a[k.charCodeAt(ne+2)]>>2,j[W++]=L>>8&255,j[W++]=L&255),j}function A(k){return r[k>>18&63]+r[k>>12&63]+r[k>>6&63]+r[k&63]}function B(k,L,T){for(var I,F=[],j=L;j<T;j+=3)I=(k[j]<<16&16711680)+(k[j+1]<<8&65280)+(k[j+2]&255),F.push(A(I));return F.join("")}function x(k){for(var L,T=k.length,I=T%3,F=[],j=16383,W=0,Z=T-I;W<Z;W+=j)F.push(B(k,W,W+j>Z?Z:W+j));return I===1?(L=k[T-1],F.push(r[L>>2]+r[L<<4&63]+"==")):I===2&&(L=(k[T-2]<<8)+k[T-1],F.push(r[L>>10]+r[L>>4&63]+r[L<<2&63]+"=")),F.join("")}var U={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */U.read=function(k,L,T,I,F){var j,W,Z=F*8-I-1,ne=(1<<Z)-1,ae=ne>>1,N=-7,E=T?F-1:0,s=T?-1:1,y=k[L+E];for(E+=s,j=y&(1<<-N)-1,y>>=-N,N+=Z;N>0;j=j*256+k[L+E],E+=s,N-=8);for(W=j&(1<<-N)-1,j>>=-N,N+=I;N>0;W=W*256+k[L+E],E+=s,N-=8);if(j===0)j=1-ae;else{if(j===ne)return W?NaN:(y?-1:1)*(1/0);W=W+Math.pow(2,I),j=j-ae}return(y?-1:1)*W*Math.pow(2,j-I)},U.write=function(k,L,T,I,F,j){var W,Z,ne,ae=j*8-F-1,N=(1<<ae)-1,E=N>>1,s=F===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=I?0:j-1,S=I?1:-1,g=L<0||L===0&&1/L<0?1:0;for(L=Math.abs(L),isNaN(L)||L===1/0?(Z=isNaN(L)?1:0,W=N):(W=Math.floor(Math.log(L)/Math.LN2),L*(ne=Math.pow(2,-W))<1&&(W--,ne*=2),W+E>=1?L+=s/ne:L+=s*Math.pow(2,1-E),L*ne>=2&&(W++,ne/=2),W+E>=N?(Z=0,W=N):W+E>=1?(Z=(L*ne-1)*Math.pow(2,F),W=W+E):(Z=L*Math.pow(2,E-1)*Math.pow(2,F),W=0));F>=8;k[T+y]=Z&255,y+=S,Z/=256,F-=8);for(W=W<<F|Z,ae+=F;ae>0;k[T+y]=W&255,y+=S,W/=256,ae-=8);k[T+y-S]|=g*128};/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(k){const F=c,q=P,L=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;k.Buffer=e,k.SlowBuffer=O,k.INSPECT_MAX_BYTES=50;const V=2147483647;k.kMaxLength=V;const{Uint8Array:ee,ArrayBuffer:ne,SharedArrayBuffer:J}=globalThis;e.TYPED_ARRAY_SUPPORT=ue(),!e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function ue(){try{const j=new ee(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,ee.prototype),Object.setPrototypeOf(j,N),j.foo()===42}catch{return!1}}Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});function m(j){if(j>V)throw new RangeError('The value "'+j+'" is invalid for option "size"');const N=new ee(j);return Object.setPrototypeOf(N,e.prototype),N}function e(j,N,U){if(typeof j=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(j)}return r(j,N,U)}e.poolSize=8192;function r(j,N,U){if(typeof j=="string")return l(j,N);if(ne.isView(j))return s(j);if(j==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j);if(Te(j,ne)||j&&Te(j.buffer,ne)||typeof J<"u"&&(Te(j,J)||j&&Te(j.buffer,J)))return t(j,N,U);if(typeof j=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=j.valueOf&&j.valueOf();if(Y!=null&&Y!==j)return e.from(Y,N,U);const ie=u(j);if(ie)return ie;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof j[Symbol.toPrimitive]=="function")return e.from(j[Symbol.toPrimitive]("string"),N,U);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j)}e.from=function(j,N,U){return r(j,N,U)},Object.setPrototypeOf(e.prototype,ee.prototype),Object.setPrototypeOf(e,ee);function i(j){if(typeof j!="number")throw new TypeError('"size" argument must be of type number');if(j<0)throw new RangeError('The value "'+j+'" is invalid for option "size"')}function f(j,N,U){return i(j),j<=0?m(j):N!==void 0?typeof U=="string"?m(j).fill(N,U):m(j).fill(N):m(j)}e.alloc=function(j,N,U){return f(j,N,U)};function h(j){return i(j),m(j<0?0:S(j)|0)}e.allocUnsafe=function(j){return h(j)},e.allocUnsafeSlow=function(j){return h(j)};function l(j,N){if((typeof N!="string"||N==="")&&(N="utf8"),!e.isEncoding(N))throw new TypeError("Unknown encoding: "+N);const U=H(j,N)|0;let Y=m(U);const ie=Y.write(j,N);return ie!==U&&(Y=Y.slice(0,ie)),Y}function p(j){const N=j.length<0?0:S(j.length)|0,U=m(N);for(let Y=0;Y<N;Y+=1)U[Y]=j[Y]&255;return U}function s(j){if(Te(j,ee)){const N=new ee(j);return t(N.buffer,N.byteOffset,N.byteLength)}return p(j)}function t(j,N,U){if(N<0||j.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(j.byteLength<N+(U||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return N===void 0&&U===void 0?Y=new ee(j):U===void 0?Y=new ee(j,N):Y=new ee(j,N,U),Object.setPrototypeOf(Y,e.prototype),Y}function u(j){if(e.isBuffer(j)){const N=S(j.length)|0,U=m(N);return U.length===0||j.copy(U,0,0,N),U}if(j.length!==void 0)return typeof j.length!="number"||rt(j.length)?m(0):p(j);if(j.type==="Buffer"&&Array.isArray(j.data))return p(j.data)}function S(j){if(j>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return j|0}function O(j){return+j!=j&&(j=0),e.alloc(+j)}e.isBuffer=function(N){return N!=null&&N._isBuffer===!0&&N!==e.prototype},e.compare=function(N,U){if(Te(N,ee)&&(N=e.from(N,N.offset,N.byteLength)),Te(U,ee)&&(U=e.from(U,U.offset,U.byteLength)),!e.isBuffer(N)||!e.isBuffer(U))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(N===U)return 0;let Y=N.length,ie=U.length;for(let me=0,fe=Math.min(Y,ie);me<fe;++me)if(N[me]!==U[me]){Y=N[me],ie=U[me];break}return Y<ie?-1:ie<Y?1:0},e.isEncoding=function(N){switch(String(N).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}},e.concat=function(N,U){if(!Array.isArray(N))throw new TypeError('"list" argument must be an Array of Buffers');if(N.length===0)return e.alloc(0);let Y;if(U===void 0)for(U=0,Y=0;Y<N.length;++Y)U+=N[Y].length;const ie=e.allocUnsafe(U);let me=0;for(Y=0;Y<N.length;++Y){let fe=N[Y];if(Te(fe,ee))me+fe.length>ie.length?(e.isBuffer(fe)||(fe=e.from(fe)),fe.copy(ie,me)):ee.prototype.set.call(ie,fe,me);else if(e.isBuffer(fe))fe.copy(ie,me);else throw new TypeError('"list" argument must be an Array of Buffers');me+=fe.length}return ie};function H(j,N){if(e.isBuffer(j))return j.length;if(ne.isView(j)||Te(j,ne))return j.byteLength;if(typeof j!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof j);const U=j.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&U===0)return 0;let ie=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":return ze(j).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U*2;case"hex":return U>>>1;case"base64":return He(j).length;default:if(ie)return Y?-1:ze(j).length;N=(""+N).toLowerCase(),ie=!0}}e.byteLength=H;function Q(j,N,U){let Y=!1;if((N===void 0||N<0)&&(N=0),N>this.length||((U===void 0||U>this.length)&&(U=this.length),U<=0)||(U>>>=0,N>>>=0,U<=N))return"";for(j||(j="utf8");;)switch(j){case"hex":return Ue(this,N,U);case"utf8":case"utf-8":return le(this,N,U);case"ascii":return be(this,N,U);case"latin1":case"binary":return se(this,N,U);case"base64":return Pe(this,N,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,N,U);default:if(Y)throw new TypeError("Unknown encoding: "+j);j=(j+"").toLowerCase(),Y=!0}}e.prototype._isBuffer=!0;function G(j,N,U){const Y=j[N];j[N]=j[U],j[U]=Y}e.prototype.swap16=function(){const N=this.length;if(N%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let U=0;U<N;U+=2)G(this,U,U+1);return this},e.prototype.swap32=function(){const N=this.length;if(N%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let U=0;U<N;U+=4)G(this,U,U+3),G(this,U+1,U+2);return this},e.prototype.swap64=function(){const N=this.length;if(N%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let U=0;U<N;U+=8)G(this,U,U+7),G(this,U+1,U+6),G(this,U+2,U+5),G(this,U+3,U+4);return this},e.prototype.toString=function(){const N=this.length;return N===0?"":arguments.length===0?le(this,0,N):Q.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(N){if(!e.isBuffer(N))throw new TypeError("Argument must be a Buffer");return this===N?!0:e.compare(this,N)===0},e.prototype.inspect=function(){let N="";const U=k.INSPECT_MAX_BYTES;return N=this.toString("hex",0,U).replace(/(.{2})/g,"$1 ").trim(),this.length>U&&(N+=" ... "),"<Buffer "+N+">"},L&&(e.prototype[L]=e.prototype.inspect),e.prototype.compare=function(N,U,Y,ie,me){if(Te(N,ee)&&(N=e.from(N,N.offset,N.byteLength)),!e.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(U===void 0&&(U=0),Y===void 0&&(Y=N?N.length:0),ie===void 0&&(ie=0),me===void 0&&(me=this.length),U<0||Y>N.length||ie<0||me>this.length)throw new RangeError("out of range index");if(ie>=me&&U>=Y)return 0;if(ie>=me)return-1;if(U>=Y)return 1;if(U>>>=0,Y>>>=0,ie>>>=0,me>>>=0,this===N)return 0;let fe=me-ie,xe=Y-U;const Ve=Math.min(fe,xe),we=this.slice(ie,me),Re=N.slice(U,Y);for(let Ke=0;Ke<Ve;++Ke)if(we[Ke]!==Re[Ke]){fe=we[Ke],xe=Re[Ke];break}return fe<xe?-1:xe<fe?1:0};function R(j,N,U,Y,ie){if(j.length===0)return-1;if(typeof U=="string"?(Y=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,rt(U)&&(U=ie?0:j.length-1),U<0&&(U=j.length+U),U>=j.length){if(ie)return-1;U=j.length-1}else if(U<0)if(ie)U=0;else return-1;if(typeof N=="string"&&(N=e.from(N,Y)),e.isBuffer(N))return N.length===0?-1:C(j,N,U,Y,ie);if(typeof N=="number")return N=N&255,typeof ee.prototype.indexOf=="function"?ie?ee.prototype.indexOf.call(j,N,U):ee.prototype.lastIndexOf.call(j,N,U):C(j,[N],U,Y,ie);throw new TypeError("val must be string, number or Buffer")}function C(j,N,U,Y,ie){let me=1,fe=j.length,xe=N.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(j.length<2||N.length<2)return-1;me=2,fe/=2,xe/=2,U/=2}function Ve(Re,Ke){return me===1?Re[Ke]:Re.readUInt16BE(Ke*me)}let we;if(ie){let Re=-1;for(we=U;we<fe;we++)if(Ve(j,we)===Ve(N,Re===-1?0:we-Re)){if(Re===-1&&(Re=we),we-Re+1===xe)return Re*me}else Re!==-1&&(we-=we-Re),Re=-1}else for(U+xe>fe&&(U=fe-xe),we=U;we>=0;we--){let Re=!0;for(let Ke=0;Ke<xe;Ke++)if(Ve(j,we+Ke)!==Ve(N,Ke)){Re=!1;break}if(Re)return we}return-1}e.prototype.includes=function(N,U,Y){return this.indexOf(N,U,Y)!==-1},e.prototype.indexOf=function(N,U,Y){return R(this,N,U,Y,!0)},e.prototype.lastIndexOf=function(N,U,Y){return R(this,N,U,Y,!1)};function $(j,N,U,Y){U=Number(U)||0;const ie=j.length-U;Y?(Y=Number(Y),Y>ie&&(Y=ie)):Y=ie;const me=N.length;Y>me/2&&(Y=me/2);let fe;for(fe=0;fe<Y;++fe){const xe=parseInt(N.substr(fe*2,2),16);if(rt(xe))return fe;j[U+fe]=xe}return fe}function X(j,N,U,Y){return Ae(ze(N,j.length-U),j,U,Y)}function Z(j,N,U,Y){return Ae(ye(N),j,U,Y)}function K(j,N,U,Y){return Ae(He(N),j,U,Y)}function te(j,N,U,Y){return Ae(Be(N,j.length-U),j,U,Y)}e.prototype.write=function(N,U,Y,ie){if(U===void 0)ie="utf8",Y=this.length,U=0;else if(Y===void 0&&typeof U=="string")ie=U,Y=this.length,U=0;else if(isFinite(U))U=U>>>0,isFinite(Y)?(Y=Y>>>0,ie===void 0&&(ie="utf8")):(ie=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const me=this.length-U;if((Y===void 0||Y>me)&&(Y=me),N.length>0&&(Y<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let fe=!1;for(;;)switch(ie){case"hex":return $(this,N,U,Y);case"utf8":case"utf-8":return X(this,N,U,Y);case"ascii":case"latin1":case"binary":return Z(this,N,U,Y);case"base64":return K(this,N,U,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,N,U,Y);default:if(fe)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),fe=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pe(j,N,U){return N===0&&U===j.length?F.fromByteArray(j):F.fromByteArray(j.slice(N,U))}function le(j,N,U){U=Math.min(j.length,U);const Y=[];let ie=N;for(;ie<U;){const me=j[ie];let fe=null,xe=me>239?4:me>223?3:me>191?2:1;if(ie+xe<=U){let Ve,we,Re,Ke;switch(xe){case 1:me<128&&(fe=me);break;case 2:Ve=j[ie+1],(Ve&192)===128&&(Ke=(me&31)<<6|Ve&63,Ke>127&&(fe=Ke));break;case 3:Ve=j[ie+1],we=j[ie+2],(Ve&192)===128&&(we&192)===128&&(Ke=(me&15)<<12|(Ve&63)<<6|we&63,Ke>2047&&(Ke<55296||Ke>57343)&&(fe=Ke));break;case 4:Ve=j[ie+1],we=j[ie+2],Re=j[ie+3],(Ve&192)===128&&(we&192)===128&&(Re&192)===128&&(Ke=(me&15)<<18|(Ve&63)<<12|(we&63)<<6|Re&63,Ke>65535&&Ke<1114112&&(fe=Ke))}}fe===null?(fe=65533,xe=1):fe>65535&&(fe-=65536,Y.push(fe>>>10&1023|55296),fe=56320|fe&1023),Y.push(fe),ie+=xe}return Le(Y)}const ce=4096;function Le(j){const N=j.length;if(N<=ce)return String.fromCharCode.apply(String,j);let U="",Y=0;for(;Y<N;)U+=String.fromCharCode.apply(String,j.slice(Y,Y+=ce));return U}function be(j,N,U){let Y="";U=Math.min(j.length,U);for(let ie=N;ie<U;++ie)Y+=String.fromCharCode(j[ie]&127);return Y}function se(j,N,U){let Y="";U=Math.min(j.length,U);for(let ie=N;ie<U;++ie)Y+=String.fromCharCode(j[ie]);return Y}function Ue(j,N,U){const Y=j.length;(!N||N<0)&&(N=0),(!U||U<0||U>Y)&&(U=Y);let ie="";for(let me=N;me<U;++me)ie+=Ie[j[me]];return ie}function de(j,N,U){const Y=j.slice(N,U);let ie="";for(let me=0;me<Y.length-1;me+=2)ie+=String.fromCharCode(Y[me]+Y[me+1]*256);return ie}e.prototype.slice=function(N,U){const Y=this.length;N=~~N,U=U===void 0?Y:~~U,N<0?(N+=Y,N<0&&(N=0)):N>Y&&(N=Y),U<0?(U+=Y,U<0&&(U=0)):U>Y&&(U=Y),U<N&&(U=N);const ie=this.subarray(N,U);return Object.setPrototypeOf(ie,e.prototype),ie};function ge(j,N,U){if(j%1!==0||j<0)throw new RangeError("offset is not uint");if(j+N>U)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(N,U,Y){N=N>>>0,U=U>>>0,Y||ge(N,U,this.length);let ie=this[N],me=1,fe=0;for(;++fe<U&&(me*=256);)ie+=this[N+fe]*me;return ie},e.prototype.readUintBE=e.prototype.readUIntBE=function(N,U,Y){N=N>>>0,U=U>>>0,Y||ge(N,U,this.length);let ie=this[N+--U],me=1;for(;U>0&&(me*=256);)ie+=this[N+--U]*me;return ie},e.prototype.readUint8=e.prototype.readUInt8=function(N,U){return N=N>>>0,U||ge(N,1,this.length),this[N]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(N,U){return N=N>>>0,U||ge(N,2,this.length),this[N]|this[N+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(N,U){return N=N>>>0,U||ge(N,2,this.length),this[N]<<8|this[N+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(N,U){return N=N>>>0,U||ge(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+this[N+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(N,U){return N=N>>>0,U||ge(N,4,this.length),this[N]*16777216+(this[N+1]<<16|this[N+2]<<8|this[N+3])},e.prototype.readBigUInt64LE=Ne(function(N){N=N>>>0,re(N,"offset");const U=this[N],Y=this[N+7];(U===void 0||Y===void 0)&&pe(N,this.length-8);const ie=U+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24,me=this[++N]+this[++N]*2**8+this[++N]*2**16+Y*2**24;return BigInt(ie)+(BigInt(me)<<BigInt(32))}),e.prototype.readBigUInt64BE=Ne(function(N){N=N>>>0,re(N,"offset");const U=this[N],Y=this[N+7];(U===void 0||Y===void 0)&&pe(N,this.length-8);const ie=U*2**24+this[++N]*2**16+this[++N]*2**8+this[++N],me=this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+Y;return(BigInt(ie)<<BigInt(32))+BigInt(me)}),e.prototype.readIntLE=function(N,U,Y){N=N>>>0,U=U>>>0,Y||ge(N,U,this.length);let ie=this[N],me=1,fe=0;for(;++fe<U&&(me*=256);)ie+=this[N+fe]*me;return me*=128,ie>=me&&(ie-=Math.pow(2,8*U)),ie},e.prototype.readIntBE=function(N,U,Y){N=N>>>0,U=U>>>0,Y||ge(N,U,this.length);let ie=U,me=1,fe=this[N+--ie];for(;ie>0&&(me*=256);)fe+=this[N+--ie]*me;return me*=128,fe>=me&&(fe-=Math.pow(2,8*U)),fe},e.prototype.readInt8=function(N,U){return N=N>>>0,U||ge(N,1,this.length),this[N]&128?(255-this[N]+1)*-1:this[N]},e.prototype.readInt16LE=function(N,U){N=N>>>0,U||ge(N,2,this.length);const Y=this[N]|this[N+1]<<8;return Y&32768?Y|4294901760:Y},e.prototype.readInt16BE=function(N,U){N=N>>>0,U||ge(N,2,this.length);const Y=this[N+1]|this[N]<<8;return Y&32768?Y|4294901760:Y},e.prototype.readInt32LE=function(N,U){return N=N>>>0,U||ge(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},e.prototype.readInt32BE=function(N,U){return N=N>>>0,U||ge(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},e.prototype.readBigInt64LE=Ne(function(N){N=N>>>0,re(N,"offset");const U=this[N],Y=this[N+7];(U===void 0||Y===void 0)&&pe(N,this.length-8);const ie=this[N+4]+this[N+5]*2**8+this[N+6]*2**16+(Y<<24);return(BigInt(ie)<<BigInt(32))+BigInt(U+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24)}),e.prototype.readBigInt64BE=Ne(function(N){N=N>>>0,re(N,"offset");const U=this[N],Y=this[N+7];(U===void 0||Y===void 0)&&pe(N,this.length-8);const ie=(U<<24)+this[++N]*2**16+this[++N]*2**8+this[++N];return(BigInt(ie)<<BigInt(32))+BigInt(this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+Y)}),e.prototype.readFloatLE=function(N,U){return N=N>>>0,U||ge(N,4,this.length),q.read(this,N,!0,23,4)},e.prototype.readFloatBE=function(N,U){return N=N>>>0,U||ge(N,4,this.length),q.read(this,N,!1,23,4)},e.prototype.readDoubleLE=function(N,U){return N=N>>>0,U||ge(N,8,this.length),q.read(this,N,!0,52,8)},e.prototype.readDoubleBE=function(N,U){return N=N>>>0,U||ge(N,8,this.length),q.read(this,N,!1,52,8)};function De(j,N,U,Y,ie,me){if(!e.isBuffer(j))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>ie||N<me)throw new RangeError('"value" argument is out of bounds');if(U+Y>j.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(N,U,Y,ie){if(N=+N,U=U>>>0,Y=Y>>>0,!ie){const xe=Math.pow(2,8*Y)-1;De(this,N,U,Y,xe,0)}let me=1,fe=0;for(this[U]=N&255;++fe<Y&&(me*=256);)this[U+fe]=N/me&255;return U+Y},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(N,U,Y,ie){if(N=+N,U=U>>>0,Y=Y>>>0,!ie){const xe=Math.pow(2,8*Y)-1;De(this,N,U,Y,xe,0)}let me=Y-1,fe=1;for(this[U+me]=N&255;--me>=0&&(fe*=256);)this[U+me]=N/fe&255;return U+Y},e.prototype.writeUint8=e.prototype.writeUInt8=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,1,255,0),this[U]=N&255,U+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,2,65535,0),this[U]=N&255,this[U+1]=N>>>8,U+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,2,65535,0),this[U]=N>>>8,this[U+1]=N&255,U+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,4,4294967295,0),this[U+3]=N>>>24,this[U+2]=N>>>16,this[U+1]=N>>>8,this[U]=N&255,U+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,4,4294967295,0),this[U]=N>>>24,this[U+1]=N>>>16,this[U+2]=N>>>8,this[U+3]=N&255,U+4};function ve(j,N,U,Y,ie){W(N,Y,ie,j,U,7);let me=Number(N&BigInt(4294967295));j[U++]=me,me=me>>8,j[U++]=me,me=me>>8,j[U++]=me,me=me>>8,j[U++]=me;let fe=Number(N>>BigInt(32)&BigInt(4294967295));return j[U++]=fe,fe=fe>>8,j[U++]=fe,fe=fe>>8,j[U++]=fe,fe=fe>>8,j[U++]=fe,U}function _e(j,N,U,Y,ie){W(N,Y,ie,j,U,7);let me=Number(N&BigInt(4294967295));j[U+7]=me,me=me>>8,j[U+6]=me,me=me>>8,j[U+5]=me,me=me>>8,j[U+4]=me;let fe=Number(N>>BigInt(32)&BigInt(4294967295));return j[U+3]=fe,fe=fe>>8,j[U+2]=fe,fe=fe>>8,j[U+1]=fe,fe=fe>>8,j[U]=fe,U+8}e.prototype.writeBigUInt64LE=Ne(function(N,U=0){return ve(this,N,U,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=Ne(function(N,U=0){return _e(this,N,U,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(N,U,Y,ie){if(N=+N,U=U>>>0,!ie){const Ve=Math.pow(2,8*Y-1);De(this,N,U,Y,Ve-1,-Ve)}let me=0,fe=1,xe=0;for(this[U]=N&255;++me<Y&&(fe*=256);)N<0&&xe===0&&this[U+me-1]!==0&&(xe=1),this[U+me]=(N/fe>>0)-xe&255;return U+Y},e.prototype.writeIntBE=function(N,U,Y,ie){if(N=+N,U=U>>>0,!ie){const Ve=Math.pow(2,8*Y-1);De(this,N,U,Y,Ve-1,-Ve)}let me=Y-1,fe=1,xe=0;for(this[U+me]=N&255;--me>=0&&(fe*=256);)N<0&&xe===0&&this[U+me+1]!==0&&(xe=1),this[U+me]=(N/fe>>0)-xe&255;return U+Y},e.prototype.writeInt8=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,1,127,-128),N<0&&(N=255+N+1),this[U]=N&255,U+1},e.prototype.writeInt16LE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,2,32767,-32768),this[U]=N&255,this[U+1]=N>>>8,U+2},e.prototype.writeInt16BE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,2,32767,-32768),this[U]=N>>>8,this[U+1]=N&255,U+2},e.prototype.writeInt32LE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,4,2147483647,-2147483648),this[U]=N&255,this[U+1]=N>>>8,this[U+2]=N>>>16,this[U+3]=N>>>24,U+4},e.prototype.writeInt32BE=function(N,U,Y){return N=+N,U=U>>>0,Y||De(this,N,U,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[U]=N>>>24,this[U+1]=N>>>16,this[U+2]=N>>>8,this[U+3]=N&255,U+4},e.prototype.writeBigInt64LE=Ne(function(N,U=0){return ve(this,N,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=Ne(function(N,U=0){return _e(this,N,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ge(j,N,U,Y,ie,me){if(U+Y>j.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function Se(j,N,U,Y,ie){return N=+N,U=U>>>0,ie||Ge(j,N,U,4),q.write(j,N,U,Y,23,4),U+4}e.prototype.writeFloatLE=function(N,U,Y){return Se(this,N,U,!0,Y)},e.prototype.writeFloatBE=function(N,U,Y){return Se(this,N,U,!1,Y)};function Oe(j,N,U,Y,ie){return N=+N,U=U>>>0,ie||Ge(j,N,U,8),q.write(j,N,U,Y,52,8),U+8}e.prototype.writeDoubleLE=function(N,U,Y){return Oe(this,N,U,!0,Y)},e.prototype.writeDoubleBE=function(N,U,Y){return Oe(this,N,U,!1,Y)},e.prototype.copy=function(N,U,Y,ie){if(!e.isBuffer(N))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!ie&&ie!==0&&(ie=this.length),U>=N.length&&(U=N.length),U||(U=0),ie>0&&ie<Y&&(ie=Y),ie===Y||N.length===0||this.length===0)return 0;if(U<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),N.length-U<ie-Y&&(ie=N.length-U+Y);const me=ie-Y;return this===N&&typeof ee.prototype.copyWithin=="function"?this.copyWithin(U,Y,ie):ee.prototype.set.call(N,this.subarray(Y,ie),U),me},e.prototype.fill=function(N,U,Y,ie){if(typeof N=="string"){if(typeof U=="string"?(ie=U,U=0,Y=this.length):typeof Y=="string"&&(ie=Y,Y=this.length),ie!==void 0&&typeof ie!="string")throw new TypeError("encoding must be a string");if(typeof ie=="string"&&!e.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);if(N.length===1){const fe=N.charCodeAt(0);(ie==="utf8"&&fe<128||ie==="latin1")&&(N=fe)}}else typeof N=="number"?N=N&255:typeof N=="boolean"&&(N=Number(N));if(U<0||this.length<U||this.length<Y)throw new RangeError("Out of range index");if(Y<=U)return this;U=U>>>0,Y=Y===void 0?this.length:Y>>>0,N||(N=0);let me;if(typeof N=="number")for(me=U;me<Y;++me)this[me]=N;else{const fe=e.isBuffer(N)?N:e.from(N,ie),xe=fe.length;if(xe===0)throw new TypeError('The value "'+N+'" is invalid for argument "value"');for(me=0;me<Y-U;++me)this[me+U]=fe[me%xe]}return this};const Ze={};function z(j,N,U){Ze[j]=class extends U{constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${j}]`,this.stack,delete this.name}get code(){return j}set code(ie){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ie,writable:!0})}toString(){return`${this.name} [${j}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(j){return j?`${j} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(j,N){return`The "${j}" argument must be of type number. Received type ${typeof N}`},TypeError),z("ERR_OUT_OF_RANGE",function(j,N,U){let Y=`The value of "${j}" is out of range.`,ie=U;return Number.isInteger(U)&&Math.abs(U)>2**32?ie=T(String(U)):typeof U=="bigint"&&(ie=String(U),(U>BigInt(2)**BigInt(32)||U<-(BigInt(2)**BigInt(32)))&&(ie=T(ie)),ie+="n"),Y+=` It must be ${N}. Received ${ie}`,Y},RangeError);function T(j){let N="",U=j.length;const Y=j[0]==="-"?1:0;for(;U>=Y+4;U-=3)N=`_${j.slice(U-3,U)}${N}`;return`${j.slice(0,U)}${N}`}function D(j,N,U){re(N,"offset"),(j[N]===void 0||j[N+U]===void 0)&&pe(N,j.length-(U+1))}function W(j,N,U,Y,ie,me){if(j>U||j<N){const fe=typeof N=="bigint"?"n":"";let xe;throw N===0||N===BigInt(0)?xe=`>= 0${fe} and < 2${fe} ** ${(me+1)*8}${fe}`:xe=`>= -(2${fe} ** ${(me+1)*8-1}${fe}) and < 2 ** ${(me+1)*8-1}${fe}`,new Ze.ERR_OUT_OF_RANGE("value",xe,j)}D(Y,ie,me)}function re(j,N){if(typeof j!="number")throw new Ze.ERR_INVALID_ARG_TYPE(N,"number",j)}function pe(j,N,U){throw Math.floor(j)!==j?(re(j,U),new Ze.ERR_OUT_OF_RANGE("offset","an integer",j)):N<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${N}`,j)}const ae=/[^+/0-9A-Za-z-_]/g;function Me(j){if(j=j.split("=")[0],j=j.trim().replace(ae,""),j.length<2)return"";for(;j.length%4!==0;)j=j+"=";return j}function ze(j,N){N=N||1/0;let U;const Y=j.length;let ie=null;const me=[];for(let fe=0;fe<Y;++fe){if(U=j.charCodeAt(fe),U>55295&&U<57344){if(!ie){if(U>56319){(N-=3)>-1&&me.push(239,191,189);continue}else if(fe+1===Y){(N-=3)>-1&&me.push(239,191,189);continue}ie=U;continue}if(U<56320){(N-=3)>-1&&me.push(239,191,189),ie=U;continue}U=(ie-55296<<10|U-56320)+65536}else ie&&(N-=3)>-1&&me.push(239,191,189);if(ie=null,U<128){if((N-=1)<0)break;me.push(U)}else if(U<2048){if((N-=2)<0)break;me.push(U>>6|192,U&63|128)}else if(U<65536){if((N-=3)<0)break;me.push(U>>12|224,U>>6&63|128,U&63|128)}else if(U<1114112){if((N-=4)<0)break;me.push(U>>18|240,U>>12&63|128,U>>6&63|128,U&63|128)}else throw new Error("Invalid code point")}return me}function ye(j){const N=[];for(let U=0;U<j.length;++U)N.push(j.charCodeAt(U)&255);return N}function Be(j,N){let U,Y,ie;const me=[];for(let fe=0;fe<j.length&&!((N-=2)<0);++fe)U=j.charCodeAt(fe),Y=U>>8,ie=U%256,me.push(ie),me.push(Y);return me}function He(j){return F.toByteArray(Me(j))}function Ae(j,N,U,Y){let ie;for(ie=0;ie<Y&&!(ie+U>=N.length||ie>=j.length);++ie)N[ie+U]=j[ie];return ie}function Te(j,N){return j instanceof N||j!=null&&j.constructor!=null&&j.constructor.name!=null&&j.constructor.name===N.name}function rt(j){return j!==j}const Ie=function(){const j="0123456789abcdef",N=new Array(256);for(let U=0;U<16;++U){const Y=U*16;for(let ie=0;ie<16;++ie)N[Y+ie]=j[U]+j[ie]}return N}();function Ne(j){return typeof BigInt>"u"?nt:j}function nt(){throw new Error("BigInt not supported")}})(a);const I=a.Buffer;M.Blob=a.Blob,M.BlobOptions=a.BlobOptions,M.Buffer=a.Buffer,M.File=a.File,M.FileOptions=a.FileOptions,M.INSPECT_MAX_BYTES=a.INSPECT_MAX_BYTES,M.SlowBuffer=a.SlowBuffer,M.TranscodeEncoding=a.TranscodeEncoding,M.atob=a.atob,M.btoa=a.btoa,M.constants=a.constants,M.default=I,M.isAscii=a.isAscii,M.isUtf8=a.isUtf8,M.kMaxLength=a.kMaxLength,M.kStringMaxLength=a.kStringMaxLength,M.resolveObjectURL=a.resolveObjectURL,M.transcode=a.transcode}(zi)),zi}var Jl=ri.exports,co;function er(){return co||(co=1,function(M){(function(a,c){function o(r,i){if(!r)throw new Error(i||"Assertion failed")}function x(r,i){r.super_=i;var f=function(){};f.prototype=i.prototype,r.prototype=new f,r.prototype.constructor=r}function n(r,i,f){if(n.isBN(r))return r;this.negative=0,this.words=null,this.length=0,this.red=null,r!==null&&((i==="le"||i==="be")&&(f=i,i=10),this._init(r||0,i||10,f||"be"))}typeof a=="object"?a.exports=n:c.BN=n,n.BN=n,n.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=Nt().Buffer}catch{}n.isBN=function(i){return i instanceof n?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===n.wordSize&&Array.isArray(i.words)},n.max=function(i,f){return i.cmp(f)>0?i:f},n.min=function(i,f){return i.cmp(f)<0?i:f},n.prototype._init=function(i,f,h){if(typeof i=="number")return this._initNumber(i,f,h);if(typeof i=="object")return this._initArray(i,f,h);f==="hex"&&(f=16),o(f===(f|0)&&f>=2&&f<=36),i=i.toString().replace(/\s+/g,"");var l=0;i[0]==="-"&&(l++,this.negative=1),l<i.length&&(f===16?this._parseHex(i,l,h):(this._parseBase(i,f,l),h==="le"&&this._initArray(this.toArray(),f,h)))},n.prototype._initNumber=function(i,f,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(o(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},n.prototype._initArray=function(i,f,h){if(o(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var p,s,t=0;if(h==="be")for(l=i.length-1,p=0;l>=0;l-=3)s=i[l]|i[l-1]<<8|i[l-2]<<16,this.words[p]|=s<<t&67108863,this.words[p+1]=s>>>26-t&67108863,t+=24,t>=26&&(t-=26,p++);else if(h==="le")for(l=0,p=0;l<i.length;l+=3)s=i[l]|i[l+1]<<8|i[l+2]<<16,this.words[p]|=s<<t&67108863,this.words[p+1]=s>>>26-t&67108863,t+=24,t>=26&&(t-=26,p++);return this._strip()};function y(r,i){var f=r.charCodeAt(i);if(f>=48&&f<=57)return f-48;if(f>=65&&f<=70)return f-55;if(f>=97&&f<=102)return f-87;o(!1,"Invalid character in "+r)}function b(r,i,f){var h=y(r,f);return f-1>=i&&(h|=y(r,f-1)<<4),h}n.prototype._parseHex=function(i,f,h){this.length=Math.ceil((i.length-f)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var p=0,s=0,t;if(h==="be")for(l=i.length-1;l>=f;l-=2)t=b(i,f,l)<<p,this.words[s]|=t&67108863,p>=18?(p-=18,s+=1,this.words[s]|=t>>>26):p+=8;else{var u=i.length-f;for(l=u%2===0?f+1:f;l<i.length;l+=2)t=b(i,f,l)<<p,this.words[s]|=t&67108863,p>=18?(p-=18,s+=1,this.words[s]|=t>>>26):p+=8}this._strip()};function v(r,i,f,h){for(var l=0,p=0,s=Math.min(r.length,f),t=i;t<s;t++){var u=r.charCodeAt(t)-48;l*=h,u>=49?p=u-49+10:u>=17?p=u-17+10:p=u,o(u>=0&&p<h,"Invalid character"),l+=p}return l}n.prototype._parseBase=function(i,f,h){this.words=[0],this.length=1;for(var l=0,p=1;p<=67108863;p*=f)l++;l--,p=p/f|0;for(var s=i.length-h,t=s%l,u=Math.min(s,s-t)+h,S=0,O=h;O<u;O+=l)S=v(i,O,O+l,f),this.imuln(p),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S);if(t!==0){var H=1;for(S=v(i,O,i.length,f),O=0;O<t;O++)H*=f;this.imuln(H),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S)}this._strip()},n.prototype.copy=function(i){i.words=new Array(this.length);for(var f=0;f<this.length;f++)i.words[f]=this.words[f];i.length=this.length,i.negative=this.negative,i.red=this.red};function d(r,i){r.words=i.words,r.length=i.length,r.negative=i.negative,r.red=i.red}if(n.prototype._move=function(i){d(i,this)},n.prototype.clone=function(){var i=new n(null);return this.copy(i),i},n.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{n.prototype.inspect=w}else n.prototype.inspect=w;function w(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var _=["","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"],E=[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],B=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(i,f){i=i||10,f=f|0||1;var h;if(i===16||i==="hex"){h="";for(var l=0,p=0,s=0;s<this.length;s++){var t=this.words[s],u=((t<<l|p)&16777215).toString(16);p=t>>>24-l&16777215,l+=2,l>=26&&(l-=26,s--),p!==0||s!==this.length-1?h=_[6-u.length]+u+h:h=u+h}for(p!==0&&(h=p.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var S=E[i],O=B[i];h="";var H=this.clone();for(H.negative=0;!H.isZero();){var Q=H.modrn(O).toString(i);H=H.idivn(O),H.isZero()?h=Q+h:h=_[S-Q.length]+Q+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},n.prototype.toJSON=function(){return this.toString(16,2)},g&&(n.prototype.toBuffer=function(i,f){return this.toArrayLike(g,i,f)}),n.prototype.toArray=function(i,f){return this.toArrayLike(Array,i,f)};var A=function(i,f){return i.allocUnsafe?i.allocUnsafe(f):new i(f)};n.prototype.toArrayLike=function(i,f,h){this._strip();var l=this.byteLength(),p=h||Math.max(1,l);o(l<=p,"byte array longer than desired length"),o(p>0,"Requested array length <= 0");var s=A(i,p),t=f==="le"?"LE":"BE";return this["_toArrayLike"+t](s,l),s},n.prototype._toArrayLikeLE=function(i,f){for(var h=0,l=0,p=0,s=0;p<this.length;p++){var t=this.words[p]<<s|l;i[h++]=t&255,h<i.length&&(i[h++]=t>>8&255),h<i.length&&(i[h++]=t>>16&255),s===6?(h<i.length&&(i[h++]=t>>24&255),l=0,s=0):(l=t>>>24,s+=2)}if(h<i.length)for(i[h++]=l;h<i.length;)i[h++]=0},n.prototype._toArrayLikeBE=function(i,f){for(var h=i.length-1,l=0,p=0,s=0;p<this.length;p++){var t=this.words[p]<<s|l;i[h--]=t&255,h>=0&&(i[h--]=t>>8&255),h>=0&&(i[h--]=t>>16&255),s===6?(h>=0&&(i[h--]=t>>24&255),l=0,s=0):(l=t>>>24,s+=2)}if(h>=0)for(i[h--]=l;h>=0;)i[h--]=0},Math.clz32?n.prototype._countBits=function(i){return 32-Math.clz32(i)}:n.prototype._countBits=function(i){var f=i,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},n.prototype._zeroBits=function(i){if(i===0)return 26;var f=i,h=0;return(f&8191)===0&&(h+=13,f>>>=13),(f&127)===0&&(h+=7,f>>>=7),(f&15)===0&&(h+=4,f>>>=4),(f&3)===0&&(h+=2,f>>>=2),(f&1)===0&&h++,h},n.prototype.bitLength=function(){var i=this.words[this.length-1],f=this._countBits(i);return(this.length-1)*26+f};function P(r){for(var i=new Array(r.bitLength()),f=0;f<i.length;f++){var h=f/26|0,l=f%26;i[f]=r.words[h]>>>l&1}return i}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(i+=h,h!==26)break}return i},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},n.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var f=0;f<i.length;f++)this.words[f]=this.words[f]|i.words[f];return this._strip()},n.prototype.ior=function(i){return o((this.negative|i.negative)===0),this.iuor(i)},n.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},n.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},n.prototype.iuand=function(i){var f;this.length>i.length?f=i:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=f.length,this._strip()},n.prototype.iand=function(i){return o((this.negative|i.negative)===0),this.iuand(i)},n.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},n.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},n.prototype.iuxor=function(i){var f,h;this.length>i.length?(f=this,h=i):(f=i,h=this);for(var l=0;l<h.length;l++)this.words[l]=f.words[l]^h.words[l];if(this!==f)for(;l<f.length;l++)this.words[l]=f.words[l];return this.length=f.length,this._strip()},n.prototype.ixor=function(i){return o((this.negative|i.negative)===0),this.iuxor(i)},n.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},n.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},n.prototype.inotn=function(i){o(typeof i=="number"&&i>=0);var f=Math.ceil(i/26)|0,h=i%26;this._expand(f),h>0&&f--;for(var l=0;l<f;l++)this.words[l]=~this.words[l]&67108863;return h>0&&(this.words[l]=~this.words[l]&67108863>>26-h),this._strip()},n.prototype.notn=function(i){return this.clone().inotn(i)},n.prototype.setn=function(i,f){o(typeof i=="number"&&i>=0);var h=i/26|0,l=i%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<l:this.words[h]=this.words[h]&~(1<<l),this._strip()},n.prototype.iadd=function(i){var f;if(this.negative!==0&&i.negative===0)return this.negative=0,f=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,f=this.isub(i),i.negative=1,f._normSign();var h,l;this.length>i.length?(h=this,l=i):(h=i,l=this);for(var p=0,s=0;s<l.length;s++)f=(h.words[s]|0)+(l.words[s]|0)+p,this.words[s]=f&67108863,p=f>>>26;for(;p!==0&&s<h.length;s++)f=(h.words[s]|0)+p,this.words[s]=f&67108863,p=f>>>26;if(this.length=h.length,p!==0)this.words[this.length]=p,this.length++;else if(h!==this)for(;s<h.length;s++)this.words[s]=h.words[s];return this},n.prototype.add=function(i){var f;return i.negative!==0&&this.negative===0?(i.negative=0,f=this.sub(i),i.negative^=1,f):i.negative===0&&this.negative!==0?(this.negative=0,f=i.sub(this),this.negative=1,f):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},n.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var f=this.iadd(i);return i.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,p;h>0?(l=this,p=i):(l=i,p=this);for(var s=0,t=0;t<p.length;t++)f=(l.words[t]|0)-(p.words[t]|0)+s,s=f>>26,this.words[t]=f&67108863;for(;s!==0&&t<l.length;t++)f=(l.words[t]|0)+s,s=f>>26,this.words[t]=f&67108863;if(s===0&&t<l.length&&l!==this)for(;t<l.length;t++)this.words[t]=l.words[t];return this.length=Math.max(this.length,t),l!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(i){return this.clone().isub(i)};function I(r,i,f){f.negative=i.negative^r.negative;var h=r.length+i.length|0;f.length=h,h=h-1|0;var l=r.words[0]|0,p=i.words[0]|0,s=l*p,t=s&67108863,u=s/67108864|0;f.words[0]=t;for(var S=1;S<h;S++){for(var O=u>>>26,H=u&67108863,Q=Math.min(S,i.length-1),G=Math.max(0,S-r.length+1);G<=Q;G++){var R=S-G|0;l=r.words[R]|0,p=i.words[G]|0,s=l*p+H,O+=s/67108864|0,H=s&67108863}f.words[S]=H|0,u=O|0}return u!==0?f.words[S]=u|0:f.length--,f._strip()}var k=function(i,f,h){var l=i.words,p=f.words,s=h.words,t=0,u,S,O,H=l[0]|0,Q=H&8191,G=H>>>13,R=l[1]|0,C=R&8191,$=R>>>13,X=l[2]|0,Z=X&8191,K=X>>>13,te=l[3]|0,Pe=te&8191,le=te>>>13,ce=l[4]|0,Le=ce&8191,be=ce>>>13,se=l[5]|0,Ue=se&8191,de=se>>>13,ge=l[6]|0,De=ge&8191,ve=ge>>>13,_e=l[7]|0,Ge=_e&8191,Se=_e>>>13,Oe=l[8]|0,Ze=Oe&8191,z=Oe>>>13,T=l[9]|0,D=T&8191,W=T>>>13,re=p[0]|0,pe=re&8191,ae=re>>>13,Me=p[1]|0,ze=Me&8191,ye=Me>>>13,Be=p[2]|0,He=Be&8191,Ae=Be>>>13,Te=p[3]|0,rt=Te&8191,Ie=Te>>>13,Ne=p[4]|0,nt=Ne&8191,j=Ne>>>13,N=p[5]|0,U=N&8191,Y=N>>>13,ie=p[6]|0,me=ie&8191,fe=ie>>>13,xe=p[7]|0,Ve=xe&8191,we=xe>>>13,Re=p[8]|0,Ke=Re&8191,ke=Re>>>13,Ce=p[9]|0,Xe=Ce&8191,Qe=Ce>>>13;h.negative=i.negative^f.negative,h.length=19,u=Math.imul(Q,pe),S=Math.imul(Q,ae),S=S+Math.imul(G,pe)|0,O=Math.imul(G,ae);var lt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(lt>>>26)|0,lt&=67108863,u=Math.imul(C,pe),S=Math.imul(C,ae),S=S+Math.imul($,pe)|0,O=Math.imul($,ae),u=u+Math.imul(Q,ze)|0,S=S+Math.imul(Q,ye)|0,S=S+Math.imul(G,ze)|0,O=O+Math.imul(G,ye)|0;var dt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(dt>>>26)|0,dt&=67108863,u=Math.imul(Z,pe),S=Math.imul(Z,ae),S=S+Math.imul(K,pe)|0,O=Math.imul(K,ae),u=u+Math.imul(C,ze)|0,S=S+Math.imul(C,ye)|0,S=S+Math.imul($,ze)|0,O=O+Math.imul($,ye)|0,u=u+Math.imul(Q,He)|0,S=S+Math.imul(Q,Ae)|0,S=S+Math.imul(G,He)|0,O=O+Math.imul(G,Ae)|0;var pt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(pt>>>26)|0,pt&=67108863,u=Math.imul(Pe,pe),S=Math.imul(Pe,ae),S=S+Math.imul(le,pe)|0,O=Math.imul(le,ae),u=u+Math.imul(Z,ze)|0,S=S+Math.imul(Z,ye)|0,S=S+Math.imul(K,ze)|0,O=O+Math.imul(K,ye)|0,u=u+Math.imul(C,He)|0,S=S+Math.imul(C,Ae)|0,S=S+Math.imul($,He)|0,O=O+Math.imul($,Ae)|0,u=u+Math.imul(Q,rt)|0,S=S+Math.imul(Q,Ie)|0,S=S+Math.imul(G,rt)|0,O=O+Math.imul(G,Ie)|0;var vt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(vt>>>26)|0,vt&=67108863,u=Math.imul(Le,pe),S=Math.imul(Le,ae),S=S+Math.imul(be,pe)|0,O=Math.imul(be,ae),u=u+Math.imul(Pe,ze)|0,S=S+Math.imul(Pe,ye)|0,S=S+Math.imul(le,ze)|0,O=O+Math.imul(le,ye)|0,u=u+Math.imul(Z,He)|0,S=S+Math.imul(Z,Ae)|0,S=S+Math.imul(K,He)|0,O=O+Math.imul(K,Ae)|0,u=u+Math.imul(C,rt)|0,S=S+Math.imul(C,Ie)|0,S=S+Math.imul($,rt)|0,O=O+Math.imul($,Ie)|0,u=u+Math.imul(Q,nt)|0,S=S+Math.imul(Q,j)|0,S=S+Math.imul(G,nt)|0,O=O+Math.imul(G,j)|0;var mt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(mt>>>26)|0,mt&=67108863,u=Math.imul(Ue,pe),S=Math.imul(Ue,ae),S=S+Math.imul(de,pe)|0,O=Math.imul(de,ae),u=u+Math.imul(Le,ze)|0,S=S+Math.imul(Le,ye)|0,S=S+Math.imul(be,ze)|0,O=O+Math.imul(be,ye)|0,u=u+Math.imul(Pe,He)|0,S=S+Math.imul(Pe,Ae)|0,S=S+Math.imul(le,He)|0,O=O+Math.imul(le,Ae)|0,u=u+Math.imul(Z,rt)|0,S=S+Math.imul(Z,Ie)|0,S=S+Math.imul(K,rt)|0,O=O+Math.imul(K,Ie)|0,u=u+Math.imul(C,nt)|0,S=S+Math.imul(C,j)|0,S=S+Math.imul($,nt)|0,O=O+Math.imul($,j)|0,u=u+Math.imul(Q,U)|0,S=S+Math.imul(Q,Y)|0,S=S+Math.imul(G,U)|0,O=O+Math.imul(G,Y)|0;var bt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(bt>>>26)|0,bt&=67108863,u=Math.imul(De,pe),S=Math.imul(De,ae),S=S+Math.imul(ve,pe)|0,O=Math.imul(ve,ae),u=u+Math.imul(Ue,ze)|0,S=S+Math.imul(Ue,ye)|0,S=S+Math.imul(de,ze)|0,O=O+Math.imul(de,ye)|0,u=u+Math.imul(Le,He)|0,S=S+Math.imul(Le,Ae)|0,S=S+Math.imul(be,He)|0,O=O+Math.imul(be,Ae)|0,u=u+Math.imul(Pe,rt)|0,S=S+Math.imul(Pe,Ie)|0,S=S+Math.imul(le,rt)|0,O=O+Math.imul(le,Ie)|0,u=u+Math.imul(Z,nt)|0,S=S+Math.imul(Z,j)|0,S=S+Math.imul(K,nt)|0,O=O+Math.imul(K,j)|0,u=u+Math.imul(C,U)|0,S=S+Math.imul(C,Y)|0,S=S+Math.imul($,U)|0,O=O+Math.imul($,Y)|0,u=u+Math.imul(Q,me)|0,S=S+Math.imul(Q,fe)|0,S=S+Math.imul(G,me)|0,O=O+Math.imul(G,fe)|0;var gt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(gt>>>26)|0,gt&=67108863,u=Math.imul(Ge,pe),S=Math.imul(Ge,ae),S=S+Math.imul(Se,pe)|0,O=Math.imul(Se,ae),u=u+Math.imul(De,ze)|0,S=S+Math.imul(De,ye)|0,S=S+Math.imul(ve,ze)|0,O=O+Math.imul(ve,ye)|0,u=u+Math.imul(Ue,He)|0,S=S+Math.imul(Ue,Ae)|0,S=S+Math.imul(de,He)|0,O=O+Math.imul(de,Ae)|0,u=u+Math.imul(Le,rt)|0,S=S+Math.imul(Le,Ie)|0,S=S+Math.imul(be,rt)|0,O=O+Math.imul(be,Ie)|0,u=u+Math.imul(Pe,nt)|0,S=S+Math.imul(Pe,j)|0,S=S+Math.imul(le,nt)|0,O=O+Math.imul(le,j)|0,u=u+Math.imul(Z,U)|0,S=S+Math.imul(Z,Y)|0,S=S+Math.imul(K,U)|0,O=O+Math.imul(K,Y)|0,u=u+Math.imul(C,me)|0,S=S+Math.imul(C,fe)|0,S=S+Math.imul($,me)|0,O=O+Math.imul($,fe)|0,u=u+Math.imul(Q,Ve)|0,S=S+Math.imul(Q,we)|0,S=S+Math.imul(G,Ve)|0,O=O+Math.imul(G,we)|0;var yt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(yt>>>26)|0,yt&=67108863,u=Math.imul(Ze,pe),S=Math.imul(Ze,ae),S=S+Math.imul(z,pe)|0,O=Math.imul(z,ae),u=u+Math.imul(Ge,ze)|0,S=S+Math.imul(Ge,ye)|0,S=S+Math.imul(Se,ze)|0,O=O+Math.imul(Se,ye)|0,u=u+Math.imul(De,He)|0,S=S+Math.imul(De,Ae)|0,S=S+Math.imul(ve,He)|0,O=O+Math.imul(ve,Ae)|0,u=u+Math.imul(Ue,rt)|0,S=S+Math.imul(Ue,Ie)|0,S=S+Math.imul(de,rt)|0,O=O+Math.imul(de,Ie)|0,u=u+Math.imul(Le,nt)|0,S=S+Math.imul(Le,j)|0,S=S+Math.imul(be,nt)|0,O=O+Math.imul(be,j)|0,u=u+Math.imul(Pe,U)|0,S=S+Math.imul(Pe,Y)|0,S=S+Math.imul(le,U)|0,O=O+Math.imul(le,Y)|0,u=u+Math.imul(Z,me)|0,S=S+Math.imul(Z,fe)|0,S=S+Math.imul(K,me)|0,O=O+Math.imul(K,fe)|0,u=u+Math.imul(C,Ve)|0,S=S+Math.imul(C,we)|0,S=S+Math.imul($,Ve)|0,O=O+Math.imul($,we)|0,u=u+Math.imul(Q,Ke)|0,S=S+Math.imul(Q,ke)|0,S=S+Math.imul(G,Ke)|0,O=O+Math.imul(G,ke)|0;var wt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(wt>>>26)|0,wt&=67108863,u=Math.imul(D,pe),S=Math.imul(D,ae),S=S+Math.imul(W,pe)|0,O=Math.imul(W,ae),u=u+Math.imul(Ze,ze)|0,S=S+Math.imul(Ze,ye)|0,S=S+Math.imul(z,ze)|0,O=O+Math.imul(z,ye)|0,u=u+Math.imul(Ge,He)|0,S=S+Math.imul(Ge,Ae)|0,S=S+Math.imul(Se,He)|0,O=O+Math.imul(Se,Ae)|0,u=u+Math.imul(De,rt)|0,S=S+Math.imul(De,Ie)|0,S=S+Math.imul(ve,rt)|0,O=O+Math.imul(ve,Ie)|0,u=u+Math.imul(Ue,nt)|0,S=S+Math.imul(Ue,j)|0,S=S+Math.imul(de,nt)|0,O=O+Math.imul(de,j)|0,u=u+Math.imul(Le,U)|0,S=S+Math.imul(Le,Y)|0,S=S+Math.imul(be,U)|0,O=O+Math.imul(be,Y)|0,u=u+Math.imul(Pe,me)|0,S=S+Math.imul(Pe,fe)|0,S=S+Math.imul(le,me)|0,O=O+Math.imul(le,fe)|0,u=u+Math.imul(Z,Ve)|0,S=S+Math.imul(Z,we)|0,S=S+Math.imul(K,Ve)|0,O=O+Math.imul(K,we)|0,u=u+Math.imul(C,Ke)|0,S=S+Math.imul(C,ke)|0,S=S+Math.imul($,Ke)|0,O=O+Math.imul($,ke)|0,u=u+Math.imul(Q,Xe)|0,S=S+Math.imul(Q,Qe)|0,S=S+Math.imul(G,Xe)|0,O=O+Math.imul(G,Qe)|0;var Mt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,u=Math.imul(D,ze),S=Math.imul(D,ye),S=S+Math.imul(W,ze)|0,O=Math.imul(W,ye),u=u+Math.imul(Ze,He)|0,S=S+Math.imul(Ze,Ae)|0,S=S+Math.imul(z,He)|0,O=O+Math.imul(z,Ae)|0,u=u+Math.imul(Ge,rt)|0,S=S+Math.imul(Ge,Ie)|0,S=S+Math.imul(Se,rt)|0,O=O+Math.imul(Se,Ie)|0,u=u+Math.imul(De,nt)|0,S=S+Math.imul(De,j)|0,S=S+Math.imul(ve,nt)|0,O=O+Math.imul(ve,j)|0,u=u+Math.imul(Ue,U)|0,S=S+Math.imul(Ue,Y)|0,S=S+Math.imul(de,U)|0,O=O+Math.imul(de,Y)|0,u=u+Math.imul(Le,me)|0,S=S+Math.imul(Le,fe)|0,S=S+Math.imul(be,me)|0,O=O+Math.imul(be,fe)|0,u=u+Math.imul(Pe,Ve)|0,S=S+Math.imul(Pe,we)|0,S=S+Math.imul(le,Ve)|0,O=O+Math.imul(le,we)|0,u=u+Math.imul(Z,Ke)|0,S=S+Math.imul(Z,ke)|0,S=S+Math.imul(K,Ke)|0,O=O+Math.imul(K,ke)|0,u=u+Math.imul(C,Xe)|0,S=S+Math.imul(C,Qe)|0,S=S+Math.imul($,Xe)|0,O=O+Math.imul($,Qe)|0;var xt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(xt>>>26)|0,xt&=67108863,u=Math.imul(D,He),S=Math.imul(D,Ae),S=S+Math.imul(W,He)|0,O=Math.imul(W,Ae),u=u+Math.imul(Ze,rt)|0,S=S+Math.imul(Ze,Ie)|0,S=S+Math.imul(z,rt)|0,O=O+Math.imul(z,Ie)|0,u=u+Math.imul(Ge,nt)|0,S=S+Math.imul(Ge,j)|0,S=S+Math.imul(Se,nt)|0,O=O+Math.imul(Se,j)|0,u=u+Math.imul(De,U)|0,S=S+Math.imul(De,Y)|0,S=S+Math.imul(ve,U)|0,O=O+Math.imul(ve,Y)|0,u=u+Math.imul(Ue,me)|0,S=S+Math.imul(Ue,fe)|0,S=S+Math.imul(de,me)|0,O=O+Math.imul(de,fe)|0,u=u+Math.imul(Le,Ve)|0,S=S+Math.imul(Le,we)|0,S=S+Math.imul(be,Ve)|0,O=O+Math.imul(be,we)|0,u=u+Math.imul(Pe,Ke)|0,S=S+Math.imul(Pe,ke)|0,S=S+Math.imul(le,Ke)|0,O=O+Math.imul(le,ke)|0,u=u+Math.imul(Z,Xe)|0,S=S+Math.imul(Z,Qe)|0,S=S+Math.imul(K,Xe)|0,O=O+Math.imul(K,Qe)|0;var _t=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(_t>>>26)|0,_t&=67108863,u=Math.imul(D,rt),S=Math.imul(D,Ie),S=S+Math.imul(W,rt)|0,O=Math.imul(W,Ie),u=u+Math.imul(Ze,nt)|0,S=S+Math.imul(Ze,j)|0,S=S+Math.imul(z,nt)|0,O=O+Math.imul(z,j)|0,u=u+Math.imul(Ge,U)|0,S=S+Math.imul(Ge,Y)|0,S=S+Math.imul(Se,U)|0,O=O+Math.imul(Se,Y)|0,u=u+Math.imul(De,me)|0,S=S+Math.imul(De,fe)|0,S=S+Math.imul(ve,me)|0,O=O+Math.imul(ve,fe)|0,u=u+Math.imul(Ue,Ve)|0,S=S+Math.imul(Ue,we)|0,S=S+Math.imul(de,Ve)|0,O=O+Math.imul(de,we)|0,u=u+Math.imul(Le,Ke)|0,S=S+Math.imul(Le,ke)|0,S=S+Math.imul(be,Ke)|0,O=O+Math.imul(be,ke)|0,u=u+Math.imul(Pe,Xe)|0,S=S+Math.imul(Pe,Qe)|0,S=S+Math.imul(le,Xe)|0,O=O+Math.imul(le,Qe)|0;var St=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(St>>>26)|0,St&=67108863,u=Math.imul(D,nt),S=Math.imul(D,j),S=S+Math.imul(W,nt)|0,O=Math.imul(W,j),u=u+Math.imul(Ze,U)|0,S=S+Math.imul(Ze,Y)|0,S=S+Math.imul(z,U)|0,O=O+Math.imul(z,Y)|0,u=u+Math.imul(Ge,me)|0,S=S+Math.imul(Ge,fe)|0,S=S+Math.imul(Se,me)|0,O=O+Math.imul(Se,fe)|0,u=u+Math.imul(De,Ve)|0,S=S+Math.imul(De,we)|0,S=S+Math.imul(ve,Ve)|0,O=O+Math.imul(ve,we)|0,u=u+Math.imul(Ue,Ke)|0,S=S+Math.imul(Ue,ke)|0,S=S+Math.imul(de,Ke)|0,O=O+Math.imul(de,ke)|0,u=u+Math.imul(Le,Xe)|0,S=S+Math.imul(Le,Qe)|0,S=S+Math.imul(be,Xe)|0,O=O+Math.imul(be,Qe)|0;var Et=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(Et>>>26)|0,Et&=67108863,u=Math.imul(D,U),S=Math.imul(D,Y),S=S+Math.imul(W,U)|0,O=Math.imul(W,Y),u=u+Math.imul(Ze,me)|0,S=S+Math.imul(Ze,fe)|0,S=S+Math.imul(z,me)|0,O=O+Math.imul(z,fe)|0,u=u+Math.imul(Ge,Ve)|0,S=S+Math.imul(Ge,we)|0,S=S+Math.imul(Se,Ve)|0,O=O+Math.imul(Se,we)|0,u=u+Math.imul(De,Ke)|0,S=S+Math.imul(De,ke)|0,S=S+Math.imul(ve,Ke)|0,O=O+Math.imul(ve,ke)|0,u=u+Math.imul(Ue,Xe)|0,S=S+Math.imul(Ue,Qe)|0,S=S+Math.imul(de,Xe)|0,O=O+Math.imul(de,Qe)|0;var Bt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u=Math.imul(D,me),S=Math.imul(D,fe),S=S+Math.imul(W,me)|0,O=Math.imul(W,fe),u=u+Math.imul(Ze,Ve)|0,S=S+Math.imul(Ze,we)|0,S=S+Math.imul(z,Ve)|0,O=O+Math.imul(z,we)|0,u=u+Math.imul(Ge,Ke)|0,S=S+Math.imul(Ge,ke)|0,S=S+Math.imul(Se,Ke)|0,O=O+Math.imul(Se,ke)|0,u=u+Math.imul(De,Xe)|0,S=S+Math.imul(De,Qe)|0,S=S+Math.imul(ve,Xe)|0,O=O+Math.imul(ve,Qe)|0;var At=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(At>>>26)|0,At&=67108863,u=Math.imul(D,Ve),S=Math.imul(D,we),S=S+Math.imul(W,Ve)|0,O=Math.imul(W,we),u=u+Math.imul(Ze,Ke)|0,S=S+Math.imul(Ze,ke)|0,S=S+Math.imul(z,Ke)|0,O=O+Math.imul(z,ke)|0,u=u+Math.imul(Ge,Xe)|0,S=S+Math.imul(Ge,Qe)|0,S=S+Math.imul(Se,Xe)|0,O=O+Math.imul(Se,Qe)|0;var Rt=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u=Math.imul(D,Ke),S=Math.imul(D,ke),S=S+Math.imul(W,Ke)|0,O=Math.imul(W,ke),u=u+Math.imul(Ze,Xe)|0,S=S+Math.imul(Ze,Qe)|0,S=S+Math.imul(z,Xe)|0,O=O+Math.imul(z,Qe)|0;var so=(t+u|0)+((S&8191)<<13)|0;t=(O+(S>>>13)|0)+(so>>>26)|0,so&=67108863,u=Math.imul(D,Xe),S=Math.imul(D,Qe),S=S+Math.imul(W,Xe)|0,O=Math.imul(W,Qe);var oo=(t+u|0)+((S&8191)<<13)|0;return t=(O+(S>>>13)|0)+(oo>>>26)|0,oo&=67108863,s[0]=lt,s[1]=dt,s[2]=pt,s[3]=vt,s[4]=mt,s[5]=bt,s[6]=gt,s[7]=yt,s[8]=wt,s[9]=Mt,s[10]=xt,s[11]=_t,s[12]=St,s[13]=Et,s[14]=Bt,s[15]=At,s[16]=Rt,s[17]=so,s[18]=oo,t!==0&&(s[19]=t,h.length++),h};Math.imul||(k=I);function F(r,i,f){f.negative=i.negative^r.negative,f.length=r.length+i.length;for(var h=0,l=0,p=0;p<f.length-1;p++){var s=l;l=0;for(var t=h&67108863,u=Math.min(p,i.length-1),S=Math.max(0,p-r.length+1);S<=u;S++){var O=p-S,H=r.words[O]|0,Q=i.words[S]|0,G=H*Q,R=G&67108863;s=s+(G/67108864|0)|0,R=R+t|0,t=R&67108863,s=s+(R>>>26)|0,l+=s>>>26,s&=67108863}f.words[p]=t,h=s,s=l}return h!==0?f.words[p]=h:f.length--,f._strip()}function q(r,i,f){return F(r,i,f)}n.prototype.mulTo=function(i,f){var h,l=this.length+i.length;return this.length===10&&i.length===10?h=k(this,i,f):l<63?h=I(this,i,f):l<1024?h=F(this,i,f):h=q(this,i,f),h},n.prototype.mul=function(i){var f=new n(null);return f.words=new Array(this.length+i.length),this.mulTo(i,f)},n.prototype.mulf=function(i){var f=new n(null);return f.words=new Array(this.length+i.length),q(this,i,f)},n.prototype.imul=function(i){return this.clone().mulTo(i,this)},n.prototype.imuln=function(i){var f=i<0;f&&(i=-i),o(typeof i=="number"),o(i<67108864);for(var h=0,l=0;l<this.length;l++){var p=(this.words[l]|0)*i,s=(p&67108863)+(h&67108863);h>>=26,h+=p/67108864|0,h+=s>>>26,this.words[l]=s&67108863}return h!==0&&(this.words[l]=h,this.length++),f?this.ineg():this},n.prototype.muln=function(i){return this.clone().imuln(i)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(i){var f=P(i);if(f.length===0)return new n(1);for(var h=this,l=0;l<f.length&&f[l]===0;l++,h=h.sqr());if(++l<f.length)for(var p=h.sqr();l<f.length;l++,p=p.sqr())f[l]!==0&&(h=h.mul(p));return h},n.prototype.iushln=function(i){o(typeof i=="number"&&i>=0);var f=i%26,h=(i-f)/26,l=67108863>>>26-f<<26-f,p;if(f!==0){var s=0;for(p=0;p<this.length;p++){var t=this.words[p]&l,u=(this.words[p]|0)-t<<f;this.words[p]=u|s,s=t>>>26-f}s&&(this.words[p]=s,this.length++)}if(h!==0){for(p=this.length-1;p>=0;p--)this.words[p+h]=this.words[p];for(p=0;p<h;p++)this.words[p]=0;this.length+=h}return this._strip()},n.prototype.ishln=function(i){return o(this.negative===0),this.iushln(i)},n.prototype.iushrn=function(i,f,h){o(typeof i=="number"&&i>=0);var l;f?l=(f-f%26)/26:l=0;var p=i%26,s=Math.min((i-p)/26,this.length),t=67108863^67108863>>>p<<p,u=h;if(l-=s,l=Math.max(0,l),u){for(var S=0;S<s;S++)u.words[S]=this.words[S];u.length=s}if(s!==0)if(this.length>s)for(this.length-=s,S=0;S<this.length;S++)this.words[S]=this.words[S+s];else this.words[0]=0,this.length=1;var O=0;for(S=this.length-1;S>=0&&(O!==0||S>=l);S--){var H=this.words[S]|0;this.words[S]=O<<26-p|H>>>p,O=H&t}return u&&O!==0&&(u.words[u.length++]=O),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(i,f,h){return o(this.negative===0),this.iushrn(i,f,h)},n.prototype.shln=function(i){return this.clone().ishln(i)},n.prototype.ushln=function(i){return this.clone().iushln(i)},n.prototype.shrn=function(i){return this.clone().ishrn(i)},n.prototype.ushrn=function(i){return this.clone().iushrn(i)},n.prototype.testn=function(i){o(typeof i=="number"&&i>=0);var f=i%26,h=(i-f)/26,l=1<<f;if(this.length<=h)return!1;var p=this.words[h];return!!(p&l)},n.prototype.imaskn=function(i){o(typeof i=="number"&&i>=0);var f=i%26,h=(i-f)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var l=67108863^67108863>>>f<<f;this.words[this.length-1]&=l}return this._strip()},n.prototype.maskn=function(i){return this.clone().imaskn(i)},n.prototype.iaddn=function(i){return o(typeof i=="number"),o(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},n.prototype._iaddn=function(i){this.words[0]+=i;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},n.prototype.isubn=function(i){if(o(typeof i=="number"),o(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this._strip()},n.prototype.addn=function(i){return this.clone().iaddn(i)},n.prototype.subn=function(i){return this.clone().isubn(i)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(i,f,h){var l=i.length+h,p;this._expand(l);var s,t=0;for(p=0;p<i.length;p++){s=(this.words[p+h]|0)+t;var u=(i.words[p]|0)*f;s-=u&67108863,t=(s>>26)-(u/67108864|0),this.words[p+h]=s&67108863}for(;p<this.length-h;p++)s=(this.words[p+h]|0)+t,t=s>>26,this.words[p+h]=s&67108863;if(t===0)return this._strip();for(o(t===-1),t=0,p=0;p<this.length;p++)s=-(this.words[p]|0)+t,t=s>>26,this.words[p]=s&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(i,f){var h=this.length-i.length,l=this.clone(),p=i,s=p.words[p.length-1]|0,t=this._countBits(s);h=26-t,h!==0&&(p=p.ushln(h),l.iushln(h),s=p.words[p.length-1]|0);var u=l.length-p.length,S;if(f!=="mod"){S=new n(null),S.length=u+1,S.words=new Array(S.length);for(var O=0;O<S.length;O++)S.words[O]=0}var H=l.clone()._ishlnsubmul(p,1,u);H.negative===0&&(l=H,S&&(S.words[u]=1));for(var Q=u-1;Q>=0;Q--){var G=(l.words[p.length+Q]|0)*67108864+(l.words[p.length+Q-1]|0);for(G=Math.min(G/s|0,67108863),l._ishlnsubmul(p,G,Q);l.negative!==0;)G--,l.negative=0,l._ishlnsubmul(p,1,Q),l.isZero()||(l.negative^=1);S&&(S.words[Q]=G)}return S&&S._strip(),l._strip(),f!=="div"&&h!==0&&l.iushrn(h),{div:S||null,mod:l}},n.prototype.divmod=function(i,f,h){if(o(!i.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var l,p,s;return this.negative!==0&&i.negative===0?(s=this.neg().divmod(i,f),f!=="mod"&&(l=s.div.neg()),f!=="div"&&(p=s.mod.neg(),h&&p.negative!==0&&p.iadd(i)),{div:l,mod:p}):this.negative===0&&i.negative!==0?(s=this.divmod(i.neg(),f),f!=="mod"&&(l=s.div.neg()),{div:l,mod:s.mod}):(this.negative&i.negative)!==0?(s=this.neg().divmod(i.neg(),f),f!=="div"&&(p=s.mod.neg(),h&&p.negative!==0&&p.isub(i)),{div:s.div,mod:p}):i.length>this.length||this.cmp(i)<0?{div:new n(0),mod:this}:i.length===1?f==="div"?{div:this.divn(i.words[0]),mod:null}:f==="mod"?{div:null,mod:new n(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new n(this.modrn(i.words[0]))}:this._wordDiv(i,f)},n.prototype.div=function(i){return this.divmod(i,"div",!1).div},n.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},n.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},n.prototype.divRound=function(i){var f=this.divmod(i);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(i):f.mod,l=i.ushrn(1),p=i.andln(1),s=h.cmp(l);return s<0||p===1&&s===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},n.prototype.modrn=function(i){var f=i<0;f&&(i=-i),o(i<=67108863);for(var h=(1<<26)%i,l=0,p=this.length-1;p>=0;p--)l=(h*l+(this.words[p]|0))%i;return f?-l:l},n.prototype.modn=function(i){return this.modrn(i)},n.prototype.idivn=function(i){var f=i<0;f&&(i=-i),o(i<=67108863);for(var h=0,l=this.length-1;l>=0;l--){var p=(this.words[l]|0)+h*67108864;this.words[l]=p/i|0,h=p%i}return this._strip(),f?this.ineg():this},n.prototype.divn=function(i){return this.clone().idivn(i)},n.prototype.egcd=function(i){o(i.negative===0),o(!i.isZero());var f=this,h=i.clone();f.negative!==0?f=f.umod(i):f=f.clone();for(var l=new n(1),p=new n(0),s=new n(0),t=new n(1),u=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++u;for(var S=h.clone(),O=f.clone();!f.isZero();){for(var H=0,Q=1;(f.words[0]&Q)===0&&H<26;++H,Q<<=1);if(H>0)for(f.iushrn(H);H-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(S),p.isub(O)),l.iushrn(1),p.iushrn(1);for(var G=0,R=1;(h.words[0]&R)===0&&G<26;++G,R<<=1);if(G>0)for(h.iushrn(G);G-- >0;)(s.isOdd()||t.isOdd())&&(s.iadd(S),t.isub(O)),s.iushrn(1),t.iushrn(1);f.cmp(h)>=0?(f.isub(h),l.isub(s),p.isub(t)):(h.isub(f),s.isub(l),t.isub(p))}return{a:s,b:t,gcd:h.iushln(u)}},n.prototype._invmp=function(i){o(i.negative===0),o(!i.isZero());var f=this,h=i.clone();f.negative!==0?f=f.umod(i):f=f.clone();for(var l=new n(1),p=new n(0),s=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var t=0,u=1;(f.words[0]&u)===0&&t<26;++t,u<<=1);if(t>0)for(f.iushrn(t);t-- >0;)l.isOdd()&&l.iadd(s),l.iushrn(1);for(var S=0,O=1;(h.words[0]&O)===0&&S<26;++S,O<<=1);if(S>0)for(h.iushrn(S);S-- >0;)p.isOdd()&&p.iadd(s),p.iushrn(1);f.cmp(h)>=0?(f.isub(h),l.isub(p)):(h.isub(f),p.isub(l))}var H;return f.cmpn(1)===0?H=l:H=p,H.cmpn(0)<0&&H.iadd(i),H},n.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var f=this.clone(),h=i.clone();f.negative=0,h.negative=0;for(var l=0;f.isEven()&&h.isEven();l++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var p=f.cmp(h);if(p<0){var s=f;f=h,h=s}else if(p===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(l)},n.prototype.invm=function(i){return this.egcd(i).a.umod(i)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(i){return this.words[0]&i},n.prototype.bincn=function(i){o(typeof i=="number");var f=i%26,h=(i-f)/26,l=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=l,this;for(var p=l,s=h;p!==0&&s<this.length;s++){var t=this.words[s]|0;t+=p,p=t>>>26,t&=67108863,this.words[s]=t}return p!==0&&(this.words[s]=p,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(i){var f=i<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this._strip();var h;if(this.length>1)h=1;else{f&&(i=-i),o(i<=67108863,"Number is too big");var l=this.words[0]|0;h=l===i?0:l<i?-1:1}return this.negative!==0?-h|0:h},n.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var f=this.ucmp(i);return this.negative!==0?-f|0:f},n.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var l=this.words[h]|0,p=i.words[h]|0;if(l!==p){l<p?f=-1:l>p&&(f=1);break}}return f},n.prototype.gtn=function(i){return this.cmpn(i)===1},n.prototype.gt=function(i){return this.cmp(i)===1},n.prototype.gten=function(i){return this.cmpn(i)>=0},n.prototype.gte=function(i){return this.cmp(i)>=0},n.prototype.ltn=function(i){return this.cmpn(i)===-1},n.prototype.lt=function(i){return this.cmp(i)===-1},n.prototype.lten=function(i){return this.cmpn(i)<=0},n.prototype.lte=function(i){return this.cmp(i)<=0},n.prototype.eqn=function(i){return this.cmpn(i)===0},n.prototype.eq=function(i){return this.cmp(i)===0},n.red=function(i){return new m(i)},n.prototype.toRed=function(i){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(i){return this.red=i,this},n.prototype.forceRed=function(i){return o(!this.red,"Already a number in reduction context"),this._forceRed(i)},n.prototype.redAdd=function(i){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},n.prototype.redIAdd=function(i){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},n.prototype.redSub=function(i){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},n.prototype.redISub=function(i){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},n.prototype.redShl=function(i){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},n.prototype.redMul=function(i){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},n.prototype.redIMul=function(i){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(i){return o(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var L={k256:null,p224:null,p192:null,p25519:null};function V(r,i){this.name=r,this.p=new n(i,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var i=new n(null);return i.words=new Array(Math.ceil(this.n/13)),i},V.prototype.ireduce=function(i){var f=i,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var l=h<this.n?-1:f.ucmp(this.p);return l===0?(f.words[0]=0,f.length=1):l>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},V.prototype.split=function(i,f){i.iushrn(this.n,0,f)},V.prototype.imulK=function(i){return i.imul(this.k)};function ee(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}x(ee,V),ee.prototype.split=function(i,f){for(var h=4194303,l=Math.min(i.length,9),p=0;p<l;p++)f.words[p]=i.words[p];if(f.length=l,i.length<=9){i.words[0]=0,i.length=1;return}var s=i.words[9];for(f.words[f.length++]=s&h,p=10;p<i.length;p++){var t=i.words[p]|0;i.words[p-10]=(t&h)<<4|s>>>22,s=t}s>>>=22,i.words[p-10]=s,s===0&&i.length>10?i.length-=10:i.length-=9},ee.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var f=0,h=0;h<i.length;h++){var l=i.words[h]|0;f+=l*977,i.words[h]=f&67108863,f=l*64+(f/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function ne(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}x(ne,V);function J(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}x(J,V);function ue(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}x(ue,V),ue.prototype.imulK=function(i){for(var f=0,h=0;h<i.length;h++){var l=(i.words[h]|0)*19+f,p=l&67108863;l>>>=26,i.words[h]=p,f=l}return f!==0&&(i.words[i.length++]=f),i},n._prime=function(i){if(L[i])return L[i];var f;if(i==="k256")f=new ee;else if(i==="p224")f=new ne;else if(i==="p192")f=new J;else if(i==="p25519")f=new ue;else throw new Error("Unknown prime "+i);return L[i]=f,f};function m(r){if(typeof r=="string"){var i=n._prime(r);this.m=i.p,this.prime=i}else o(r.gtn(1),"modulus must be greater than 1"),this.m=r,this.prime=null}m.prototype._verify1=function(i){o(i.negative===0,"red works only with positives"),o(i.red,"red works only with red numbers")},m.prototype._verify2=function(i,f){o((i.negative|f.negative)===0,"red works only with positives"),o(i.red&&i.red===f.red,"red works only with red numbers")},m.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(d(i,i.umod(this.m)._forceRed(this)),i)},m.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},m.prototype.add=function(i,f){this._verify2(i,f);var h=i.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},m.prototype.iadd=function(i,f){this._verify2(i,f);var h=i.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},m.prototype.sub=function(i,f){this._verify2(i,f);var h=i.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},m.prototype.isub=function(i,f){this._verify2(i,f);var h=i.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},m.prototype.shl=function(i,f){return this._verify1(i),this.imod(i.ushln(f))},m.prototype.imul=function(i,f){return this._verify2(i,f),this.imod(i.imul(f))},m.prototype.mul=function(i,f){return this._verify2(i,f),this.imod(i.mul(f))},m.prototype.isqr=function(i){return this.imul(i,i.clone())},m.prototype.sqr=function(i){return this.mul(i,i)},m.prototype.sqrt=function(i){if(i.isZero())return i.clone();var f=this.m.andln(3);if(o(f%2===1),f===3){var h=this.m.add(new n(1)).iushrn(2);return this.pow(i,h)}for(var l=this.m.subn(1),p=0;!l.isZero()&&l.andln(1)===0;)p++,l.iushrn(1);o(!l.isZero());var s=new n(1).toRed(this),t=s.redNeg(),u=this.m.subn(1).iushrn(1),S=this.m.bitLength();for(S=new n(2*S*S).toRed(this);this.pow(S,u).cmp(t)!==0;)S.redIAdd(t);for(var O=this.pow(S,l),H=this.pow(i,l.addn(1).iushrn(1)),Q=this.pow(i,l),G=p;Q.cmp(s)!==0;){for(var R=Q,C=0;R.cmp(s)!==0;C++)R=R.redSqr();o(C<G);var $=this.pow(O,new n(1).iushln(G-C-1));H=H.redMul($),O=$.redSqr(),Q=Q.redMul(O),G=C}return H},m.prototype.invm=function(i){var f=i._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},m.prototype.pow=function(i,f){if(f.isZero())return new n(1).toRed(this);if(f.cmpn(1)===0)return i.clone();var h=4,l=new Array(1<<h);l[0]=new n(1).toRed(this),l[1]=i;for(var p=2;p<l.length;p++)l[p]=this.mul(l[p-1],i);var s=l[0],t=0,u=0,S=f.bitLength()%26;for(S===0&&(S=26),p=f.length-1;p>=0;p--){for(var O=f.words[p],H=S-1;H>=0;H--){var Q=O>>H&1;if(s!==l[0]&&(s=this.sqr(s)),Q===0&&t===0){u=0;continue}t<<=1,t|=Q,u++,!(u!==h&&(p!==0||H!==0))&&(s=this.mul(s,l[t]),u=0,t=0)}S=26}return s},m.prototype.convertTo=function(i){var f=i.umod(this.m);return f===i?f.clone():f},m.prototype.convertFrom=function(i){var f=i.clone();return f.red=null,f},n.mont=function(i){return new e(i)};function e(r){m.call(this,r),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}x(e,m),e.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},e.prototype.convertFrom=function(i){var f=this.imod(i.mul(this.rinv));return f.red=null,f},e.prototype.imul=function(i,f){if(i.isZero()||f.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(f),l=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=h.isub(l).iushrn(this.shift),s=p;return p.cmp(this.m)>=0?s=p.isub(this.m):p.cmpn(0)<0&&(s=p.iadd(this.m)),s._forceRed(this)},e.prototype.mul=function(i,f){if(i.isZero()||f.isZero())return new n(0)._forceRed(this);var h=i.mul(f),l=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=h.isub(l).iushrn(this.shift),s=p;return p.cmp(this.m)>=0?s=p.isub(this.m):p.cmpn(0)<0&&(s=p.iadd(this.m)),s._forceRed(this)},e.prototype.invm=function(i){var f=this.imod(i._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(M,Jl)}(ri)),ri.exports}var Zl=er();const qt=Ar(Zl);function Xl(M){if(M.length>=255)throw new TypeError("Alphabet too long");const a=new Uint8Array(256);for(let v=0;v<a.length;v++)a[v]=255;for(let v=0;v<M.length;v++){const d=M.charAt(v),w=d.charCodeAt(0);if(a[w]!==255)throw new TypeError(d+" is ambiguous");a[w]=v}const c=M.length,o=M.charAt(0),x=Math.log(c)/Math.log(256),n=Math.log(256)/Math.log(c);function g(v){if(v instanceof Uint8Array||(ArrayBuffer.isView(v)?v=new Uint8Array(v.buffer,v.byteOffset,v.byteLength):Array.isArray(v)&&(v=Uint8Array.from(v))),!(v instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(v.length===0)return"";let d=0,w=0,_=0;const E=v.length;for(;_!==E&&v[_]===0;)_++,d++;const B=(E-_)*n+1>>>0,A=new Uint8Array(B);for(;_!==E;){let k=v[_],F=0;for(let q=B-1;(k!==0||F<w)&&q!==-1;q--,F++)k+=256*A[q]>>>0,A[q]=k%c>>>0,k=k/c>>>0;if(k!==0)throw new Error("Non-zero carry");w=F,_++}let P=B-w;for(;P!==B&&A[P]===0;)P++;let I=o.repeat(d);for(;P<B;++P)I+=M.charAt(A[P]);return I}function y(v){if(typeof v!="string")throw new TypeError("Expected String");if(v.length===0)return new Uint8Array;let d=0,w=0,_=0;for(;v[d]===o;)w++,d++;const E=(v.length-d)*x+1>>>0,B=new Uint8Array(E);for(;d<v.length;){const k=v.charCodeAt(d);if(k>255)return;let F=a[k];if(F===255)return;let q=0;for(let L=E-1;(F!==0||q<_)&&L!==-1;L--,q++)F+=c*B[L]>>>0,B[L]=F%256>>>0,F=F/256>>>0;if(F!==0)throw new Error("Non-zero carry");_=q,d++}let A=E-_;for(;A!==E&&B[A]===0;)A++;const P=new Uint8Array(w+(E-A));let I=w;for(;A!==E;)P[I++]=B[A++];return P}function b(v){const d=y(v);if(d)return d;throw new Error("Non-base"+c+" character")}return{encode:g,decodeUnsafe:y,decode:b}}var Ql="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const ji=Xl(Ql);var Vi={};const ed={version:"7.0.1"};var $i={},Gi,lo;function Ht(){if(lo)return Gi;lo=1,Gi=M;function M(a,c){if(!a)throw new Error(c||"Assertion failed")}return M.equal=function(c,o,x){if(c!=o)throw new Error(x||"Assertion failed: "+c+" != "+o)},Gi}var Wi={},po;function Yi(){return po||(po=1,function(M){var a=M;function c(n,g){if(Array.isArray(n))return n.slice();if(!n)return[];var y=[];if(typeof n!="string"){for(var b=0;b<n.length;b++)y[b]=n[b]|0;return y}if(g==="hex"){n=n.replace(/[^a-z0-9]+/ig,""),n.length%2!==0&&(n="0"+n);for(var b=0;b<n.length;b+=2)y.push(parseInt(n[b]+n[b+1],16))}else for(var b=0;b<n.length;b++){var v=n.charCodeAt(b),d=v>>8,w=v&255;d?y.push(d,w):y.push(w)}return y}a.toArray=c;function o(n){return n.length===1?"0"+n:n}a.zero2=o;function x(n){for(var g="",y=0;y<n.length;y++)g+=o(n[y].toString(16));return g}a.toHex=x,a.encode=function(g,y){return y==="hex"?x(g):g}}(Wi)),Wi}var vo;function br(){return vo||(vo=1,function(M){var a=M,c=er(),o=Ht(),x=Yi();a.assert=o,a.toArray=x.toArray,a.zero2=x.zero2,a.toHex=x.toHex,a.encode=x.encode;function n(d,w,_){var E=new Array(Math.max(d.bitLength(),_)+1);E.fill(0);for(var B=1<<w+1,A=d.clone(),P=0;P<E.length;P++){var I,k=A.andln(B-1);A.isOdd()?(k>(B>>1)-1?I=(B>>1)-k:I=k,A.isubn(I)):I=0,E[P]=I,A.iushrn(1)}return E}a.getNAF=n;function g(d,w){var _=[[],[]];d=d.clone(),w=w.clone();for(var E=0,B=0;d.cmpn(-E)>0||w.cmpn(-B)>0;){var A=d.andln(3)+E&3,P=w.andln(3)+B&3;A===3&&(A=-1),P===3&&(P=-1);var I;if((A&1)===0)I=0;else{var k=d.andln(7)+E&7;(k===3||k===5)&&P===2?I=-A:I=A}_[0].push(I);var F;if((P&1)===0)F=0;else{var k=w.andln(7)+B&7;(k===3||k===5)&&A===2?F=-P:F=P}_[1].push(F),2*E===I+1&&(E=1-E),2*B===F+1&&(B=1-B),d.iushrn(1),w.iushrn(1)}return _}a.getJSF=g;function y(d,w,_){var E="_"+w;d.prototype[w]=function(){return this[E]!==void 0?this[E]:this[E]=_.call(this)}}a.cachedProperty=y;function b(d){return typeof d=="string"?a.toArray(d,"hex"):d}a.parseBytes=b;function v(d){return new c(d,"hex","le")}a.intFromLE=v}($i)),$i}var ii={exports:{}},it={};function td(M){return M&&M.__esModule&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M}var mo={exports:{}},Tt=mo.exports={},tr,rr;function Ji(){throw new Error("setTimeout has not been defined")}function Zi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?tr=setTimeout:tr=Ji}catch{tr=Ji}try{typeof clearTimeout=="function"?rr=clearTimeout:rr=Zi}catch{rr=Zi}})();function bo(M){if(tr===setTimeout)return setTimeout(M,0);if((tr===Ji||!tr)&&setTimeout)return tr=setTimeout,setTimeout(M,0);try{return tr(M,0)}catch{try{return tr.call(null,M,0)}catch{return tr.call(this,M,0)}}}function rd(M){if(rr===clearTimeout)return clearTimeout(M);if((rr===Zi||!rr)&&clearTimeout)return rr=clearTimeout,clearTimeout(M);try{return rr(M)}catch{try{return rr.call(null,M)}catch{return rr.call(this,M)}}}var hr=[],Rr=!1,gr,ni=-1;function id(){!Rr||!gr||(Rr=!1,gr.length?hr=gr.concat(hr):ni=-1,hr.length&&go())}function go(){if(!Rr){var M=bo(id);Rr=!0;for(var a=hr.length;a;){for(gr=hr,hr=[];++ni<a;)gr&&gr[ni].run();ni=-1,a=hr.length}gr=null,Rr=!1,rd(M)}}Tt.nextTick=function(M){var a=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)a[c-1]=arguments[c];hr.push(new yo(M,a)),hr.length===1&&!Rr&&bo(go)};function yo(M,a){this.fun=M,this.array=a}yo.prototype.run=function(){this.fun.apply(null,this.array)},Tt.title="browser",Tt.browser=!0,Tt.env={},Tt.argv=[],Tt.version="",Tt.versions={};function ur(){}Tt.on=ur,Tt.addListener=ur,Tt.once=ur,Tt.off=ur,Tt.removeListener=ur,Tt.removeAllListeners=ur,Tt.emit=ur,Tt.prependListener=ur,Tt.prependOnceListener=ur,Tt.listeners=function(M){return[]},Tt.binding=function(M){throw new Error("process.binding is not supported")},Tt.cwd=function(){return"/"},Tt.chdir=function(M){throw new Error("process.chdir is not supported")},Tt.umask=function(){return 0};var nd=mo.exports;const je=td(nd);var ai={exports:{}},fi={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var wo;function tt(){return wo||(wo=1,function(M,a){var c=Nt(),o=c.Buffer;function x(g,y){for(var b in g)y[b]=g[b]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?M.exports=c:(x(c,a),a.Buffer=n);function n(g,y,b){return o(g,y,b)}n.prototype=Object.create(o.prototype),x(o,n),n.from=function(g,y,b){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,b)},n.alloc=function(g,y,b){if(typeof g!="number")throw new TypeError("Argument must be a number");var v=o(g);return y!==void 0?typeof b=="string"?v.fill(y,b):v.fill(y):v.fill(0),v},n.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},n.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(g)}}(fi,fi.exports)),fi.exports}var Mo;function yr(){if(Mo)return ai.exports;Mo=1;var M=65536,a=4294967295;function c(){throw new Error(`Secure random number generation is not supported by this browser.
7
- Use Chrome, Firefox or Internet Explorer 11`)}var o=tt().Buffer,x=et.crypto||et.msCrypto;x&&x.getRandomValues?ai.exports=n:ai.exports=c;function n(g,y){if(g>a)throw new RangeError("requested too many random bytes");var b=o.allocUnsafe(g);if(g>0)if(g>M)for(var v=0;v<g;v+=M)x.getRandomValues(b.slice(v,v+M));else x.getRandomValues(b);return typeof y=="function"?je.nextTick(function(){y(null,b)}):b}return ai.exports}var si={exports:{}},xo;function Ye(){return xo||(xo=1,typeof Object.create=="function"?si.exports=function(a,c){c&&(a.super_=c,a.prototype=Object.create(c.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}))}:si.exports=function(a,c){if(c){a.super_=c;var o=function(){};o.prototype=c.prototype,a.prototype=new o,a.prototype.constructor=a}}),si.exports}var Xi,_o;function ad(){if(_o)return Xi;_o=1;var M={}.toString;return Xi=Array.isArray||function(a){return M.call(a)=="[object Array]"},Xi}var Qi,So;function Dr(){return So||(So=1,Qi=TypeError),Qi}var en,Eo;function Bo(){return Eo||(Eo=1,en=Object),en}var tn,Ao;function fd(){return Ao||(Ao=1,tn=Error),tn}var rn,Ro;function sd(){return Ro||(Ro=1,rn=EvalError),rn}var nn,Io;function od(){return Io||(Io=1,nn=RangeError),nn}var an,Oo;function hd(){return Oo||(Oo=1,an=ReferenceError),an}var fn,ko;function Po(){return ko||(ko=1,fn=SyntaxError),fn}var sn,To;function ud(){return To||(To=1,sn=URIError),sn}var on,No;function cd(){return No||(No=1,on=Math.abs),on}var hn,Co;function ld(){return Co||(Co=1,hn=Math.floor),hn}var un,qo;function dd(){return qo||(qo=1,un=Math.max),un}var cn,Lo;function pd(){return Lo||(Lo=1,cn=Math.min),cn}var ln,Fo;function vd(){return Fo||(Fo=1,ln=Math.pow),ln}var dn,Do;function md(){return Do||(Do=1,dn=Math.round),dn}var pn,Uo;function bd(){return Uo||(Uo=1,pn=Number.isNaN||function(a){return a!==a}),pn}var vn,Ho;function gd(){if(Ho)return vn;Ho=1;var M=bd();return vn=function(c){return M(c)||c===0?c:c<0?-1:1},vn}var mn,Ko;function yd(){return Ko||(Ko=1,mn=Object.getOwnPropertyDescriptor),mn}var bn,zo;function Ur(){if(zo)return bn;zo=1;var M=yd();if(M)try{M([],"length")}catch{M=null}return bn=M,bn}var gn,jo;function oi(){if(jo)return gn;jo=1;var M=Object.defineProperty||!1;if(M)try{M({},"a",{value:1})}catch{M=!1}return gn=M,gn}var yn,Vo;function $o(){return Vo||(Vo=1,yn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var a={},c=Symbol("test"),o=Object(c);if(typeof c=="string"||Object.prototype.toString.call(c)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var x=42;a[c]=x;for(var n in a)return!1;if(typeof Object.keys=="function"&&Object.keys(a).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(a).length!==0)return!1;var g=Object.getOwnPropertySymbols(a);if(g.length!==1||g[0]!==c||!Object.prototype.propertyIsEnumerable.call(a,c))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var y=Object.getOwnPropertyDescriptor(a,c);if(y.value!==x||y.enumerable!==!0)return!1}return!0}),yn}var wn,Go;function wd(){if(Go)return wn;Go=1;var M=typeof Symbol<"u"&&Symbol,a=$o();return wn=function(){return typeof M!="function"||typeof Symbol!="function"||typeof M("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:a()},wn}var Mn,Wo;function Yo(){return Wo||(Wo=1,Mn=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Mn}var xn,Jo;function Zo(){if(Jo)return xn;Jo=1;var M=Bo();return xn=M.getPrototypeOf||null,xn}var _n,Xo;function Md(){if(Xo)return _n;Xo=1;var M="Function.prototype.bind called on incompatible ",a=Object.prototype.toString,c=Math.max,o="[object Function]",x=function(b,v){for(var d=[],w=0;w<b.length;w+=1)d[w]=b[w];for(var _=0;_<v.length;_+=1)d[_+b.length]=v[_];return d},n=function(b,v){for(var d=[],w=v,_=0;w<b.length;w+=1,_+=1)d[_]=b[w];return d},g=function(y,b){for(var v="",d=0;d<y.length;d+=1)v+=y[d],d+1<y.length&&(v+=b);return v};return _n=function(b){var v=this;if(typeof v!="function"||a.apply(v)!==o)throw new TypeError(M+v);for(var d=n(arguments,1),w,_=function(){if(this instanceof w){var I=v.apply(this,x(d,arguments));return Object(I)===I?I:this}return v.apply(b,x(d,arguments))},E=c(0,v.length-d.length),B=[],A=0;A<E;A++)B[A]="$"+A;if(w=Function("binder","return function ("+g(B,",")+"){ return binder.apply(this,arguments); }")(_),v.prototype){var P=function(){};P.prototype=v.prototype,w.prototype=new P,P.prototype=null}return w},_n}var Sn,Qo;function Hr(){if(Qo)return Sn;Qo=1;var M=Md();return Sn=Function.prototype.bind||M,Sn}var En,eh;function Bn(){return eh||(eh=1,En=Function.prototype.call),En}var An,th;function Rn(){return th||(th=1,An=Function.prototype.apply),An}var In,rh;function xd(){return rh||(rh=1,In=typeof Reflect<"u"&&Reflect&&Reflect.apply),In}var On,ih;function nh(){if(ih)return On;ih=1;var M=Hr(),a=Rn(),c=Bn(),o=xd();return On=o||M.call(c,a),On}var kn,ah;function Pn(){if(ah)return kn;ah=1;var M=Hr(),a=Dr(),c=Bn(),o=nh();return kn=function(n){if(n.length<1||typeof n[0]!="function")throw new a("a function is required");return o(M,c,n)},kn}var Tn,fh;function _d(){if(fh)return Tn;fh=1;var M=Pn(),a=Ur(),c;try{c=[].__proto__===Array.prototype}catch(g){if(!g||typeof g!="object"||!("code"in g)||g.code!=="ERR_PROTO_ACCESS")throw g}var o=!!c&&a&&a(Object.prototype,"__proto__"),x=Object,n=x.getPrototypeOf;return Tn=o&&typeof o.get=="function"?M([o.get]):typeof n=="function"?function(y){return n(y==null?y:x(y))}:!1,Tn}var Nn,sh;function Sd(){if(sh)return Nn;sh=1;var M=Yo(),a=Zo(),c=_d();return Nn=M?function(x){return M(x)}:a?function(x){if(!x||typeof x!="object"&&typeof x!="function")throw new TypeError("getProto: not an object");return a(x)}:c?function(x){return c(x)}:null,Nn}var Cn,oh;function Ed(){if(oh)return Cn;oh=1;var M=Function.prototype.call,a=Object.prototype.hasOwnProperty,c=Hr();return Cn=c.call(M,a),Cn}var qn,hh;function Ln(){if(hh)return qn;hh=1;var M,a=Bo(),c=fd(),o=sd(),x=od(),n=hd(),g=Po(),y=Dr(),b=ud(),v=cd(),d=ld(),w=dd(),_=pd(),E=vd(),B=md(),A=gd(),P=Function,I=function($){try{return P('"use strict"; return ('+$+").constructor;")()}catch{}},k=Ur(),F=oi(),q=function(){throw new y},L=k?function(){try{return arguments.callee,q}catch{try{return k(arguments,"callee").get}catch{return q}}}():q,V=wd()(),ee=Sd(),ne=Zo(),J=Yo(),ue=Rn(),m=Bn(),e={},r=typeof Uint8Array>"u"||!ee?M:ee(Uint8Array),i={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":V&&ee?ee([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":e,"%AsyncGenerator%":e,"%AsyncGeneratorFunction%":e,"%AsyncIteratorPrototype%":e,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":c,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":P,"%GeneratorFunction%":e,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":V&&ee?ee(ee([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!V||!ee?M:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":a,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":x,"%ReferenceError%":n,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!V||!ee?M:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":V&&ee?ee(""[Symbol.iterator]()):M,"%Symbol%":V?Symbol:M,"%SyntaxError%":g,"%ThrowTypeError%":L,"%TypedArray%":r,"%TypeError%":y,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":b,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":m,"%Function.prototype.apply%":ue,"%Object.defineProperty%":F,"%Object.getPrototypeOf%":ne,"%Math.abs%":v,"%Math.floor%":d,"%Math.max%":w,"%Math.min%":_,"%Math.pow%":E,"%Math.round%":B,"%Math.sign%":A,"%Reflect.getPrototypeOf%":J};if(ee)try{null.error}catch($){var f=ee(ee($));i["%Error.prototype%"]=f}var h=function $(X){var Z;if(X==="%AsyncFunction%")Z=I("async function () {}");else if(X==="%GeneratorFunction%")Z=I("function* () {}");else if(X==="%AsyncGeneratorFunction%")Z=I("async function* () {}");else if(X==="%AsyncGenerator%"){var K=$("%AsyncGeneratorFunction%");K&&(Z=K.prototype)}else if(X==="%AsyncIteratorPrototype%"){var te=$("%AsyncGenerator%");te&&ee&&(Z=ee(te.prototype))}return i[X]=Z,Z},l={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},p=Hr(),s=Ed(),t=p.call(m,Array.prototype.concat),u=p.call(ue,Array.prototype.splice),S=p.call(m,String.prototype.replace),O=p.call(m,String.prototype.slice),H=p.call(m,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,R=function(X){var Z=O(X,0,1),K=O(X,-1);if(Z==="%"&&K!=="%")throw new g("invalid intrinsic syntax, expected closing `%`");if(K==="%"&&Z!=="%")throw new g("invalid intrinsic syntax, expected opening `%`");var te=[];return S(X,Q,function(Pe,le,ce,Le){te[te.length]=ce?S(Le,G,"$1"):le||Pe}),te},C=function(X,Z){var K=X,te;if(s(l,K)&&(te=l[K],K="%"+te[0]+"%"),s(i,K)){var Pe=i[K];if(Pe===e&&(Pe=h(K)),typeof Pe>"u"&&!Z)throw new y("intrinsic "+X+" exists, but is not available. Please file an issue!");return{alias:te,name:K,value:Pe}}throw new g("intrinsic "+X+" does not exist!")};return qn=function(X,Z){if(typeof X!="string"||X.length===0)throw new y("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Z!="boolean")throw new y('"allowMissing" argument must be a boolean');if(H(/^%?[^%]*%?$/,X)===null)throw new g("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var K=R(X),te=K.length>0?K[0]:"",Pe=C("%"+te+"%",Z),le=Pe.name,ce=Pe.value,Le=!1,be=Pe.alias;be&&(te=be[0],u(K,t([0,1],be)));for(var se=1,Ue=!0;se<K.length;se+=1){var de=K[se],ge=O(de,0,1),De=O(de,-1);if((ge==='"'||ge==="'"||ge==="`"||De==='"'||De==="'"||De==="`")&&ge!==De)throw new g("property names with quotes must have matching quotes");if((de==="constructor"||!Ue)&&(Le=!0),te+="."+de,le="%"+te+"%",s(i,le))ce=i[le];else if(ce!=null){if(!(de in ce)){if(!Z)throw new y("base intrinsic for "+X+" exists, but the property is not available.");return}if(k&&se+1>=K.length){var ve=k(ce,de);Ue=!!ve,Ue&&"get"in ve&&!("originalValue"in ve.get)?ce=ve.get:ce=ce[de]}else Ue=s(ce,de),ce=ce[de];Ue&&!Le&&(i[le]=ce)}}return ce},qn}var Fn,uh;function ch(){if(uh)return Fn;uh=1;var M=Ln(),a=Pn(),c=a([M("%String.prototype.indexOf%")]);return Fn=function(x,n){var g=M(x,!!n);return typeof g=="function"&&c(x,".prototype.")>-1?a([g]):g},Fn}var Dn,lh;function Bd(){if(lh)return Dn;lh=1;var M=Function.prototype.toString,a=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,c,o;if(typeof a=="function"&&typeof Object.defineProperty=="function")try{c=Object.defineProperty({},"length",{get:function(){throw o}}),o={},a(function(){throw 42},null,c)}catch(k){k!==o&&(a=null)}else a=null;var x=/^\s*class\b/,n=function(F){try{var q=M.call(F);return x.test(q)}catch{return!1}},g=function(F){try{return n(F)?!1:(M.call(F),!0)}catch{return!1}},y=Object.prototype.toString,b="[object Object]",v="[object Function]",d="[object GeneratorFunction]",w="[object HTMLAllCollection]",_="[object HTML document.all class]",E="[object HTMLCollection]",B=typeof Symbol=="function"&&!!Symbol.toStringTag,A=!(0 in[,]),P=function(){return!1};if(typeof document=="object"){var I=document.all;y.call(I)===y.call(document.all)&&(P=function(F){if((A||!F)&&(typeof F>"u"||typeof F=="object"))try{var q=y.call(F);return(q===w||q===_||q===E||q===b)&&F("")==null}catch{}return!1})}return Dn=a?function(F){if(P(F))return!0;if(!F||typeof F!="function"&&typeof F!="object")return!1;try{a(F,null,c)}catch(q){if(q!==o)return!1}return!n(F)&&g(F)}:function(F){if(P(F))return!0;if(!F||typeof F!="function"&&typeof F!="object")return!1;if(B)return g(F);if(n(F))return!1;var q=y.call(F);return q!==v&&q!==d&&!/^\[object HTML/.test(q)?!1:g(F)},Dn}var Un,dh;function Ad(){if(dh)return Un;dh=1;var M=Bd(),a=Object.prototype.toString,c=Object.prototype.hasOwnProperty,o=function(b,v,d){for(var w=0,_=b.length;w<_;w++)c.call(b,w)&&(d==null?v(b[w],w,b):v.call(d,b[w],w,b))},x=function(b,v,d){for(var w=0,_=b.length;w<_;w++)d==null?v(b.charAt(w),w,b):v.call(d,b.charAt(w),w,b)},n=function(b,v,d){for(var w in b)c.call(b,w)&&(d==null?v(b[w],w,b):v.call(d,b[w],w,b))},g=function(b,v,d){if(!M(v))throw new TypeError("iterator must be a function");var w;arguments.length>=3&&(w=d),a.call(b)==="[object Array]"?o(b,v,w):typeof b=="string"?x(b,v,w):n(b,v,w)};return Un=g,Un}var Hn,ph;function Rd(){return ph||(ph=1,Hn=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Hn}var Kn,vh;function Id(){if(vh)return Kn;vh=1;var M=Rd(),a=typeof globalThis>"u"?et:globalThis;return Kn=function(){for(var o=[],x=0;x<M.length;x++)typeof a[M[x]]=="function"&&(o[o.length]=M[x]);return o},Kn}var zn={exports:{}},jn,mh;function Od(){if(mh)return jn;mh=1;var M=oi(),a=Po(),c=Dr(),o=Ur();return jn=function(n,g,y){if(!n||typeof n!="object"&&typeof n!="function")throw new c("`obj` must be an object or a function`");if(typeof g!="string"&&typeof g!="symbol")throw new c("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new c("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new c("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new c("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new c("`loose`, if provided, must be a boolean");var b=arguments.length>3?arguments[3]:null,v=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,w=arguments.length>6?arguments[6]:!1,_=!!o&&o(n,g);if(M)M(n,g,{configurable:d===null&&_?_.configurable:!d,enumerable:b===null&&_?_.enumerable:!b,value:y,writable:v===null&&_?_.writable:!v});else if(w||!b&&!v&&!d)n[g]=y;else throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},jn}var Vn,bh;function kd(){if(bh)return Vn;bh=1;var M=oi(),a=function(){return!!M};return a.hasArrayLengthDefineBug=function(){if(!M)return null;try{return M([],"length",{value:1}).length!==1}catch{return!0}},Vn=a,Vn}var $n,gh;function Pd(){if(gh)return $n;gh=1;var M=Ln(),a=Od(),c=kd()(),o=Ur(),x=Dr(),n=M("%Math.floor%");return $n=function(y,b){if(typeof y!="function")throw new x("`fn` is not a function");if(typeof b!="number"||b<0||b>4294967295||n(b)!==b)throw new x("`length` must be a positive 32-bit integer");var v=arguments.length>2&&!!arguments[2],d=!0,w=!0;if("length"in y&&o){var _=o(y,"length");_&&!_.configurable&&(d=!1),_&&!_.writable&&(w=!1)}return(d||w||!v)&&(c?a(y,"length",b,!0,!0):a(y,"length",b)),y},$n}var Gn,yh;function Td(){if(yh)return Gn;yh=1;var M=Hr(),a=Rn(),c=nh();return Gn=function(){return c(M,a,arguments)},Gn}var wh;function Mh(){return wh||(wh=1,function(M){var a=Pd(),c=oi(),o=Pn(),x=Td();M.exports=function(g){var y=o(arguments),b=g.length-(arguments.length-1);return a(y,1+(b>0?b:0),!0)},c?c(M.exports,"apply",{value:x}):M.exports.apply=x}(zn)),zn.exports}var Wn,xh;function Yn(){if(xh)return Wn;xh=1;var M=$o();return Wn=function(){return M()&&!!Symbol.toStringTag},Wn}var Jn,_h;function Sh(){if(_h)return Jn;_h=1;var M=Ad(),a=Id(),c=Mh(),o=ch(),x=Ur(),n=o("Object.prototype.toString"),g=Yn()(),y=typeof globalThis>"u"?et:globalThis,b=a(),v=o("String.prototype.slice"),d=Object.getPrototypeOf,w=o("Array.prototype.indexOf",!0)||function(P,I){for(var k=0;k<P.length;k+=1)if(P[k]===I)return k;return-1},_={__proto__:null};g&&x&&d?M(b,function(A){var P=new y[A];if(Symbol.toStringTag in P){var I=d(P),k=x(I,Symbol.toStringTag);if(!k){var F=d(I);k=x(F,Symbol.toStringTag)}_["$"+A]=c(k.get)}}):M(b,function(A){var P=new y[A],I=P.slice||P.set;I&&(_["$"+A]=c(I))});var E=function(P){var I=!1;return M(_,function(k,F){if(!I)try{"$"+k(P)===F&&(I=v(F,1))}catch{}}),I},B=function(P){var I=!1;return M(_,function(k,F){if(!I)try{k(P),I=v(F,1)}catch{}}),I};return Jn=function(P){if(!P||typeof P!="object")return!1;if(!g){var I=v(n(P),8,-1);return w(b,I)>-1?I:I!=="Object"?!1:B(P)}return x?E(P):null},Jn}var Zn,Eh;function Bh(){if(Eh)return Zn;Eh=1;var M=Sh();return Zn=function(c){return!!M(c)},Zn}var Xn,Ah;function Nd(){if(Ah)return Xn;Ah=1;var M=Dr(),a=ch(),c=a("TypedArray.prototype.buffer",!0),o=Bh();return Xn=c||function(n){if(!o(n))throw new M("Not a Typed Array");return n.buffer},Xn}var Qn,Rh;function hi(){if(Rh)return Qn;Rh=1;var M=tt().Buffer,a=ad(),c=Nd(),o=ArrayBuffer.isView||function(b){try{return c(b),!0}catch{return!1}},x=typeof Uint8Array<"u",n=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",g=n&&(M.prototype instanceof Uint8Array||M.TYPED_ARRAY_SUPPORT);return Qn=function(b,v){if(M.isBuffer(b))return b.constructor&&!("isBuffer"in b)?M.from(b):b;if(typeof b=="string")return M.from(b,v);if(n&&o(b)){if(b.byteLength===0)return M.alloc(0);if(g){var d=M.from(b.buffer,b.byteOffset,b.byteLength);if(d.byteLength===b.byteLength)return d}var w=b instanceof Uint8Array?b:new Uint8Array(b.buffer,b.byteOffset,b.byteLength),_=M.from(w);if(_.length===b.byteLength)return _}if(x&&b instanceof Uint8Array)return M.from(b);var E=a(b);if(E)for(var B=0;B<b.length;B+=1){var A=b[B];if(typeof A!="number"||A<0||A>255||~~A!==A)throw new RangeError("Array items must be numbers in the range 0-255.")}if(E||M.isBuffer(b)&&b.constructor&&typeof b.constructor.isBuffer=="function"&&b.constructor.isBuffer(b))return M.from(b);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Qn}var ea,Ih;function Cd(){if(Ih)return ea;Ih=1;var M=tt().Buffer,a=hi(),c=typeof Uint8Array<"u",o=c&&typeof ArrayBuffer<"u",x=o&&ArrayBuffer.isView;return ea=function(n,g){if(typeof n=="string"||M.isBuffer(n)||c&&n instanceof Uint8Array||x&&x(n))return a(n,g);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},ea}var ui={exports:{}},ci={exports:{}},Oh;function dr(){if(Oh)return ci.exports;Oh=1,typeof je>"u"||!je.version||je.version.indexOf("v0.")===0||je.version.indexOf("v1.")===0&&je.version.indexOf("v1.8.")!==0?ci.exports={nextTick:M}:ci.exports=je;function M(a,c,o,x){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,g,y;switch(n){case 0:case 1:return je.nextTick(a);case 2:return je.nextTick(function(){a.call(null,c)});case 3:return je.nextTick(function(){a.call(null,c,o)});case 4:return je.nextTick(function(){a.call(null,c,o,x)});default:for(g=new Array(n-1),y=0;y<g.length;)g[y++]=arguments[y];return je.nextTick(function(){a.apply(null,g)})}}return ci.exports}var ta,kh;function Ph(){if(kh)return ta;kh=1;var M={}.toString;return ta=Array.isArray||function(a){return M.call(a)=="[object Array]"},ta}var li={exports:{}},Th;function wr(){if(Th)return li.exports;Th=1;var M=typeof Reflect=="object"?Reflect:null,a=M&&typeof M.apply=="function"?M.apply:function(L,V,ee){return Function.prototype.apply.call(L,V,ee)},c;M&&typeof M.ownKeys=="function"?c=M.ownKeys:Object.getOwnPropertySymbols?c=function(L){return Object.getOwnPropertyNames(L).concat(Object.getOwnPropertySymbols(L))}:c=function(L){return Object.getOwnPropertyNames(L)};function o(q){console&&console.warn&&console.warn(q)}var x=Number.isNaN||function(L){return L!==L};function n(){n.init.call(this)}li.exports=n,li.exports.once=I,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var g=10;function y(q){if(typeof q!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof q)}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(q){if(typeof q!="number"||q<0||x(q))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+q+".");g=q}}),n.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(L){if(typeof L!="number"||L<0||x(L))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+L+".");return this._maxListeners=L,this};function b(q){return q._maxListeners===void 0?n.defaultMaxListeners:q._maxListeners}n.prototype.getMaxListeners=function(){return b(this)},n.prototype.emit=function(L){for(var V=[],ee=1;ee<arguments.length;ee++)V.push(arguments[ee]);var ne=L==="error",J=this._events;if(J!==void 0)ne=ne&&J.error===void 0;else if(!ne)return!1;if(ne){var ue;if(V.length>0&&(ue=V[0]),ue instanceof Error)throw ue;var m=new Error("Unhandled error."+(ue?" ("+ue.message+")":""));throw m.context=ue,m}var e=J[L];if(e===void 0)return!1;if(typeof e=="function")a(e,this,V);else for(var r=e.length,i=B(e,r),ee=0;ee<r;++ee)a(i[ee],this,V);return!0};function v(q,L,V,ee){var ne,J,ue;if(y(V),J=q._events,J===void 0?(J=q._events=Object.create(null),q._eventsCount=0):(J.newListener!==void 0&&(q.emit("newListener",L,V.listener?V.listener:V),J=q._events),ue=J[L]),ue===void 0)ue=J[L]=V,++q._eventsCount;else if(typeof ue=="function"?ue=J[L]=ee?[V,ue]:[ue,V]:ee?ue.unshift(V):ue.push(V),ne=b(q),ne>0&&ue.length>ne&&!ue.warned){ue.warned=!0;var m=new Error("Possible EventEmitter memory leak detected. "+ue.length+" "+String(L)+" listeners added. Use emitter.setMaxListeners() to increase limit");m.name="MaxListenersExceededWarning",m.emitter=q,m.type=L,m.count=ue.length,o(m)}return q}n.prototype.addListener=function(L,V){return v(this,L,V,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(L,V){return v(this,L,V,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(q,L,V){var ee={fired:!1,wrapFn:void 0,target:q,type:L,listener:V},ne=d.bind(ee);return ne.listener=V,ee.wrapFn=ne,ne}n.prototype.once=function(L,V){return y(V),this.on(L,w(this,L,V)),this},n.prototype.prependOnceListener=function(L,V){return y(V),this.prependListener(L,w(this,L,V)),this},n.prototype.removeListener=function(L,V){var ee,ne,J,ue,m;if(y(V),ne=this._events,ne===void 0)return this;if(ee=ne[L],ee===void 0)return this;if(ee===V||ee.listener===V)--this._eventsCount===0?this._events=Object.create(null):(delete ne[L],ne.removeListener&&this.emit("removeListener",L,ee.listener||V));else if(typeof ee!="function"){for(J=-1,ue=ee.length-1;ue>=0;ue--)if(ee[ue]===V||ee[ue].listener===V){m=ee[ue].listener,J=ue;break}if(J<0)return this;J===0?ee.shift():A(ee,J),ee.length===1&&(ne[L]=ee[0]),ne.removeListener!==void 0&&this.emit("removeListener",L,m||V)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(L){var V,ee,ne;if(ee=this._events,ee===void 0)return this;if(ee.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ee[L]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ee[L]),this;if(arguments.length===0){var J=Object.keys(ee),ue;for(ne=0;ne<J.length;++ne)ue=J[ne],ue!=="removeListener"&&this.removeAllListeners(ue);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(V=ee[L],typeof V=="function")this.removeListener(L,V);else if(V!==void 0)for(ne=V.length-1;ne>=0;ne--)this.removeListener(L,V[ne]);return this};function _(q,L,V){var ee=q._events;if(ee===void 0)return[];var ne=ee[L];return ne===void 0?[]:typeof ne=="function"?V?[ne.listener||ne]:[ne]:V?P(ne):B(ne,ne.length)}n.prototype.listeners=function(L){return _(this,L,!0)},n.prototype.rawListeners=function(L){return _(this,L,!1)},n.listenerCount=function(q,L){return typeof q.listenerCount=="function"?q.listenerCount(L):E.call(q,L)},n.prototype.listenerCount=E;function E(q){var L=this._events;if(L!==void 0){var V=L[q];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?c(this._events):[]};function B(q,L){for(var V=new Array(L),ee=0;ee<L;++ee)V[ee]=q[ee];return V}function A(q,L){for(;L+1<q.length;L++)q[L]=q[L+1];q.pop()}function P(q){for(var L=new Array(q.length),V=0;V<L.length;++V)L[V]=q[V].listener||q[V];return L}function I(q,L){return new Promise(function(V,ee){function ne(ue){q.removeListener(L,J),ee(ue)}function J(){typeof q.removeListener=="function"&&q.removeListener("error",ne),V([].slice.call(arguments))}F(q,L,J,{once:!0}),L!=="error"&&k(q,ne,{once:!0})})}function k(q,L,V){typeof q.on=="function"&&F(q,"error",L,V)}function F(q,L,V,ee){if(typeof q.on=="function")ee.once?q.once(L,V):q.on(L,V);else if(typeof q.addEventListener=="function")q.addEventListener(L,function ne(J){ee.once&&q.removeEventListener(L,ne),V(J)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof q)}return li.exports}var ra,Nh;function Ch(){return Nh||(Nh=1,ra=wr().EventEmitter),ra}var di={exports:{}},qh;function ia(){return qh||(qh=1,function(M,a){var c=Nt(),o=c.Buffer;function x(g,y){for(var b in g)y[b]=g[b]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?M.exports=c:(x(c,a),a.Buffer=n);function n(g,y,b){return o(g,y,b)}x(o,n),n.from=function(g,y,b){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,b)},n.alloc=function(g,y,b){if(typeof g!="number")throw new TypeError("Argument must be a number");var v=o(g);return y!==void 0?typeof b=="string"?v.fill(y,b):v.fill(y):v.fill(0),v},n.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},n.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(g)}}(di,di.exports)),di.exports}var Ct={},Lh;function ir(){if(Lh)return Ct;Lh=1;function M(A){return Array.isArray?Array.isArray(A):B(A)==="[object Array]"}Ct.isArray=M;function a(A){return typeof A=="boolean"}Ct.isBoolean=a;function c(A){return A===null}Ct.isNull=c;function o(A){return A==null}Ct.isNullOrUndefined=o;function x(A){return typeof A=="number"}Ct.isNumber=x;function n(A){return typeof A=="string"}Ct.isString=n;function g(A){return typeof A=="symbol"}Ct.isSymbol=g;function y(A){return A===void 0}Ct.isUndefined=y;function b(A){return B(A)==="[object RegExp]"}Ct.isRegExp=b;function v(A){return typeof A=="object"&&A!==null}Ct.isObject=v;function d(A){return B(A)==="[object Date]"}Ct.isDate=d;function w(A){return B(A)==="[object Error]"||A instanceof Error}Ct.isError=w;function _(A){return typeof A=="function"}Ct.isFunction=_;function E(A){return A===null||typeof A=="boolean"||typeof A=="number"||typeof A=="string"||typeof A=="symbol"||typeof A>"u"}Ct.isPrimitive=E,Ct.isBuffer=Nt().Buffer.isBuffer;function B(A){return Object.prototype.toString.call(A)}return Ct}var na={},aa={},fa,Fh;function qd(){if(Fh)return fa;Fh=1;var M=Ln(),a=Mh(),c=a(M("String.prototype.indexOf"));return fa=function(x,n){var g=M(x,!!n);return typeof g=="function"&&c(x,".prototype.")>-1?a(g):g},fa}var sa,Dh;function Ld(){if(Dh)return sa;Dh=1;var M=Yn()(),a=qd(),c=a("Object.prototype.toString"),o=function(y){return M&&y&&typeof y=="object"&&Symbol.toStringTag in y?!1:c(y)==="[object Arguments]"},x=function(y){return o(y)?!0:y!==null&&typeof y=="object"&&typeof y.length=="number"&&y.length>=0&&c(y)!=="[object Array]"&&c(y.callee)==="[object Function]"},n=function(){return o(arguments)}();return o.isLegacyArguments=x,sa=n?o:x,sa}var oa,Uh;function Fd(){if(Uh)return oa;Uh=1;var M=Object.prototype.toString,a=Function.prototype.toString,c=/^\s*(?:function)?\*/,o=Yn()(),x=Object.getPrototypeOf,n=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch{}},g;return oa=function(b){if(typeof b!="function")return!1;if(c.test(a.call(b)))return!0;if(!o){var v=M.call(b);return v==="[object GeneratorFunction]"}if(!x)return!1;if(typeof g>"u"){var d=n();g=d?x(d):!1}return x(b)===g},oa}var Hh;function Dd(){return Hh||(Hh=1,function(M){var a=Ld(),c=Fd(),o=Sh(),x=Bh();function n(se){return se.call.bind(se)}var g=typeof BigInt<"u",y=typeof Symbol<"u",b=n(Object.prototype.toString),v=n(Number.prototype.valueOf),d=n(String.prototype.valueOf),w=n(Boolean.prototype.valueOf);if(g)var _=n(BigInt.prototype.valueOf);if(y)var E=n(Symbol.prototype.valueOf);function B(se,Ue){if(typeof se!="object")return!1;try{return Ue(se),!0}catch{return!1}}M.isArgumentsObject=a,M.isGeneratorFunction=c,M.isTypedArray=x;function A(se){return typeof Promise<"u"&&se instanceof Promise||se!==null&&typeof se=="object"&&typeof se.then=="function"&&typeof se.catch=="function"}M.isPromise=A;function P(se){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(se):x(se)||O(se)}M.isArrayBufferView=P;function I(se){return o(se)==="Uint8Array"}M.isUint8Array=I;function k(se){return o(se)==="Uint8ClampedArray"}M.isUint8ClampedArray=k;function F(se){return o(se)==="Uint16Array"}M.isUint16Array=F;function q(se){return o(se)==="Uint32Array"}M.isUint32Array=q;function L(se){return o(se)==="Int8Array"}M.isInt8Array=L;function V(se){return o(se)==="Int16Array"}M.isInt16Array=V;function ee(se){return o(se)==="Int32Array"}M.isInt32Array=ee;function ne(se){return o(se)==="Float32Array"}M.isFloat32Array=ne;function J(se){return o(se)==="Float64Array"}M.isFloat64Array=J;function ue(se){return o(se)==="BigInt64Array"}M.isBigInt64Array=ue;function m(se){return o(se)==="BigUint64Array"}M.isBigUint64Array=m;function e(se){return b(se)==="[object Map]"}e.working=typeof Map<"u"&&e(new Map);function r(se){return typeof Map>"u"?!1:e.working?e(se):se instanceof Map}M.isMap=r;function i(se){return b(se)==="[object Set]"}i.working=typeof Set<"u"&&i(new Set);function f(se){return typeof Set>"u"?!1:i.working?i(se):se instanceof Set}M.isSet=f;function h(se){return b(se)==="[object WeakMap]"}h.working=typeof WeakMap<"u"&&h(new WeakMap);function l(se){return typeof WeakMap>"u"?!1:h.working?h(se):se instanceof WeakMap}M.isWeakMap=l;function p(se){return b(se)==="[object WeakSet]"}p.working=typeof WeakSet<"u"&&p(new WeakSet);function s(se){return p(se)}M.isWeakSet=s;function t(se){return b(se)==="[object ArrayBuffer]"}t.working=typeof ArrayBuffer<"u"&&t(new ArrayBuffer);function u(se){return typeof ArrayBuffer>"u"?!1:t.working?t(se):se instanceof ArrayBuffer}M.isArrayBuffer=u;function S(se){return b(se)==="[object DataView]"}S.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&S(new DataView(new ArrayBuffer(1),0,1));function O(se){return typeof DataView>"u"?!1:S.working?S(se):se instanceof DataView}M.isDataView=O;var H=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Q(se){return b(se)==="[object SharedArrayBuffer]"}function G(se){return typeof H>"u"?!1:(typeof Q.working>"u"&&(Q.working=Q(new H)),Q.working?Q(se):se instanceof H)}M.isSharedArrayBuffer=G;function R(se){return b(se)==="[object AsyncFunction]"}M.isAsyncFunction=R;function C(se){return b(se)==="[object Map Iterator]"}M.isMapIterator=C;function $(se){return b(se)==="[object Set Iterator]"}M.isSetIterator=$;function X(se){return b(se)==="[object Generator]"}M.isGeneratorObject=X;function Z(se){return b(se)==="[object WebAssembly.Module]"}M.isWebAssemblyCompiledModule=Z;function K(se){return B(se,v)}M.isNumberObject=K;function te(se){return B(se,d)}M.isStringObject=te;function Pe(se){return B(se,w)}M.isBooleanObject=Pe;function le(se){return g&&B(se,_)}M.isBigIntObject=le;function ce(se){return y&&B(se,E)}M.isSymbolObject=ce;function Le(se){return K(se)||te(se)||Pe(se)||le(se)||ce(se)}M.isBoxedPrimitive=Le;function be(se){return typeof Uint8Array<"u"&&(u(se)||G(se))}M.isAnyArrayBuffer=be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(se){Object.defineProperty(M,se,{enumerable:!1,value:function(){throw new Error(se+" is not supported in userland")}})})}(aa)),aa}var ha,Kh;function Ud(){return Kh||(Kh=1,ha=function(a){return a&&typeof a=="object"&&typeof a.copy=="function"&&typeof a.fill=="function"&&typeof a.readUInt8=="function"}),ha}var zh;function Ir(){return zh||(zh=1,function(M){var a=Object.getOwnPropertyDescriptors||function(O){for(var H=Object.keys(O),Q={},G=0;G<H.length;G++)Q[H[G]]=Object.getOwnPropertyDescriptor(O,H[G]);return Q},c=/%[sdj%]/g;M.format=function(S){if(!L(S)){for(var O=[],H=0;H<arguments.length;H++)O.push(g(arguments[H]));return O.join(" ")}for(var H=1,Q=arguments,G=Q.length,R=String(S).replace(c,function($){if($==="%%")return"%";if(H>=G)return $;switch($){case"%s":return String(Q[H++]);case"%d":return Number(Q[H++]);case"%j":try{return JSON.stringify(Q[H++])}catch{return"[Circular]"}default:return $}}),C=Q[H];H<G;C=Q[++H])k(C)||!J(C)?R+=" "+C:R+=" "+g(C);return R},M.deprecate=function(S,O){if(typeof je<"u"&&je.noDeprecation===!0)return S;if(typeof je>"u")return function(){return M.deprecate(S,O).apply(this,arguments)};var H=!1;function Q(){if(!H){if(je.throwDeprecation)throw new Error(O);je.traceDeprecation?console.trace(O):console.error(O),H=!0}return S.apply(this,arguments)}return Q};var o={},x=/^$/;if(je.env.NODE_DEBUG){var n=je.env.NODE_DEBUG;n=n.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),x=new RegExp("^"+n+"$","i")}M.debuglog=function(S){if(S=S.toUpperCase(),!o[S])if(x.test(S)){var O=je.pid;o[S]=function(){var H=M.format.apply(M,arguments);console.error("%s %d: %s",S,O,H)}}else o[S]=function(){};return o[S]};function g(S,O){var H={seen:[],stylize:b};return arguments.length>=3&&(H.depth=arguments[2]),arguments.length>=4&&(H.colors=arguments[3]),I(O)?H.showHidden=O:O&&M._extend(H,O),ee(H.showHidden)&&(H.showHidden=!1),ee(H.depth)&&(H.depth=2),ee(H.colors)&&(H.colors=!1),ee(H.customInspect)&&(H.customInspect=!0),H.colors&&(H.stylize=y),d(H,S,H.depth)}M.inspect=g,g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function y(S,O){var H=g.styles[O];return H?"\x1B["+g.colors[H][0]+"m"+S+"\x1B["+g.colors[H][1]+"m":S}function b(S,O){return S}function v(S){var O={};return S.forEach(function(H,Q){O[H]=!0}),O}function d(S,O,H){if(S.customInspect&&O&&e(O.inspect)&&O.inspect!==M.inspect&&!(O.constructor&&O.constructor.prototype===O)){var Q=O.inspect(H,S);return L(Q)||(Q=d(S,Q,H)),Q}var G=w(S,O);if(G)return G;var R=Object.keys(O),C=v(R);if(S.showHidden&&(R=Object.getOwnPropertyNames(O)),m(O)&&(R.indexOf("message")>=0||R.indexOf("description")>=0))return _(O);if(R.length===0){if(e(O)){var $=O.name?": "+O.name:"";return S.stylize("[Function"+$+"]","special")}if(ne(O))return S.stylize(RegExp.prototype.toString.call(O),"regexp");if(ue(O))return S.stylize(Date.prototype.toString.call(O),"date");if(m(O))return _(O)}var X="",Z=!1,K=["{","}"];if(P(O)&&(Z=!0,K=["[","]"]),e(O)){var te=O.name?": "+O.name:"";X=" [Function"+te+"]"}if(ne(O)&&(X=" "+RegExp.prototype.toString.call(O)),ue(O)&&(X=" "+Date.prototype.toUTCString.call(O)),m(O)&&(X=" "+_(O)),R.length===0&&(!Z||O.length==0))return K[0]+X+K[1];if(H<0)return ne(O)?S.stylize(RegExp.prototype.toString.call(O),"regexp"):S.stylize("[Object]","special");S.seen.push(O);var Pe;return Z?Pe=E(S,O,H,C,R):Pe=R.map(function(le){return B(S,O,H,C,le,Z)}),S.seen.pop(),A(Pe,X,K)}function w(S,O){if(ee(O))return S.stylize("undefined","undefined");if(L(O)){var H="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return S.stylize(H,"string")}if(q(O))return S.stylize(""+O,"number");if(I(O))return S.stylize(""+O,"boolean");if(k(O))return S.stylize("null","null")}function _(S){return"["+Error.prototype.toString.call(S)+"]"}function E(S,O,H,Q,G){for(var R=[],C=0,$=O.length;C<$;++C)p(O,String(C))?R.push(B(S,O,H,Q,String(C),!0)):R.push("");return G.forEach(function(X){X.match(/^\d+$/)||R.push(B(S,O,H,Q,X,!0))}),R}function B(S,O,H,Q,G,R){var C,$,X;if(X=Object.getOwnPropertyDescriptor(O,G)||{value:O[G]},X.get?X.set?$=S.stylize("[Getter/Setter]","special"):$=S.stylize("[Getter]","special"):X.set&&($=S.stylize("[Setter]","special")),p(Q,G)||(C="["+G+"]"),$||(S.seen.indexOf(X.value)<0?(k(H)?$=d(S,X.value,null):$=d(S,X.value,H-1),$.indexOf(`
8
- `)>-1&&(R?$=$.split(`
9
- `).map(function(Z){return" "+Z}).join(`
10
- `).slice(2):$=`
11
- `+$.split(`
12
- `).map(function(Z){return" "+Z}).join(`
13
- `))):$=S.stylize("[Circular]","special")),ee(C)){if(R&&G.match(/^\d+$/))return $;C=JSON.stringify(""+G),C.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(C=C.slice(1,-1),C=S.stylize(C,"name")):(C=C.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),C=S.stylize(C,"string"))}return C+": "+$}function A(S,O,H){var Q=S.reduce(function(G,R){return R.indexOf(`
14
- `)>=0,G+R.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Q>60?H[0]+(O===""?"":O+`
15
- `)+" "+S.join(`,
16
- `)+" "+H[1]:H[0]+O+" "+S.join(", ")+" "+H[1]}M.types=Dd();function P(S){return Array.isArray(S)}M.isArray=P;function I(S){return typeof S=="boolean"}M.isBoolean=I;function k(S){return S===null}M.isNull=k;function F(S){return S==null}M.isNullOrUndefined=F;function q(S){return typeof S=="number"}M.isNumber=q;function L(S){return typeof S=="string"}M.isString=L;function V(S){return typeof S=="symbol"}M.isSymbol=V;function ee(S){return S===void 0}M.isUndefined=ee;function ne(S){return J(S)&&i(S)==="[object RegExp]"}M.isRegExp=ne,M.types.isRegExp=ne;function J(S){return typeof S=="object"&&S!==null}M.isObject=J;function ue(S){return J(S)&&i(S)==="[object Date]"}M.isDate=ue,M.types.isDate=ue;function m(S){return J(S)&&(i(S)==="[object Error]"||S instanceof Error)}M.isError=m,M.types.isNativeError=m;function e(S){return typeof S=="function"}M.isFunction=e;function r(S){return S===null||typeof S=="boolean"||typeof S=="number"||typeof S=="string"||typeof S=="symbol"||typeof S>"u"}M.isPrimitive=r,M.isBuffer=Ud();function i(S){return Object.prototype.toString.call(S)}function f(S){return S<10?"0"+S.toString(10):S.toString(10)}var h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function l(){var S=new Date,O=[f(S.getHours()),f(S.getMinutes()),f(S.getSeconds())].join(":");return[S.getDate(),h[S.getMonth()],O].join(" ")}M.log=function(){console.log("%s - %s",l(),M.format.apply(M,arguments))},M.inherits=Ye(),M._extend=function(S,O){if(!O||!J(O))return S;for(var H=Object.keys(O),Q=H.length;Q--;)S[H[Q]]=O[H[Q]];return S};function p(S,O){return Object.prototype.hasOwnProperty.call(S,O)}var s=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;M.promisify=function(O){if(typeof O!="function")throw new TypeError('The "original" argument must be of type Function');if(s&&O[s]){var H=O[s];if(typeof H!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(H,s,{value:H,enumerable:!1,writable:!1,configurable:!0}),H}function H(){for(var Q,G,R=new Promise(function(X,Z){Q=X,G=Z}),C=[],$=0;$<arguments.length;$++)C.push(arguments[$]);C.push(function(X,Z){X?G(X):Q(Z)});try{O.apply(this,C)}catch(X){G(X)}return R}return Object.setPrototypeOf(H,Object.getPrototypeOf(O)),s&&Object.defineProperty(H,s,{value:H,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(H,a(O))},M.promisify.custom=s;function t(S,O){if(!S){var H=new Error("Promise was rejected with a falsy value");H.reason=S,S=H}return O(S)}function u(S){if(typeof S!="function")throw new TypeError('The "original" argument must be of type Function');function O(){for(var H=[],Q=0;Q<arguments.length;Q++)H.push(arguments[Q]);var G=H.pop();if(typeof G!="function")throw new TypeError("The last argument must be of type Function");var R=this,C=function(){return G.apply(R,arguments)};S.apply(this,H).then(function($){je.nextTick(C.bind(null,null,$))},function($){je.nextTick(t.bind(null,$,C))})}return Object.setPrototypeOf(O,Object.getPrototypeOf(S)),Object.defineProperties(O,a(S)),O}M.callbackify=u}(na)),na}var ua={exports:{}},jh;function Hd(){return jh||(jh=1,function(M){function a(n,g){if(!(n instanceof g))throw new TypeError("Cannot call a class as a function")}var c=ia().Buffer,o=Ir();function x(n,g,y){n.copy(g,y)}M.exports=function(){function n(){a(this,n),this.head=null,this.tail=null,this.length=0}return n.prototype.push=function(y){var b={data:y,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length},n.prototype.unshift=function(y){var b={data:y,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length},n.prototype.shift=function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}},n.prototype.clear=function(){this.head=this.tail=null,this.length=0},n.prototype.join=function(y){if(this.length===0)return"";for(var b=this.head,v=""+b.data;b=b.next;)v+=y+b.data;return v},n.prototype.concat=function(y){if(this.length===0)return c.alloc(0);for(var b=c.allocUnsafe(y>>>0),v=this.head,d=0;v;)x(v.data,b,d),d+=v.data.length,v=v.next;return b},n}(),o&&o.inspect&&o.inspect.custom&&(M.exports.prototype[o.inspect.custom]=function(){var n=o.inspect({length:this.length});return this.constructor.name+" "+n})}(ua)),ua.exports}var ca,Vh;function $h(){if(Vh)return ca;Vh=1;var M=dr();function a(x,n){var g=this,y=this._readableState&&this._readableState.destroyed,b=this._writableState&&this._writableState.destroyed;return y||b?(n?n(x):x&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,M.nextTick(o,this,x)):M.nextTick(o,this,x)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(x||null,function(v){!n&&v?g._writableState?g._writableState.errorEmitted||(g._writableState.errorEmitted=!0,M.nextTick(o,g,v)):M.nextTick(o,g,v):n&&n(v)}),this)}function c(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(x,n){x.emit("error",n)}return ca={destroy:a,undestroy:c},ca}var la,Gh;function da(){if(Gh)return la;Gh=1,la=M;function M(c,o){if(a("noDeprecation"))return c;var x=!1;function n(){if(!x){if(a("throwDeprecation"))throw new Error(o);a("traceDeprecation")?console.trace(o):console.warn(o),x=!0}return c.apply(this,arguments)}return n}function a(c){try{if(!et.localStorage)return!1}catch{return!1}var o=et.localStorage[c];return o==null?!1:String(o).toLowerCase()==="true"}return la}var pa,Wh;function Yh(){if(Wh)return pa;Wh=1;var M=dr();pa=A;function a(l){var p=this;this.next=null,this.entry=null,this.finish=function(){h(p,l)}}var c=!je.browser&&["v0.10","v0.9."].indexOf(je.version.slice(0,5))>-1?setImmediate:M.nextTick,o;A.WritableState=E;var x=Object.create(ir());x.inherits=Ye();var n={deprecate:da()},g=Ch(),y=ia().Buffer,b=(typeof et<"u"?et:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function v(l){return y.from(l)}function d(l){return y.isBuffer(l)||l instanceof b}var w=$h();x.inherits(A,g);function _(){}function E(l,p){o=o||Or(),l=l||{};var s=p instanceof o;this.objectMode=!!l.objectMode,s&&(this.objectMode=this.objectMode||!!l.writableObjectMode);var t=l.highWaterMark,u=l.writableHighWaterMark,S=this.objectMode?16:16*1024;t||t===0?this.highWaterMark=t:s&&(u||u===0)?this.highWaterMark=u:this.highWaterMark=S,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var O=l.decodeStrings===!1;this.decodeStrings=!O,this.defaultEncoding=l.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(H){ee(p,H)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}E.prototype.getBuffer=function(){for(var p=this.bufferedRequest,s=[];p;)s.push(p),p=p.next;return s},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var B;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(B=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(l){return B.call(this,l)?!0:this!==A?!1:l&&l._writableState instanceof E}})):B=function(l){return l instanceof this};function A(l){if(o=o||Or(),!B.call(A,this)&&!(this instanceof o))return new A(l);this._writableState=new E(l,this),this.writable=!0,l&&(typeof l.write=="function"&&(this._write=l.write),typeof l.writev=="function"&&(this._writev=l.writev),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.final=="function"&&(this._final=l.final)),g.call(this)}A.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function P(l,p){var s=new Error("write after end");l.emit("error",s),M.nextTick(p,s)}function I(l,p,s,t){var u=!0,S=!1;return s===null?S=new TypeError("May not write null values to stream"):typeof s!="string"&&s!==void 0&&!p.objectMode&&(S=new TypeError("Invalid non-string/buffer chunk")),S&&(l.emit("error",S),M.nextTick(t,S),u=!1),u}A.prototype.write=function(l,p,s){var t=this._writableState,u=!1,S=!t.objectMode&&d(l);return S&&!y.isBuffer(l)&&(l=v(l)),typeof p=="function"&&(s=p,p=null),S?p="buffer":p||(p=t.defaultEncoding),typeof s!="function"&&(s=_),t.ended?P(this,s):(S||I(this,t,l,s))&&(t.pendingcb++,u=F(this,t,S,l,p,s)),u},A.prototype.cork=function(){var l=this._writableState;l.corked++},A.prototype.uncork=function(){var l=this._writableState;l.corked&&(l.corked--,!l.writing&&!l.corked&&!l.bufferProcessing&&l.bufferedRequest&&ue(this,l))},A.prototype.setDefaultEncoding=function(p){if(typeof p=="string"&&(p=p.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((p+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+p);return this._writableState.defaultEncoding=p,this};function k(l,p,s){return!l.objectMode&&l.decodeStrings!==!1&&typeof p=="string"&&(p=y.from(p,s)),p}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(l,p,s,t,u,S){if(!s){var O=k(p,t,u);t!==O&&(s=!0,u="buffer",t=O)}var H=p.objectMode?1:t.length;p.length+=H;var Q=p.length<p.highWaterMark;if(Q||(p.needDrain=!0),p.writing||p.corked){var G=p.lastBufferedRequest;p.lastBufferedRequest={chunk:t,encoding:u,isBuf:s,callback:S,next:null},G?G.next=p.lastBufferedRequest:p.bufferedRequest=p.lastBufferedRequest,p.bufferedRequestCount+=1}else q(l,p,!1,H,t,u,S);return Q}function q(l,p,s,t,u,S,O){p.writelen=t,p.writecb=O,p.writing=!0,p.sync=!0,s?l._writev(u,p.onwrite):l._write(u,S,p.onwrite),p.sync=!1}function L(l,p,s,t,u){--p.pendingcb,s?(M.nextTick(u,t),M.nextTick(i,l,p),l._writableState.errorEmitted=!0,l.emit("error",t)):(u(t),l._writableState.errorEmitted=!0,l.emit("error",t),i(l,p))}function V(l){l.writing=!1,l.writecb=null,l.length-=l.writelen,l.writelen=0}function ee(l,p){var s=l._writableState,t=s.sync,u=s.writecb;if(V(s),p)L(l,s,t,p,u);else{var S=m(s);!S&&!s.corked&&!s.bufferProcessing&&s.bufferedRequest&&ue(l,s),t?c(ne,l,s,S,u):ne(l,s,S,u)}}function ne(l,p,s,t){s||J(l,p),p.pendingcb--,t(),i(l,p)}function J(l,p){p.length===0&&p.needDrain&&(p.needDrain=!1,l.emit("drain"))}function ue(l,p){p.bufferProcessing=!0;var s=p.bufferedRequest;if(l._writev&&s&&s.next){var t=p.bufferedRequestCount,u=new Array(t),S=p.corkedRequestsFree;S.entry=s;for(var O=0,H=!0;s;)u[O]=s,s.isBuf||(H=!1),s=s.next,O+=1;u.allBuffers=H,q(l,p,!0,p.length,u,"",S.finish),p.pendingcb++,p.lastBufferedRequest=null,S.next?(p.corkedRequestsFree=S.next,S.next=null):p.corkedRequestsFree=new a(p),p.bufferedRequestCount=0}else{for(;s;){var Q=s.chunk,G=s.encoding,R=s.callback,C=p.objectMode?1:Q.length;if(q(l,p,!1,C,Q,G,R),s=s.next,p.bufferedRequestCount--,p.writing)break}s===null&&(p.lastBufferedRequest=null)}p.bufferedRequest=s,p.bufferProcessing=!1}A.prototype._write=function(l,p,s){s(new Error("_write() is not implemented"))},A.prototype._writev=null,A.prototype.end=function(l,p,s){var t=this._writableState;typeof l=="function"?(s=l,l=null,p=null):typeof p=="function"&&(s=p,p=null),l!=null&&this.write(l,p),t.corked&&(t.corked=1,this.uncork()),t.ending||f(this,t,s)};function m(l){return l.ending&&l.length===0&&l.bufferedRequest===null&&!l.finished&&!l.writing}function e(l,p){l._final(function(s){p.pendingcb--,s&&l.emit("error",s),p.prefinished=!0,l.emit("prefinish"),i(l,p)})}function r(l,p){!p.prefinished&&!p.finalCalled&&(typeof l._final=="function"?(p.pendingcb++,p.finalCalled=!0,M.nextTick(e,l,p)):(p.prefinished=!0,l.emit("prefinish")))}function i(l,p){var s=m(p);return s&&(r(l,p),p.pendingcb===0&&(p.finished=!0,l.emit("finish"))),s}function f(l,p,s){p.ending=!0,i(l,p),s&&(p.finished?M.nextTick(s):l.once("finish",s)),p.ended=!0,l.writable=!1}function h(l,p,s){var t=l.entry;for(l.entry=null;t;){var u=t.callback;p.pendingcb--,u(s),t=t.next}p.corkedRequestsFree.next=l}return Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(l){this._writableState&&(this._writableState.destroyed=l)}}),A.prototype.destroy=w.destroy,A.prototype._undestroy=w.undestroy,A.prototype._destroy=function(l,p){this.end(),p(l)},pa}var va,Jh;function Or(){if(Jh)return va;Jh=1;var M=dr(),a=Object.keys||function(w){var _=[];for(var E in w)_.push(E);return _};va=b;var c=Object.create(ir());c.inherits=Ye();var o=Qh(),x=Yh();c.inherits(b,o);for(var n=a(x.prototype),g=0;g<n.length;g++){var y=n[g];b.prototype[y]||(b.prototype[y]=x.prototype[y])}function b(w){if(!(this instanceof b))return new b(w);o.call(this,w),x.call(this,w),w&&w.readable===!1&&(this.readable=!1),w&&w.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,w&&w.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",v)}Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function v(){this.allowHalfOpen||this._writableState.ended||M.nextTick(d,this)}function d(w){w.end()}return Object.defineProperty(b.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(w){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=w,this._writableState.destroyed=w)}}),b.prototype._destroy=function(w,_){this.push(null),this.end(),M.nextTick(_,w)},va}var ma={},Zh;function Mr(){if(Zh)return ma;Zh=1;var M=tt().Buffer,a=M.isEncoding||function(I){switch(I=""+I,I&&I.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function c(I){if(!I)return"utf8";for(var k;;)switch(I){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return I;default:if(k)return;I=(""+I).toLowerCase(),k=!0}}function o(I){var k=c(I);if(typeof k!="string"&&(M.isEncoding===a||!a(I)))throw new Error("Unknown encoding: "+I);return k||I}ma.StringDecoder=x;function x(I){this.encoding=o(I);var k;switch(this.encoding){case"utf16le":this.text=w,this.end=_,k=4;break;case"utf8":this.fillLast=b,k=4;break;case"base64":this.text=E,this.end=B,k=3;break;default:this.write=A,this.end=P;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=M.allocUnsafe(k)}x.prototype.write=function(I){if(I.length===0)return"";var k,F;if(this.lastNeed){if(k=this.fillLast(I),k===void 0)return"";F=this.lastNeed,this.lastNeed=0}else F=0;return F<I.length?k?k+this.text(I,F):this.text(I,F):k||""},x.prototype.end=d,x.prototype.text=v,x.prototype.fillLast=function(I){if(this.lastNeed<=I.length)return I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,this.lastTotal-this.lastNeed,0,I.length),this.lastNeed-=I.length};function n(I){return I<=127?0:I>>5===6?2:I>>4===14?3:I>>3===30?4:I>>6===2?-1:-2}function g(I,k,F){var q=k.length-1;if(q<F)return 0;var L=n(k[q]);return L>=0?(L>0&&(I.lastNeed=L-1),L):--q<F||L===-2?0:(L=n(k[q]),L>=0?(L>0&&(I.lastNeed=L-2),L):--q<F||L===-2?0:(L=n(k[q]),L>=0?(L>0&&(L===2?L=0:I.lastNeed=L-3),L):0))}function y(I,k,F){if((k[0]&192)!==128)return I.lastNeed=0,"�";if(I.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return I.lastNeed=1,"�";if(I.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return I.lastNeed=2,"�"}}function b(I){var k=this.lastTotal-this.lastNeed,F=y(this,I);if(F!==void 0)return F;if(this.lastNeed<=I.length)return I.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,k,0,I.length),this.lastNeed-=I.length}function v(I,k){var F=g(this,I,k);if(!this.lastNeed)return I.toString("utf8",k);this.lastTotal=F;var q=I.length-(F-this.lastNeed);return I.copy(this.lastChar,0,q),I.toString("utf8",k,q)}function d(I){var k=I&&I.length?this.write(I):"";return this.lastNeed?k+"�":k}function w(I,k){if((I.length-k)%2===0){var F=I.toString("utf16le",k);if(F){var q=F.charCodeAt(F.length-1);if(q>=55296&&q<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],F.slice(0,-1)}return F}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",k,I.length-1)}function _(I){var k=I&&I.length?this.write(I):"";if(this.lastNeed){var F=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,F)}return k}function E(I,k){var F=(I.length-k)%3;return F===0?I.toString("base64",k):(this.lastNeed=3-F,this.lastTotal=3,F===1?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",k,I.length-F))}function B(I){var k=I&&I.length?this.write(I):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function A(I){return I.toString(this.encoding)}function P(I){return I&&I.length?this.write(I):""}return ma}var ba,Xh;function Qh(){if(Xh)return ba;Xh=1;var M=dr();ba=k;var a=Ph(),c;k.ReadableState=I,wr().EventEmitter;var o=function(R,C){return R.listeners(C).length},x=Ch(),n=ia().Buffer,g=(typeof et<"u"?et:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function y(R){return n.from(R)}function b(R){return n.isBuffer(R)||R instanceof g}var v=Object.create(ir());v.inherits=Ye();var d=Ir(),w=void 0;d&&d.debuglog?w=d.debuglog("stream"):w=function(){};var _=Hd(),E=$h(),B;v.inherits(k,x);var A=["error","close","destroy","pause","resume"];function P(R,C,$){if(typeof R.prependListener=="function")return R.prependListener(C,$);!R._events||!R._events[C]?R.on(C,$):a(R._events[C])?R._events[C].unshift($):R._events[C]=[$,R._events[C]]}function I(R,C){c=c||Or(),R=R||{};var $=C instanceof c;this.objectMode=!!R.objectMode,$&&(this.objectMode=this.objectMode||!!R.readableObjectMode);var X=R.highWaterMark,Z=R.readableHighWaterMark,K=this.objectMode?16:16*1024;X||X===0?this.highWaterMark=X:$&&(Z||Z===0)?this.highWaterMark=Z:this.highWaterMark=K,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(B||(B=Mr().StringDecoder),this.decoder=new B(R.encoding),this.encoding=R.encoding)}function k(R){if(c=c||Or(),!(this instanceof k))return new k(R);this._readableState=new I(R,this),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),x.call(this)}Object.defineProperty(k.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),k.prototype.destroy=E.destroy,k.prototype._undestroy=E.undestroy,k.prototype._destroy=function(R,C){this.push(null),C(R)},k.prototype.push=function(R,C){var $=this._readableState,X;return $.objectMode?X=!0:typeof R=="string"&&(C=C||$.defaultEncoding,C!==$.encoding&&(R=n.from(R,C),C=""),X=!0),F(this,R,C,!1,X)},k.prototype.unshift=function(R){return F(this,R,null,!0,!1)};function F(R,C,$,X,Z){var K=R._readableState;if(C===null)K.reading=!1,ue(R,K);else{var te;Z||(te=L(K,C)),te?R.emit("error",te):K.objectMode||C&&C.length>0?(typeof C!="string"&&!K.objectMode&&Object.getPrototypeOf(C)!==n.prototype&&(C=y(C)),X?K.endEmitted?R.emit("error",new Error("stream.unshift() after end event")):q(R,K,C,!0):K.ended?R.emit("error",new Error("stream.push() after EOF")):(K.reading=!1,K.decoder&&!$?(C=K.decoder.write(C),K.objectMode||C.length!==0?q(R,K,C,!1):r(R,K)):q(R,K,C,!1))):X||(K.reading=!1)}return V(K)}function q(R,C,$,X){C.flowing&&C.length===0&&!C.sync?(R.emit("data",$),R.read(0)):(C.length+=C.objectMode?1:$.length,X?C.buffer.unshift($):C.buffer.push($),C.needReadable&&m(R)),r(R,C)}function L(R,C){var $;return!b(C)&&typeof C!="string"&&C!==void 0&&!R.objectMode&&($=new TypeError("Invalid non-string/buffer chunk")),$}function V(R){return!R.ended&&(R.needReadable||R.length<R.highWaterMark||R.length===0)}k.prototype.isPaused=function(){return this._readableState.flowing===!1},k.prototype.setEncoding=function(R){return B||(B=Mr().StringDecoder),this._readableState.decoder=new B(R),this._readableState.encoding=R,this};var ee=8388608;function ne(R){return R>=ee?R=ee:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function J(R,C){return R<=0||C.length===0&&C.ended?0:C.objectMode?1:R!==R?C.flowing&&C.length?C.buffer.head.data.length:C.length:(R>C.highWaterMark&&(C.highWaterMark=ne(R)),R<=C.length?R:C.ended?C.length:(C.needReadable=!0,0))}k.prototype.read=function(R){w("read",R),R=parseInt(R,10);var C=this._readableState,$=R;if(R!==0&&(C.emittedReadable=!1),R===0&&C.needReadable&&(C.length>=C.highWaterMark||C.ended))return w("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?H(this):m(this),null;if(R=J(R,C),R===0&&C.ended)return C.length===0&&H(this),null;var X=C.needReadable;w("need readable",X),(C.length===0||C.length-R<C.highWaterMark)&&(X=!0,w("length less than watermark",X)),C.ended||C.reading?(X=!1,w("reading or ended",X)):X&&(w("do read"),C.reading=!0,C.sync=!0,C.length===0&&(C.needReadable=!0),this._read(C.highWaterMark),C.sync=!1,C.reading||(R=J($,C)));var Z;return R>0?Z=t(R,C):Z=null,Z===null?(C.needReadable=!0,R=0):C.length-=R,C.length===0&&(C.ended||(C.needReadable=!0),$!==R&&C.ended&&H(this)),Z!==null&&this.emit("data",Z),Z};function ue(R,C){if(!C.ended){if(C.decoder){var $=C.decoder.end();$&&$.length&&(C.buffer.push($),C.length+=C.objectMode?1:$.length)}C.ended=!0,m(R)}}function m(R){var C=R._readableState;C.needReadable=!1,C.emittedReadable||(w("emitReadable",C.flowing),C.emittedReadable=!0,C.sync?M.nextTick(e,R):e(R))}function e(R){w("emit readable"),R.emit("readable"),s(R)}function r(R,C){C.readingMore||(C.readingMore=!0,M.nextTick(i,R,C))}function i(R,C){for(var $=C.length;!C.reading&&!C.flowing&&!C.ended&&C.length<C.highWaterMark&&(w("maybeReadMore read 0"),R.read(0),$!==C.length);)$=C.length;C.readingMore=!1}k.prototype._read=function(R){this.emit("error",new Error("_read() is not implemented"))},k.prototype.pipe=function(R,C){var $=this,X=this._readableState;switch(X.pipesCount){case 0:X.pipes=R;break;case 1:X.pipes=[X.pipes,R];break;default:X.pipes.push(R);break}X.pipesCount+=1,w("pipe count=%d opts=%j",X.pipesCount,C);var Z=(!C||C.end!==!1)&&R!==je.stdout&&R!==je.stderr,K=Z?Pe:De;X.endEmitted?M.nextTick(K):$.once("end",K),R.on("unpipe",te);function te(ve,_e){w("onunpipe"),ve===$&&_e&&_e.hasUnpiped===!1&&(_e.hasUnpiped=!0,Le())}function Pe(){w("onend"),R.end()}var le=f($);R.on("drain",le);var ce=!1;function Le(){w("cleanup"),R.removeListener("close",de),R.removeListener("finish",ge),R.removeListener("drain",le),R.removeListener("error",Ue),R.removeListener("unpipe",te),$.removeListener("end",Pe),$.removeListener("end",De),$.removeListener("data",se),ce=!0,X.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&le()}var be=!1;$.on("data",se);function se(ve){w("ondata"),be=!1;var _e=R.write(ve);_e===!1&&!be&&((X.pipesCount===1&&X.pipes===R||X.pipesCount>1&&G(X.pipes,R)!==-1)&&!ce&&(w("false write response, pause",X.awaitDrain),X.awaitDrain++,be=!0),$.pause())}function Ue(ve){w("onerror",ve),De(),R.removeListener("error",Ue),o(R,"error")===0&&R.emit("error",ve)}P(R,"error",Ue);function de(){R.removeListener("finish",ge),De()}R.once("close",de);function ge(){w("onfinish"),R.removeListener("close",de),De()}R.once("finish",ge);function De(){w("unpipe"),$.unpipe(R)}return R.emit("pipe",$),X.flowing||(w("pipe resume"),$.resume()),R};function f(R){return function(){var C=R._readableState;w("pipeOnDrain",C.awaitDrain),C.awaitDrain&&C.awaitDrain--,C.awaitDrain===0&&o(R,"data")&&(C.flowing=!0,s(R))}}k.prototype.unpipe=function(R){var C=this._readableState,$={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return R&&R!==C.pipes?this:(R||(R=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,R&&R.emit("unpipe",this,$),this);if(!R){var X=C.pipes,Z=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var K=0;K<Z;K++)X[K].emit("unpipe",this,{hasUnpiped:!1});return this}var te=G(C.pipes,R);return te===-1?this:(C.pipes.splice(te,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),R.emit("unpipe",this,$),this)},k.prototype.on=function(R,C){var $=x.prototype.on.call(this,R,C);if(R==="data")this._readableState.flowing!==!1&&this.resume();else if(R==="readable"){var X=this._readableState;!X.endEmitted&&!X.readableListening&&(X.readableListening=X.needReadable=!0,X.emittedReadable=!1,X.reading?X.length&&m(this):M.nextTick(h,this))}return $},k.prototype.addListener=k.prototype.on;function h(R){w("readable nexttick read 0"),R.read(0)}k.prototype.resume=function(){var R=this._readableState;return R.flowing||(w("resume"),R.flowing=!0,l(this,R)),this};function l(R,C){C.resumeScheduled||(C.resumeScheduled=!0,M.nextTick(p,R,C))}function p(R,C){C.reading||(w("resume read 0"),R.read(0)),C.resumeScheduled=!1,C.awaitDrain=0,R.emit("resume"),s(R),C.flowing&&!C.reading&&R.read(0)}k.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function s(R){var C=R._readableState;for(w("flow",C.flowing);C.flowing&&R.read()!==null;);}k.prototype.wrap=function(R){var C=this,$=this._readableState,X=!1;R.on("end",function(){if(w("wrapped end"),$.decoder&&!$.ended){var te=$.decoder.end();te&&te.length&&C.push(te)}C.push(null)}),R.on("data",function(te){if(w("wrapped data"),$.decoder&&(te=$.decoder.write(te)),!($.objectMode&&te==null)&&!(!$.objectMode&&(!te||!te.length))){var Pe=C.push(te);Pe||(X=!0,R.pause())}});for(var Z in R)this[Z]===void 0&&typeof R[Z]=="function"&&(this[Z]=function(te){return function(){return R[te].apply(R,arguments)}}(Z));for(var K=0;K<A.length;K++)R.on(A[K],this.emit.bind(this,A[K]));return this._read=function(te){w("wrapped _read",te),X&&(X=!1,R.resume())},this},Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),k._fromList=t;function t(R,C){if(C.length===0)return null;var $;return C.objectMode?$=C.buffer.shift():!R||R>=C.length?(C.decoder?$=C.buffer.join(""):C.buffer.length===1?$=C.buffer.head.data:$=C.buffer.concat(C.length),C.buffer.clear()):$=u(R,C.buffer,C.decoder),$}function u(R,C,$){var X;return R<C.head.data.length?(X=C.head.data.slice(0,R),C.head.data=C.head.data.slice(R)):R===C.head.data.length?X=C.shift():X=$?S(R,C):O(R,C),X}function S(R,C){var $=C.head,X=1,Z=$.data;for(R-=Z.length;$=$.next;){var K=$.data,te=R>K.length?K.length:R;if(te===K.length?Z+=K:Z+=K.slice(0,R),R-=te,R===0){te===K.length?(++X,$.next?C.head=$.next:C.head=C.tail=null):(C.head=$,$.data=K.slice(te));break}++X}return C.length-=X,Z}function O(R,C){var $=n.allocUnsafe(R),X=C.head,Z=1;for(X.data.copy($),R-=X.data.length;X=X.next;){var K=X.data,te=R>K.length?K.length:R;if(K.copy($,$.length-R,0,te),R-=te,R===0){te===K.length?(++Z,X.next?C.head=X.next:C.head=C.tail=null):(C.head=X,X.data=K.slice(te));break}++Z}return C.length-=Z,$}function H(R){var C=R._readableState;if(C.length>0)throw new Error('"endReadable()" called on non-empty stream');C.endEmitted||(C.ended=!0,M.nextTick(Q,C,R))}function Q(R,C){!R.endEmitted&&R.length===0&&(R.endEmitted=!0,C.readable=!1,C.emit("end"))}function G(R,C){for(var $=0,X=R.length;$<X;$++)if(R[$]===C)return $;return-1}return ba}var ga,e0;function t0(){if(e0)return ga;e0=1,ga=o;var M=Or(),a=Object.create(ir());a.inherits=Ye(),a.inherits(o,M);function c(g,y){var b=this._transformState;b.transforming=!1;var v=b.writecb;if(!v)return this.emit("error",new Error("write callback called multiple times"));b.writechunk=null,b.writecb=null,y!=null&&this.push(y),v(g);var d=this._readableState;d.reading=!1,(d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}function o(g){if(!(this instanceof o))return new o(g);M.call(this,g),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,g&&(typeof g.transform=="function"&&(this._transform=g.transform),typeof g.flush=="function"&&(this._flush=g.flush)),this.on("prefinish",x)}function x(){var g=this;typeof this._flush=="function"?this._flush(function(y,b){n(g,y,b)}):n(this,null,null)}o.prototype.push=function(g,y){return this._transformState.needTransform=!1,M.prototype.push.call(this,g,y)},o.prototype._transform=function(g,y,b){throw new Error("_transform() is not implemented")},o.prototype._write=function(g,y,b){var v=this._transformState;if(v.writecb=b,v.writechunk=g,v.writeencoding=y,!v.transforming){var d=this._readableState;(v.needTransform||d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}},o.prototype._read=function(g){var y=this._transformState;y.writechunk!==null&&y.writecb&&!y.transforming?(y.transforming=!0,this._transform(y.writechunk,y.writeencoding,y.afterTransform)):y.needTransform=!0},o.prototype._destroy=function(g,y){var b=this;M.prototype._destroy.call(this,g,function(v){y(v),b.emit("close")})};function n(g,y,b){if(y)return g.emit("error",y);if(b!=null&&g.push(b),g._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(g._transformState.transforming)throw new Error("Calling transform done when still transforming");return g.push(null)}return ga}var ya,r0;function Kd(){if(r0)return ya;r0=1,ya=c;var M=t0(),a=Object.create(ir());a.inherits=Ye(),a.inherits(c,M);function c(o){if(!(this instanceof c))return new c(o);M.call(this,o)}return c.prototype._transform=function(o,x,n){n(null,o)},ya}var i0;function zd(){return i0||(i0=1,function(M,a){a=M.exports=Qh(),a.Stream=a,a.Readable=a,a.Writable=Yh(),a.Duplex=Or(),a.Transform=t0(),a.PassThrough=Kd()}(ui,ui.exports)),ui.exports}var wa,n0;function a0(){if(n0)return wa;n0=1;var M=tt().Buffer,a=Cd(),c=zd().Transform,o=Ye();function x(n){c.call(this),this._block=M.allocUnsafe(n),this._blockSize=n,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return o(x,c),x.prototype._transform=function(n,g,y){var b=null;try{this.update(n,g)}catch(v){b=v}y(b)},x.prototype._flush=function(n){var g=null;try{this.push(this.digest())}catch(y){g=y}n(g)},x.prototype.update=function(n,g){if(this._finalized)throw new Error("Digest already called");for(var y=a(n,g),b=this._block,v=0;this._blockOffset+y.length-v>=this._blockSize;){for(var d=this._blockOffset;d<this._blockSize;)b[d]=y[v],d+=1,v+=1;this._update(),this._blockOffset=0}for(;v<y.length;)b[this._blockOffset]=y[v],this._blockOffset+=1,v+=1;for(var w=0,_=y.length*8;_>0;++w)this._length[w]+=_,_=this._length[w]/4294967296|0,_>0&&(this._length[w]-=4294967296*_);return this},x.prototype._update=function(){throw new Error("_update is not implemented")},x.prototype.digest=function(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var g=this._digest();n!==void 0&&(g=g.toString(n)),this._block.fill(0),this._blockOffset=0;for(var y=0;y<4;++y)this._length[y]=0;return g},x.prototype._digest=function(){throw new Error("_digest is not implemented")},wa=x,wa}var Ma,f0;function xa(){if(f0)return Ma;f0=1;var M=Ye(),a=a0(),c=tt().Buffer,o=new Array(16);function x(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}M(x,a),x.prototype._update=function(){for(var d=o,w=0;w<16;++w)d[w]=this._block.readInt32LE(w*4);var _=this._a,E=this._b,B=this._c,A=this._d;_=g(_,E,B,A,d[0],3614090360,7),A=g(A,_,E,B,d[1],3905402710,12),B=g(B,A,_,E,d[2],606105819,17),E=g(E,B,A,_,d[3],3250441966,22),_=g(_,E,B,A,d[4],4118548399,7),A=g(A,_,E,B,d[5],1200080426,12),B=g(B,A,_,E,d[6],2821735955,17),E=g(E,B,A,_,d[7],4249261313,22),_=g(_,E,B,A,d[8],1770035416,7),A=g(A,_,E,B,d[9],2336552879,12),B=g(B,A,_,E,d[10],4294925233,17),E=g(E,B,A,_,d[11],2304563134,22),_=g(_,E,B,A,d[12],1804603682,7),A=g(A,_,E,B,d[13],4254626195,12),B=g(B,A,_,E,d[14],2792965006,17),E=g(E,B,A,_,d[15],1236535329,22),_=y(_,E,B,A,d[1],4129170786,5),A=y(A,_,E,B,d[6],3225465664,9),B=y(B,A,_,E,d[11],643717713,14),E=y(E,B,A,_,d[0],3921069994,20),_=y(_,E,B,A,d[5],3593408605,5),A=y(A,_,E,B,d[10],38016083,9),B=y(B,A,_,E,d[15],3634488961,14),E=y(E,B,A,_,d[4],3889429448,20),_=y(_,E,B,A,d[9],568446438,5),A=y(A,_,E,B,d[14],3275163606,9),B=y(B,A,_,E,d[3],4107603335,14),E=y(E,B,A,_,d[8],1163531501,20),_=y(_,E,B,A,d[13],2850285829,5),A=y(A,_,E,B,d[2],4243563512,9),B=y(B,A,_,E,d[7],1735328473,14),E=y(E,B,A,_,d[12],2368359562,20),_=b(_,E,B,A,d[5],4294588738,4),A=b(A,_,E,B,d[8],2272392833,11),B=b(B,A,_,E,d[11],1839030562,16),E=b(E,B,A,_,d[14],4259657740,23),_=b(_,E,B,A,d[1],2763975236,4),A=b(A,_,E,B,d[4],1272893353,11),B=b(B,A,_,E,d[7],4139469664,16),E=b(E,B,A,_,d[10],3200236656,23),_=b(_,E,B,A,d[13],681279174,4),A=b(A,_,E,B,d[0],3936430074,11),B=b(B,A,_,E,d[3],3572445317,16),E=b(E,B,A,_,d[6],76029189,23),_=b(_,E,B,A,d[9],3654602809,4),A=b(A,_,E,B,d[12],3873151461,11),B=b(B,A,_,E,d[15],530742520,16),E=b(E,B,A,_,d[2],3299628645,23),_=v(_,E,B,A,d[0],4096336452,6),A=v(A,_,E,B,d[7],1126891415,10),B=v(B,A,_,E,d[14],2878612391,15),E=v(E,B,A,_,d[5],4237533241,21),_=v(_,E,B,A,d[12],1700485571,6),A=v(A,_,E,B,d[3],2399980690,10),B=v(B,A,_,E,d[10],4293915773,15),E=v(E,B,A,_,d[1],2240044497,21),_=v(_,E,B,A,d[8],1873313359,6),A=v(A,_,E,B,d[15],4264355552,10),B=v(B,A,_,E,d[6],2734768916,15),E=v(E,B,A,_,d[13],1309151649,21),_=v(_,E,B,A,d[4],4149444226,6),A=v(A,_,E,B,d[11],3174756917,10),B=v(B,A,_,E,d[2],718787259,15),E=v(E,B,A,_,d[9],3951481745,21),this._a=this._a+_|0,this._b=this._b+E|0,this._c=this._c+B|0,this._d=this._d+A|0},x.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var d=c.allocUnsafe(16);return d.writeInt32LE(this._a,0),d.writeInt32LE(this._b,4),d.writeInt32LE(this._c,8),d.writeInt32LE(this._d,12),d};function n(d,w){return d<<w|d>>>32-w}function g(d,w,_,E,B,A,P){return n(d+(w&_|~w&E)+B+A|0,P)+w|0}function y(d,w,_,E,B,A,P){return n(d+(w&E|_&~E)+B+A|0,P)+w|0}function b(d,w,_,E,B,A,P){return n(d+(w^_^E)+B+A|0,P)+w|0}function v(d,w,_,E,B,A,P){return n(d+(_^(w|~E))+B+A|0,P)+w|0}return Ma=x,Ma}var _a,s0;function Sa(){if(s0)return _a;s0=1;var M=Nt().Buffer,a=Ye(),c=a0(),o=new Array(16),x=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],n=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],b=[0,1518500249,1859775393,2400959708,2840853838],v=[1352829926,1548603684,1836072691,2053994217,0];function d(I,k){return I<<k|I>>>32-k}function w(I,k,F,q,L,V,ee,ne){return d(I+(k^F^q)+V+ee|0,ne)+L|0}function _(I,k,F,q,L,V,ee,ne){return d(I+(k&F|~k&q)+V+ee|0,ne)+L|0}function E(I,k,F,q,L,V,ee,ne){return d(I+((k|~F)^q)+V+ee|0,ne)+L|0}function B(I,k,F,q,L,V,ee,ne){return d(I+(k&q|F&~q)+V+ee|0,ne)+L|0}function A(I,k,F,q,L,V,ee,ne){return d(I+(k^(F|~q))+V+ee|0,ne)+L|0}function P(){c.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return a(P,c),P.prototype._update=function(){for(var I=o,k=0;k<16;++k)I[k]=this._block.readInt32LE(k*4);for(var F=this._a|0,q=this._b|0,L=this._c|0,V=this._d|0,ee=this._e|0,ne=this._a|0,J=this._b|0,ue=this._c|0,m=this._d|0,e=this._e|0,r=0;r<80;r+=1){var i,f;r<16?(i=w(F,q,L,V,ee,I[x[r]],b[0],g[r]),f=A(ne,J,ue,m,e,I[n[r]],v[0],y[r])):r<32?(i=_(F,q,L,V,ee,I[x[r]],b[1],g[r]),f=B(ne,J,ue,m,e,I[n[r]],v[1],y[r])):r<48?(i=E(F,q,L,V,ee,I[x[r]],b[2],g[r]),f=E(ne,J,ue,m,e,I[n[r]],v[2],y[r])):r<64?(i=B(F,q,L,V,ee,I[x[r]],b[3],g[r]),f=_(ne,J,ue,m,e,I[n[r]],v[3],y[r])):(i=A(F,q,L,V,ee,I[x[r]],b[4],g[r]),f=w(ne,J,ue,m,e,I[n[r]],v[4],y[r])),F=ee,ee=V,V=d(L,10),L=q,q=i,ne=e,e=m,m=d(ue,10),ue=J,J=f}var h=this._b+L+m|0;this._b=this._c+V+e|0,this._c=this._d+ee+ne|0,this._d=this._e+F+J|0,this._e=this._a+q+ue|0,this._a=h},P.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var I=M.alloc?M.alloc(20):new M(20);return I.writeInt32LE(this._a,0),I.writeInt32LE(this._b,4),I.writeInt32LE(this._c,8),I.writeInt32LE(this._d,12),I.writeInt32LE(this._e,16),I},_a=P,_a}var Ea={exports:{}},Ba,o0;function kr(){if(o0)return Ba;o0=1;var M=tt().Buffer,a=hi();function c(o,x){this._block=M.alloc(o),this._finalSize=x,this._blockSize=o,this._len=0}return c.prototype.update=function(o,x){o=a(o,x||"utf8");for(var n=this._block,g=this._blockSize,y=o.length,b=this._len,v=0;v<y;){for(var d=b%g,w=Math.min(y-v,g-d),_=0;_<w;_++)n[d+_]=o[v+_];b+=w,v+=w,b%g===0&&this._update(n)}return this._len+=y,this},c.prototype.digest=function(o){var x=this._len%this._blockSize;this._block[x]=128,this._block.fill(0,x+1),x>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var g=(n&4294967295)>>>0,y=(n-g)/4294967296;this._block.writeUInt32BE(y,this._blockSize-8),this._block.writeUInt32BE(g,this._blockSize-4)}this._update(this._block);var b=this._hash();return o?b.toString(o):b},c.prototype._update=function(){throw new Error("_update must be implemented by subclass")},Ba=c,Ba}var Aa,h0;function jd(){if(h0)return Aa;h0=1;var M=Ye(),a=kr(),c=tt().Buffer,o=[1518500249,1859775393,-1894007588,-899497514],x=new Array(80);function n(){this.init(),this._w=x,a.call(this,64,56)}M(n,a),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function g(v){return v<<5|v>>>27}function y(v){return v<<30|v>>>2}function b(v,d,w,_){return v===0?d&w|~d&_:v===2?d&w|d&_|w&_:d^w^_}return n.prototype._update=function(v){for(var d=this._w,w=this._a|0,_=this._b|0,E=this._c|0,B=this._d|0,A=this._e|0,P=0;P<16;++P)d[P]=v.readInt32BE(P*4);for(;P<80;++P)d[P]=d[P-3]^d[P-8]^d[P-14]^d[P-16];for(var I=0;I<80;++I){var k=~~(I/20),F=g(w)+b(k,_,E,B)+A+d[I]+o[k]|0;A=B,B=E,E=y(_),_=w,w=F}this._a=w+this._a|0,this._b=_+this._b|0,this._c=E+this._c|0,this._d=B+this._d|0,this._e=A+this._e|0},n.prototype._hash=function(){var v=c.allocUnsafe(20);return v.writeInt32BE(this._a|0,0),v.writeInt32BE(this._b|0,4),v.writeInt32BE(this._c|0,8),v.writeInt32BE(this._d|0,12),v.writeInt32BE(this._e|0,16),v},Aa=n,Aa}var Ra,u0;function Vd(){if(u0)return Ra;u0=1;var M=Ye(),a=kr(),c=tt().Buffer,o=[1518500249,1859775393,-1894007588,-899497514],x=new Array(80);function n(){this.init(),this._w=x,a.call(this,64,56)}M(n,a),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function g(d){return d<<1|d>>>31}function y(d){return d<<5|d>>>27}function b(d){return d<<30|d>>>2}function v(d,w,_,E){return d===0?w&_|~w&E:d===2?w&_|w&E|_&E:w^_^E}return n.prototype._update=function(d){for(var w=this._w,_=this._a|0,E=this._b|0,B=this._c|0,A=this._d|0,P=this._e|0,I=0;I<16;++I)w[I]=d.readInt32BE(I*4);for(;I<80;++I)w[I]=g(w[I-3]^w[I-8]^w[I-14]^w[I-16]);for(var k=0;k<80;++k){var F=~~(k/20),q=y(_)+v(F,E,B,A)+P+w[k]+o[F]|0;P=A,A=B,B=b(E),E=_,_=q}this._a=_+this._a|0,this._b=E+this._b|0,this._c=B+this._c|0,this._d=A+this._d|0,this._e=P+this._e|0},n.prototype._hash=function(){var d=c.allocUnsafe(20);return d.writeInt32BE(this._a|0,0),d.writeInt32BE(this._b|0,4),d.writeInt32BE(this._c|0,8),d.writeInt32BE(this._d|0,12),d.writeInt32BE(this._e|0,16),d},Ra=n,Ra}var Ia,c0;function l0(){if(c0)return Ia;c0=1;var M=Ye(),a=kr(),c=tt().Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],x=new Array(64);function n(){this.init(),this._w=x,a.call(this,64,56)}M(n,a),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function g(_,E,B){return B^_&(E^B)}function y(_,E,B){return _&E|B&(_|E)}function b(_){return(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10)}function v(_){return(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7)}function d(_){return(_>>>7|_<<25)^(_>>>18|_<<14)^_>>>3}function w(_){return(_>>>17|_<<15)^(_>>>19|_<<13)^_>>>10}return n.prototype._update=function(_){for(var E=this._w,B=this._a|0,A=this._b|0,P=this._c|0,I=this._d|0,k=this._e|0,F=this._f|0,q=this._g|0,L=this._h|0,V=0;V<16;++V)E[V]=_.readInt32BE(V*4);for(;V<64;++V)E[V]=w(E[V-2])+E[V-7]+d(E[V-15])+E[V-16]|0;for(var ee=0;ee<64;++ee){var ne=L+v(k)+g(k,F,q)+o[ee]+E[ee]|0,J=b(B)+y(B,A,P)|0;L=q,q=F,F=k,k=I+ne|0,I=P,P=A,A=B,B=ne+J|0}this._a=B+this._a|0,this._b=A+this._b|0,this._c=P+this._c|0,this._d=I+this._d|0,this._e=k+this._e|0,this._f=F+this._f|0,this._g=q+this._g|0,this._h=L+this._h|0},n.prototype._hash=function(){var _=c.allocUnsafe(32);return _.writeInt32BE(this._a,0),_.writeInt32BE(this._b,4),_.writeInt32BE(this._c,8),_.writeInt32BE(this._d,12),_.writeInt32BE(this._e,16),_.writeInt32BE(this._f,20),_.writeInt32BE(this._g,24),_.writeInt32BE(this._h,28),_},Ia=n,Ia}var Oa,d0;function $d(){if(d0)return Oa;d0=1;var M=Ye(),a=l0(),c=kr(),o=tt().Buffer,x=new Array(64);function n(){this.init(),this._w=x,c.call(this,64,56)}return M(n,a),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var g=o.allocUnsafe(28);return g.writeInt32BE(this._a,0),g.writeInt32BE(this._b,4),g.writeInt32BE(this._c,8),g.writeInt32BE(this._d,12),g.writeInt32BE(this._e,16),g.writeInt32BE(this._f,20),g.writeInt32BE(this._g,24),g},Oa=n,Oa}var ka,p0;function v0(){if(p0)return ka;p0=1;var M=Ye(),a=kr(),c=tt().Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],x=new Array(160);function n(){this.init(),this._w=x,a.call(this,128,112)}M(n,a),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function g(A,P,I){return I^A&(P^I)}function y(A,P,I){return A&P|I&(A|P)}function b(A,P){return(A>>>28|P<<4)^(P>>>2|A<<30)^(P>>>7|A<<25)}function v(A,P){return(A>>>14|P<<18)^(A>>>18|P<<14)^(P>>>9|A<<23)}function d(A,P){return(A>>>1|P<<31)^(A>>>8|P<<24)^A>>>7}function w(A,P){return(A>>>1|P<<31)^(A>>>8|P<<24)^(A>>>7|P<<25)}function _(A,P){return(A>>>19|P<<13)^(P>>>29|A<<3)^A>>>6}function E(A,P){return(A>>>19|P<<13)^(P>>>29|A<<3)^(A>>>6|P<<26)}function B(A,P){return A>>>0<P>>>0?1:0}return n.prototype._update=function(A){for(var P=this._w,I=this._ah|0,k=this._bh|0,F=this._ch|0,q=this._dh|0,L=this._eh|0,V=this._fh|0,ee=this._gh|0,ne=this._hh|0,J=this._al|0,ue=this._bl|0,m=this._cl|0,e=this._dl|0,r=this._el|0,i=this._fl|0,f=this._gl|0,h=this._hl|0,l=0;l<32;l+=2)P[l]=A.readInt32BE(l*4),P[l+1]=A.readInt32BE(l*4+4);for(;l<160;l+=2){var p=P[l-30],s=P[l-15*2+1],t=d(p,s),u=w(s,p);p=P[l-2*2],s=P[l-2*2+1];var S=_(p,s),O=E(s,p),H=P[l-7*2],Q=P[l-7*2+1],G=P[l-16*2],R=P[l-16*2+1],C=u+Q|0,$=t+H+B(C,u)|0;C=C+O|0,$=$+S+B(C,O)|0,C=C+R|0,$=$+G+B(C,R)|0,P[l]=$,P[l+1]=C}for(var X=0;X<160;X+=2){$=P[X],C=P[X+1];var Z=y(I,k,F),K=y(J,ue,m),te=b(I,J),Pe=b(J,I),le=v(L,r),ce=v(r,L),Le=o[X],be=o[X+1],se=g(L,V,ee),Ue=g(r,i,f),de=h+ce|0,ge=ne+le+B(de,h)|0;de=de+Ue|0,ge=ge+se+B(de,Ue)|0,de=de+be|0,ge=ge+Le+B(de,be)|0,de=de+C|0,ge=ge+$+B(de,C)|0;var De=Pe+K|0,ve=te+Z+B(De,Pe)|0;ne=ee,h=f,ee=V,f=i,V=L,i=r,r=e+de|0,L=q+ge+B(r,e)|0,q=F,e=m,F=k,m=ue,k=I,ue=J,J=de+De|0,I=ge+ve+B(J,de)|0}this._al=this._al+J|0,this._bl=this._bl+ue|0,this._cl=this._cl+m|0,this._dl=this._dl+e|0,this._el=this._el+r|0,this._fl=this._fl+i|0,this._gl=this._gl+f|0,this._hl=this._hl+h|0,this._ah=this._ah+I+B(this._al,J)|0,this._bh=this._bh+k+B(this._bl,ue)|0,this._ch=this._ch+F+B(this._cl,m)|0,this._dh=this._dh+q+B(this._dl,e)|0,this._eh=this._eh+L+B(this._el,r)|0,this._fh=this._fh+V+B(this._fl,i)|0,this._gh=this._gh+ee+B(this._gl,f)|0,this._hh=this._hh+ne+B(this._hl,h)|0},n.prototype._hash=function(){var A=c.allocUnsafe(64);function P(I,k,F){A.writeInt32BE(I,F),A.writeInt32BE(k,F+4)}return P(this._ah,this._al,0),P(this._bh,this._bl,8),P(this._ch,this._cl,16),P(this._dh,this._dl,24),P(this._eh,this._el,32),P(this._fh,this._fl,40),P(this._gh,this._gl,48),P(this._hh,this._hl,56),A},ka=n,ka}var Pa,m0;function Gd(){if(m0)return Pa;m0=1;var M=Ye(),a=v0(),c=kr(),o=tt().Buffer,x=new Array(160);function n(){this.init(),this._w=x,c.call(this,128,112)}return M(n,a),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){var g=o.allocUnsafe(48);function y(b,v,d){g.writeInt32BE(b,d),g.writeInt32BE(v,d+4)}return y(this._ah,this._al,0),y(this._bh,this._bl,8),y(this._ch,this._cl,16),y(this._dh,this._dl,24),y(this._eh,this._el,32),y(this._fh,this._fl,40),g},Pa=n,Pa}var b0;function Ta(){return b0||(b0=1,function(M){M.exports=function(c){var o=c.toLowerCase(),x=M.exports[o];if(!x)throw new Error(o+" is not supported (we accept pull requests)");return new x},M.exports.sha=jd(),M.exports.sha1=Vd(),M.exports.sha224=$d(),M.exports.sha256=l0(),M.exports.sha384=Gd(),M.exports.sha512=v0()}(Ea)),Ea.exports}var Na,g0;function y0(){return g0||(g0=1,Na=wr().EventEmitter),Na}var Ca,w0;function Wd(){if(w0)return Ca;w0=1;function M(B,A){var P=Object.keys(B);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(B);A&&(I=I.filter(function(k){return Object.getOwnPropertyDescriptor(B,k).enumerable})),P.push.apply(P,I)}return P}function a(B){for(var A=1;A<arguments.length;A++){var P=arguments[A]!=null?arguments[A]:{};A%2?M(Object(P),!0).forEach(function(I){c(B,I,P[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(B,Object.getOwnPropertyDescriptors(P)):M(Object(P)).forEach(function(I){Object.defineProperty(B,I,Object.getOwnPropertyDescriptor(P,I))})}return B}function c(B,A,P){return A=g(A),A in B?Object.defineProperty(B,A,{value:P,enumerable:!0,configurable:!0,writable:!0}):B[A]=P,B}function o(B,A){if(!(B instanceof A))throw new TypeError("Cannot call a class as a function")}function x(B,A){for(var P=0;P<A.length;P++){var I=A[P];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(B,g(I.key),I)}}function n(B,A,P){return A&&x(B.prototype,A),Object.defineProperty(B,"prototype",{writable:!1}),B}function g(B){var A=y(B,"string");return typeof A=="symbol"?A:String(A)}function y(B,A){if(typeof B!="object"||B===null)return B;var P=B[Symbol.toPrimitive];if(P!==void 0){var I=P.call(B,A);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(B)}var b=Nt(),v=b.Buffer,d=Ir(),w=d.inspect,_=w&&w.custom||"inspect";function E(B,A,P){v.prototype.copy.call(B,A,P)}return Ca=function(){function B(){o(this,B),this.head=null,this.tail=null,this.length=0}return n(B,[{key:"push",value:function(P){var I={data:P,next:null};this.length>0?this.tail.next=I:this.head=I,this.tail=I,++this.length}},{key:"unshift",value:function(P){var I={data:P,next:this.head};this.length===0&&(this.tail=I),this.head=I,++this.length}},{key:"shift",value:function(){if(this.length!==0){var P=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(this.length===0)return"";for(var I=this.head,k=""+I.data;I=I.next;)k+=P+I.data;return k}},{key:"concat",value:function(P){if(this.length===0)return v.alloc(0);for(var I=v.allocUnsafe(P>>>0),k=this.head,F=0;k;)E(k.data,I,F),F+=k.data.length,k=k.next;return I}},{key:"consume",value:function(P,I){var k;return P<this.head.data.length?(k=this.head.data.slice(0,P),this.head.data=this.head.data.slice(P)):P===this.head.data.length?k=this.shift():k=I?this._getString(P):this._getBuffer(P),k}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(P){var I=this.head,k=1,F=I.data;for(P-=F.length;I=I.next;){var q=I.data,L=P>q.length?q.length:P;if(L===q.length?F+=q:F+=q.slice(0,P),P-=L,P===0){L===q.length?(++k,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=q.slice(L));break}++k}return this.length-=k,F}},{key:"_getBuffer",value:function(P){var I=v.allocUnsafe(P),k=this.head,F=1;for(k.data.copy(I),P-=k.data.length;k=k.next;){var q=k.data,L=P>q.length?q.length:P;if(q.copy(I,I.length-P,0,L),P-=L,P===0){L===q.length?(++F,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=q.slice(L));break}++F}return this.length-=F,I}},{key:_,value:function(P,I){return w(this,a(a({},I),{},{depth:0,customInspect:!1}))}}]),B}(),Ca}var qa,M0;function x0(){if(M0)return qa;M0=1;function M(g,y){var b=this,v=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return v||d?(y?y(g):g&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,je.nextTick(x,this,g)):je.nextTick(x,this,g)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(g||null,function(w){!y&&w?b._writableState?b._writableState.errorEmitted?je.nextTick(c,b):(b._writableState.errorEmitted=!0,je.nextTick(a,b,w)):je.nextTick(a,b,w):y?(je.nextTick(c,b),y(w)):je.nextTick(c,b)}),this)}function a(g,y){x(g,y),c(g)}function c(g){g._writableState&&!g._writableState.emitClose||g._readableState&&!g._readableState.emitClose||g.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function x(g,y){g.emit("error",y)}function n(g,y){var b=g._readableState,v=g._writableState;b&&b.autoDestroy||v&&v.autoDestroy?g.destroy(y):g.emit("error",y)}return qa={destroy:M,undestroy:o,errorOrDestroy:n},qa}var La={},_0;function Pr(){if(_0)return La;_0=1;function M(y,b){y.prototype=Object.create(b.prototype),y.prototype.constructor=y,y.__proto__=b}var a={};function c(y,b,v){v||(v=Error);function d(_,E,B){return typeof b=="string"?b:b(_,E,B)}var w=function(_){M(E,_);function E(B,A,P){return _.call(this,d(B,A,P))||this}return E}(v);w.prototype.name=v.name,w.prototype.code=y,a[y]=w}function o(y,b){if(Array.isArray(y)){var v=y.length;return y=y.map(function(d){return String(d)}),v>2?"one of ".concat(b," ").concat(y.slice(0,v-1).join(", "),", or ")+y[v-1]:v===2?"one of ".concat(b," ").concat(y[0]," or ").concat(y[1]):"of ".concat(b," ").concat(y[0])}else return"of ".concat(b," ").concat(String(y))}function x(y,b,v){return y.substr(0,b.length)===b}function n(y,b,v){return(v===void 0||v>y.length)&&(v=y.length),y.substring(v-b.length,v)===b}function g(y,b,v){return typeof v!="number"&&(v=0),v+b.length>y.length?!1:y.indexOf(b,v)!==-1}return c("ERR_INVALID_OPT_VALUE",function(y,b){return'The value "'+b+'" is invalid for option "'+y+'"'},TypeError),c("ERR_INVALID_ARG_TYPE",function(y,b,v){var d;typeof b=="string"&&x(b,"not ")?(d="must not be",b=b.replace(/^not /,"")):d="must be";var w;if(n(y," argument"))w="The ".concat(y," ").concat(d," ").concat(o(b,"type"));else{var _=g(y,".")?"property":"argument";w='The "'.concat(y,'" ').concat(_," ").concat(d," ").concat(o(b,"type"))}return w+=". Received type ".concat(typeof v),w},TypeError),c("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),c("ERR_METHOD_NOT_IMPLEMENTED",function(y){return"The "+y+" method is not implemented"}),c("ERR_STREAM_PREMATURE_CLOSE","Premature close"),c("ERR_STREAM_DESTROYED",function(y){return"Cannot call "+y+" after a stream was destroyed"}),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),c("ERR_STREAM_WRITE_AFTER_END","write after end"),c("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),c("ERR_UNKNOWN_ENCODING",function(y){return"Unknown encoding: "+y},TypeError),c("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),La.codes=a,La}var Fa,S0;function E0(){if(S0)return Fa;S0=1;var M=Pr().codes.ERR_INVALID_OPT_VALUE;function a(o,x,n){return o.highWaterMark!=null?o.highWaterMark:x?o[n]:null}function c(o,x,n,g){var y=a(x,g,n);if(y!=null){if(!(isFinite(y)&&Math.floor(y)===y)||y<0){var b=g?n:"highWaterMark";throw new M(b,y)}return Math.floor(y)}return o.objectMode?16:16*1024}return Fa={getHighWaterMark:c},Fa}var Da,B0;function A0(){if(B0)return Da;B0=1,Da=ne;function M(G){var R=this;this.next=null,this.entry=null,this.finish=function(){Q(R,G)}}var a;ne.WritableState=V;var c={deprecate:da()},o=y0(),x=Nt().Buffer,n=(typeof et<"u"?et:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function g(G){return x.from(G)}function y(G){return x.isBuffer(G)||G instanceof n}var b=x0(),v=E0(),d=v.getHighWaterMark,w=Pr().codes,_=w.ERR_INVALID_ARG_TYPE,E=w.ERR_METHOD_NOT_IMPLEMENTED,B=w.ERR_MULTIPLE_CALLBACK,A=w.ERR_STREAM_CANNOT_PIPE,P=w.ERR_STREAM_DESTROYED,I=w.ERR_STREAM_NULL_VALUES,k=w.ERR_STREAM_WRITE_AFTER_END,F=w.ERR_UNKNOWN_ENCODING,q=b.errorOrDestroy;Ye()(ne,o);function L(){}function V(G,R,C){a=a||Tr(),G=G||{},typeof C!="boolean"&&(C=R instanceof a),this.objectMode=!!G.objectMode,C&&(this.objectMode=this.objectMode||!!G.writableObjectMode),this.highWaterMark=d(this,G,"writableHighWaterMark",C),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var $=G.decodeStrings===!1;this.decodeStrings=!$,this.defaultEncoding=G.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(X){h(R,X)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=G.emitClose!==!1,this.autoDestroy=!!G.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new M(this)}V.prototype.getBuffer=function(){for(var R=this.bufferedRequest,C=[];R;)C.push(R),R=R.next;return C},function(){try{Object.defineProperty(V.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ee;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ee=Function.prototype[Symbol.hasInstance],Object.defineProperty(ne,Symbol.hasInstance,{value:function(R){return ee.call(this,R)?!0:this!==ne?!1:R&&R._writableState instanceof V}})):ee=function(R){return R instanceof this};function ne(G){a=a||Tr();var R=this instanceof a;if(!R&&!ee.call(ne,this))return new ne(G);this._writableState=new V(G,this,R),this.writable=!0,G&&(typeof G.write=="function"&&(this._write=G.write),typeof G.writev=="function"&&(this._writev=G.writev),typeof G.destroy=="function"&&(this._destroy=G.destroy),typeof G.final=="function"&&(this._final=G.final)),o.call(this)}ne.prototype.pipe=function(){q(this,new A)};function J(G,R){var C=new k;q(G,C),je.nextTick(R,C)}function ue(G,R,C,$){var X;return C===null?X=new I:typeof C!="string"&&!R.objectMode&&(X=new _("chunk",["string","Buffer"],C)),X?(q(G,X),je.nextTick($,X),!1):!0}ne.prototype.write=function(G,R,C){var $=this._writableState,X=!1,Z=!$.objectMode&&y(G);return Z&&!x.isBuffer(G)&&(G=g(G)),typeof R=="function"&&(C=R,R=null),Z?R="buffer":R||(R=$.defaultEncoding),typeof C!="function"&&(C=L),$.ending?J(this,C):(Z||ue(this,$,G,C))&&($.pendingcb++,X=e(this,$,Z,G,R,C)),X},ne.prototype.cork=function(){this._writableState.corked++},ne.prototype.uncork=function(){var G=this._writableState;G.corked&&(G.corked--,!G.writing&&!G.corked&&!G.bufferProcessing&&G.bufferedRequest&&s(this,G))},ne.prototype.setDefaultEncoding=function(R){if(typeof R=="string"&&(R=R.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((R+"").toLowerCase())>-1))throw new F(R);return this._writableState.defaultEncoding=R,this},Object.defineProperty(ne.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function m(G,R,C){return!G.objectMode&&G.decodeStrings!==!1&&typeof R=="string"&&(R=x.from(R,C)),R}Object.defineProperty(ne.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function e(G,R,C,$,X,Z){if(!C){var K=m(R,$,X);$!==K&&(C=!0,X="buffer",$=K)}var te=R.objectMode?1:$.length;R.length+=te;var Pe=R.length<R.highWaterMark;if(Pe||(R.needDrain=!0),R.writing||R.corked){var le=R.lastBufferedRequest;R.lastBufferedRequest={chunk:$,encoding:X,isBuf:C,callback:Z,next:null},le?le.next=R.lastBufferedRequest:R.bufferedRequest=R.lastBufferedRequest,R.bufferedRequestCount+=1}else r(G,R,!1,te,$,X,Z);return Pe}function r(G,R,C,$,X,Z,K){R.writelen=$,R.writecb=K,R.writing=!0,R.sync=!0,R.destroyed?R.onwrite(new P("write")):C?G._writev(X,R.onwrite):G._write(X,Z,R.onwrite),R.sync=!1}function i(G,R,C,$,X){--R.pendingcb,C?(je.nextTick(X,$),je.nextTick(O,G,R),G._writableState.errorEmitted=!0,q(G,$)):(X($),G._writableState.errorEmitted=!0,q(G,$),O(G,R))}function f(G){G.writing=!1,G.writecb=null,G.length-=G.writelen,G.writelen=0}function h(G,R){var C=G._writableState,$=C.sync,X=C.writecb;if(typeof X!="function")throw new B;if(f(C),R)i(G,C,$,R,X);else{var Z=t(C)||G.destroyed;!Z&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&s(G,C),$?je.nextTick(l,G,C,Z,X):l(G,C,Z,X)}}function l(G,R,C,$){C||p(G,R),R.pendingcb--,$(),O(G,R)}function p(G,R){R.length===0&&R.needDrain&&(R.needDrain=!1,G.emit("drain"))}function s(G,R){R.bufferProcessing=!0;var C=R.bufferedRequest;if(G._writev&&C&&C.next){var $=R.bufferedRequestCount,X=new Array($),Z=R.corkedRequestsFree;Z.entry=C;for(var K=0,te=!0;C;)X[K]=C,C.isBuf||(te=!1),C=C.next,K+=1;X.allBuffers=te,r(G,R,!0,R.length,X,"",Z.finish),R.pendingcb++,R.lastBufferedRequest=null,Z.next?(R.corkedRequestsFree=Z.next,Z.next=null):R.corkedRequestsFree=new M(R),R.bufferedRequestCount=0}else{for(;C;){var Pe=C.chunk,le=C.encoding,ce=C.callback,Le=R.objectMode?1:Pe.length;if(r(G,R,!1,Le,Pe,le,ce),C=C.next,R.bufferedRequestCount--,R.writing)break}C===null&&(R.lastBufferedRequest=null)}R.bufferedRequest=C,R.bufferProcessing=!1}ne.prototype._write=function(G,R,C){C(new E("_write()"))},ne.prototype._writev=null,ne.prototype.end=function(G,R,C){var $=this._writableState;return typeof G=="function"?(C=G,G=null,R=null):typeof R=="function"&&(C=R,R=null),G!=null&&this.write(G,R),$.corked&&($.corked=1,this.uncork()),$.ending||H(this,$,C),this},Object.defineProperty(ne.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function t(G){return G.ending&&G.length===0&&G.bufferedRequest===null&&!G.finished&&!G.writing}function u(G,R){G._final(function(C){R.pendingcb--,C&&q(G,C),R.prefinished=!0,G.emit("prefinish"),O(G,R)})}function S(G,R){!R.prefinished&&!R.finalCalled&&(typeof G._final=="function"&&!R.destroyed?(R.pendingcb++,R.finalCalled=!0,je.nextTick(u,G,R)):(R.prefinished=!0,G.emit("prefinish")))}function O(G,R){var C=t(R);if(C&&(S(G,R),R.pendingcb===0&&(R.finished=!0,G.emit("finish"),R.autoDestroy))){var $=G._readableState;(!$||$.autoDestroy&&$.endEmitted)&&G.destroy()}return C}function H(G,R,C){R.ending=!0,O(G,R),C&&(R.finished?je.nextTick(C):G.once("finish",C)),R.ended=!0,G.writable=!1}function Q(G,R,C){var $=G.entry;for(G.entry=null;$;){var X=$.callback;R.pendingcb--,X(C),$=$.next}R.corkedRequestsFree.next=G}return Object.defineProperty(ne.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(R){this._writableState&&(this._writableState.destroyed=R)}}),ne.prototype.destroy=b.destroy,ne.prototype._undestroy=b.undestroy,ne.prototype._destroy=function(G,R){R(G)},Da}var Ua,R0;function Tr(){if(R0)return Ua;R0=1;var M=Object.keys||function(v){var d=[];for(var w in v)d.push(w);return d};Ua=g;var a=T0(),c=A0();Ye()(g,a);for(var o=M(c.prototype),x=0;x<o.length;x++){var n=o[x];g.prototype[n]||(g.prototype[n]=c.prototype[n])}function g(v){if(!(this instanceof g))return new g(v);a.call(this,v),c.call(this,v),this.allowHalfOpen=!0,v&&(v.readable===!1&&(this.readable=!1),v.writable===!1&&(this.writable=!1),v.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",y)))}Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(g.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(g.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function y(){this._writableState.ended||je.nextTick(b,this)}function b(v){v.end()}return Object.defineProperty(g.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),Ua}var Ha,I0;function Ka(){if(I0)return Ha;I0=1;var M=Pr().codes.ERR_STREAM_PREMATURE_CLOSE;function a(n){var g=!1;return function(){if(!g){g=!0;for(var y=arguments.length,b=new Array(y),v=0;v<y;v++)b[v]=arguments[v];n.apply(this,b)}}}function c(){}function o(n){return n.setHeader&&typeof n.abort=="function"}function x(n,g,y){if(typeof g=="function")return x(n,null,g);g||(g={}),y=a(y||c);var b=g.readable||g.readable!==!1&&n.readable,v=g.writable||g.writable!==!1&&n.writable,d=function(){n.writable||_()},w=n._writableState&&n._writableState.finished,_=function(){v=!1,w=!0,b||y.call(n)},E=n._readableState&&n._readableState.endEmitted,B=function(){b=!1,E=!0,v||y.call(n)},A=function(F){y.call(n,F)},P=function(){var F;if(b&&!E)return(!n._readableState||!n._readableState.ended)&&(F=new M),y.call(n,F);if(v&&!w)return(!n._writableState||!n._writableState.ended)&&(F=new M),y.call(n,F)},I=function(){n.req.on("finish",_)};return o(n)?(n.on("complete",_),n.on("abort",P),n.req?I():n.on("request",I)):v&&!n._writableState&&(n.on("end",d),n.on("close",d)),n.on("end",B),n.on("finish",_),g.error!==!1&&n.on("error",A),n.on("close",P),function(){n.removeListener("complete",_),n.removeListener("abort",P),n.removeListener("request",I),n.req&&n.req.removeListener("finish",_),n.removeListener("end",d),n.removeListener("close",d),n.removeListener("finish",_),n.removeListener("end",B),n.removeListener("error",A),n.removeListener("close",P)}}return Ha=x,Ha}var za,O0;function Yd(){if(O0)return za;O0=1;var M;function a(F,q,L){return q=c(q),q in F?Object.defineProperty(F,q,{value:L,enumerable:!0,configurable:!0,writable:!0}):F[q]=L,F}function c(F){var q=o(F,"string");return typeof q=="symbol"?q:String(q)}function o(F,q){if(typeof F!="object"||F===null)return F;var L=F[Symbol.toPrimitive];if(L!==void 0){var V=L.call(F,q);if(typeof V!="object")return V;throw new TypeError("@@toPrimitive must return a primitive value.")}return(q==="string"?String:Number)(F)}var x=Ka(),n=Symbol("lastResolve"),g=Symbol("lastReject"),y=Symbol("error"),b=Symbol("ended"),v=Symbol("lastPromise"),d=Symbol("handlePromise"),w=Symbol("stream");function _(F,q){return{value:F,done:q}}function E(F){var q=F[n];if(q!==null){var L=F[w].read();L!==null&&(F[v]=null,F[n]=null,F[g]=null,q(_(L,!1)))}}function B(F){je.nextTick(E,F)}function A(F,q){return function(L,V){F.then(function(){if(q[b]){L(_(void 0,!0));return}q[d](L,V)},V)}}var P=Object.getPrototypeOf(function(){}),I=Object.setPrototypeOf((M={get stream(){return this[w]},next:function(){var q=this,L=this[y];if(L!==null)return Promise.reject(L);if(this[b])return Promise.resolve(_(void 0,!0));if(this[w].destroyed)return new Promise(function(J,ue){je.nextTick(function(){q[y]?ue(q[y]):J(_(void 0,!0))})});var V=this[v],ee;if(V)ee=new Promise(A(V,this));else{var ne=this[w].read();if(ne!==null)return Promise.resolve(_(ne,!1));ee=new Promise(this[d])}return this[v]=ee,ee}},a(M,Symbol.asyncIterator,function(){return this}),a(M,"return",function(){var q=this;return new Promise(function(L,V){q[w].destroy(null,function(ee){if(ee){V(ee);return}L(_(void 0,!0))})})}),M),P),k=function(q){var L,V=Object.create(I,(L={},a(L,w,{value:q,writable:!0}),a(L,n,{value:null,writable:!0}),a(L,g,{value:null,writable:!0}),a(L,y,{value:null,writable:!0}),a(L,b,{value:q._readableState.endEmitted,writable:!0}),a(L,d,{value:function(ne,J){var ue=V[w].read();ue?(V[v]=null,V[n]=null,V[g]=null,ne(_(ue,!1))):(V[n]=ne,V[g]=J)},writable:!0}),L));return V[v]=null,x(q,function(ee){if(ee&&ee.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ne=V[g];ne!==null&&(V[v]=null,V[n]=null,V[g]=null,ne(ee)),V[y]=ee;return}var J=V[n];J!==null&&(V[v]=null,V[n]=null,V[g]=null,J(_(void 0,!0))),V[b]=!0}),q.on("readable",B.bind(null,V)),V};return za=k,za}var ja,k0;function Jd(){return k0||(k0=1,ja=function(){throw new Error("Readable.from is not available in the browser")}),ja}var Va,P0;function T0(){if(P0)return Va;P0=1,Va=J;var M;J.ReadableState=ne,wr().EventEmitter;var a=function(K,te){return K.listeners(te).length},c=y0(),o=Nt().Buffer,x=(typeof et<"u"?et:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function n(Z){return o.from(Z)}function g(Z){return o.isBuffer(Z)||Z instanceof x}var y=Ir(),b;y&&y.debuglog?b=y.debuglog("stream"):b=function(){};var v=Wd(),d=x0(),w=E0(),_=w.getHighWaterMark,E=Pr().codes,B=E.ERR_INVALID_ARG_TYPE,A=E.ERR_STREAM_PUSH_AFTER_EOF,P=E.ERR_METHOD_NOT_IMPLEMENTED,I=E.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,k,F,q;Ye()(J,c);var L=d.errorOrDestroy,V=["error","close","destroy","pause","resume"];function ee(Z,K,te){if(typeof Z.prependListener=="function")return Z.prependListener(K,te);!Z._events||!Z._events[K]?Z.on(K,te):Array.isArray(Z._events[K])?Z._events[K].unshift(te):Z._events[K]=[te,Z._events[K]]}function ne(Z,K,te){M=M||Tr(),Z=Z||{},typeof te!="boolean"&&(te=K instanceof M),this.objectMode=!!Z.objectMode,te&&(this.objectMode=this.objectMode||!!Z.readableObjectMode),this.highWaterMark=_(this,Z,"readableHighWaterMark",te),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=Z.emitClose!==!1,this.autoDestroy=!!Z.autoDestroy,this.destroyed=!1,this.defaultEncoding=Z.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Z.encoding&&(k||(k=Mr().StringDecoder),this.decoder=new k(Z.encoding),this.encoding=Z.encoding)}function J(Z){if(M=M||Tr(),!(this instanceof J))return new J(Z);var K=this instanceof M;this._readableState=new ne(Z,this,K),this.readable=!0,Z&&(typeof Z.read=="function"&&(this._read=Z.read),typeof Z.destroy=="function"&&(this._destroy=Z.destroy)),c.call(this)}Object.defineProperty(J.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(K){this._readableState&&(this._readableState.destroyed=K)}}),J.prototype.destroy=d.destroy,J.prototype._undestroy=d.undestroy,J.prototype._destroy=function(Z,K){K(Z)},J.prototype.push=function(Z,K){var te=this._readableState,Pe;return te.objectMode?Pe=!0:typeof Z=="string"&&(K=K||te.defaultEncoding,K!==te.encoding&&(Z=o.from(Z,K),K=""),Pe=!0),ue(this,Z,K,!1,Pe)},J.prototype.unshift=function(Z){return ue(this,Z,null,!0,!1)};function ue(Z,K,te,Pe,le){b("readableAddChunk",K);var ce=Z._readableState;if(K===null)ce.reading=!1,h(Z,ce);else{var Le;if(le||(Le=e(ce,K)),Le)L(Z,Le);else if(ce.objectMode||K&&K.length>0)if(typeof K!="string"&&!ce.objectMode&&Object.getPrototypeOf(K)!==o.prototype&&(K=n(K)),Pe)ce.endEmitted?L(Z,new I):m(Z,ce,K,!0);else if(ce.ended)L(Z,new A);else{if(ce.destroyed)return!1;ce.reading=!1,ce.decoder&&!te?(K=ce.decoder.write(K),ce.objectMode||K.length!==0?m(Z,ce,K,!1):s(Z,ce)):m(Z,ce,K,!1)}else Pe||(ce.reading=!1,s(Z,ce))}return!ce.ended&&(ce.length<ce.highWaterMark||ce.length===0)}function m(Z,K,te,Pe){K.flowing&&K.length===0&&!K.sync?(K.awaitDrain=0,Z.emit("data",te)):(K.length+=K.objectMode?1:te.length,Pe?K.buffer.unshift(te):K.buffer.push(te),K.needReadable&&l(Z)),s(Z,K)}function e(Z,K){var te;return!g(K)&&typeof K!="string"&&K!==void 0&&!Z.objectMode&&(te=new B("chunk",["string","Buffer","Uint8Array"],K)),te}J.prototype.isPaused=function(){return this._readableState.flowing===!1},J.prototype.setEncoding=function(Z){k||(k=Mr().StringDecoder);var K=new k(Z);this._readableState.decoder=K,this._readableState.encoding=this._readableState.decoder.encoding;for(var te=this._readableState.buffer.head,Pe="";te!==null;)Pe+=K.write(te.data),te=te.next;return this._readableState.buffer.clear(),Pe!==""&&this._readableState.buffer.push(Pe),this._readableState.length=Pe.length,this};var r=1073741824;function i(Z){return Z>=r?Z=r:(Z--,Z|=Z>>>1,Z|=Z>>>2,Z|=Z>>>4,Z|=Z>>>8,Z|=Z>>>16,Z++),Z}function f(Z,K){return Z<=0||K.length===0&&K.ended?0:K.objectMode?1:Z!==Z?K.flowing&&K.length?K.buffer.head.data.length:K.length:(Z>K.highWaterMark&&(K.highWaterMark=i(Z)),Z<=K.length?Z:K.ended?K.length:(K.needReadable=!0,0))}J.prototype.read=function(Z){b("read",Z),Z=parseInt(Z,10);var K=this._readableState,te=Z;if(Z!==0&&(K.emittedReadable=!1),Z===0&&K.needReadable&&((K.highWaterMark!==0?K.length>=K.highWaterMark:K.length>0)||K.ended))return b("read: emitReadable",K.length,K.ended),K.length===0&&K.ended?C(this):l(this),null;if(Z=f(Z,K),Z===0&&K.ended)return K.length===0&&C(this),null;var Pe=K.needReadable;b("need readable",Pe),(K.length===0||K.length-Z<K.highWaterMark)&&(Pe=!0,b("length less than watermark",Pe)),K.ended||K.reading?(Pe=!1,b("reading or ended",Pe)):Pe&&(b("do read"),K.reading=!0,K.sync=!0,K.length===0&&(K.needReadable=!0),this._read(K.highWaterMark),K.sync=!1,K.reading||(Z=f(te,K)));var le;return Z>0?le=R(Z,K):le=null,le===null?(K.needReadable=K.length<=K.highWaterMark,Z=0):(K.length-=Z,K.awaitDrain=0),K.length===0&&(K.ended||(K.needReadable=!0),te!==Z&&K.ended&&C(this)),le!==null&&this.emit("data",le),le};function h(Z,K){if(b("onEofChunk"),!K.ended){if(K.decoder){var te=K.decoder.end();te&&te.length&&(K.buffer.push(te),K.length+=K.objectMode?1:te.length)}K.ended=!0,K.sync?l(Z):(K.needReadable=!1,K.emittedReadable||(K.emittedReadable=!0,p(Z)))}}function l(Z){var K=Z._readableState;b("emitReadable",K.needReadable,K.emittedReadable),K.needReadable=!1,K.emittedReadable||(b("emitReadable",K.flowing),K.emittedReadable=!0,je.nextTick(p,Z))}function p(Z){var K=Z._readableState;b("emitReadable_",K.destroyed,K.length,K.ended),!K.destroyed&&(K.length||K.ended)&&(Z.emit("readable"),K.emittedReadable=!1),K.needReadable=!K.flowing&&!K.ended&&K.length<=K.highWaterMark,G(Z)}function s(Z,K){K.readingMore||(K.readingMore=!0,je.nextTick(t,Z,K))}function t(Z,K){for(;!K.reading&&!K.ended&&(K.length<K.highWaterMark||K.flowing&&K.length===0);){var te=K.length;if(b("maybeReadMore read 0"),Z.read(0),te===K.length)break}K.readingMore=!1}J.prototype._read=function(Z){L(this,new P("_read()"))},J.prototype.pipe=function(Z,K){var te=this,Pe=this._readableState;switch(Pe.pipesCount){case 0:Pe.pipes=Z;break;case 1:Pe.pipes=[Pe.pipes,Z];break;default:Pe.pipes.push(Z);break}Pe.pipesCount+=1,b("pipe count=%d opts=%j",Pe.pipesCount,K);var le=(!K||K.end!==!1)&&Z!==je.stdout&&Z!==je.stderr,ce=le?be:Ge;Pe.endEmitted?je.nextTick(ce):te.once("end",ce),Z.on("unpipe",Le);function Le(Se,Oe){b("onunpipe"),Se===te&&Oe&&Oe.hasUnpiped===!1&&(Oe.hasUnpiped=!0,de())}function be(){b("onend"),Z.end()}var se=u(te);Z.on("drain",se);var Ue=!1;function de(){b("cleanup"),Z.removeListener("close",ve),Z.removeListener("finish",_e),Z.removeListener("drain",se),Z.removeListener("error",De),Z.removeListener("unpipe",Le),te.removeListener("end",be),te.removeListener("end",Ge),te.removeListener("data",ge),Ue=!0,Pe.awaitDrain&&(!Z._writableState||Z._writableState.needDrain)&&se()}te.on("data",ge);function ge(Se){b("ondata");var Oe=Z.write(Se);b("dest.write",Oe),Oe===!1&&((Pe.pipesCount===1&&Pe.pipes===Z||Pe.pipesCount>1&&X(Pe.pipes,Z)!==-1)&&!Ue&&(b("false write response, pause",Pe.awaitDrain),Pe.awaitDrain++),te.pause())}function De(Se){b("onerror",Se),Ge(),Z.removeListener("error",De),a(Z,"error")===0&&L(Z,Se)}ee(Z,"error",De);function ve(){Z.removeListener("finish",_e),Ge()}Z.once("close",ve);function _e(){b("onfinish"),Z.removeListener("close",ve),Ge()}Z.once("finish",_e);function Ge(){b("unpipe"),te.unpipe(Z)}return Z.emit("pipe",te),Pe.flowing||(b("pipe resume"),te.resume()),Z};function u(Z){return function(){var te=Z._readableState;b("pipeOnDrain",te.awaitDrain),te.awaitDrain&&te.awaitDrain--,te.awaitDrain===0&&a(Z,"data")&&(te.flowing=!0,G(Z))}}J.prototype.unpipe=function(Z){var K=this._readableState,te={hasUnpiped:!1};if(K.pipesCount===0)return this;if(K.pipesCount===1)return Z&&Z!==K.pipes?this:(Z||(Z=K.pipes),K.pipes=null,K.pipesCount=0,K.flowing=!1,Z&&Z.emit("unpipe",this,te),this);if(!Z){var Pe=K.pipes,le=K.pipesCount;K.pipes=null,K.pipesCount=0,K.flowing=!1;for(var ce=0;ce<le;ce++)Pe[ce].emit("unpipe",this,{hasUnpiped:!1});return this}var Le=X(K.pipes,Z);return Le===-1?this:(K.pipes.splice(Le,1),K.pipesCount-=1,K.pipesCount===1&&(K.pipes=K.pipes[0]),Z.emit("unpipe",this,te),this)},J.prototype.on=function(Z,K){var te=c.prototype.on.call(this,Z,K),Pe=this._readableState;return Z==="data"?(Pe.readableListening=this.listenerCount("readable")>0,Pe.flowing!==!1&&this.resume()):Z==="readable"&&!Pe.endEmitted&&!Pe.readableListening&&(Pe.readableListening=Pe.needReadable=!0,Pe.flowing=!1,Pe.emittedReadable=!1,b("on readable",Pe.length,Pe.reading),Pe.length?l(this):Pe.reading||je.nextTick(O,this)),te},J.prototype.addListener=J.prototype.on,J.prototype.removeListener=function(Z,K){var te=c.prototype.removeListener.call(this,Z,K);return Z==="readable"&&je.nextTick(S,this),te},J.prototype.removeAllListeners=function(Z){var K=c.prototype.removeAllListeners.apply(this,arguments);return(Z==="readable"||Z===void 0)&&je.nextTick(S,this),K};function S(Z){var K=Z._readableState;K.readableListening=Z.listenerCount("readable")>0,K.resumeScheduled&&!K.paused?K.flowing=!0:Z.listenerCount("data")>0&&Z.resume()}function O(Z){b("readable nexttick read 0"),Z.read(0)}J.prototype.resume=function(){var Z=this._readableState;return Z.flowing||(b("resume"),Z.flowing=!Z.readableListening,H(this,Z)),Z.paused=!1,this};function H(Z,K){K.resumeScheduled||(K.resumeScheduled=!0,je.nextTick(Q,Z,K))}function Q(Z,K){b("resume",K.reading),K.reading||Z.read(0),K.resumeScheduled=!1,Z.emit("resume"),G(Z),K.flowing&&!K.reading&&Z.read(0)}J.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function G(Z){var K=Z._readableState;for(b("flow",K.flowing);K.flowing&&Z.read()!==null;);}J.prototype.wrap=function(Z){var K=this,te=this._readableState,Pe=!1;Z.on("end",function(){if(b("wrapped end"),te.decoder&&!te.ended){var Le=te.decoder.end();Le&&Le.length&&K.push(Le)}K.push(null)}),Z.on("data",function(Le){if(b("wrapped data"),te.decoder&&(Le=te.decoder.write(Le)),!(te.objectMode&&Le==null)&&!(!te.objectMode&&(!Le||!Le.length))){var be=K.push(Le);be||(Pe=!0,Z.pause())}});for(var le in Z)this[le]===void 0&&typeof Z[le]=="function"&&(this[le]=function(be){return function(){return Z[be].apply(Z,arguments)}}(le));for(var ce=0;ce<V.length;ce++)Z.on(V[ce],this.emit.bind(this,V[ce]));return this._read=function(Le){b("wrapped _read",Le),Pe&&(Pe=!1,Z.resume())},this},typeof Symbol=="function"&&(J.prototype[Symbol.asyncIterator]=function(){return F===void 0&&(F=Yd()),F(this)}),Object.defineProperty(J.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(J.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(J.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(K){this._readableState&&(this._readableState.flowing=K)}}),J._fromList=R,Object.defineProperty(J.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function R(Z,K){if(K.length===0)return null;var te;return K.objectMode?te=K.buffer.shift():!Z||Z>=K.length?(K.decoder?te=K.buffer.join(""):K.buffer.length===1?te=K.buffer.first():te=K.buffer.concat(K.length),K.buffer.clear()):te=K.buffer.consume(Z,K.decoder),te}function C(Z){var K=Z._readableState;b("endReadable",K.endEmitted),K.endEmitted||(K.ended=!0,je.nextTick($,K,Z))}function $(Z,K){if(b("endReadableNT",Z.endEmitted,Z.length),!Z.endEmitted&&Z.length===0&&(Z.endEmitted=!0,K.readable=!1,K.emit("end"),Z.autoDestroy)){var te=K._writableState;(!te||te.autoDestroy&&te.finished)&&K.destroy()}}typeof Symbol=="function"&&(J.from=function(Z,K){return q===void 0&&(q=Jd()),q(J,Z,K)});function X(Z,K){for(var te=0,Pe=Z.length;te<Pe;te++)if(Z[te]===K)return te;return-1}return Va}var $a,N0;function C0(){if(N0)return $a;N0=1,$a=y;var M=Pr().codes,a=M.ERR_METHOD_NOT_IMPLEMENTED,c=M.ERR_MULTIPLE_CALLBACK,o=M.ERR_TRANSFORM_ALREADY_TRANSFORMING,x=M.ERR_TRANSFORM_WITH_LENGTH_0,n=Tr();Ye()(y,n);function g(d,w){var _=this._transformState;_.transforming=!1;var E=_.writecb;if(E===null)return this.emit("error",new c);_.writechunk=null,_.writecb=null,w!=null&&this.push(w),E(d);var B=this._readableState;B.reading=!1,(B.needReadable||B.length<B.highWaterMark)&&this._read(B.highWaterMark)}function y(d){if(!(this instanceof y))return new y(d);n.call(this,d),this._transformState={afterTransform:g.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",b)}function b(){var d=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(w,_){v(d,w,_)}):v(this,null,null)}y.prototype.push=function(d,w){return this._transformState.needTransform=!1,n.prototype.push.call(this,d,w)},y.prototype._transform=function(d,w,_){_(new a("_transform()"))},y.prototype._write=function(d,w,_){var E=this._transformState;if(E.writecb=_,E.writechunk=d,E.writeencoding=w,!E.transforming){var B=this._readableState;(E.needTransform||B.needReadable||B.length<B.highWaterMark)&&this._read(B.highWaterMark)}},y.prototype._read=function(d){var w=this._transformState;w.writechunk!==null&&!w.transforming?(w.transforming=!0,this._transform(w.writechunk,w.writeencoding,w.afterTransform)):w.needTransform=!0},y.prototype._destroy=function(d,w){n.prototype._destroy.call(this,d,function(_){w(_)})};function v(d,w,_){if(w)return d.emit("error",w);if(_!=null&&d.push(_),d._writableState.length)throw new x;if(d._transformState.transforming)throw new o;return d.push(null)}return $a}var Ga,q0;function Zd(){if(q0)return Ga;q0=1,Ga=a;var M=C0();Ye()(a,M);function a(c){if(!(this instanceof a))return new a(c);M.call(this,c)}return a.prototype._transform=function(c,o,x){x(null,c)},Ga}var Wa,L0;function Xd(){if(L0)return Wa;L0=1;var M;function a(_){var E=!1;return function(){E||(E=!0,_.apply(void 0,arguments))}}var c=Pr().codes,o=c.ERR_MISSING_ARGS,x=c.ERR_STREAM_DESTROYED;function n(_){if(_)throw _}function g(_){return _.setHeader&&typeof _.abort=="function"}function y(_,E,B,A){A=a(A);var P=!1;_.on("close",function(){P=!0}),M===void 0&&(M=Ka()),M(_,{readable:E,writable:B},function(k){if(k)return A(k);P=!0,A()});var I=!1;return function(k){if(!P&&!I){if(I=!0,g(_))return _.abort();if(typeof _.destroy=="function")return _.destroy();A(k||new x("pipe"))}}}function b(_){_()}function v(_,E){return _.pipe(E)}function d(_){return!_.length||typeof _[_.length-1]!="function"?n:_.pop()}function w(){for(var _=arguments.length,E=new Array(_),B=0;B<_;B++)E[B]=arguments[B];var A=d(E);if(Array.isArray(E[0])&&(E=E[0]),E.length<2)throw new o("streams");var P,I=E.map(function(k,F){var q=F<E.length-1,L=F>0;return y(k,q,L,function(V){P||(P=V),V&&I.forEach(b),!q&&(I.forEach(b),A(P))})});return E.reduce(v)}return Wa=w,Wa}var Ya,F0;function Qd(){if(F0)return Ya;F0=1,Ya=c;var M=wr().EventEmitter,a=Ye();a(c,M),c.Readable=T0(),c.Writable=A0(),c.Duplex=Tr(),c.Transform=C0(),c.PassThrough=Zd(),c.finished=Ka(),c.pipeline=Xd(),c.Stream=c;function c(){M.call(this)}return c.prototype.pipe=function(o,x){var n=this;function g(E){o.writable&&o.write(E)===!1&&n.pause&&n.pause()}n.on("data",g);function y(){n.readable&&n.resume&&n.resume()}o.on("drain",y),!o._isStdio&&(!x||x.end!==!1)&&(n.on("end",v),n.on("close",d));var b=!1;function v(){b||(b=!0,o.end())}function d(){b||(b=!0,typeof o.destroy=="function"&&o.destroy())}function w(E){if(_(),M.listenerCount(this,"error")===0)throw E}n.on("error",w),o.on("error",w);function _(){n.removeListener("data",g),o.removeListener("drain",y),n.removeListener("end",v),n.removeListener("close",d),n.removeListener("error",w),o.removeListener("error",w),n.removeListener("end",_),n.removeListener("close",_),o.removeListener("close",_)}return n.on("end",_),n.on("close",_),o.on("close",_),o.emit("pipe",n),o},Ya}var Ja,D0;function pr(){if(D0)return Ja;D0=1;var M=tt().Buffer,a=Qd().Transform,c=Mr().StringDecoder,o=Ye(),x=hi();function n(g){a.call(this),this.hashMode=typeof g=="string",this.hashMode?this[g]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return o(n,a),n.prototype.update=function(g,y,b){var v=x(g,y),d=this._update(v);return this.hashMode?this:(b&&(d=this._toString(d,b)),d)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(g,y,b){var v;try{this.hashMode?this._update(g):this.push(this._update(g))}catch(d){v=d}finally{b(v)}},n.prototype._flush=function(g){var y;try{this.push(this.__final())}catch(b){y=b}g(y)},n.prototype._finalOrDigest=function(g){var y=this.__final()||M.alloc(0);return g&&(y=this._toString(y,g,!0)),y},n.prototype._toString=function(g,y,b){if(this._decoder||(this._decoder=new c(y),this._encoding=y),this._encoding!==y)throw new Error("can’t switch encodings");var v=this._decoder.write(g);return b&&(v+=this._decoder.end()),v},Ja=n,Ja}var Za,U0;function Kr(){if(U0)return Za;U0=1;var M=Ye(),a=xa(),c=Sa(),o=Ta(),x=pr();function n(g){x.call(this,"digest"),this._hash=g}return M(n,x),n.prototype._update=function(g){this._hash.update(g)},n.prototype._final=function(){return this._hash.digest()},Za=function(y){return y=y.toLowerCase(),y==="md5"?new a:y==="rmd160"||y==="ripemd160"?new c:new n(o(y))},Za}var Xa,H0;function ep(){if(H0)return Xa;H0=1;var M=Ye(),a=tt().Buffer,c=pr(),o=a.alloc(128),x=64;function n(g,y){c.call(this,"digest"),typeof y=="string"&&(y=a.from(y)),this._alg=g,this._key=y,y.length>x?y=g(y):y.length<x&&(y=a.concat([y,o],x));for(var b=this._ipad=a.allocUnsafe(x),v=this._opad=a.allocUnsafe(x),d=0;d<x;d++)b[d]=y[d]^54,v[d]=y[d]^92;this._hash=[b]}return M(n,c),n.prototype._update=function(g){this._hash.push(g)},n.prototype._final=function(){var g=this._alg(a.concat(this._hash));return this._alg(a.concat([this._opad,g]))},Xa=n,Xa}var Qa,K0;function z0(){if(K0)return Qa;K0=1;var M=xa();return Qa=function(a){return new M().update(a).digest()},Qa}var ef,j0;function V0(){if(j0)return ef;j0=1;var M=Ye(),a=ep(),c=pr(),o=tt().Buffer,x=z0(),n=Sa(),g=Ta(),y=o.alloc(128);function b(v,d){c.call(this,"digest"),typeof d=="string"&&(d=o.from(d));var w=v==="sha512"||v==="sha384"?128:64;if(this._alg=v,this._key=d,d.length>w){var _=v==="rmd160"?new n:g(v);d=_.update(d).digest()}else d.length<w&&(d=o.concat([d,y],w));for(var E=this._ipad=o.allocUnsafe(w),B=this._opad=o.allocUnsafe(w),A=0;A<w;A++)E[A]=d[A]^54,B[A]=d[A]^92;this._hash=v==="rmd160"?new n:g(v),this._hash.update(E)}return M(b,c),b.prototype._update=function(v){this._hash.update(v)},b.prototype._final=function(){var v=this._hash.digest(),d=this._alg==="rmd160"?new n:g(this._alg);return d.update(this._opad).update(v).digest()},ef=function(d,w){return d=d.toLowerCase(),d==="rmd160"||d==="ripemd160"?new b("rmd160",w):d==="md5"?new a(x,w):new b(d,w)},ef}const $0={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var tf,G0;function tp(){return G0||(G0=1,tf=$0),tf}var pi={},rf,W0;function Y0(){if(W0)return rf;W0=1;var M=isFinite,a=Math.pow(2,30)-1;return rf=function(c,o){if(typeof c!="number")throw new TypeError("Iterations not a number");if(c<0||!M(c))throw new TypeError("Bad iterations");if(typeof o!="number")throw new TypeError("Key length not a number");if(o<0||o>a||o!==o)throw new TypeError("Bad key length")},rf}var nf,J0;function Z0(){if(J0)return nf;J0=1;var M;if(et.process&&et.process.browser)M="utf-8";else if(et.process&&et.process.version){var a=parseInt(je.version.split(".")[0].slice(1),10);M=a>=6?"utf-8":"binary"}else M="utf-8";return nf=M,nf}var af,X0;function Q0(){if(X0)return af;X0=1;var M=tt().Buffer,a=hi(),c=typeof Uint8Array<"u",o=c&&typeof ArrayBuffer<"u",x=o&&ArrayBuffer.isView;return af=function(n,g,y){if(typeof n=="string"||M.isBuffer(n)||c&&n instanceof Uint8Array||x&&x(n))return a(n,g);throw new TypeError(y+" must be a string, a Buffer, a Uint8Array, or a DataView")},af}var ff,eu;function tu(){if(eu)return ff;eu=1;var M=z0(),a=Sa(),c=Ta(),o=tt().Buffer,x=Y0(),n=Z0(),g=Q0(),y=o.alloc(128),b={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},v={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function d(B){return new a().update(B).digest()}function w(B){function A(P){return c(B).update(P).digest()}return B==="rmd160"||B==="ripemd160"?d:B==="md5"?M:A}function _(B,A,P){var I=w(B),k=B==="sha512"||B==="sha384"?128:64;A.length>k?A=I(A):A.length<k&&(A=o.concat([A,y],k));for(var F=o.allocUnsafe(k+b[B]),q=o.allocUnsafe(k+b[B]),L=0;L<k;L++)F[L]=A[L]^54,q[L]=A[L]^92;var V=o.allocUnsafe(k+P+4);F.copy(V,0,0,k),this.ipad1=V,this.ipad2=F,this.opad=q,this.alg=B,this.blocksize=k,this.hash=I,this.size=b[B]}_.prototype.run=function(B,A){B.copy(A,this.blocksize);var P=this.hash(A);return P.copy(this.opad,this.blocksize),this.hash(this.opad)};function E(B,A,P,I,k){x(P,I),B=g(B,n,"Password"),A=g(A,n,"Salt");var F=(k||"sha1").toLowerCase(),q=v[F]||F,L=b[q];if(typeof L!="number"||!L)throw new TypeError("Digest algorithm not supported: "+k);var V=new _(q,B,A.length),ee=o.allocUnsafe(I),ne=o.allocUnsafe(A.length+4);A.copy(ne,0,0,A.length);for(var J=0,ue=L,m=Math.ceil(I/ue),e=1;e<=m;e++){ne.writeUInt32BE(e,A.length);for(var r=V.run(ne,V.ipad1),i=r,f=1;f<P;f++){i=V.run(i,V.ipad2);for(var h=0;h<ue;h++)r[h]^=i[h]}r.copy(ee,J),J+=ue}return ee}return ff=E,ff}var sf,ru;function rp(){if(ru)return sf;ru=1;var M=tt().Buffer,a=Y0(),c=Z0(),o=tu(),x=Q0(),n,g=et.crypto&&et.crypto.subtle,y={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},b=[],v;function d(){return v||(et.process&&et.process.nextTick?v=et.process.nextTick:et.queueMicrotask?v=et.queueMicrotask:et.setImmediate?v=et.setImmediate:v=et.setTimeout,v)}function w(B,A,P,I,k){return g.importKey("raw",B,{name:"PBKDF2"},!1,["deriveBits"]).then(function(F){return g.deriveBits({name:"PBKDF2",salt:A,iterations:P,hash:{name:k}},F,I<<3)}).then(function(F){return M.from(F)})}function _(B){if(et.process&&!et.process.browser||!g||!g.importKey||!g.deriveBits)return Promise.resolve(!1);if(b[B]!==void 0)return b[B];n=n||M.alloc(8);var A=w(n,n,10,128,B).then(function(){return!0},function(){return!1});return b[B]=A,A}function E(B,A){B.then(function(P){d()(function(){A(null,P)})},function(P){d()(function(){A(P)})})}return sf=function(B,A,P,I,k,F){if(typeof k=="function"&&(F=k,k=void 0),a(P,I),B=x(B,c,"Password"),A=x(A,c,"Salt"),typeof F!="function")throw new Error("No callback provided to pbkdf2");k=k||"sha1";var q=y[k.toLowerCase()];if(!q||typeof et.Promise!="function"){d()(function(){var L;try{L=o(B,A,P,I,k)}catch(V){F(V);return}F(null,L)});return}E(_(q).then(function(L){return L?w(B,A,P,I,q):o(B,A,P,I,k)}),F)},sf}var iu;function of(){return iu||(iu=1,pi.pbkdf2=rp(),pi.pbkdf2Sync=tu()),pi}var zt={},xr={},Kt={},nu;function au(){if(nu)return Kt;nu=1,Kt.readUInt32BE=function(x,n){var g=x[0+n]<<24|x[1+n]<<16|x[2+n]<<8|x[3+n];return g>>>0},Kt.writeUInt32BE=function(x,n,g){x[0+g]=n>>>24,x[1+g]=n>>>16&255,x[2+g]=n>>>8&255,x[3+g]=n&255},Kt.ip=function(x,n,g,y){for(var b=0,v=0,d=6;d>=0;d-=2){for(var w=0;w<=24;w+=8)b<<=1,b|=n>>>w+d&1;for(var w=0;w<=24;w+=8)b<<=1,b|=x>>>w+d&1}for(var d=6;d>=0;d-=2){for(var w=1;w<=25;w+=8)v<<=1,v|=n>>>w+d&1;for(var w=1;w<=25;w+=8)v<<=1,v|=x>>>w+d&1}g[y+0]=b>>>0,g[y+1]=v>>>0},Kt.rip=function(x,n,g,y){for(var b=0,v=0,d=0;d<4;d++)for(var w=24;w>=0;w-=8)b<<=1,b|=n>>>w+d&1,b<<=1,b|=x>>>w+d&1;for(var d=4;d<8;d++)for(var w=24;w>=0;w-=8)v<<=1,v|=n>>>w+d&1,v<<=1,v|=x>>>w+d&1;g[y+0]=b>>>0,g[y+1]=v>>>0},Kt.pc1=function(x,n,g,y){for(var b=0,v=0,d=7;d>=5;d--){for(var w=0;w<=24;w+=8)b<<=1,b|=n>>w+d&1;for(var w=0;w<=24;w+=8)b<<=1,b|=x>>w+d&1}for(var w=0;w<=24;w+=8)b<<=1,b|=n>>w+d&1;for(var d=1;d<=3;d++){for(var w=0;w<=24;w+=8)v<<=1,v|=n>>w+d&1;for(var w=0;w<=24;w+=8)v<<=1,v|=x>>w+d&1}for(var w=0;w<=24;w+=8)v<<=1,v|=x>>w+d&1;g[y+0]=b>>>0,g[y+1]=v>>>0},Kt.r28shl=function(x,n){return x<<n&268435455|x>>>28-n};var M=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];Kt.pc2=function(x,n,g,y){for(var b=0,v=0,d=M.length>>>1,w=0;w<d;w++)b<<=1,b|=x>>>M[w]&1;for(var w=d;w<M.length;w++)v<<=1,v|=n>>>M[w]&1;g[y+0]=b>>>0,g[y+1]=v>>>0},Kt.expand=function(x,n,g){var y=0,b=0;y=(x&1)<<5|x>>>27;for(var v=23;v>=15;v-=4)y<<=6,y|=x>>>v&63;for(var v=11;v>=3;v-=4)b|=x>>>v&63,b<<=6;b|=(x&31)<<1|x>>>31,n[g+0]=y>>>0,n[g+1]=b>>>0};var a=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];Kt.substitute=function(x,n){for(var g=0,y=0;y<4;y++){var b=x>>>18-y*6&63,v=a[y*64+b];g<<=4,g|=v}for(var y=0;y<4;y++){var b=n>>>18-y*6&63,v=a[4*64+y*64+b];g<<=4,g|=v}return g>>>0};var c=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return Kt.permute=function(x){for(var n=0,g=0;g<c.length;g++)n<<=1,n|=x>>>c[g]&1;return n>>>0},Kt.padSplit=function(x,n,g){for(var y=x.toString(2);y.length<n;)y="0"+y;for(var b=[],v=0;v<n;v+=g)b.push(y.slice(v,v+g));return b.join(" ")},Kt}var hf,fu;function uf(){if(fu)return hf;fu=1;var M=Ht();function a(c){this.options=c,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=c.padding!==!1}return hf=a,a.prototype._init=function(){},a.prototype.update=function(o){return o.length===0?[]:this.type==="decrypt"?this._updateDecrypt(o):this._updateEncrypt(o)},a.prototype._buffer=function(o,x){for(var n=Math.min(this.buffer.length-this.bufferOff,o.length-x),g=0;g<n;g++)this.buffer[this.bufferOff+g]=o[x+g];return this.bufferOff+=n,n},a.prototype._flushBuffer=function(o,x){return this._update(this.buffer,0,o,x),this.bufferOff=0,this.blockSize},a.prototype._updateEncrypt=function(o){var x=0,n=0,g=(this.bufferOff+o.length)/this.blockSize|0,y=new Array(g*this.blockSize);this.bufferOff!==0&&(x+=this._buffer(o,x),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(y,n)));for(var b=o.length-(o.length-x)%this.blockSize;x<b;x+=this.blockSize)this._update(o,x,y,n),n+=this.blockSize;for(;x<o.length;x++,this.bufferOff++)this.buffer[this.bufferOff]=o[x];return y},a.prototype._updateDecrypt=function(o){for(var x=0,n=0,g=Math.ceil((this.bufferOff+o.length)/this.blockSize)-1,y=new Array(g*this.blockSize);g>0;g--)x+=this._buffer(o,x),n+=this._flushBuffer(y,n);return x+=this._buffer(o,x),y},a.prototype.final=function(o){var x;o&&(x=this.update(o));var n;return this.type==="encrypt"?n=this._finalEncrypt():n=this._finalDecrypt(),x?x.concat(n):n},a.prototype._pad=function(o,x){if(x===0)return!1;for(;x<o.length;)o[x++]=0;return!0},a.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var o=new Array(this.blockSize);return this._update(this.buffer,0,o,0),o},a.prototype._unpad=function(o){return o},a.prototype._finalDecrypt=function(){M.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var o=new Array(this.blockSize);return this._flushBuffer(o,0),this._unpad(o)},hf}var cf,su;function ou(){if(su)return cf;su=1;var M=Ht(),a=Ye(),c=au(),o=uf();function x(){this.tmp=new Array(2),this.keys=null}function n(y){o.call(this,y);var b=new x;this._desState=b,this.deriveKeys(b,y.key)}a(n,o),cf=n,n.create=function(b){return new n(b)};var g=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return n.prototype.deriveKeys=function(b,v){b.keys=new Array(16*2),M.equal(v.length,this.blockSize,"Invalid key length");var d=c.readUInt32BE(v,0),w=c.readUInt32BE(v,4);c.pc1(d,w,b.tmp,0),d=b.tmp[0],w=b.tmp[1];for(var _=0;_<b.keys.length;_+=2){var E=g[_>>>1];d=c.r28shl(d,E),w=c.r28shl(w,E),c.pc2(d,w,b.keys,_)}},n.prototype._update=function(b,v,d,w){var _=this._desState,E=c.readUInt32BE(b,v),B=c.readUInt32BE(b,v+4);c.ip(E,B,_.tmp,0),E=_.tmp[0],B=_.tmp[1],this.type==="encrypt"?this._encrypt(_,E,B,_.tmp,0):this._decrypt(_,E,B,_.tmp,0),E=_.tmp[0],B=_.tmp[1],c.writeUInt32BE(d,E,w),c.writeUInt32BE(d,B,w+4)},n.prototype._pad=function(b,v){if(this.padding===!1)return!1;for(var d=b.length-v,w=v;w<b.length;w++)b[w]=d;return!0},n.prototype._unpad=function(b){if(this.padding===!1)return b;for(var v=b[b.length-1],d=b.length-v;d<b.length;d++)M.equal(b[d],v);return b.slice(0,b.length-v)},n.prototype._encrypt=function(b,v,d,w,_){for(var E=v,B=d,A=0;A<b.keys.length;A+=2){var P=b.keys[A],I=b.keys[A+1];c.expand(B,b.tmp,0),P^=b.tmp[0],I^=b.tmp[1];var k=c.substitute(P,I),F=c.permute(k),q=B;B=(E^F)>>>0,E=q}c.rip(B,E,w,_)},n.prototype._decrypt=function(b,v,d,w,_){for(var E=d,B=v,A=b.keys.length-2;A>=0;A-=2){var P=b.keys[A],I=b.keys[A+1];c.expand(E,b.tmp,0),P^=b.tmp[0],I^=b.tmp[1];var k=c.substitute(P,I),F=c.permute(k),q=E;E=(B^F)>>>0,B=q}c.rip(E,B,w,_)},cf}var lf={},hu;function ip(){if(hu)return lf;hu=1;var M=Ht(),a=Ye(),c={};function o(n){M.equal(n.length,8,"Invalid IV length"),this.iv=new Array(8);for(var g=0;g<this.iv.length;g++)this.iv[g]=n[g]}function x(n){function g(d){n.call(this,d),this._cbcInit()}a(g,n);for(var y=Object.keys(c),b=0;b<y.length;b++){var v=y[b];g.prototype[v]=c[v]}return g.create=function(w){return new g(w)},g}return lf.instantiate=x,c._cbcInit=function(){var g=new o(this.options.iv);this._cbcState=g},c._update=function(g,y,b,v){var d=this._cbcState,w=this.constructor.super_.prototype,_=d.iv;if(this.type==="encrypt"){for(var E=0;E<this.blockSize;E++)_[E]^=g[y+E];w._update.call(this,_,0,b,v);for(var E=0;E<this.blockSize;E++)_[E]=b[v+E]}else{w._update.call(this,g,y,b,v);for(var E=0;E<this.blockSize;E++)b[v+E]^=_[E];for(var E=0;E<this.blockSize;E++)_[E]=g[y+E]}},lf}var df,uu;function np(){if(uu)return df;uu=1;var M=Ht(),a=Ye(),c=uf(),o=ou();function x(g,y){M.equal(y.length,24,"Invalid key length");var b=y.slice(0,8),v=y.slice(8,16),d=y.slice(16,24);g==="encrypt"?this.ciphers=[o.create({type:"encrypt",key:b}),o.create({type:"decrypt",key:v}),o.create({type:"encrypt",key:d})]:this.ciphers=[o.create({type:"decrypt",key:d}),o.create({type:"encrypt",key:v}),o.create({type:"decrypt",key:b})]}function n(g){c.call(this,g);var y=new x(this.type,this.options.key);this._edeState=y}return a(n,c),df=n,n.create=function(y){return new n(y)},n.prototype._update=function(y,b,v,d){var w=this._edeState;w.ciphers[0]._update(y,b,v,d),w.ciphers[1]._update(v,d,v,d),w.ciphers[2]._update(v,d,v,d)},n.prototype._pad=o.prototype._pad,n.prototype._unpad=o.prototype._unpad,df}var cu;function ap(){return cu||(cu=1,xr.utils=au(),xr.Cipher=uf(),xr.DES=ou(),xr.CBC=ip(),xr.EDE=np()),xr}var pf,lu;function fp(){if(lu)return pf;lu=1;var M=pr(),a=ap(),c=Ye(),o=tt().Buffer,x={"des-ede3-cbc":a.CBC.instantiate(a.EDE),"des-ede3":a.EDE,"des-ede-cbc":a.CBC.instantiate(a.EDE),"des-ede":a.EDE,"des-cbc":a.CBC.instantiate(a.DES),"des-ecb":a.DES};x.des=x["des-cbc"],x.des3=x["des-ede3-cbc"],pf=n,c(n,M);function n(g){M.call(this);var y=g.mode.toLowerCase(),b=x[y],v;g.decrypt?v="decrypt":v="encrypt";var d=g.key;o.isBuffer(d)||(d=o.from(d)),(y==="des-ede"||y==="des-ede-cbc")&&(d=o.concat([d,d.slice(0,8)]));var w=g.iv;o.isBuffer(w)||(w=o.from(w)),this._des=b.create({key:d,iv:w,type:v})}return n.prototype._update=function(g){return o.from(this._des.update(g))},n.prototype._final=function(){return o.from(this._des.final())},pf}var jt={},vi={},mi={},du;function sp(){return du||(du=1,mi.encrypt=function(M,a){return M._cipher.encryptBlock(a)},mi.decrypt=function(M,a){return M._cipher.decryptBlock(a)}),mi}var bi={},vf={},gi={};gi.byteLength=up,gi.toByteArray=lp,gi.fromByteArray=vp;for(var nr=[],Vt=[],op=typeof Uint8Array<"u"?Uint8Array:Array,mf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nr=0,hp=mf.length;Nr<hp;++Nr)nr[Nr]=mf[Nr],Vt[mf.charCodeAt(Nr)]=Nr;Vt[45]=62,Vt[95]=63;function pu(M){var a=M.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=M.indexOf("=");c===-1&&(c=a);var o=c===a?0:4-c%4;return[c,o]}function up(M){var a=pu(M),c=a[0],o=a[1];return(c+o)*3/4-o}function cp(M,a,c){return(a+c)*3/4-c}function lp(M){var a,c=pu(M),o=c[0],x=c[1],n=new op(cp(M,o,x)),g=0,y=x>0?o-4:o,b;for(b=0;b<y;b+=4)a=Vt[M.charCodeAt(b)]<<18|Vt[M.charCodeAt(b+1)]<<12|Vt[M.charCodeAt(b+2)]<<6|Vt[M.charCodeAt(b+3)],n[g++]=a>>16&255,n[g++]=a>>8&255,n[g++]=a&255;return x===2&&(a=Vt[M.charCodeAt(b)]<<2|Vt[M.charCodeAt(b+1)]>>4,n[g++]=a&255),x===1&&(a=Vt[M.charCodeAt(b)]<<10|Vt[M.charCodeAt(b+1)]<<4|Vt[M.charCodeAt(b+2)]>>2,n[g++]=a>>8&255,n[g++]=a&255),n}function dp(M){return nr[M>>18&63]+nr[M>>12&63]+nr[M>>6&63]+nr[M&63]}function pp(M,a,c){for(var o,x=[],n=a;n<c;n+=3)o=(M[n]<<16&16711680)+(M[n+1]<<8&65280)+(M[n+2]&255),x.push(dp(o));return x.join("")}function vp(M){for(var a,c=M.length,o=c%3,x=[],n=16383,g=0,y=c-o;g<y;g+=n)x.push(pp(M,g,g+n>y?y:g+n));return o===1?(a=M[c-1],x.push(nr[a>>2]+nr[a<<4&63]+"==")):o===2&&(a=(M[c-2]<<8)+M[c-1],x.push(nr[a>>10]+nr[a>>4&63]+nr[a<<2&63]+"=")),x.join("")}var bf={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */bf.read=function(M,a,c,o,x){var n,g,y=x*8-o-1,b=(1<<y)-1,v=b>>1,d=-7,w=c?x-1:0,_=c?-1:1,E=M[a+w];for(w+=_,n=E&(1<<-d)-1,E>>=-d,d+=y;d>0;n=n*256+M[a+w],w+=_,d-=8);for(g=n&(1<<-d)-1,n>>=-d,d+=o;d>0;g=g*256+M[a+w],w+=_,d-=8);if(n===0)n=1-v;else{if(n===b)return g?NaN:(E?-1:1)*(1/0);g=g+Math.pow(2,o),n=n-v}return(E?-1:1)*g*Math.pow(2,n-o)},bf.write=function(M,a,c,o,x,n){var g,y,b,v=n*8-x-1,d=(1<<v)-1,w=d>>1,_=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=o?0:n-1,B=o?1:-1,A=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(y=isNaN(a)?1:0,g=d):(g=Math.floor(Math.log(a)/Math.LN2),a*(b=Math.pow(2,-g))<1&&(g--,b*=2),g+w>=1?a+=_/b:a+=_*Math.pow(2,1-w),a*b>=2&&(g++,b/=2),g+w>=d?(y=0,g=d):g+w>=1?(y=(a*b-1)*Math.pow(2,x),g=g+w):(y=a*Math.pow(2,w-1)*Math.pow(2,x),g=0));x>=8;M[c+E]=y&255,E+=B,y/=256,x-=8);for(g=g<<x|y,v+=x;v>0;M[c+E]=g&255,E+=B,g/=256,v-=8);M[c+E-B]|=A*128};/*!
6
+ */(function(k){const L=t,T=U,I=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;k.Buffer=N,k.SlowBuffer=q,k.INSPECT_MAX_BYTES=50;const F=2147483647;k.kMaxLength=F;const{Uint8Array:j,ArrayBuffer:W,SharedArrayBuffer:Z}=globalThis;N.TYPED_ARRAY_SUPPORT=ne(),!N.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function ne(){try{const R=new j(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,j.prototype),Object.setPrototypeOf(R,d),R.foo()===42}catch{return!1}}Object.defineProperty(N.prototype,"parent",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.buffer}}),Object.defineProperty(N.prototype,"offset",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.byteOffset}});function ae(R){if(R>F)throw new RangeError('The value "'+R+'" is invalid for option "size"');const d=new j(R);return Object.setPrototypeOf(d,N.prototype),d}function N(R,d,m){if(typeof R=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(R)}return E(R,d,m)}N.poolSize=8192;function E(R,d,m){if(typeof R=="string")return g(R,d);if(W.isView(R))return M(R);if(R==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R);if(vt(R,W)||R&&vt(R.buffer,W)||typeof Z<"u"&&(vt(R,Z)||R&&vt(R.buffer,Z)))return G(R,d,m);if(typeof R=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=R.valueOf&&R.valueOf();if(D!=null&&D!==R)return N.from(D,d,m);const J=C(R);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof R[Symbol.toPrimitive]=="function")return N.from(R[Symbol.toPrimitive]("string"),d,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof R)}N.from=function(R,d,m){return E(R,d,m)},Object.setPrototypeOf(N.prototype,j.prototype),Object.setPrototypeOf(N,j);function s(R){if(typeof R!="number")throw new TypeError('"size" argument must be of type number');if(R<0)throw new RangeError('The value "'+R+'" is invalid for option "size"')}function y(R,d,m){return s(R),R<=0?ae(R):d!==void 0?typeof m=="string"?ae(R).fill(d,m):ae(R).fill(d):ae(R)}N.alloc=function(R,d,m){return y(R,d,m)};function S(R){return s(R),ae(R<0?0:p(R)|0)}N.allocUnsafe=function(R){return S(R)},N.allocUnsafeSlow=function(R){return S(R)};function g(R,d){if((typeof d!="string"||d==="")&&(d="utf8"),!N.isEncoding(d))throw new TypeError("Unknown encoding: "+d);const m=ue(R,d)|0;let D=ae(m);const J=D.write(R,d);return J!==m&&(D=D.slice(0,J)),D}function _(R){const d=R.length<0?0:p(R.length)|0,m=ae(d);for(let D=0;D<d;D+=1)m[D]=R[D]&255;return m}function M(R){if(vt(R,j)){const d=new j(R);return G(d.buffer,d.byteOffset,d.byteLength)}return _(R)}function G(R,d,m){if(d<0||R.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(R.byteLength<d+(m||0))throw new RangeError('"length" is outside of buffer bounds');let D;return d===void 0&&m===void 0?D=new j(R):m===void 0?D=new j(R,d):D=new j(R,d,m),Object.setPrototypeOf(D,N.prototype),D}function C(R){if(N.isBuffer(R)){const d=p(R.length)|0,m=ae(d);return m.length===0||R.copy(m,0,0,d),m}if(R.length!==void 0)return typeof R.length!="number"||tt(R.length)?ae(0):_(R);if(R.type==="Buffer"&&Array.isArray(R.data))return _(R.data)}function p(R){if(R>=F)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+F.toString(16)+" bytes");return R|0}function q(R){return+R!=R&&(R=0),N.alloc(+R)}N.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==N.prototype},N.compare=function(d,m){if(vt(d,j)&&(d=N.from(d,d.offset,d.byteLength)),vt(m,j)&&(m=N.from(m,m.offset,m.byteLength)),!N.isBuffer(d)||!N.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===m)return 0;let D=d.length,J=m.length;for(let Q=0,ie=Math.min(D,J);Q<ie;++Q)if(d[Q]!==m[Q]){D=d[Q],J=m[Q];break}return D<J?-1:J<D?1:0},N.isEncoding=function(d){switch(String(d).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}},N.concat=function(d,m){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return N.alloc(0);let D;if(m===void 0)for(m=0,D=0;D<d.length;++D)m+=d[D].length;const J=N.allocUnsafe(m);let Q=0;for(D=0;D<d.length;++D){let ie=d[D];if(vt(ie,j))Q+ie.length>J.length?(N.isBuffer(ie)||(ie=N.from(ie)),ie.copy(J,Q)):j.prototype.set.call(J,ie,Q);else if(N.isBuffer(ie))ie.copy(J,Q);else throw new TypeError('"list" argument must be an Array of Buffers');Q+=ie.length}return J};function ue(R,d){if(N.isBuffer(R))return R.length;if(W.isView(R)||vt(R,W))return R.byteLength;if(typeof R!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof R);const m=R.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&m===0)return 0;let J=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Ee(R).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return ve(R).length;default:if(J)return D?-1:Ee(R).length;d=(""+d).toLowerCase(),J=!0}}N.byteLength=ue;function he(R,d,m){let D=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,d>>>=0,m<=d))return"";for(R||(R="utf8");;)switch(R){case"hex":return ke(this,d,m);case"utf8":case"utf-8":return Ie(this,d,m);case"ascii":return Ce(this,d,m);case"latin1":case"binary":return ft(this,d,m);case"base64":return xe(this,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,d,m);default:if(D)throw new TypeError("Unknown encoding: "+R);R=(R+"").toLowerCase(),D=!0}}N.prototype._isBuffer=!0;function de(R,d,m){const D=R[d];R[d]=R[m],R[m]=D}N.prototype.swap16=function(){const d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;m<d;m+=2)de(this,m,m+1);return this},N.prototype.swap32=function(){const d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let m=0;m<d;m+=4)de(this,m,m+3),de(this,m+1,m+2);return this},N.prototype.swap64=function(){const d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let m=0;m<d;m+=8)de(this,m,m+7),de(this,m+1,m+6),de(this,m+2,m+5),de(this,m+3,m+4);return this},N.prototype.toString=function(){const d=this.length;return d===0?"":arguments.length===0?Ie(this,0,d):he.apply(this,arguments)},N.prototype.toLocaleString=N.prototype.toString,N.prototype.equals=function(d){if(!N.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:N.compare(this,d)===0},N.prototype.inspect=function(){let d="";const m=k.INSPECT_MAX_BYTES;return d=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(d+=" ... "),"<Buffer "+d+">"},I&&(N.prototype[I]=N.prototype.inspect),N.prototype.compare=function(d,m,D,J,Q){if(vt(d,j)&&(d=N.from(d,d.offset,d.byteLength)),!N.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(m===void 0&&(m=0),D===void 0&&(D=d?d.length:0),J===void 0&&(J=0),Q===void 0&&(Q=this.length),m<0||D>d.length||J<0||Q>this.length)throw new RangeError("out of range index");if(J>=Q&&m>=D)return 0;if(J>=Q)return-1;if(m>=D)return 1;if(m>>>=0,D>>>=0,J>>>=0,Q>>>=0,this===d)return 0;let ie=Q-J,Te=D-m;const Pe=Math.min(ie,Te),Ae=this.slice(J,Q),Qe=d.slice(m,D);for(let _e=0;_e<Pe;++_e)if(Ae[_e]!==Qe[_e]){ie=Ae[_e],Te=Qe[_e];break}return ie<Te?-1:Te<ie?1:0};function V(R,d,m,D,J){if(R.length===0)return-1;if(typeof m=="string"?(D=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,tt(m)&&(m=J?0:R.length-1),m<0&&(m=R.length+m),m>=R.length){if(J)return-1;m=R.length-1}else if(m<0)if(J)m=0;else return-1;if(typeof d=="string"&&(d=N.from(d,D)),N.isBuffer(d))return d.length===0?-1:K(R,d,m,D,J);if(typeof d=="number")return d=d&255,typeof j.prototype.indexOf=="function"?J?j.prototype.indexOf.call(R,d,m):j.prototype.lastIndexOf.call(R,d,m):K(R,[d],m,D,J);throw new TypeError("val must be string, number or Buffer")}function K(R,d,m,D,J){let Q=1,ie=R.length,Te=d.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(R.length<2||d.length<2)return-1;Q=2,ie/=2,Te/=2,m/=2}function Pe(Qe,_e){return Q===1?Qe[_e]:Qe.readUInt16BE(_e*Q)}let Ae;if(J){let Qe=-1;for(Ae=m;Ae<ie;Ae++)if(Pe(R,Ae)===Pe(d,Qe===-1?0:Ae-Qe)){if(Qe===-1&&(Qe=Ae),Ae-Qe+1===Te)return Qe*Q}else Qe!==-1&&(Ae-=Ae-Qe),Qe=-1}else for(m+Te>ie&&(m=ie-Te),Ae=m;Ae>=0;Ae--){let Qe=!0;for(let _e=0;_e<Te;_e++)if(Pe(R,Ae+_e)!==Pe(d,_e)){Qe=!1;break}if(Qe)return Ae}return-1}N.prototype.includes=function(d,m,D){return this.indexOf(d,m,D)!==-1},N.prototype.indexOf=function(d,m,D){return V(this,d,m,D,!0)},N.prototype.lastIndexOf=function(d,m,D){return V(this,d,m,D,!1)};function te(R,d,m,D){m=Number(m)||0;const J=R.length-m;D?(D=Number(D),D>J&&(D=J)):D=J;const Q=d.length;D>Q/2&&(D=Q/2);let ie;for(ie=0;ie<D;++ie){const Te=parseInt(d.substr(ie*2,2),16);if(tt(Te))return ie;R[m+ie]=Te}return ie}function se(R,d,m,D){return Xe(Ee(d,R.length-m),R,m,D)}function le(R,d,m,D){return Xe(Be(d),R,m,D)}function fe(R,d,m,D){return Xe(ve(d),R,m,D)}function pe(R,d,m,D){return Xe($e(d,R.length-m),R,m,D)}N.prototype.write=function(d,m,D,J){if(m===void 0)J="utf8",D=this.length,m=0;else if(D===void 0&&typeof m=="string")J=m,D=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(D)?(D=D>>>0,J===void 0&&(J="utf8")):(J=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Q=this.length-m;if((D===void 0||D>Q)&&(D=Q),d.length>0&&(D<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let ie=!1;for(;;)switch(J){case"hex":return te(this,d,m,D);case"utf8":case"utf-8":return se(this,d,m,D);case"ascii":case"latin1":case"binary":return le(this,d,m,D);case"base64":return fe(this,d,m,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,d,m,D);default:if(ie)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),ie=!0}},N.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xe(R,d,m){return d===0&&m===R.length?L.fromByteArray(R):L.fromByteArray(R.slice(d,m))}function Ie(R,d,m){m=Math.min(R.length,m);const D=[];let J=d;for(;J<m;){const Q=R[J];let ie=null,Te=Q>239?4:Q>223?3:Q>191?2:1;if(J+Te<=m){let Pe,Ae,Qe,_e;switch(Te){case 1:Q<128&&(ie=Q);break;case 2:Pe=R[J+1],(Pe&192)===128&&(_e=(Q&31)<<6|Pe&63,_e>127&&(ie=_e));break;case 3:Pe=R[J+1],Ae=R[J+2],(Pe&192)===128&&(Ae&192)===128&&(_e=(Q&15)<<12|(Pe&63)<<6|Ae&63,_e>2047&&(_e<55296||_e>57343)&&(ie=_e));break;case 4:Pe=R[J+1],Ae=R[J+2],Qe=R[J+3],(Pe&192)===128&&(Ae&192)===128&&(Qe&192)===128&&(_e=(Q&15)<<18|(Pe&63)<<12|(Ae&63)<<6|Qe&63,_e>65535&&_e<1114112&&(ie=_e))}}ie===null?(ie=65533,Te=1):ie>65535&&(ie-=65536,D.push(ie>>>10&1023|55296),ie=56320|ie&1023),D.push(ie),J+=Te}return Re(D)}const Me=4096;function Re(R){const d=R.length;if(d<=Me)return String.fromCharCode.apply(String,R);let m="",D=0;for(;D<d;)m+=String.fromCharCode.apply(String,R.slice(D,D+=Me));return m}function Ce(R,d,m){let D="";m=Math.min(R.length,m);for(let J=d;J<m;++J)D+=String.fromCharCode(R[J]&127);return D}function ft(R,d,m){let D="";m=Math.min(R.length,m);for(let J=d;J<m;++J)D+=String.fromCharCode(R[J]);return D}function ke(R,d,m){const D=R.length;(!d||d<0)&&(d=0),(!m||m<0||m>D)&&(m=D);let J="";for(let Q=d;Q<m;++Q)J+=rt[R[Q]];return J}function me(R,d,m){const D=R.slice(d,m);let J="";for(let Q=0;Q<D.length-1;Q+=2)J+=String.fromCharCode(D[Q]+D[Q+1]*256);return J}N.prototype.slice=function(d,m){const D=this.length;d=~~d,m=m===void 0?D:~~m,d<0?(d+=D,d<0&&(d=0)):d>D&&(d=D),m<0?(m+=D,m<0&&(m=0)):m>D&&(m=D),m<d&&(m=d);const J=this.subarray(d,m);return Object.setPrototypeOf(J,N.prototype),J};function Oe(R,d,m){if(R%1!==0||R<0)throw new RangeError("offset is not uint");if(R+d>m)throw new RangeError("Trying to access beyond buffer length")}N.prototype.readUintLE=N.prototype.readUIntLE=function(d,m,D){d=d>>>0,m=m>>>0,D||Oe(d,m,this.length);let J=this[d],Q=1,ie=0;for(;++ie<m&&(Q*=256);)J+=this[d+ie]*Q;return J},N.prototype.readUintBE=N.prototype.readUIntBE=function(d,m,D){d=d>>>0,m=m>>>0,D||Oe(d,m,this.length);let J=this[d+--m],Q=1;for(;m>0&&(Q*=256);)J+=this[d+--m]*Q;return J},N.prototype.readUint8=N.prototype.readUInt8=function(d,m){return d=d>>>0,m||Oe(d,1,this.length),this[d]},N.prototype.readUint16LE=N.prototype.readUInt16LE=function(d,m){return d=d>>>0,m||Oe(d,2,this.length),this[d]|this[d+1]<<8},N.prototype.readUint16BE=N.prototype.readUInt16BE=function(d,m){return d=d>>>0,m||Oe(d,2,this.length),this[d]<<8|this[d+1]},N.prototype.readUint32LE=N.prototype.readUInt32LE=function(d,m){return d=d>>>0,m||Oe(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},N.prototype.readUint32BE=N.prototype.readUInt32BE=function(d,m){return d=d>>>0,m||Oe(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},N.prototype.readBigUInt64LE=At(function(d){d=d>>>0,$(d,"offset");const m=this[d],D=this[d+7];(m===void 0||D===void 0)&&X(d,this.length-8);const J=m+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,Q=this[++d]+this[++d]*2**8+this[++d]*2**16+D*2**24;return BigInt(J)+(BigInt(Q)<<BigInt(32))}),N.prototype.readBigUInt64BE=At(function(d){d=d>>>0,$(d,"offset");const m=this[d],D=this[d+7];(m===void 0||D===void 0)&&X(d,this.length-8);const J=m*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],Q=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+D;return(BigInt(J)<<BigInt(32))+BigInt(Q)}),N.prototype.readIntLE=function(d,m,D){d=d>>>0,m=m>>>0,D||Oe(d,m,this.length);let J=this[d],Q=1,ie=0;for(;++ie<m&&(Q*=256);)J+=this[d+ie]*Q;return Q*=128,J>=Q&&(J-=Math.pow(2,8*m)),J},N.prototype.readIntBE=function(d,m,D){d=d>>>0,m=m>>>0,D||Oe(d,m,this.length);let J=m,Q=1,ie=this[d+--J];for(;J>0&&(Q*=256);)ie+=this[d+--J]*Q;return Q*=128,ie>=Q&&(ie-=Math.pow(2,8*m)),ie},N.prototype.readInt8=function(d,m){return d=d>>>0,m||Oe(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},N.prototype.readInt16LE=function(d,m){d=d>>>0,m||Oe(d,2,this.length);const D=this[d]|this[d+1]<<8;return D&32768?D|4294901760:D},N.prototype.readInt16BE=function(d,m){d=d>>>0,m||Oe(d,2,this.length);const D=this[d+1]|this[d]<<8;return D&32768?D|4294901760:D},N.prototype.readInt32LE=function(d,m){return d=d>>>0,m||Oe(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},N.prototype.readInt32BE=function(d,m){return d=d>>>0,m||Oe(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},N.prototype.readBigInt64LE=At(function(d){d=d>>>0,$(d,"offset");const m=this[d],D=this[d+7];(m===void 0||D===void 0)&&X(d,this.length-8);const J=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(D<<24);return(BigInt(J)<<BigInt(32))+BigInt(m+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),N.prototype.readBigInt64BE=At(function(d){d=d>>>0,$(d,"offset");const m=this[d],D=this[d+7];(m===void 0||D===void 0)&&X(d,this.length-8);const J=(m<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(J)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+D)}),N.prototype.readFloatLE=function(d,m){return d=d>>>0,m||Oe(d,4,this.length),T.read(this,d,!0,23,4)},N.prototype.readFloatBE=function(d,m){return d=d>>>0,m||Oe(d,4,this.length),T.read(this,d,!1,23,4)},N.prototype.readDoubleLE=function(d,m){return d=d>>>0,m||Oe(d,8,this.length),T.read(this,d,!0,52,8)},N.prototype.readDoubleBE=function(d,m){return d=d>>>0,m||Oe(d,8,this.length),T.read(this,d,!1,52,8)};function ye(R,d,m,D,J,Q){if(!N.isBuffer(R))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>J||d<Q)throw new RangeError('"value" argument is out of bounds');if(m+D>R.length)throw new RangeError("Index out of range")}N.prototype.writeUintLE=N.prototype.writeUIntLE=function(d,m,D,J){if(d=+d,m=m>>>0,D=D>>>0,!J){const Te=Math.pow(2,8*D)-1;ye(this,d,m,D,Te,0)}let Q=1,ie=0;for(this[m]=d&255;++ie<D&&(Q*=256);)this[m+ie]=d/Q&255;return m+D},N.prototype.writeUintBE=N.prototype.writeUIntBE=function(d,m,D,J){if(d=+d,m=m>>>0,D=D>>>0,!J){const Te=Math.pow(2,8*D)-1;ye(this,d,m,D,Te,0)}let Q=D-1,ie=1;for(this[m+Q]=d&255;--Q>=0&&(ie*=256);)this[m+Q]=d/ie&255;return m+D},N.prototype.writeUint8=N.prototype.writeUInt8=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,1,255,0),this[m]=d&255,m+1},N.prototype.writeUint16LE=N.prototype.writeUInt16LE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,2,65535,0),this[m]=d&255,this[m+1]=d>>>8,m+2},N.prototype.writeUint16BE=N.prototype.writeUInt16BE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,2,65535,0),this[m]=d>>>8,this[m+1]=d&255,m+2},N.prototype.writeUint32LE=N.prototype.writeUInt32LE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,4,4294967295,0),this[m+3]=d>>>24,this[m+2]=d>>>16,this[m+1]=d>>>8,this[m]=d&255,m+4},N.prototype.writeUint32BE=N.prototype.writeUInt32BE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,4,4294967295,0),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4};function Se(R,d,m,D,J){H(d,D,J,R,m,7);let Q=Number(d&BigInt(4294967295));R[m++]=Q,Q=Q>>8,R[m++]=Q,Q=Q>>8,R[m++]=Q,Q=Q>>8,R[m++]=Q;let ie=Number(d>>BigInt(32)&BigInt(4294967295));return R[m++]=ie,ie=ie>>8,R[m++]=ie,ie=ie>>8,R[m++]=ie,ie=ie>>8,R[m++]=ie,m}function Ye(R,d,m,D,J){H(d,D,J,R,m,7);let Q=Number(d&BigInt(4294967295));R[m+7]=Q,Q=Q>>8,R[m+6]=Q,Q=Q>>8,R[m+5]=Q,Q=Q>>8,R[m+4]=Q;let ie=Number(d>>BigInt(32)&BigInt(4294967295));return R[m+3]=ie,ie=ie>>8,R[m+2]=ie,ie=ie>>8,R[m+1]=ie,ie=ie>>8,R[m]=ie,m+8}N.prototype.writeBigUInt64LE=At(function(d,m=0){return Se(this,d,m,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeBigUInt64BE=At(function(d,m=0){return Ye(this,d,m,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeIntLE=function(d,m,D,J){if(d=+d,m=m>>>0,!J){const Pe=Math.pow(2,8*D-1);ye(this,d,m,D,Pe-1,-Pe)}let Q=0,ie=1,Te=0;for(this[m]=d&255;++Q<D&&(ie*=256);)d<0&&Te===0&&this[m+Q-1]!==0&&(Te=1),this[m+Q]=(d/ie>>0)-Te&255;return m+D},N.prototype.writeIntBE=function(d,m,D,J){if(d=+d,m=m>>>0,!J){const Pe=Math.pow(2,8*D-1);ye(this,d,m,D,Pe-1,-Pe)}let Q=D-1,ie=1,Te=0;for(this[m+Q]=d&255;--Q>=0&&(ie*=256);)d<0&&Te===0&&this[m+Q+1]!==0&&(Te=1),this[m+Q]=(d/ie>>0)-Te&255;return m+D},N.prototype.writeInt8=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,1,127,-128),d<0&&(d=255+d+1),this[m]=d&255,m+1},N.prototype.writeInt16LE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,2,32767,-32768),this[m]=d&255,this[m+1]=d>>>8,m+2},N.prototype.writeInt16BE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,2,32767,-32768),this[m]=d>>>8,this[m+1]=d&255,m+2},N.prototype.writeInt32LE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,4,2147483647,-2147483648),this[m]=d&255,this[m+1]=d>>>8,this[m+2]=d>>>16,this[m+3]=d>>>24,m+4},N.prototype.writeInt32BE=function(d,m,D){return d=+d,m=m>>>0,D||ye(this,d,m,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4},N.prototype.writeBigInt64LE=At(function(d,m=0){return Se(this,d,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),N.prototype.writeBigInt64BE=At(function(d,m=0){return Ye(this,d,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ke(R,d,m,D,J,Q){if(m+D>R.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Ge(R,d,m,D,J){return d=+d,m=m>>>0,J||Ke(R,d,m,4),T.write(R,d,m,D,23,4),m+4}N.prototype.writeFloatLE=function(d,m,D){return Ge(this,d,m,!0,D)},N.prototype.writeFloatBE=function(d,m,D){return Ge(this,d,m,!1,D)};function gt(R,d,m,D,J){return d=+d,m=m>>>0,J||Ke(R,d,m,8),T.write(R,d,m,D,52,8),m+8}N.prototype.writeDoubleLE=function(d,m,D){return gt(this,d,m,!0,D)},N.prototype.writeDoubleBE=function(d,m,D){return gt(this,d,m,!1,D)},N.prototype.copy=function(d,m,D,J){if(!N.isBuffer(d))throw new TypeError("argument should be a Buffer");if(D||(D=0),!J&&J!==0&&(J=this.length),m>=d.length&&(m=d.length),m||(m=0),J>0&&J<D&&(J=D),J===D||d.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),d.length-m<J-D&&(J=d.length-m+D);const Q=J-D;return this===d&&typeof j.prototype.copyWithin=="function"?this.copyWithin(m,D,J):j.prototype.set.call(d,this.subarray(D,J),m),Q},N.prototype.fill=function(d,m,D,J){if(typeof d=="string"){if(typeof m=="string"?(J=m,m=0,D=this.length):typeof D=="string"&&(J=D,D=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!N.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(d.length===1){const ie=d.charCodeAt(0);(J==="utf8"&&ie<128||J==="latin1")&&(d=ie)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(m<0||this.length<m||this.length<D)throw new RangeError("Out of range index");if(D<=m)return this;m=m>>>0,D=D===void 0?this.length:D>>>0,d||(d=0);let Q;if(typeof d=="number")for(Q=m;Q<D;++Q)this[Q]=d;else{const ie=N.isBuffer(d)?d:N.from(d,J),Te=ie.length;if(Te===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(Q=0;Q<D-m;++Q)this[Q+m]=ie[Q%Te]}return this};const Ve={};function O(R,d,m){Ve[R]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${R}]`,this.stack,delete this.name}get code(){return R}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${R}]: ${this.message}`}}}O("ERR_BUFFER_OUT_OF_BOUNDS",function(R){return R?`${R} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),O("ERR_INVALID_ARG_TYPE",function(R,d){return`The "${R}" argument must be of type number. Received type ${typeof d}`},TypeError),O("ERR_OUT_OF_RANGE",function(R,d,m){let D=`The value of "${R}" is out of range.`,J=m;return Number.isInteger(m)&&Math.abs(m)>2**32?J=l(String(m)):typeof m=="bigint"&&(J=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(J=l(J)),J+="n"),D+=` It must be ${d}. Received ${J}`,D},RangeError);function l(R){let d="",m=R.length;const D=R[0]==="-"?1:0;for(;m>=D+4;m-=3)d=`_${R.slice(m-3,m)}${d}`;return`${R.slice(0,m)}${d}`}function b(R,d,m){$(d,"offset"),(R[d]===void 0||R[d+m]===void 0)&&X(d,R.length-(m+1))}function H(R,d,m,D,J,Q){if(R>m||R<d){const ie=typeof d=="bigint"?"n":"";let Te;throw d===0||d===BigInt(0)?Te=`>= 0${ie} and < 2${ie} ** ${(Q+1)*8}${ie}`:Te=`>= -(2${ie} ** ${(Q+1)*8-1}${ie}) and < 2 ** ${(Q+1)*8-1}${ie}`,new Ve.ERR_OUT_OF_RANGE("value",Te,R)}b(D,J,Q)}function $(R,d){if(typeof R!="number")throw new Ve.ERR_INVALID_ARG_TYPE(d,"number",R)}function X(R,d,m){throw Math.floor(R)!==R?($(R,m),new Ve.ERR_OUT_OF_RANGE("offset","an integer",R)):d<0?new Ve.ERR_BUFFER_OUT_OF_BOUNDS:new Ve.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${d}`,R)}const re=/[^+/0-9A-Za-z-_]/g;function Ne(R){if(R=R.split("=")[0],R=R.trim().replace(re,""),R.length<2)return"";for(;R.length%4!==0;)R=R+"=";return R}function Ee(R,d){d=d||1/0;let m;const D=R.length;let J=null;const Q=[];for(let ie=0;ie<D;++ie){if(m=R.charCodeAt(ie),m>55295&&m<57344){if(!J){if(m>56319){(d-=3)>-1&&Q.push(239,191,189);continue}else if(ie+1===D){(d-=3)>-1&&Q.push(239,191,189);continue}J=m;continue}if(m<56320){(d-=3)>-1&&Q.push(239,191,189),J=m;continue}m=(J-55296<<10|m-56320)+65536}else J&&(d-=3)>-1&&Q.push(239,191,189);if(J=null,m<128){if((d-=1)<0)break;Q.push(m)}else if(m<2048){if((d-=2)<0)break;Q.push(m>>6|192,m&63|128)}else if(m<65536){if((d-=3)<0)break;Q.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((d-=4)<0)break;Q.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return Q}function Be(R){const d=[];for(let m=0;m<R.length;++m)d.push(R.charCodeAt(m)&255);return d}function $e(R,d){let m,D,J;const Q=[];for(let ie=0;ie<R.length&&!((d-=2)<0);++ie)m=R.charCodeAt(ie),D=m>>8,J=m%256,Q.push(J),Q.push(D);return Q}function ve(R){return L.toByteArray(Ne(R))}function Xe(R,d,m,D){let J;for(J=0;J<D&&!(J+m>=d.length||J>=R.length);++J)d[J+m]=R[J];return J}function vt(R,d){return R instanceof d||R!=null&&R.constructor!=null&&R.constructor.name!=null&&R.constructor.name===d.name}function tt(R){return R!==R}const rt=function(){const R="0123456789abcdef",d=new Array(256);for(let m=0;m<16;++m){const D=m*16;for(let J=0;J<16;++J)d[D+J]=R[m]+R[J]}return d}();function At(R){return typeof BigInt>"u"?it:R}function it(){throw new Error("BigInt not supported")}})(e);const P=e.Buffer;n.Blob=e.Blob,n.BlobOptions=e.BlobOptions,n.Buffer=e.Buffer,n.File=e.File,n.FileOptions=e.FileOptions,n.INSPECT_MAX_BYTES=e.INSPECT_MAX_BYTES,n.SlowBuffer=e.SlowBuffer,n.TranscodeEncoding=e.TranscodeEncoding,n.atob=e.atob,n.btoa=e.btoa,n.constants=e.constants,n.default=P,n.isAscii=e.isAscii,n.isUtf8=e.isUtf8,n.kMaxLength=e.kMaxLength,n.kStringMaxLength=e.kStringMaxLength,n.resolveObjectURL=e.resolveObjectURL,n.transcode=e.transcode}(Ur)),Ur}var yf=dr.exports,ga;function Dt(){return ga||(ga=1,function(n){(function(e,t){function r(E,s){if(!E)throw new Error(s||"Assertion failed")}function a(E,s){E.super_=s;var y=function(){};y.prototype=s.prototype,E.prototype=new y,E.prototype.constructor=E}function i(E,s,y){if(i.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((s==="le"||s==="be")&&(y=s,s=10),this._init(E||0,s||10,y||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=Jt().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,y){return s.cmp(y)>0?s:y},i.min=function(s,y){return s.cmp(y)<0?s:y},i.prototype._init=function(s,y,S){if(typeof s=="number")return this._initNumber(s,y,S);if(typeof s=="object")return this._initArray(s,y,S);y==="hex"&&(y=16),r(y===(y|0)&&y>=2&&y<=36),s=s.toString().replace(/\s+/g,"");var g=0;s[0]==="-"&&(g++,this.negative=1),g<s.length&&(y===16?this._parseHex(s,g,S):(this._parseBase(s,y,g),S==="le"&&this._initArray(this.toArray(),y,S)))},i.prototype._initNumber=function(s,y,S){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),S==="le"&&this._initArray(this.toArray(),y,S)},i.prototype._initArray=function(s,y,S){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var _,M,G=0;if(S==="be")for(g=s.length-1,_=0;g>=0;g-=3)M=s[g]|s[g-1]<<8|s[g-2]<<16,this.words[_]|=M<<G&67108863,this.words[_+1]=M>>>26-G&67108863,G+=24,G>=26&&(G-=26,_++);else if(S==="le")for(g=0,_=0;g<s.length;g+=3)M=s[g]|s[g+1]<<8|s[g+2]<<16,this.words[_]|=M<<G&67108863,this.words[_+1]=M>>>26-G&67108863,G+=24,G>=26&&(G-=26,_++);return this._strip()};function c(E,s){var y=E.charCodeAt(s);if(y>=48&&y<=57)return y-48;if(y>=65&&y<=70)return y-55;if(y>=97&&y<=102)return y-87;r(!1,"Invalid character in "+E)}function h(E,s,y){var S=c(E,y);return y-1>=s&&(S|=c(E,y-1)<<4),S}i.prototype._parseHex=function(s,y,S){this.length=Math.ceil((s.length-y)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var _=0,M=0,G;if(S==="be")for(g=s.length-1;g>=y;g-=2)G=h(s,y,g)<<_,this.words[M]|=G&67108863,_>=18?(_-=18,M+=1,this.words[M]|=G>>>26):_+=8;else{var C=s.length-y;for(g=C%2===0?y+1:y;g<s.length;g+=2)G=h(s,y,g)<<_,this.words[M]|=G&67108863,_>=18?(_-=18,M+=1,this.words[M]|=G>>>26):_+=8}this._strip()};function f(E,s,y,S){for(var g=0,_=0,M=Math.min(E.length,y),G=s;G<M;G++){var C=E.charCodeAt(G)-48;g*=S,C>=49?_=C-49+10:C>=17?_=C-17+10:_=C,r(C>=0&&_<S,"Invalid character"),g+=_}return g}i.prototype._parseBase=function(s,y,S){this.words=[0],this.length=1;for(var g=0,_=1;_<=67108863;_*=y)g++;g--,_=_/y|0;for(var M=s.length-S,G=M%g,C=Math.min(M,M-G)+S,p=0,q=S;q<C;q+=g)p=f(s,q,q+g,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(G!==0){var ue=1;for(p=f(s,q,s.length,y),q=0;q<G;q++)ue*=y;this.imuln(ue),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this._strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var y=0;y<this.length;y++)s.words[y]=this.words[y];s.length=this.length,s.negative=this.negative,s.red=this.red};function o(E,s){E.words=s.words,E.length=s.length,E.negative=s.negative,E.red=s.red}if(i.prototype._move=function(s){o(s,this)},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{i.prototype.inspect=v}else i.prototype.inspect=v;function v(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var w=["","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"],A=[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],B=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,y){s=s||10,y=y|0||1;var S;if(s===16||s==="hex"){S="";for(var g=0,_=0,M=0;M<this.length;M++){var G=this.words[M],C=((G<<g|_)&16777215).toString(16);_=G>>>24-g&16777215,g+=2,g>=26&&(g-=26,M--),_!==0||M!==this.length-1?S=w[6-C.length]+C+S:S=C+S}for(_!==0&&(S=_.toString(16)+S);S.length%y!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(s===(s|0)&&s>=2&&s<=36){var p=A[s],q=B[s];S="";var ue=this.clone();for(ue.negative=0;!ue.isZero();){var he=ue.modrn(q).toString(s);ue=ue.idivn(q),ue.isZero()?S=he+S:S=w[p-he.length]+he+S}for(this.isZero()&&(S="0"+S);S.length%y!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16,2)},u&&(i.prototype.toBuffer=function(s,y){return this.toArrayLike(u,s,y)}),i.prototype.toArray=function(s,y){return this.toArrayLike(Array,s,y)};var x=function(s,y){return s.allocUnsafe?s.allocUnsafe(y):new s(y)};i.prototype.toArrayLike=function(s,y,S){this._strip();var g=this.byteLength(),_=S||Math.max(1,g);r(g<=_,"byte array longer than desired length"),r(_>0,"Requested array length <= 0");var M=x(s,_),G=y==="le"?"LE":"BE";return this["_toArrayLike"+G](M,g),M},i.prototype._toArrayLikeLE=function(s,y){for(var S=0,g=0,_=0,M=0;_<this.length;_++){var G=this.words[_]<<M|g;s[S++]=G&255,S<s.length&&(s[S++]=G>>8&255),S<s.length&&(s[S++]=G>>16&255),M===6?(S<s.length&&(s[S++]=G>>24&255),g=0,M=0):(g=G>>>24,M+=2)}if(S<s.length)for(s[S++]=g;S<s.length;)s[S++]=0},i.prototype._toArrayLikeBE=function(s,y){for(var S=s.length-1,g=0,_=0,M=0;_<this.length;_++){var G=this.words[_]<<M|g;s[S--]=G&255,S>=0&&(s[S--]=G>>8&255),S>=0&&(s[S--]=G>>16&255),M===6?(S>=0&&(s[S--]=G>>24&255),g=0,M=0):(g=G>>>24,M+=2)}if(S>=0)for(s[S--]=g;S>=0;)s[S--]=0},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var y=s,S=0;return y>=4096&&(S+=13,y>>>=13),y>=64&&(S+=7,y>>>=7),y>=8&&(S+=4,y>>>=4),y>=2&&(S+=2,y>>>=2),S+y},i.prototype._zeroBits=function(s){if(s===0)return 26;var y=s,S=0;return(y&8191)===0&&(S+=13,y>>>=13),(y&127)===0&&(S+=7,y>>>=7),(y&15)===0&&(S+=4,y>>>=4),(y&3)===0&&(S+=2,y>>>=2),(y&1)===0&&S++,S},i.prototype.bitLength=function(){var s=this.words[this.length-1],y=this._countBits(s);return(this.length-1)*26+y};function U(E){for(var s=new Array(E.bitLength()),y=0;y<s.length;y++){var S=y/26|0,g=y%26;s[y]=E.words[S]>>>g&1}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,y=0;y<this.length;y++){var S=this._zeroBits(this.words[y]);if(s+=S,S!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var y=0;y<s.length;y++)this.words[y]=this.words[y]|s.words[y];return this._strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var y;this.length>s.length?y=s:y=this;for(var S=0;S<y.length;S++)this.words[S]=this.words[S]&s.words[S];return this.length=y.length,this._strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var y,S;this.length>s.length?(y=this,S=s):(y=s,S=this);for(var g=0;g<S.length;g++)this.words[g]=y.words[g]^S.words[g];if(this!==y)for(;g<y.length;g++)this.words[g]=y.words[g];return this.length=y.length,this._strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var y=Math.ceil(s/26)|0,S=s%26;this._expand(y),S>0&&y--;for(var g=0;g<y;g++)this.words[g]=~this.words[g]&67108863;return S>0&&(this.words[g]=~this.words[g]&67108863>>26-S),this._strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,y){r(typeof s=="number"&&s>=0);var S=s/26|0,g=s%26;return this._expand(S+1),y?this.words[S]=this.words[S]|1<<g:this.words[S]=this.words[S]&~(1<<g),this._strip()},i.prototype.iadd=function(s){var y;if(this.negative!==0&&s.negative===0)return this.negative=0,y=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,y=this.isub(s),s.negative=1,y._normSign();var S,g;this.length>s.length?(S=this,g=s):(S=s,g=this);for(var _=0,M=0;M<g.length;M++)y=(S.words[M]|0)+(g.words[M]|0)+_,this.words[M]=y&67108863,_=y>>>26;for(;_!==0&&M<S.length;M++)y=(S.words[M]|0)+_,this.words[M]=y&67108863,_=y>>>26;if(this.length=S.length,_!==0)this.words[this.length]=_,this.length++;else if(S!==this)for(;M<S.length;M++)this.words[M]=S.words[M];return this},i.prototype.add=function(s){var y;return s.negative!==0&&this.negative===0?(s.negative=0,y=this.sub(s),s.negative^=1,y):s.negative===0&&this.negative!==0?(this.negative=0,y=s.sub(this),this.negative=1,y):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var y=this.iadd(s);return s.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var S=this.cmp(s);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,_;S>0?(g=this,_=s):(g=s,_=this);for(var M=0,G=0;G<_.length;G++)y=(g.words[G]|0)-(_.words[G]|0)+M,M=y>>26,this.words[G]=y&67108863;for(;M!==0&&G<g.length;G++)y=(g.words[G]|0)+M,M=y>>26,this.words[G]=y&67108863;if(M===0&&G<g.length&&g!==this)for(;G<g.length;G++)this.words[G]=g.words[G];return this.length=Math.max(this.length,G),g!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function P(E,s,y){y.negative=s.negative^E.negative;var S=E.length+s.length|0;y.length=S,S=S-1|0;var g=E.words[0]|0,_=s.words[0]|0,M=g*_,G=M&67108863,C=M/67108864|0;y.words[0]=G;for(var p=1;p<S;p++){for(var q=C>>>26,ue=C&67108863,he=Math.min(p,s.length-1),de=Math.max(0,p-E.length+1);de<=he;de++){var V=p-de|0;g=E.words[V]|0,_=s.words[de]|0,M=g*_+ue,q+=M/67108864|0,ue=M&67108863}y.words[p]=ue|0,C=q|0}return C!==0?y.words[p]=C|0:y.length--,y._strip()}var k=function(s,y,S){var g=s.words,_=y.words,M=S.words,G=0,C,p,q,ue=g[0]|0,he=ue&8191,de=ue>>>13,V=g[1]|0,K=V&8191,te=V>>>13,se=g[2]|0,le=se&8191,fe=se>>>13,pe=g[3]|0,xe=pe&8191,Ie=pe>>>13,Me=g[4]|0,Re=Me&8191,Ce=Me>>>13,ft=g[5]|0,ke=ft&8191,me=ft>>>13,Oe=g[6]|0,ye=Oe&8191,Se=Oe>>>13,Ye=g[7]|0,Ke=Ye&8191,Ge=Ye>>>13,gt=g[8]|0,Ve=gt&8191,O=gt>>>13,l=g[9]|0,b=l&8191,H=l>>>13,$=_[0]|0,X=$&8191,re=$>>>13,Ne=_[1]|0,Ee=Ne&8191,Be=Ne>>>13,$e=_[2]|0,ve=$e&8191,Xe=$e>>>13,vt=_[3]|0,tt=vt&8191,rt=vt>>>13,At=_[4]|0,it=At&8191,R=At>>>13,d=_[5]|0,m=d&8191,D=d>>>13,J=_[6]|0,Q=J&8191,ie=J>>>13,Te=_[7]|0,Pe=Te&8191,Ae=Te>>>13,Qe=_[8]|0,_e=Qe&8191,at=Qe>>>13,df=_[9]|0,st=df&8191,ot=df>>>13;S.negative=s.negative^y.negative,S.length=19,C=Math.imul(he,X),p=Math.imul(he,re),p=p+Math.imul(de,X)|0,q=Math.imul(de,re);var Xn=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,C=Math.imul(K,X),p=Math.imul(K,re),p=p+Math.imul(te,X)|0,q=Math.imul(te,re),C=C+Math.imul(he,Ee)|0,p=p+Math.imul(he,Be)|0,p=p+Math.imul(de,Ee)|0,q=q+Math.imul(de,Be)|0;var Qn=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,C=Math.imul(le,X),p=Math.imul(le,re),p=p+Math.imul(fe,X)|0,q=Math.imul(fe,re),C=C+Math.imul(K,Ee)|0,p=p+Math.imul(K,Be)|0,p=p+Math.imul(te,Ee)|0,q=q+Math.imul(te,Be)|0,C=C+Math.imul(he,ve)|0,p=p+Math.imul(he,Xe)|0,p=p+Math.imul(de,ve)|0,q=q+Math.imul(de,Xe)|0;var Zn=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(Zn>>>26)|0,Zn&=67108863,C=Math.imul(xe,X),p=Math.imul(xe,re),p=p+Math.imul(Ie,X)|0,q=Math.imul(Ie,re),C=C+Math.imul(le,Ee)|0,p=p+Math.imul(le,Be)|0,p=p+Math.imul(fe,Ee)|0,q=q+Math.imul(fe,Be)|0,C=C+Math.imul(K,ve)|0,p=p+Math.imul(K,Xe)|0,p=p+Math.imul(te,ve)|0,q=q+Math.imul(te,Xe)|0,C=C+Math.imul(he,tt)|0,p=p+Math.imul(he,rt)|0,p=p+Math.imul(de,tt)|0,q=q+Math.imul(de,rt)|0;var ea=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(ea>>>26)|0,ea&=67108863,C=Math.imul(Re,X),p=Math.imul(Re,re),p=p+Math.imul(Ce,X)|0,q=Math.imul(Ce,re),C=C+Math.imul(xe,Ee)|0,p=p+Math.imul(xe,Be)|0,p=p+Math.imul(Ie,Ee)|0,q=q+Math.imul(Ie,Be)|0,C=C+Math.imul(le,ve)|0,p=p+Math.imul(le,Xe)|0,p=p+Math.imul(fe,ve)|0,q=q+Math.imul(fe,Xe)|0,C=C+Math.imul(K,tt)|0,p=p+Math.imul(K,rt)|0,p=p+Math.imul(te,tt)|0,q=q+Math.imul(te,rt)|0,C=C+Math.imul(he,it)|0,p=p+Math.imul(he,R)|0,p=p+Math.imul(de,it)|0,q=q+Math.imul(de,R)|0;var ta=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(ta>>>26)|0,ta&=67108863,C=Math.imul(ke,X),p=Math.imul(ke,re),p=p+Math.imul(me,X)|0,q=Math.imul(me,re),C=C+Math.imul(Re,Ee)|0,p=p+Math.imul(Re,Be)|0,p=p+Math.imul(Ce,Ee)|0,q=q+Math.imul(Ce,Be)|0,C=C+Math.imul(xe,ve)|0,p=p+Math.imul(xe,Xe)|0,p=p+Math.imul(Ie,ve)|0,q=q+Math.imul(Ie,Xe)|0,C=C+Math.imul(le,tt)|0,p=p+Math.imul(le,rt)|0,p=p+Math.imul(fe,tt)|0,q=q+Math.imul(fe,rt)|0,C=C+Math.imul(K,it)|0,p=p+Math.imul(K,R)|0,p=p+Math.imul(te,it)|0,q=q+Math.imul(te,R)|0,C=C+Math.imul(he,m)|0,p=p+Math.imul(he,D)|0,p=p+Math.imul(de,m)|0,q=q+Math.imul(de,D)|0;var ra=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(ra>>>26)|0,ra&=67108863,C=Math.imul(ye,X),p=Math.imul(ye,re),p=p+Math.imul(Se,X)|0,q=Math.imul(Se,re),C=C+Math.imul(ke,Ee)|0,p=p+Math.imul(ke,Be)|0,p=p+Math.imul(me,Ee)|0,q=q+Math.imul(me,Be)|0,C=C+Math.imul(Re,ve)|0,p=p+Math.imul(Re,Xe)|0,p=p+Math.imul(Ce,ve)|0,q=q+Math.imul(Ce,Xe)|0,C=C+Math.imul(xe,tt)|0,p=p+Math.imul(xe,rt)|0,p=p+Math.imul(Ie,tt)|0,q=q+Math.imul(Ie,rt)|0,C=C+Math.imul(le,it)|0,p=p+Math.imul(le,R)|0,p=p+Math.imul(fe,it)|0,q=q+Math.imul(fe,R)|0,C=C+Math.imul(K,m)|0,p=p+Math.imul(K,D)|0,p=p+Math.imul(te,m)|0,q=q+Math.imul(te,D)|0,C=C+Math.imul(he,Q)|0,p=p+Math.imul(he,ie)|0,p=p+Math.imul(de,Q)|0,q=q+Math.imul(de,ie)|0;var ia=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(ia>>>26)|0,ia&=67108863,C=Math.imul(Ke,X),p=Math.imul(Ke,re),p=p+Math.imul(Ge,X)|0,q=Math.imul(Ge,re),C=C+Math.imul(ye,Ee)|0,p=p+Math.imul(ye,Be)|0,p=p+Math.imul(Se,Ee)|0,q=q+Math.imul(Se,Be)|0,C=C+Math.imul(ke,ve)|0,p=p+Math.imul(ke,Xe)|0,p=p+Math.imul(me,ve)|0,q=q+Math.imul(me,Xe)|0,C=C+Math.imul(Re,tt)|0,p=p+Math.imul(Re,rt)|0,p=p+Math.imul(Ce,tt)|0,q=q+Math.imul(Ce,rt)|0,C=C+Math.imul(xe,it)|0,p=p+Math.imul(xe,R)|0,p=p+Math.imul(Ie,it)|0,q=q+Math.imul(Ie,R)|0,C=C+Math.imul(le,m)|0,p=p+Math.imul(le,D)|0,p=p+Math.imul(fe,m)|0,q=q+Math.imul(fe,D)|0,C=C+Math.imul(K,Q)|0,p=p+Math.imul(K,ie)|0,p=p+Math.imul(te,Q)|0,q=q+Math.imul(te,ie)|0,C=C+Math.imul(he,Pe)|0,p=p+Math.imul(he,Ae)|0,p=p+Math.imul(de,Pe)|0,q=q+Math.imul(de,Ae)|0;var na=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(na>>>26)|0,na&=67108863,C=Math.imul(Ve,X),p=Math.imul(Ve,re),p=p+Math.imul(O,X)|0,q=Math.imul(O,re),C=C+Math.imul(Ke,Ee)|0,p=p+Math.imul(Ke,Be)|0,p=p+Math.imul(Ge,Ee)|0,q=q+Math.imul(Ge,Be)|0,C=C+Math.imul(ye,ve)|0,p=p+Math.imul(ye,Xe)|0,p=p+Math.imul(Se,ve)|0,q=q+Math.imul(Se,Xe)|0,C=C+Math.imul(ke,tt)|0,p=p+Math.imul(ke,rt)|0,p=p+Math.imul(me,tt)|0,q=q+Math.imul(me,rt)|0,C=C+Math.imul(Re,it)|0,p=p+Math.imul(Re,R)|0,p=p+Math.imul(Ce,it)|0,q=q+Math.imul(Ce,R)|0,C=C+Math.imul(xe,m)|0,p=p+Math.imul(xe,D)|0,p=p+Math.imul(Ie,m)|0,q=q+Math.imul(Ie,D)|0,C=C+Math.imul(le,Q)|0,p=p+Math.imul(le,ie)|0,p=p+Math.imul(fe,Q)|0,q=q+Math.imul(fe,ie)|0,C=C+Math.imul(K,Pe)|0,p=p+Math.imul(K,Ae)|0,p=p+Math.imul(te,Pe)|0,q=q+Math.imul(te,Ae)|0,C=C+Math.imul(he,_e)|0,p=p+Math.imul(he,at)|0,p=p+Math.imul(de,_e)|0,q=q+Math.imul(de,at)|0;var aa=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(aa>>>26)|0,aa&=67108863,C=Math.imul(b,X),p=Math.imul(b,re),p=p+Math.imul(H,X)|0,q=Math.imul(H,re),C=C+Math.imul(Ve,Ee)|0,p=p+Math.imul(Ve,Be)|0,p=p+Math.imul(O,Ee)|0,q=q+Math.imul(O,Be)|0,C=C+Math.imul(Ke,ve)|0,p=p+Math.imul(Ke,Xe)|0,p=p+Math.imul(Ge,ve)|0,q=q+Math.imul(Ge,Xe)|0,C=C+Math.imul(ye,tt)|0,p=p+Math.imul(ye,rt)|0,p=p+Math.imul(Se,tt)|0,q=q+Math.imul(Se,rt)|0,C=C+Math.imul(ke,it)|0,p=p+Math.imul(ke,R)|0,p=p+Math.imul(me,it)|0,q=q+Math.imul(me,R)|0,C=C+Math.imul(Re,m)|0,p=p+Math.imul(Re,D)|0,p=p+Math.imul(Ce,m)|0,q=q+Math.imul(Ce,D)|0,C=C+Math.imul(xe,Q)|0,p=p+Math.imul(xe,ie)|0,p=p+Math.imul(Ie,Q)|0,q=q+Math.imul(Ie,ie)|0,C=C+Math.imul(le,Pe)|0,p=p+Math.imul(le,Ae)|0,p=p+Math.imul(fe,Pe)|0,q=q+Math.imul(fe,Ae)|0,C=C+Math.imul(K,_e)|0,p=p+Math.imul(K,at)|0,p=p+Math.imul(te,_e)|0,q=q+Math.imul(te,at)|0,C=C+Math.imul(he,st)|0,p=p+Math.imul(he,ot)|0,p=p+Math.imul(de,st)|0,q=q+Math.imul(de,ot)|0;var sa=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(sa>>>26)|0,sa&=67108863,C=Math.imul(b,Ee),p=Math.imul(b,Be),p=p+Math.imul(H,Ee)|0,q=Math.imul(H,Be),C=C+Math.imul(Ve,ve)|0,p=p+Math.imul(Ve,Xe)|0,p=p+Math.imul(O,ve)|0,q=q+Math.imul(O,Xe)|0,C=C+Math.imul(Ke,tt)|0,p=p+Math.imul(Ke,rt)|0,p=p+Math.imul(Ge,tt)|0,q=q+Math.imul(Ge,rt)|0,C=C+Math.imul(ye,it)|0,p=p+Math.imul(ye,R)|0,p=p+Math.imul(Se,it)|0,q=q+Math.imul(Se,R)|0,C=C+Math.imul(ke,m)|0,p=p+Math.imul(ke,D)|0,p=p+Math.imul(me,m)|0,q=q+Math.imul(me,D)|0,C=C+Math.imul(Re,Q)|0,p=p+Math.imul(Re,ie)|0,p=p+Math.imul(Ce,Q)|0,q=q+Math.imul(Ce,ie)|0,C=C+Math.imul(xe,Pe)|0,p=p+Math.imul(xe,Ae)|0,p=p+Math.imul(Ie,Pe)|0,q=q+Math.imul(Ie,Ae)|0,C=C+Math.imul(le,_e)|0,p=p+Math.imul(le,at)|0,p=p+Math.imul(fe,_e)|0,q=q+Math.imul(fe,at)|0,C=C+Math.imul(K,st)|0,p=p+Math.imul(K,ot)|0,p=p+Math.imul(te,st)|0,q=q+Math.imul(te,ot)|0;var oa=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(oa>>>26)|0,oa&=67108863,C=Math.imul(b,ve),p=Math.imul(b,Xe),p=p+Math.imul(H,ve)|0,q=Math.imul(H,Xe),C=C+Math.imul(Ve,tt)|0,p=p+Math.imul(Ve,rt)|0,p=p+Math.imul(O,tt)|0,q=q+Math.imul(O,rt)|0,C=C+Math.imul(Ke,it)|0,p=p+Math.imul(Ke,R)|0,p=p+Math.imul(Ge,it)|0,q=q+Math.imul(Ge,R)|0,C=C+Math.imul(ye,m)|0,p=p+Math.imul(ye,D)|0,p=p+Math.imul(Se,m)|0,q=q+Math.imul(Se,D)|0,C=C+Math.imul(ke,Q)|0,p=p+Math.imul(ke,ie)|0,p=p+Math.imul(me,Q)|0,q=q+Math.imul(me,ie)|0,C=C+Math.imul(Re,Pe)|0,p=p+Math.imul(Re,Ae)|0,p=p+Math.imul(Ce,Pe)|0,q=q+Math.imul(Ce,Ae)|0,C=C+Math.imul(xe,_e)|0,p=p+Math.imul(xe,at)|0,p=p+Math.imul(Ie,_e)|0,q=q+Math.imul(Ie,at)|0,C=C+Math.imul(le,st)|0,p=p+Math.imul(le,ot)|0,p=p+Math.imul(fe,st)|0,q=q+Math.imul(fe,ot)|0;var fa=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(fa>>>26)|0,fa&=67108863,C=Math.imul(b,tt),p=Math.imul(b,rt),p=p+Math.imul(H,tt)|0,q=Math.imul(H,rt),C=C+Math.imul(Ve,it)|0,p=p+Math.imul(Ve,R)|0,p=p+Math.imul(O,it)|0,q=q+Math.imul(O,R)|0,C=C+Math.imul(Ke,m)|0,p=p+Math.imul(Ke,D)|0,p=p+Math.imul(Ge,m)|0,q=q+Math.imul(Ge,D)|0,C=C+Math.imul(ye,Q)|0,p=p+Math.imul(ye,ie)|0,p=p+Math.imul(Se,Q)|0,q=q+Math.imul(Se,ie)|0,C=C+Math.imul(ke,Pe)|0,p=p+Math.imul(ke,Ae)|0,p=p+Math.imul(me,Pe)|0,q=q+Math.imul(me,Ae)|0,C=C+Math.imul(Re,_e)|0,p=p+Math.imul(Re,at)|0,p=p+Math.imul(Ce,_e)|0,q=q+Math.imul(Ce,at)|0,C=C+Math.imul(xe,st)|0,p=p+Math.imul(xe,ot)|0,p=p+Math.imul(Ie,st)|0,q=q+Math.imul(Ie,ot)|0;var ua=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(ua>>>26)|0,ua&=67108863,C=Math.imul(b,it),p=Math.imul(b,R),p=p+Math.imul(H,it)|0,q=Math.imul(H,R),C=C+Math.imul(Ve,m)|0,p=p+Math.imul(Ve,D)|0,p=p+Math.imul(O,m)|0,q=q+Math.imul(O,D)|0,C=C+Math.imul(Ke,Q)|0,p=p+Math.imul(Ke,ie)|0,p=p+Math.imul(Ge,Q)|0,q=q+Math.imul(Ge,ie)|0,C=C+Math.imul(ye,Pe)|0,p=p+Math.imul(ye,Ae)|0,p=p+Math.imul(Se,Pe)|0,q=q+Math.imul(Se,Ae)|0,C=C+Math.imul(ke,_e)|0,p=p+Math.imul(ke,at)|0,p=p+Math.imul(me,_e)|0,q=q+Math.imul(me,at)|0,C=C+Math.imul(Re,st)|0,p=p+Math.imul(Re,ot)|0,p=p+Math.imul(Ce,st)|0,q=q+Math.imul(Ce,ot)|0;var ca=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(ca>>>26)|0,ca&=67108863,C=Math.imul(b,m),p=Math.imul(b,D),p=p+Math.imul(H,m)|0,q=Math.imul(H,D),C=C+Math.imul(Ve,Q)|0,p=p+Math.imul(Ve,ie)|0,p=p+Math.imul(O,Q)|0,q=q+Math.imul(O,ie)|0,C=C+Math.imul(Ke,Pe)|0,p=p+Math.imul(Ke,Ae)|0,p=p+Math.imul(Ge,Pe)|0,q=q+Math.imul(Ge,Ae)|0,C=C+Math.imul(ye,_e)|0,p=p+Math.imul(ye,at)|0,p=p+Math.imul(Se,_e)|0,q=q+Math.imul(Se,at)|0,C=C+Math.imul(ke,st)|0,p=p+Math.imul(ke,ot)|0,p=p+Math.imul(me,st)|0,q=q+Math.imul(me,ot)|0;var ha=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(ha>>>26)|0,ha&=67108863,C=Math.imul(b,Q),p=Math.imul(b,ie),p=p+Math.imul(H,Q)|0,q=Math.imul(H,ie),C=C+Math.imul(Ve,Pe)|0,p=p+Math.imul(Ve,Ae)|0,p=p+Math.imul(O,Pe)|0,q=q+Math.imul(O,Ae)|0,C=C+Math.imul(Ke,_e)|0,p=p+Math.imul(Ke,at)|0,p=p+Math.imul(Ge,_e)|0,q=q+Math.imul(Ge,at)|0,C=C+Math.imul(ye,st)|0,p=p+Math.imul(ye,ot)|0,p=p+Math.imul(Se,st)|0,q=q+Math.imul(Se,ot)|0;var la=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(la>>>26)|0,la&=67108863,C=Math.imul(b,Pe),p=Math.imul(b,Ae),p=p+Math.imul(H,Pe)|0,q=Math.imul(H,Ae),C=C+Math.imul(Ve,_e)|0,p=p+Math.imul(Ve,at)|0,p=p+Math.imul(O,_e)|0,q=q+Math.imul(O,at)|0,C=C+Math.imul(Ke,st)|0,p=p+Math.imul(Ke,ot)|0,p=p+Math.imul(Ge,st)|0,q=q+Math.imul(Ge,ot)|0;var da=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(da>>>26)|0,da&=67108863,C=Math.imul(b,_e),p=Math.imul(b,at),p=p+Math.imul(H,_e)|0,q=Math.imul(H,at),C=C+Math.imul(Ve,st)|0,p=p+Math.imul(Ve,ot)|0,p=p+Math.imul(O,st)|0,q=q+Math.imul(O,ot)|0;var pa=(G+C|0)+((p&8191)<<13)|0;G=(q+(p>>>13)|0)+(pa>>>26)|0,pa&=67108863,C=Math.imul(b,st),p=Math.imul(b,ot),p=p+Math.imul(H,st)|0,q=Math.imul(H,ot);var ba=(G+C|0)+((p&8191)<<13)|0;return G=(q+(p>>>13)|0)+(ba>>>26)|0,ba&=67108863,M[0]=Xn,M[1]=Qn,M[2]=Zn,M[3]=ea,M[4]=ta,M[5]=ra,M[6]=ia,M[7]=na,M[8]=aa,M[9]=sa,M[10]=oa,M[11]=fa,M[12]=ua,M[13]=ca,M[14]=ha,M[15]=la,M[16]=da,M[17]=pa,M[18]=ba,G!==0&&(M[19]=G,S.length++),S};Math.imul||(k=P);function L(E,s,y){y.negative=s.negative^E.negative,y.length=E.length+s.length;for(var S=0,g=0,_=0;_<y.length-1;_++){var M=g;g=0;for(var G=S&67108863,C=Math.min(_,s.length-1),p=Math.max(0,_-E.length+1);p<=C;p++){var q=_-p,ue=E.words[q]|0,he=s.words[p]|0,de=ue*he,V=de&67108863;M=M+(de/67108864|0)|0,V=V+G|0,G=V&67108863,M=M+(V>>>26)|0,g+=M>>>26,M&=67108863}y.words[_]=G,S=M,M=g}return S!==0?y.words[_]=S:y.length--,y._strip()}function T(E,s,y){return L(E,s,y)}i.prototype.mulTo=function(s,y){var S,g=this.length+s.length;return this.length===10&&s.length===10?S=k(this,s,y):g<63?S=P(this,s,y):g<1024?S=L(this,s,y):S=T(this,s,y),S},i.prototype.mul=function(s){var y=new i(null);return y.words=new Array(this.length+s.length),this.mulTo(s,y)},i.prototype.mulf=function(s){var y=new i(null);return y.words=new Array(this.length+s.length),T(this,s,y)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){var y=s<0;y&&(s=-s),r(typeof s=="number"),r(s<67108864);for(var S=0,g=0;g<this.length;g++){var _=(this.words[g]|0)*s,M=(_&67108863)+(S&67108863);S>>=26,S+=_/67108864|0,S+=M>>>26,this.words[g]=M&67108863}return S!==0&&(this.words[g]=S,this.length++),y?this.ineg():this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var y=U(s);if(y.length===0)return new i(1);for(var S=this,g=0;g<y.length&&y[g]===0;g++,S=S.sqr());if(++g<y.length)for(var _=S.sqr();g<y.length;g++,_=_.sqr())y[g]!==0&&(S=S.mul(_));return S},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var y=s%26,S=(s-y)/26,g=67108863>>>26-y<<26-y,_;if(y!==0){var M=0;for(_=0;_<this.length;_++){var G=this.words[_]&g,C=(this.words[_]|0)-G<<y;this.words[_]=C|M,M=G>>>26-y}M&&(this.words[_]=M,this.length++)}if(S!==0){for(_=this.length-1;_>=0;_--)this.words[_+S]=this.words[_];for(_=0;_<S;_++)this.words[_]=0;this.length+=S}return this._strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,y,S){r(typeof s=="number"&&s>=0);var g;y?g=(y-y%26)/26:g=0;var _=s%26,M=Math.min((s-_)/26,this.length),G=67108863^67108863>>>_<<_,C=S;if(g-=M,g=Math.max(0,g),C){for(var p=0;p<M;p++)C.words[p]=this.words[p];C.length=M}if(M!==0)if(this.length>M)for(this.length-=M,p=0;p<this.length;p++)this.words[p]=this.words[p+M];else this.words[0]=0,this.length=1;var q=0;for(p=this.length-1;p>=0&&(q!==0||p>=g);p--){var ue=this.words[p]|0;this.words[p]=q<<26-_|ue>>>_,q=ue&G}return C&&q!==0&&(C.words[C.length++]=q),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(s,y,S){return r(this.negative===0),this.iushrn(s,y,S)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var y=s%26,S=(s-y)/26,g=1<<y;if(this.length<=S)return!1;var _=this.words[S];return!!(_&g)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var y=s%26,S=(s-y)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(y!==0&&S++,this.length=Math.min(S,this.length),y!==0){var g=67108863^67108863>>>y<<y;this.words[this.length-1]&=g}return this._strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<=s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this._strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,y,S){var g=s.length+S,_;this._expand(g);var M,G=0;for(_=0;_<s.length;_++){M=(this.words[_+S]|0)+G;var C=(s.words[_]|0)*y;M-=C&67108863,G=(M>>26)-(C/67108864|0),this.words[_+S]=M&67108863}for(;_<this.length-S;_++)M=(this.words[_+S]|0)+G,G=M>>26,this.words[_+S]=M&67108863;if(G===0)return this._strip();for(r(G===-1),G=0,_=0;_<this.length;_++)M=-(this.words[_]|0)+G,G=M>>26,this.words[_]=M&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(s,y){var S=this.length-s.length,g=this.clone(),_=s,M=_.words[_.length-1]|0,G=this._countBits(M);S=26-G,S!==0&&(_=_.ushln(S),g.iushln(S),M=_.words[_.length-1]|0);var C=g.length-_.length,p;if(y!=="mod"){p=new i(null),p.length=C+1,p.words=new Array(p.length);for(var q=0;q<p.length;q++)p.words[q]=0}var ue=g.clone()._ishlnsubmul(_,1,C);ue.negative===0&&(g=ue,p&&(p.words[C]=1));for(var he=C-1;he>=0;he--){var de=(g.words[_.length+he]|0)*67108864+(g.words[_.length+he-1]|0);for(de=Math.min(de/M|0,67108863),g._ishlnsubmul(_,de,he);g.negative!==0;)de--,g.negative=0,g._ishlnsubmul(_,1,he),g.isZero()||(g.negative^=1);p&&(p.words[he]=de)}return p&&p._strip(),g._strip(),y!=="div"&&S!==0&&g.iushrn(S),{div:p||null,mod:g}},i.prototype.divmod=function(s,y,S){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var g,_,M;return this.negative!==0&&s.negative===0?(M=this.neg().divmod(s,y),y!=="mod"&&(g=M.div.neg()),y!=="div"&&(_=M.mod.neg(),S&&_.negative!==0&&_.iadd(s)),{div:g,mod:_}):this.negative===0&&s.negative!==0?(M=this.divmod(s.neg(),y),y!=="mod"&&(g=M.div.neg()),{div:g,mod:M.mod}):(this.negative&s.negative)!==0?(M=this.neg().divmod(s.neg(),y),y!=="div"&&(_=M.mod.neg(),S&&_.negative!==0&&_.isub(s)),{div:M.div,mod:_}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?y==="div"?{div:this.divn(s.words[0]),mod:null}:y==="mod"?{div:null,mod:new i(this.modrn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modrn(s.words[0]))}:this._wordDiv(s,y)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var y=this.divmod(s);if(y.mod.isZero())return y.div;var S=y.div.negative!==0?y.mod.isub(s):y.mod,g=s.ushrn(1),_=s.andln(1),M=S.cmp(g);return M<0||_===1&&M===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},i.prototype.modrn=function(s){var y=s<0;y&&(s=-s),r(s<=67108863);for(var S=(1<<26)%s,g=0,_=this.length-1;_>=0;_--)g=(S*g+(this.words[_]|0))%s;return y?-g:g},i.prototype.modn=function(s){return this.modrn(s)},i.prototype.idivn=function(s){var y=s<0;y&&(s=-s),r(s<=67108863);for(var S=0,g=this.length-1;g>=0;g--){var _=(this.words[g]|0)+S*67108864;this.words[g]=_/s|0,S=_%s}return this._strip(),y?this.ineg():this},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var y=this,S=s.clone();y.negative!==0?y=y.umod(s):y=y.clone();for(var g=new i(1),_=new i(0),M=new i(0),G=new i(1),C=0;y.isEven()&&S.isEven();)y.iushrn(1),S.iushrn(1),++C;for(var p=S.clone(),q=y.clone();!y.isZero();){for(var ue=0,he=1;(y.words[0]&he)===0&&ue<26;++ue,he<<=1);if(ue>0)for(y.iushrn(ue);ue-- >0;)(g.isOdd()||_.isOdd())&&(g.iadd(p),_.isub(q)),g.iushrn(1),_.iushrn(1);for(var de=0,V=1;(S.words[0]&V)===0&&de<26;++de,V<<=1);if(de>0)for(S.iushrn(de);de-- >0;)(M.isOdd()||G.isOdd())&&(M.iadd(p),G.isub(q)),M.iushrn(1),G.iushrn(1);y.cmp(S)>=0?(y.isub(S),g.isub(M),_.isub(G)):(S.isub(y),M.isub(g),G.isub(_))}return{a:M,b:G,gcd:S.iushln(C)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var y=this,S=s.clone();y.negative!==0?y=y.umod(s):y=y.clone();for(var g=new i(1),_=new i(0),M=S.clone();y.cmpn(1)>0&&S.cmpn(1)>0;){for(var G=0,C=1;(y.words[0]&C)===0&&G<26;++G,C<<=1);if(G>0)for(y.iushrn(G);G-- >0;)g.isOdd()&&g.iadd(M),g.iushrn(1);for(var p=0,q=1;(S.words[0]&q)===0&&p<26;++p,q<<=1);if(p>0)for(S.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(M),_.iushrn(1);y.cmp(S)>=0?(y.isub(S),g.isub(_)):(S.isub(y),_.isub(g))}var ue;return y.cmpn(1)===0?ue=g:ue=_,ue.cmpn(0)<0&&ue.iadd(s),ue},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var y=this.clone(),S=s.clone();y.negative=0,S.negative=0;for(var g=0;y.isEven()&&S.isEven();g++)y.iushrn(1),S.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;S.isEven();)S.iushrn(1);var _=y.cmp(S);if(_<0){var M=y;y=S,S=M}else if(_===0||S.cmpn(1)===0)break;y.isub(S)}while(!0);return S.iushln(g)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var y=s%26,S=(s-y)/26,g=1<<y;if(this.length<=S)return this._expand(S+1),this.words[S]|=g,this;for(var _=g,M=S;_!==0&&M<this.length;M++){var G=this.words[M]|0;G+=_,_=G>>>26,G&=67108863,this.words[M]=G}return _!==0&&(this.words[M]=_,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var y=s<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this._strip();var S;if(this.length>1)S=1;else{y&&(s=-s),r(s<=67108863,"Number is too big");var g=this.words[0]|0;S=g===s?0:g<s?-1:1}return this.negative!==0?-S|0:S},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var y=this.ucmp(s);return this.negative!==0?-y|0:y},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var y=0,S=this.length-1;S>=0;S--){var g=this.words[S]|0,_=s.words[S]|0;if(g!==_){g<_?y=-1:g>_&&(y=1);break}}return y},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new ae(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},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(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var I={k256:null,p224:null,p192:null,p25519:null};function F(E,s){this.name=E,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},F.prototype.ireduce=function(s){var y=s,S;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),S=y.bitLength();while(S>this.n);var g=S<this.n?-1:y.ucmp(this.p);return g===0?(y.words[0]=0,y.length=1):g>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},F.prototype.split=function(s,y){s.iushrn(this.n,0,y)},F.prototype.imulK=function(s){return s.imul(this.k)};function j(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,F),j.prototype.split=function(s,y){for(var S=4194303,g=Math.min(s.length,9),_=0;_<g;_++)y.words[_]=s.words[_];if(y.length=g,s.length<=9){s.words[0]=0,s.length=1;return}var M=s.words[9];for(y.words[y.length++]=M&S,_=10;_<s.length;_++){var G=s.words[_]|0;s.words[_-10]=(G&S)<<4|M>>>22,M=G}M>>>=22,s.words[_-10]=M,M===0&&s.length>10?s.length-=10:s.length-=9},j.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var y=0,S=0;S<s.length;S++){var g=s.words[S]|0;y+=g*977,s.words[S]=y&67108863,y=g*64+(y/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function W(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(W,F);function Z(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,F);function ne(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(ne,F),ne.prototype.imulK=function(s){for(var y=0,S=0;S<s.length;S++){var g=(s.words[S]|0)*19+y,_=g&67108863;g>>>=26,s.words[S]=_,y=g}return y!==0&&(s.words[s.length++]=y),s},i._prime=function(s){if(I[s])return I[s];var y;if(s==="k256")y=new j;else if(s==="p224")y=new W;else if(s==="p192")y=new Z;else if(s==="p25519")y=new ne;else throw new Error("Unknown prime "+s);return I[s]=y,y};function ae(E){if(typeof E=="string"){var s=i._prime(E);this.m=s.p,this.prime=s}else r(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}ae.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},ae.prototype._verify2=function(s,y){r((s.negative|y.negative)===0,"red works only with positives"),r(s.red&&s.red===y.red,"red works only with red numbers")},ae.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):(o(s,s.umod(this.m)._forceRed(this)),s)},ae.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},ae.prototype.add=function(s,y){this._verify2(s,y);var S=s.add(y);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},ae.prototype.iadd=function(s,y){this._verify2(s,y);var S=s.iadd(y);return S.cmp(this.m)>=0&&S.isub(this.m),S},ae.prototype.sub=function(s,y){this._verify2(s,y);var S=s.sub(y);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},ae.prototype.isub=function(s,y){this._verify2(s,y);var S=s.isub(y);return S.cmpn(0)<0&&S.iadd(this.m),S},ae.prototype.shl=function(s,y){return this._verify1(s),this.imod(s.ushln(y))},ae.prototype.imul=function(s,y){return this._verify2(s,y),this.imod(s.imul(y))},ae.prototype.mul=function(s,y){return this._verify2(s,y),this.imod(s.mul(y))},ae.prototype.isqr=function(s){return this.imul(s,s.clone())},ae.prototype.sqr=function(s){return this.mul(s,s)},ae.prototype.sqrt=function(s){if(s.isZero())return s.clone();var y=this.m.andln(3);if(r(y%2===1),y===3){var S=this.m.add(new i(1)).iushrn(2);return this.pow(s,S)}for(var g=this.m.subn(1),_=0;!g.isZero()&&g.andln(1)===0;)_++,g.iushrn(1);r(!g.isZero());var M=new i(1).toRed(this),G=M.redNeg(),C=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);this.pow(p,C).cmp(G)!==0;)p.redIAdd(G);for(var q=this.pow(p,g),ue=this.pow(s,g.addn(1).iushrn(1)),he=this.pow(s,g),de=_;he.cmp(M)!==0;){for(var V=he,K=0;V.cmp(M)!==0;K++)V=V.redSqr();r(K<de);var te=this.pow(q,new i(1).iushln(de-K-1));ue=ue.redMul(te),q=te.redSqr(),he=he.redMul(q),de=K}return ue},ae.prototype.invm=function(s){var y=s._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},ae.prototype.pow=function(s,y){if(y.isZero())return new i(1).toRed(this);if(y.cmpn(1)===0)return s.clone();var S=4,g=new Array(1<<S);g[0]=new i(1).toRed(this),g[1]=s;for(var _=2;_<g.length;_++)g[_]=this.mul(g[_-1],s);var M=g[0],G=0,C=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var q=y.words[_],ue=p-1;ue>=0;ue--){var he=q>>ue&1;if(M!==g[0]&&(M=this.sqr(M)),he===0&&G===0){C=0;continue}G<<=1,G|=he,C++,!(C!==S&&(_!==0||ue!==0))&&(M=this.mul(M,g[G]),C=0,G=0)}p=26}return M},ae.prototype.convertTo=function(s){var y=s.umod(this.m);return y===s?y.clone():y},ae.prototype.convertFrom=function(s){var y=s.clone();return y.red=null,y},i.mont=function(s){return new N(s)};function N(E){ae.call(this,E),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)}a(N,ae),N.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},N.prototype.convertFrom=function(s){var y=this.imod(s.mul(this.rinv));return y.red=null,y},N.prototype.imul=function(s,y){if(s.isZero()||y.isZero())return s.words[0]=0,s.length=1,s;var S=s.imul(y),g=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=S.isub(g).iushrn(this.shift),M=_;return _.cmp(this.m)>=0?M=_.isub(this.m):_.cmpn(0)<0&&(M=_.iadd(this.m)),M._forceRed(this)},N.prototype.mul=function(s,y){if(s.isZero()||y.isZero())return new i(0)._forceRed(this);var S=s.mul(y),g=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=S.isub(g).iushrn(this.shift),M=_;return _.cmp(this.m)>=0?M=_.isub(this.m):_.cmpn(0)<0&&(M=_.iadd(this.m)),M._forceRed(this)},N.prototype.invm=function(s){var y=this.imod(s._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(n,yf)}(dr)),dr.exports}var gf=Dt();const lt=$t(gf);function vf(n){if(n.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let f=0;f<e.length;f++)e[f]=255;for(let f=0;f<n.length;f++){const o=n.charAt(f),v=o.charCodeAt(0);if(e[v]!==255)throw new TypeError(o+" is ambiguous");e[v]=f}const t=n.length,r=n.charAt(0),a=Math.log(t)/Math.log(256),i=Math.log(256)/Math.log(t);function u(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";let o=0,v=0,w=0;const A=f.length;for(;w!==A&&f[w]===0;)w++,o++;const B=(A-w)*i+1>>>0,x=new Uint8Array(B);for(;w!==A;){let k=f[w],L=0;for(let T=B-1;(k!==0||L<v)&&T!==-1;T--,L++)k+=256*x[T]>>>0,x[T]=k%t>>>0,k=k/t>>>0;if(k!==0)throw new Error("Non-zero carry");v=L,w++}let U=B-v;for(;U!==B&&x[U]===0;)U++;let P=r.repeat(o);for(;U<B;++U)P+=n.charAt(x[U]);return P}function c(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;let o=0,v=0,w=0;for(;f[o]===r;)v++,o++;const A=(f.length-o)*a+1>>>0,B=new Uint8Array(A);for(;o<f.length;){const k=f.charCodeAt(o);if(k>255)return;let L=e[k];if(L===255)return;let T=0;for(let I=A-1;(L!==0||T<w)&&I!==-1;I--,T++)L+=t*B[I]>>>0,B[I]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");w=T,o++}let x=A-w;for(;x!==A&&B[x]===0;)x++;const U=new Uint8Array(v+(A-x));let P=v;for(;x!==A;)U[P++]=B[x++];return U}function h(f){const o=c(f);if(o)return o;throw new Error("Non-base"+t+" character")}return{encode:u,decodeUnsafe:c,decode:h}}var wf="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Hr=vf(wf);var Dr={};const xf={version:"7.0.1"};var qr={},Kr,va;function qt(){if(va)return Kr;va=1,Kr=n;function n(e,t){if(!e)throw new Error(t||"Assertion failed")}return n.equal=function(t,r,a){if(t!=r)throw new Error(a||"Assertion failed: "+t+" != "+r)},Kr}var Vr={},wa;function xa(){return wa||(wa=1,function(n){var e=n;function t(i,u){if(Array.isArray(i))return i.slice();if(!i)return[];var c=[];if(typeof i!="string"){for(var h=0;h<i.length;h++)c[h]=i[h]|0;return c}if(u==="hex"){i=i.replace(/[^a-z0-9]+/ig,""),i.length%2!==0&&(i="0"+i);for(var h=0;h<i.length;h+=2)c.push(parseInt(i[h]+i[h+1],16))}else for(var h=0;h<i.length;h++){var f=i.charCodeAt(h),o=f>>8,v=f&255;o?c.push(o,v):c.push(v)}return c}e.toArray=t;function r(i){return i.length===1?"0"+i:i}e.zero2=r;function a(i){for(var u="",c=0;c<i.length;c++)u+=r(i[c].toString(16));return u}e.toHex=a,e.encode=function(u,c){return c==="hex"?a(u):u}}(Vr)),Vr}var _a;function Kt(){return _a||(_a=1,function(n){var e=n,t=Dt(),r=qt(),a=xa();e.assert=r,e.toArray=a.toArray,e.zero2=a.zero2,e.toHex=a.toHex,e.encode=a.encode;function i(o,v,w){var A=new Array(Math.max(o.bitLength(),w)+1);A.fill(0);for(var B=1<<v+1,x=o.clone(),U=0;U<A.length;U++){var P,k=x.andln(B-1);x.isOdd()?(k>(B>>1)-1?P=(B>>1)-k:P=k,x.isubn(P)):P=0,A[U]=P,x.iushrn(1)}return A}e.getNAF=i;function u(o,v){var w=[[],[]];o=o.clone(),v=v.clone();for(var A=0,B=0;o.cmpn(-A)>0||v.cmpn(-B)>0;){var x=o.andln(3)+A&3,U=v.andln(3)+B&3;x===3&&(x=-1),U===3&&(U=-1);var P;if((x&1)===0)P=0;else{var k=o.andln(7)+A&7;(k===3||k===5)&&U===2?P=-x:P=x}w[0].push(P);var L;if((U&1)===0)L=0;else{var k=v.andln(7)+B&7;(k===3||k===5)&&x===2?L=-U:L=U}w[1].push(L),2*A===P+1&&(A=1-A),2*B===L+1&&(B=1-B),o.iushrn(1),v.iushrn(1)}return w}e.getJSF=u;function c(o,v,w){var A="_"+v;o.prototype[v]=function(){return this[A]!==void 0?this[A]:this[A]=w.call(this)}}e.cachedProperty=c;function h(o){return typeof o=="string"?e.toArray(o,"hex"):o}e.parseBytes=h;function f(o){return new t(o,"hex","le")}e.intFromLE=f}(qr)),qr}var pr={exports:{}};const jr=pf(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Sa;function Ea(){if(Sa)return pr.exports;Sa=1;var n;pr.exports=function(a){return n||(n=new e(null)),n.generate(a)};function e(r){this.rand=r}if(pr.exports.Rand=e,e.prototype.generate=function(a){return this._rand(a)},e.prototype._rand=function(a){if(this.rand.getBytes)return this.rand.getBytes(a);for(var i=new Uint8Array(a),u=0;u<i.length;u++)i[u]=this.rand.getByte();return i},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(a){var i=new Uint8Array(a);return self.crypto.getRandomValues(i),i}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(a){var i=new Uint8Array(a);return self.msCrypto.getRandomValues(i),i}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var t=jr;if(typeof t.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(a){return t.randomBytes(a)}}catch{}return pr.exports}var zr={},Gr,Ba;function Ia(){if(Ba)return Gr;Ba=1;var n=Dt(),e=Kt(),t=e.getNAF,r=e.getJSF,a=e.assert;function i(c,h){this.type=c,this.p=new n(h.p,16),this.red=h.prime?n.red(h.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=h.n&&new n(h.n,16),this.g=h.g&&this.pointFromJSON(h.g,h.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var f=this.n&&this.p.div(this.n);!f||f.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Gr=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(h,f){a(h.precomputed);var o=h._getDoubles(),v=t(f,1,this._bitLength),w=(1<<o.step+1)-(o.step%2===0?2:1);w/=3;for(var A=[],B=0;B<v.length;B+=o.step){for(var x=0,f=B+o.step-1;f>=B;f--)x=(x<<1)+v[f];A.push(x)}for(var U=this.jpoint(null,null,null),P=this.jpoint(null,null,null),k=w;k>0;k--){for(var B=0;B<A.length;B++){var x=A[B];x===k?P=P.mixedAdd(o.points[B]):x===-k&&(P=P.mixedAdd(o.points[B].neg()))}U=U.add(P)}return U.toP()},i.prototype._wnafMul=function(h,f){var o=4,v=h._getNAFPoints(o);o=v.wnd;for(var w=v.points,A=t(f,o,this._bitLength),B=this.jpoint(null,null,null),x=A.length-1;x>=0;x--){for(var f=0;x>=0&&A[x]===0;x--)f++;if(x>=0&&f++,B=B.dblp(f),x<0)break;var U=A[x];a(U!==0),h.type==="affine"?U>0?B=B.mixedAdd(w[U-1>>1]):B=B.mixedAdd(w[-U-1>>1].neg()):U>0?B=B.add(w[U-1>>1]):B=B.add(w[-U-1>>1].neg())}return h.type==="affine"?B.toP():B},i.prototype._wnafMulAdd=function(h,f,o,v,w){for(var A=this._wnafT1,B=this._wnafT2,x=this._wnafT3,U=0,P=0;P<v;P++){var k=f[P],L=k._getNAFPoints(h);A[P]=L.wnd,B[P]=L.points}for(var P=v-1;P>=1;P-=2){var T=P-1,I=P;if(A[T]!==1||A[I]!==1){x[T]=t(o[T],A[T],this._bitLength),x[I]=t(o[I],A[I],this._bitLength),U=Math.max(x[T].length,U),U=Math.max(x[I].length,U);continue}var F=[f[T],null,null,f[I]];f[T].y.cmp(f[I].y)===0?(F[1]=f[T].add(f[I]),F[2]=f[T].toJ().mixedAdd(f[I].neg())):f[T].y.cmp(f[I].y.redNeg())===0?(F[1]=f[T].toJ().mixedAdd(f[I]),F[2]=f[T].add(f[I].neg())):(F[1]=f[T].toJ().mixedAdd(f[I]),F[2]=f[T].toJ().mixedAdd(f[I].neg()));var j=[-3,-1,-5,-7,0,7,5,1,3],W=r(o[T],o[I]);U=Math.max(W[0].length,U),x[T]=new Array(U),x[I]=new Array(U);for(var Z=0;Z<U;Z++){var ne=W[0][Z]|0,ae=W[1][Z]|0;x[T][Z]=j[(ne+1)*3+(ae+1)],x[I][Z]=0,B[T]=F}}for(var N=this.jpoint(null,null,null),E=this._wnafT4,P=U;P>=0;P--){for(var s=0;P>=0;){for(var y=!0,Z=0;Z<v;Z++)E[Z]=x[Z][P]|0,E[Z]!==0&&(y=!1);if(!y)break;s++,P--}if(P>=0&&s++,N=N.dblp(s),P<0)break;for(var Z=0;Z<v;Z++){var S=E[Z],k;S!==0&&(S>0?k=B[Z][S-1>>1]:S<0&&(k=B[Z][-S-1>>1].neg()),k.type==="affine"?N=N.mixedAdd(k):N=N.add(k))}}for(var P=0;P<v;P++)B[P]=null;return w?N:N.toP()};function u(c,h){this.curve=c,this.type=h,this.precomputed=null}return i.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},i.prototype.decodePoint=function(h,f){h=e.toArray(h,f);var o=this.p.byteLength();if((h[0]===4||h[0]===6||h[0]===7)&&h.length-1===2*o){h[0]===6?a(h[h.length-1]%2===0):h[0]===7&&a(h[h.length-1]%2===1);var v=this.point(h.slice(1,1+o),h.slice(1+o,1+2*o));return v}else if((h[0]===2||h[0]===3)&&h.length-1===o)return this.pointFromX(h.slice(1,1+o),h[0]===3);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(h){return this.encode(h,!0)},u.prototype._encode=function(h){var f=this.curve.p.byteLength(),o=this.getX().toArray("be",f);return h?[this.getY().isEven()?2:3].concat(o):[4].concat(o,this.getY().toArray("be",f))},u.prototype.encode=function(h,f){return e.encode(this._encode(f),h)},u.prototype.precompute=function(h){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,h),f.beta=this._getBeta(),this.precomputed=f,this},u.prototype._hasDoubles=function(h){if(!this.precomputed)return!1;var f=this.precomputed.doubles;return f?f.points.length>=Math.ceil((h.bitLength()+1)/f.step):!1},u.prototype._getDoubles=function(h,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var o=[this],v=this,w=0;w<f;w+=h){for(var A=0;A<h;A++)v=v.dbl();o.push(v)}return{step:h,points:o}},u.prototype._getNAFPoints=function(h){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var f=[this],o=(1<<h)-1,v=o===1?null:this.dbl(),w=1;w<o;w++)f[w]=f[w-1].add(v);return{wnd:h,points:f}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(h){for(var f=this,o=0;o<h;o++)f=f.dbl();return f},Gr}var br={exports:{}},Aa;function dt(){return Aa||(Aa=1,typeof Object.create=="function"?br.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:br.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),br.exports}var Yr,Oa;function _f(){if(Oa)return Yr;Oa=1;var n=Kt(),e=Dt(),t=dt(),r=Ia(),a=n.assert;function i(h){r.call(this,"short",h),this.a=new e(h.a,16).toRed(this.red),this.b=new e(h.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(h),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}t(i,r),Yr=i,i.prototype._getEndomorphism=function(f){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var o,v;if(f.beta)o=new e(f.beta,16).toRed(this.red);else{var w=this._getEndoRoots(this.p);o=w[0].cmp(w[1])<0?w[0]:w[1],o=o.toRed(this.red)}if(f.lambda)v=new e(f.lambda,16);else{var A=this._getEndoRoots(this.n);this.g.mul(A[0]).x.cmp(this.g.x.redMul(o))===0?v=A[0]:(v=A[1],a(this.g.mul(v).x.cmp(this.g.x.redMul(o))===0))}var B;return f.basis?B=f.basis.map(function(x){return{a:new e(x.a,16),b:new e(x.b,16)}}):B=this._getEndoBasis(v),{beta:o,lambda:v,basis:B}}},i.prototype._getEndoRoots=function(f){var o=f===this.p?this.red:e.mont(f),v=new e(2).toRed(o).redInvm(),w=v.redNeg(),A=new e(3).toRed(o).redNeg().redSqrt().redMul(v),B=w.redAdd(A).fromRed(),x=w.redSub(A).fromRed();return[B,x]},i.prototype._getEndoBasis=function(f){for(var o=this.n.ushrn(Math.floor(this.n.bitLength()/2)),v=f,w=this.n.clone(),A=new e(1),B=new e(0),x=new e(0),U=new e(1),P,k,L,T,I,F,j,W=0,Z,ne;v.cmpn(0)!==0;){var ae=w.div(v);Z=w.sub(ae.mul(v)),ne=x.sub(ae.mul(A));var N=U.sub(ae.mul(B));if(!L&&Z.cmp(o)<0)P=j.neg(),k=A,L=Z.neg(),T=ne;else if(L&&++W===2)break;j=Z,w=v,v=Z,x=A,A=ne,U=B,B=N}I=Z.neg(),F=ne;var E=L.sqr().add(T.sqr()),s=I.sqr().add(F.sqr());return s.cmp(E)>=0&&(I=P,F=k),L.negative&&(L=L.neg(),T=T.neg()),I.negative&&(I=I.neg(),F=F.neg()),[{a:L,b:T},{a:I,b:F}]},i.prototype._endoSplit=function(f){var o=this.endo.basis,v=o[0],w=o[1],A=w.b.mul(f).divRound(this.n),B=v.b.neg().mul(f).divRound(this.n),x=A.mul(v.a),U=B.mul(w.a),P=A.mul(v.b),k=B.mul(w.b),L=f.sub(x).sub(U),T=P.add(k).neg();return{k1:L,k2:T}},i.prototype.pointFromX=function(f,o){f=new e(f,16),f.red||(f=f.toRed(this.red));var v=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),w=v.redSqrt();if(w.redSqr().redSub(v).cmp(this.zero)!==0)throw new Error("invalid point");var A=w.fromRed().isOdd();return(o&&!A||!o&&A)&&(w=w.redNeg()),this.point(f,w)},i.prototype.validate=function(f){if(f.inf)return!0;var o=f.x,v=f.y,w=this.a.redMul(o),A=o.redSqr().redMul(o).redIAdd(w).redIAdd(this.b);return v.redSqr().redISub(A).cmpn(0)===0},i.prototype._endoWnafMulAdd=function(f,o,v){for(var w=this._endoWnafT1,A=this._endoWnafT2,B=0;B<f.length;B++){var x=this._endoSplit(o[B]),U=f[B],P=U._getBeta();x.k1.negative&&(x.k1.ineg(),U=U.neg(!0)),x.k2.negative&&(x.k2.ineg(),P=P.neg(!0)),w[B*2]=U,w[B*2+1]=P,A[B*2]=x.k1,A[B*2+1]=x.k2}for(var k=this._wnafMulAdd(1,w,A,B*2,v),L=0;L<B*2;L++)w[L]=null,A[L]=null;return k};function u(h,f,o,v){r.BasePoint.call(this,h,"affine"),f===null&&o===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(f,16),this.y=new e(o,16),v&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}t(u,r.BasePoint),i.prototype.point=function(f,o,v){return new u(this,f,o,v)},i.prototype.pointFromJSON=function(f,o){return u.fromJSON(this,f,o)},u.prototype._getBeta=function(){if(this.curve.endo){var f=this.precomputed;if(f&&f.beta)return f.beta;var o=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var v=this.curve,w=function(A){return v.point(A.x.redMul(v.endo.beta),A.y)};f.beta=o,o.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(w)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(w)}}}return o}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(f,o,v){typeof o=="string"&&(o=JSON.parse(o));var w=f.point(o[0],o[1],v);if(!o[2])return w;function A(x){return f.point(x[0],x[1],v)}var B=o[2];return w.precomputed={beta:null,doubles:B.doubles&&{step:B.doubles.step,points:[w].concat(B.doubles.points.map(A))},naf:B.naf&&{wnd:B.naf.wnd,points:[w].concat(B.naf.points.map(A))}},w},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(f){if(this.inf)return f;if(f.inf)return this;if(this.eq(f))return this.dbl();if(this.neg().eq(f))return this.curve.point(null,null);if(this.x.cmp(f.x)===0)return this.curve.point(null,null);var o=this.y.redSub(f.y);o.cmpn(0)!==0&&(o=o.redMul(this.x.redSub(f.x).redInvm()));var v=o.redSqr().redISub(this.x).redISub(f.x),w=o.redMul(this.x.redSub(v)).redISub(this.y);return this.curve.point(v,w)},u.prototype.dbl=function(){if(this.inf)return this;var f=this.y.redAdd(this.y);if(f.cmpn(0)===0)return this.curve.point(null,null);var o=this.curve.a,v=this.x.redSqr(),w=f.redInvm(),A=v.redAdd(v).redIAdd(v).redIAdd(o).redMul(w),B=A.redSqr().redISub(this.x.redAdd(this.x)),x=A.redMul(this.x.redSub(B)).redISub(this.y);return this.curve.point(B,x)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(f){return f=new e(f,16),this.isInfinity()?this:this._hasDoubles(f)?this.curve._fixedNafMul(this,f):this.curve.endo?this.curve._endoWnafMulAdd([this],[f]):this.curve._wnafMul(this,f)},u.prototype.mulAdd=function(f,o,v){var w=[this,o],A=[f,v];return this.curve.endo?this.curve._endoWnafMulAdd(w,A):this.curve._wnafMulAdd(1,w,A,2)},u.prototype.jmulAdd=function(f,o,v){var w=[this,o],A=[f,v];return this.curve.endo?this.curve._endoWnafMulAdd(w,A,!0):this.curve._wnafMulAdd(1,w,A,2,!0)},u.prototype.eq=function(f){return this===f||this.inf===f.inf&&(this.inf||this.x.cmp(f.x)===0&&this.y.cmp(f.y)===0)},u.prototype.neg=function(f){if(this.inf)return this;var o=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var v=this.precomputed,w=function(A){return A.neg()};o.precomputed={naf:v.naf&&{wnd:v.naf.wnd,points:v.naf.points.map(w)},doubles:v.doubles&&{step:v.doubles.step,points:v.doubles.points.map(w)}}}return o},u.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var f=this.curve.jpoint(this.x,this.y,this.curve.one);return f};function c(h,f,o,v){r.BasePoint.call(this,h,"jacobian"),f===null&&o===null&&v===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new e(0)):(this.x=new e(f,16),this.y=new e(o,16),this.z=new e(v,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return t(c,r.BasePoint),i.prototype.jpoint=function(f,o,v){return new c(this,f,o,v)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),o=f.redSqr(),v=this.x.redMul(o),w=this.y.redMul(o).redMul(f);return this.curve.point(v,w)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var o=f.z.redSqr(),v=this.z.redSqr(),w=this.x.redMul(o),A=f.x.redMul(v),B=this.y.redMul(o.redMul(f.z)),x=f.y.redMul(v.redMul(this.z)),U=w.redSub(A),P=B.redSub(x);if(U.cmpn(0)===0)return P.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var k=U.redSqr(),L=k.redMul(U),T=w.redMul(k),I=P.redSqr().redIAdd(L).redISub(T).redISub(T),F=P.redMul(T.redISub(I)).redISub(B.redMul(L)),j=this.z.redMul(f.z).redMul(U);return this.curve.jpoint(I,F,j)},c.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var o=this.z.redSqr(),v=this.x,w=f.x.redMul(o),A=this.y,B=f.y.redMul(o).redMul(this.z),x=v.redSub(w),U=A.redSub(B);if(x.cmpn(0)===0)return U.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var P=x.redSqr(),k=P.redMul(x),L=v.redMul(P),T=U.redSqr().redIAdd(k).redISub(L).redISub(L),I=U.redMul(L.redISub(T)).redISub(A.redMul(k)),F=this.z.redMul(x);return this.curve.jpoint(T,I,F)},c.prototype.dblp=function(f){if(f===0)return this;if(this.isInfinity())return this;if(!f)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var o=this,v=0;v<f;v++)o=o.dbl();return o}for(var w=this.curve.a,A=this.curve.tinv,B=this.x,x=this.y,U=this.z,P=U.redSqr().redSqr(),k=x.redAdd(x),v=0;v<f;v++){var L=B.redSqr(),T=k.redSqr(),I=T.redSqr(),F=L.redAdd(L).redIAdd(L).redIAdd(w.redMul(P)),j=B.redMul(T),W=F.redSqr().redISub(j.redAdd(j)),Z=j.redISub(W),ne=F.redMul(Z);ne=ne.redIAdd(ne).redISub(I);var ae=k.redMul(U);v+1<f&&(P=P.redMul(I)),B=W,U=ae,k=ne}return this.curve.jpoint(B,k.redMul(A),U)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var f,o,v;if(this.zOne){var w=this.x.redSqr(),A=this.y.redSqr(),B=A.redSqr(),x=this.x.redAdd(A).redSqr().redISub(w).redISub(B);x=x.redIAdd(x);var U=w.redAdd(w).redIAdd(w),P=U.redSqr().redISub(x).redISub(x),k=B.redIAdd(B);k=k.redIAdd(k),k=k.redIAdd(k),f=P,o=U.redMul(x.redISub(P)).redISub(k),v=this.y.redAdd(this.y)}else{var L=this.x.redSqr(),T=this.y.redSqr(),I=T.redSqr(),F=this.x.redAdd(T).redSqr().redISub(L).redISub(I);F=F.redIAdd(F);var j=L.redAdd(L).redIAdd(L),W=j.redSqr(),Z=I.redIAdd(I);Z=Z.redIAdd(Z),Z=Z.redIAdd(Z),f=W.redISub(F).redISub(F),o=j.redMul(F.redISub(f)).redISub(Z),v=this.y.redMul(this.z),v=v.redIAdd(v)}return this.curve.jpoint(f,o,v)},c.prototype._threeDbl=function(){var f,o,v;if(this.zOne){var w=this.x.redSqr(),A=this.y.redSqr(),B=A.redSqr(),x=this.x.redAdd(A).redSqr().redISub(w).redISub(B);x=x.redIAdd(x);var U=w.redAdd(w).redIAdd(w).redIAdd(this.curve.a),P=U.redSqr().redISub(x).redISub(x);f=P;var k=B.redIAdd(B);k=k.redIAdd(k),k=k.redIAdd(k),o=U.redMul(x.redISub(P)).redISub(k),v=this.y.redAdd(this.y)}else{var L=this.z.redSqr(),T=this.y.redSqr(),I=this.x.redMul(T),F=this.x.redSub(L).redMul(this.x.redAdd(L));F=F.redAdd(F).redIAdd(F);var j=I.redIAdd(I);j=j.redIAdd(j);var W=j.redAdd(j);f=F.redSqr().redISub(W),v=this.y.redAdd(this.z).redSqr().redISub(T).redISub(L);var Z=T.redSqr();Z=Z.redIAdd(Z),Z=Z.redIAdd(Z),Z=Z.redIAdd(Z),o=F.redMul(j.redISub(f)).redISub(Z)}return this.curve.jpoint(f,o,v)},c.prototype._dbl=function(){var f=this.curve.a,o=this.x,v=this.y,w=this.z,A=w.redSqr().redSqr(),B=o.redSqr(),x=v.redSqr(),U=B.redAdd(B).redIAdd(B).redIAdd(f.redMul(A)),P=o.redAdd(o);P=P.redIAdd(P);var k=P.redMul(x),L=U.redSqr().redISub(k.redAdd(k)),T=k.redISub(L),I=x.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var F=U.redMul(T).redISub(I),j=v.redAdd(v).redMul(w);return this.curve.jpoint(L,F,j)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),o=this.y.redSqr(),v=this.z.redSqr(),w=o.redSqr(),A=f.redAdd(f).redIAdd(f),B=A.redSqr(),x=this.x.redAdd(o).redSqr().redISub(f).redISub(w);x=x.redIAdd(x),x=x.redAdd(x).redIAdd(x),x=x.redISub(B);var U=x.redSqr(),P=w.redIAdd(w);P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P);var k=A.redIAdd(x).redSqr().redISub(B).redISub(U).redISub(P),L=o.redMul(k);L=L.redIAdd(L),L=L.redIAdd(L);var T=this.x.redMul(U).redISub(L);T=T.redIAdd(T),T=T.redIAdd(T);var I=this.y.redMul(k.redMul(P.redISub(k)).redISub(x.redMul(U)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var F=this.z.redAdd(x).redSqr().redISub(v).redISub(U);return this.curve.jpoint(T,I,F)},c.prototype.mul=function(f,o){return f=new e(f,o),this.curve._wnafMul(this,f)},c.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var o=this.z.redSqr(),v=f.z.redSqr();if(this.x.redMul(v).redISub(f.x.redMul(o)).cmpn(0)!==0)return!1;var w=o.redMul(this.z),A=v.redMul(f.z);return this.y.redMul(A).redISub(f.y.redMul(w)).cmpn(0)===0},c.prototype.eqXToP=function(f){var o=this.z.redSqr(),v=f.toRed(this.curve.red).redMul(o);if(this.x.cmp(v)===0)return!0;for(var w=f.clone(),A=this.curve.redN.redMul(o);;){if(w.iadd(this.curve.n),w.cmp(this.curve.p)>=0)return!1;if(v.redIAdd(A),this.x.cmp(v)===0)return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Yr}var Ra;function Pa(){return Ra||(Ra=1,function(n){var e=n;e.base=Ia(),e.short=_f()}(zr)),zr}var $r={},Jr={},je={},ka;function Ot(){if(ka)return je;ka=1;var n=qt(),e=dt();je.inherits=e;function t(N,E){return(N.charCodeAt(E)&64512)!==55296||E<0||E+1>=N.length?!1:(N.charCodeAt(E+1)&64512)===56320}function r(N,E){if(Array.isArray(N))return N.slice();if(!N)return[];var s=[];if(typeof N=="string")if(E){if(E==="hex")for(N=N.replace(/[^a-z0-9]+/ig,""),N.length%2!==0&&(N="0"+N),S=0;S<N.length;S+=2)s.push(parseInt(N[S]+N[S+1],16))}else for(var y=0,S=0;S<N.length;S++){var g=N.charCodeAt(S);g<128?s[y++]=g:g<2048?(s[y++]=g>>6|192,s[y++]=g&63|128):t(N,S)?(g=65536+((g&1023)<<10)+(N.charCodeAt(++S)&1023),s[y++]=g>>18|240,s[y++]=g>>12&63|128,s[y++]=g>>6&63|128,s[y++]=g&63|128):(s[y++]=g>>12|224,s[y++]=g>>6&63|128,s[y++]=g&63|128)}else for(S=0;S<N.length;S++)s[S]=N[S]|0;return s}je.toArray=r;function a(N){for(var E="",s=0;s<N.length;s++)E+=c(N[s].toString(16));return E}je.toHex=a;function i(N){var E=N>>>24|N>>>8&65280|N<<8&16711680|(N&255)<<24;return E>>>0}je.htonl=i;function u(N,E){for(var s="",y=0;y<N.length;y++){var S=N[y];E==="little"&&(S=i(S)),s+=h(S.toString(16))}return s}je.toHex32=u;function c(N){return N.length===1?"0"+N:N}je.zero2=c;function h(N){return N.length===7?"0"+N:N.length===6?"00"+N:N.length===5?"000"+N:N.length===4?"0000"+N:N.length===3?"00000"+N:N.length===2?"000000"+N:N.length===1?"0000000"+N:N}je.zero8=h;function f(N,E,s,y){var S=s-E;n(S%4===0);for(var g=new Array(S/4),_=0,M=E;_<g.length;_++,M+=4){var G;y==="big"?G=N[M]<<24|N[M+1]<<16|N[M+2]<<8|N[M+3]:G=N[M+3]<<24|N[M+2]<<16|N[M+1]<<8|N[M],g[_]=G>>>0}return g}je.join32=f;function o(N,E){for(var s=new Array(N.length*4),y=0,S=0;y<N.length;y++,S+=4){var g=N[y];E==="big"?(s[S]=g>>>24,s[S+1]=g>>>16&255,s[S+2]=g>>>8&255,s[S+3]=g&255):(s[S+3]=g>>>24,s[S+2]=g>>>16&255,s[S+1]=g>>>8&255,s[S]=g&255)}return s}je.split32=o;function v(N,E){return N>>>E|N<<32-E}je.rotr32=v;function w(N,E){return N<<E|N>>>32-E}je.rotl32=w;function A(N,E){return N+E>>>0}je.sum32=A;function B(N,E,s){return N+E+s>>>0}je.sum32_3=B;function x(N,E,s,y){return N+E+s+y>>>0}je.sum32_4=x;function U(N,E,s,y,S){return N+E+s+y+S>>>0}je.sum32_5=U;function P(N,E,s,y){var S=N[E],g=N[E+1],_=y+g>>>0,M=(_<y?1:0)+s+S;N[E]=M>>>0,N[E+1]=_}je.sum64=P;function k(N,E,s,y){var S=E+y>>>0,g=(S<E?1:0)+N+s;return g>>>0}je.sum64_hi=k;function L(N,E,s,y){var S=E+y;return S>>>0}je.sum64_lo=L;function T(N,E,s,y,S,g,_,M){var G=0,C=E;C=C+y>>>0,G+=C<E?1:0,C=C+g>>>0,G+=C<g?1:0,C=C+M>>>0,G+=C<M?1:0;var p=N+s+S+_+G;return p>>>0}je.sum64_4_hi=T;function I(N,E,s,y,S,g,_,M){var G=E+y+g+M;return G>>>0}je.sum64_4_lo=I;function F(N,E,s,y,S,g,_,M,G,C){var p=0,q=E;q=q+y>>>0,p+=q<E?1:0,q=q+g>>>0,p+=q<g?1:0,q=q+M>>>0,p+=q<M?1:0,q=q+C>>>0,p+=q<C?1:0;var ue=N+s+S+_+G+p;return ue>>>0}je.sum64_5_hi=F;function j(N,E,s,y,S,g,_,M,G,C){var p=E+y+g+M+C;return p>>>0}je.sum64_5_lo=j;function W(N,E,s){var y=E<<32-s|N>>>s;return y>>>0}je.rotr64_hi=W;function Z(N,E,s){var y=N<<32-s|E>>>s;return y>>>0}je.rotr64_lo=Z;function ne(N,E,s){return N>>>s}je.shr64_hi=ne;function ae(N,E,s){var y=N<<32-s|E>>>s;return y>>>0}return je.shr64_lo=ae,je}var Wr={},Na;function tr(){if(Na)return Wr;Na=1;var n=Ot(),e=qt();function t(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return Wr.BlockHash=t,t.prototype.update=function(a,i){if(a=n.toArray(a,i),this.pending?this.pending=this.pending.concat(a):this.pending=a,this.pendingTotal+=a.length,this.pending.length>=this._delta8){a=this.pending;var u=a.length%this._delta8;this.pending=a.slice(a.length-u,a.length),this.pending.length===0&&(this.pending=null),a=n.join32(a,0,a.length-u,this.endian);for(var c=0;c<a.length;c+=this._delta32)this._update(a,c,c+this._delta32)}return this},t.prototype.digest=function(a){return this.update(this._pad()),e(this.pending===null),this._digest(a)},t.prototype._pad=function(){var a=this.pendingTotal,i=this._delta8,u=i-(a+this.padLength)%i,c=new Array(u+this.padLength);c[0]=128;for(var h=1;h<u;h++)c[h]=0;if(a<<=3,this.endian==="big"){for(var f=8;f<this.padLength;f++)c[h++]=0;c[h++]=0,c[h++]=0,c[h++]=0,c[h++]=0,c[h++]=a>>>24&255,c[h++]=a>>>16&255,c[h++]=a>>>8&255,c[h++]=a&255}else for(c[h++]=a&255,c[h++]=a>>>8&255,c[h++]=a>>>16&255,c[h++]=a>>>24&255,c[h++]=0,c[h++]=0,c[h++]=0,c[h++]=0,f=8;f<this.padLength;f++)c[h++]=0;return c},Wr}var Vt={},Rt={},Ta;function Ma(){if(Ta)return Rt;Ta=1;var n=Ot(),e=n.rotr32;function t(o,v,w,A){if(o===0)return r(v,w,A);if(o===1||o===3)return i(v,w,A);if(o===2)return a(v,w,A)}Rt.ft_1=t;function r(o,v,w){return o&v^~o&w}Rt.ch32=r;function a(o,v,w){return o&v^o&w^v&w}Rt.maj32=a;function i(o,v,w){return o^v^w}Rt.p32=i;function u(o){return e(o,2)^e(o,13)^e(o,22)}Rt.s0_256=u;function c(o){return e(o,6)^e(o,11)^e(o,25)}Rt.s1_256=c;function h(o){return e(o,7)^e(o,18)^o>>>3}Rt.g0_256=h;function f(o){return e(o,17)^e(o,19)^o>>>10}return Rt.g1_256=f,Rt}var Xr,Ca;function Sf(){if(Ca)return Xr;Ca=1;var n=Ot(),e=tr(),t=Ma(),r=n.rotl32,a=n.sum32,i=n.sum32_5,u=t.ft_1,c=e.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return n.inherits(f,c),Xr=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(v,w){for(var A=this.W,B=0;B<16;B++)A[B]=v[w+B];for(;B<A.length;B++)A[B]=r(A[B-3]^A[B-8]^A[B-14]^A[B-16],1);var x=this.h[0],U=this.h[1],P=this.h[2],k=this.h[3],L=this.h[4];for(B=0;B<A.length;B++){var T=~~(B/20),I=i(r(x,5),u(T,U,P,k),L,A[B],h[T]);L=k,k=P,P=r(U,30),U=x,x=I}this.h[0]=a(this.h[0],x),this.h[1]=a(this.h[1],U),this.h[2]=a(this.h[2],P),this.h[3]=a(this.h[3],k),this.h[4]=a(this.h[4],L)},f.prototype._digest=function(v){return v==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")},Xr}var Qr,Fa;function La(){if(Fa)return Qr;Fa=1;var n=Ot(),e=tr(),t=Ma(),r=qt(),a=n.sum32,i=n.sum32_4,u=n.sum32_5,c=t.ch32,h=t.maj32,f=t.s0_256,o=t.s1_256,v=t.g0_256,w=t.g1_256,A=e.BlockHash,B=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function x(){if(!(this instanceof x))return new x;A.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=B,this.W=new Array(64)}return n.inherits(x,A),Qr=x,x.blockSize=512,x.outSize=256,x.hmacStrength=192,x.padLength=64,x.prototype._update=function(P,k){for(var L=this.W,T=0;T<16;T++)L[T]=P[k+T];for(;T<L.length;T++)L[T]=i(w(L[T-2]),L[T-7],v(L[T-15]),L[T-16]);var I=this.h[0],F=this.h[1],j=this.h[2],W=this.h[3],Z=this.h[4],ne=this.h[5],ae=this.h[6],N=this.h[7];for(r(this.k.length===L.length),T=0;T<L.length;T++){var E=u(N,o(Z),c(Z,ne,ae),this.k[T],L[T]),s=a(f(I),h(I,F,j));N=ae,ae=ne,ne=Z,Z=a(W,E),W=j,j=F,F=I,I=a(E,s)}this.h[0]=a(this.h[0],I),this.h[1]=a(this.h[1],F),this.h[2]=a(this.h[2],j),this.h[3]=a(this.h[3],W),this.h[4]=a(this.h[4],Z),this.h[5]=a(this.h[5],ne),this.h[6]=a(this.h[6],ae),this.h[7]=a(this.h[7],N)},x.prototype._digest=function(P){return P==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")},Qr}var Zr,Ua;function Ef(){if(Ua)return Zr;Ua=1;var n=Ot(),e=La();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return n.inherits(t,e),Zr=t,t.blockSize=512,t.outSize=224,t.hmacStrength=192,t.padLength=64,t.prototype._digest=function(a){return a==="hex"?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")},Zr}var ei,Ha;function Da(){if(Ha)return ei;Ha=1;var n=Ot(),e=tr(),t=qt(),r=n.rotr64_hi,a=n.rotr64_lo,i=n.shr64_hi,u=n.shr64_lo,c=n.sum64,h=n.sum64_hi,f=n.sum64_lo,o=n.sum64_4_hi,v=n.sum64_4_lo,w=n.sum64_5_hi,A=n.sum64_5_lo,B=e.BlockHash,x=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function U(){if(!(this instanceof U))return new U;B.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=x,this.W=new Array(160)}n.inherits(U,B),ei=U,U.blockSize=1024,U.outSize=512,U.hmacStrength=192,U.padLength=128,U.prototype._prepareBlock=function(s,y){for(var S=this.W,g=0;g<32;g++)S[g]=s[y+g];for(;g<S.length;g+=2){var _=ae(S[g-4],S[g-3]),M=N(S[g-4],S[g-3]),G=S[g-14],C=S[g-13],p=Z(S[g-30],S[g-29]),q=ne(S[g-30],S[g-29]),ue=S[g-32],he=S[g-31];S[g]=o(_,M,G,C,p,q,ue,he),S[g+1]=v(_,M,G,C,p,q,ue,he)}},U.prototype._update=function(s,y){this._prepareBlock(s,y);var S=this.W,g=this.h[0],_=this.h[1],M=this.h[2],G=this.h[3],C=this.h[4],p=this.h[5],q=this.h[6],ue=this.h[7],he=this.h[8],de=this.h[9],V=this.h[10],K=this.h[11],te=this.h[12],se=this.h[13],le=this.h[14],fe=this.h[15];t(this.k.length===S.length);for(var pe=0;pe<S.length;pe+=2){var xe=le,Ie=fe,Me=j(he,de),Re=W(he,de),Ce=P(he,de,V,K,te),ft=k(he,de,V,K,te,se),ke=this.k[pe],me=this.k[pe+1],Oe=S[pe],ye=S[pe+1],Se=w(xe,Ie,Me,Re,Ce,ft,ke,me,Oe,ye),Ye=A(xe,Ie,Me,Re,Ce,ft,ke,me,Oe,ye);xe=I(g,_),Ie=F(g,_),Me=L(g,_,M,G,C),Re=T(g,_,M,G,C,p);var Ke=h(xe,Ie,Me,Re),Ge=f(xe,Ie,Me,Re);le=te,fe=se,te=V,se=K,V=he,K=de,he=h(q,ue,Se,Ye),de=f(ue,ue,Se,Ye),q=C,ue=p,C=M,p=G,M=g,G=_,g=h(Se,Ye,Ke,Ge),_=f(Se,Ye,Ke,Ge)}c(this.h,0,g,_),c(this.h,2,M,G),c(this.h,4,C,p),c(this.h,6,q,ue),c(this.h,8,he,de),c(this.h,10,V,K),c(this.h,12,te,se),c(this.h,14,le,fe)},U.prototype._digest=function(s){return s==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")};function P(E,s,y,S,g){var _=E&y^~E&g;return _<0&&(_+=4294967296),_}function k(E,s,y,S,g,_){var M=s&S^~s&_;return M<0&&(M+=4294967296),M}function L(E,s,y,S,g){var _=E&y^E&g^y&g;return _<0&&(_+=4294967296),_}function T(E,s,y,S,g,_){var M=s&S^s&_^S&_;return M<0&&(M+=4294967296),M}function I(E,s){var y=r(E,s,28),S=r(s,E,2),g=r(s,E,7),_=y^S^g;return _<0&&(_+=4294967296),_}function F(E,s){var y=a(E,s,28),S=a(s,E,2),g=a(s,E,7),_=y^S^g;return _<0&&(_+=4294967296),_}function j(E,s){var y=r(E,s,14),S=r(E,s,18),g=r(s,E,9),_=y^S^g;return _<0&&(_+=4294967296),_}function W(E,s){var y=a(E,s,14),S=a(E,s,18),g=a(s,E,9),_=y^S^g;return _<0&&(_+=4294967296),_}function Z(E,s){var y=r(E,s,1),S=r(E,s,8),g=i(E,s,7),_=y^S^g;return _<0&&(_+=4294967296),_}function ne(E,s){var y=a(E,s,1),S=a(E,s,8),g=u(E,s,7),_=y^S^g;return _<0&&(_+=4294967296),_}function ae(E,s){var y=r(E,s,19),S=r(s,E,29),g=i(E,s,6),_=y^S^g;return _<0&&(_+=4294967296),_}function N(E,s){var y=a(E,s,19),S=a(s,E,29),g=u(E,s,6),_=y^S^g;return _<0&&(_+=4294967296),_}return ei}var ti,qa;function Bf(){if(qa)return ti;qa=1;var n=Ot(),e=Da();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return n.inherits(t,e),ti=t,t.blockSize=1024,t.outSize=384,t.hmacStrength=192,t.padLength=128,t.prototype._digest=function(a){return a==="hex"?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")},ti}var Ka;function If(){return Ka||(Ka=1,Vt.sha1=Sf(),Vt.sha224=Ef(),Vt.sha256=La(),Vt.sha384=Bf(),Vt.sha512=Da()),Vt}var ri={},Va;function Af(){if(Va)return ri;Va=1;var n=Ot(),e=tr(),t=n.rotl32,r=n.sum32,a=n.sum32_3,i=n.sum32_4,u=e.BlockHash;function c(){if(!(this instanceof c))return new c;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}n.inherits(c,u),ri.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(U,P){for(var k=this.h[0],L=this.h[1],T=this.h[2],I=this.h[3],F=this.h[4],j=k,W=L,Z=T,ne=I,ae=F,N=0;N<80;N++){var E=r(t(i(k,h(N,L,T,I),U[v[N]+P],f(N)),A[N]),F);k=F,F=I,I=t(T,10),T=L,L=E,E=r(t(i(j,h(79-N,W,Z,ne),U[w[N]+P],o(N)),B[N]),ae),j=ae,ae=ne,ne=t(Z,10),Z=W,W=E}E=a(this.h[1],T,ne),this.h[1]=a(this.h[2],I,ae),this.h[2]=a(this.h[3],F,j),this.h[3]=a(this.h[4],k,W),this.h[4]=a(this.h[0],L,Z),this.h[0]=E},c.prototype._digest=function(U){return U==="hex"?n.toHex32(this.h,"little"):n.split32(this.h,"little")};function h(x,U,P,k){return x<=15?U^P^k:x<=31?U&P|~U&k:x<=47?(U|~P)^k:x<=63?U&k|P&~k:U^(P|~k)}function f(x){return x<=15?0:x<=31?1518500249:x<=47?1859775393:x<=63?2400959708:2840853838}function o(x){return x<=15?1352829926:x<=31?1548603684:x<=47?1836072691:x<=63?2053994217:0}var v=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],w=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],A=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],B=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ri}var ii,ja;function Of(){if(ja)return ii;ja=1;var n=Ot(),e=qt();function t(r,a,i){if(!(this instanceof t))return new t(r,a,i);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(a,i))}return ii=t,t.prototype._init=function(a){a.length>this.blockSize&&(a=new this.Hash().update(a).digest()),e(a.length<=this.blockSize);for(var i=a.length;i<this.blockSize;i++)a.push(0);for(i=0;i<a.length;i++)a[i]^=54;for(this.inner=new this.Hash().update(a),i=0;i<a.length;i++)a[i]^=106;this.outer=new this.Hash().update(a)},t.prototype.update=function(a,i){return this.inner.update(a,i),this},t.prototype.digest=function(a){return this.outer.update(this.inner.digest()),this.outer.digest(a)},ii}var za;function ni(){return za||(za=1,function(n){var e=n;e.utils=Ot(),e.common=tr(),e.sha=If(),e.ripemd=Af(),e.hmac=Of(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(Jr)),Jr}var ai,Ga;function Rf(){return Ga||(Ga=1,ai={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),ai}var Ya;function $a(){return Ya||(Ya=1,function(n){var e=n,t=ni(),r=Pa(),a=Kt(),i=a.assert;function u(f){if(f.type!=="short")throw new Error("invalid curve type");this.curve=new r.short(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=u;function c(f,o){Object.defineProperty(e,f,{configurable:!0,enumerable:!0,get:function(){var v=new u(o);return Object.defineProperty(e,f,{configurable:!0,enumerable:!0,value:v}),v}})}var h;try{h=Rf()}catch{h=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:t.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",h]})}($r)),$r}var si,Ja;function Pf(){if(Ja)return si;Ja=1;var n=ni(),e=xa(),t=qt();function r(a){if(!(this instanceof r))return new r(a);this.hash=a.hash,this.predResist=!!a.predResist,this.outLen=this.hash.outSize,this.minEntropy=a.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=e.toArray(a.entropy,a.entropyEnc||"hex"),u=e.toArray(a.nonce,a.nonceEnc||"hex"),c=e.toArray(a.pers,a.persEnc||"hex");t(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,u,c)}return si=r,r.prototype._init=function(i,u,c){var h=i.concat(u).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(h),this._reseed=1,this.reseedInterval=281474976710656},r.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},r.prototype._update=function(i){var u=this._hmac().update(this.V).update([0]);i&&(u=u.update(i)),this.K=u.digest(),this.V=this._hmac().update(this.V).digest(),i&&(this.K=this._hmac().update(this.V).update([1]).update(i).digest(),this.V=this._hmac().update(this.V).digest())},r.prototype.reseed=function(i,u,c,h){typeof u!="string"&&(h=c,c=u,u=null),i=e.toArray(i,u),c=e.toArray(c,h),t(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(i.concat(c||[])),this._reseed=1},r.prototype.generate=function(i,u,c,h){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof u!="string"&&(h=c,c=u,u=null),c&&(c=e.toArray(c,h||"hex"),this._update(c));for(var f=[];f.length<i;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var o=f.slice(0,i);return this._update(c),this._reseed++,e.encode(o,u)},si}var oi,Wa;function kf(){if(Wa)return oi;Wa=1;var n=Dt(),e=Kt(),t=e.assert;function r(a,i){this.ec=a,this.priv=null,this.pub=null,i.priv&&this._importPrivate(i.priv,i.privEnc),i.pub&&this._importPublic(i.pub,i.pubEnc)}return oi=r,r.fromPublic=function(i,u,c){return u instanceof r?u:new r(i,{pub:u,pubEnc:c})},r.fromPrivate=function(i,u,c){return u instanceof r?u:new r(i,{priv:u,privEnc:c})},r.prototype.validate=function(){var i=this.getPublic();return i.isInfinity()?{result:!1,reason:"Invalid public key"}:i.validate()?i.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(i,u){return typeof i=="string"&&(u=i,i=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),u?this.pub.encode(u,i):this.pub},r.prototype.getPrivate=function(i){return i==="hex"?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(i,u){this.priv=new n(i,u||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(i,u){if(i.x||i.y){this.ec.curve.type==="mont"?t(i.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&t(i.x&&i.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(i.x,i.y);return}this.pub=this.ec.curve.decodePoint(i,u)},r.prototype.derive=function(i){return i.mul(this.priv).getX()},r.prototype.sign=function(i,u,c){return this.ec.sign(i,this,u,c)},r.prototype.verify=function(i,u){return this.ec.verify(i,u,this)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},oi}var fi,Xa;function Nf(){if(Xa)return fi;Xa=1;var n=Dt(),e=Kt(),t=e.assert;function r(h,f){if(h instanceof r)return h;this._importDER(h,f)||(t(h.r&&h.s,"Signature without r or s"),this.r=new n(h.r,16),this.s=new n(h.s,16),h.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=h.recoveryParam)}fi=r;function a(){this.place=0}function i(h,f){var o=h[f.place++];if(!(o&128))return o;for(var v=o&15,w=0,A=0,B=f.place;A<v;A++,B++)w<<=8,w|=h[B];return f.place=B,w}function u(h){for(var f=0,o=h.length-1;!h[f]&&!(h[f+1]&128)&&f<o;)f++;return f===0?h:h.slice(f)}r.prototype._importDER=function(f,o){f=e.toArray(f,o);var v=new a;if(f[v.place++]!==48)return!1;var w=i(f,v);if(w+v.place!==f.length||f[v.place++]!==2)return!1;var A=i(f,v),B=f.slice(v.place,A+v.place);if(v.place+=A,f[v.place++]!==2)return!1;var x=i(f,v);if(f.length!==x+v.place)return!1;var U=f.slice(v.place,x+v.place);return B[0]===0&&B[1]&128&&(B=B.slice(1)),U[0]===0&&U[1]&128&&(U=U.slice(1)),this.r=new n(B),this.s=new n(U),this.recoveryParam=null,!0};function c(h,f){if(f<128){h.push(f);return}var o=1+(Math.log(f)/Math.LN2>>>3);for(h.push(o|128);--o;)h.push(f>>>(o<<3)&255);h.push(f)}return r.prototype.toDER=function(f){var o=this.r.toArray(),v=this.s.toArray();for(o[0]&128&&(o=[0].concat(o)),v[0]&128&&(v=[0].concat(v)),o=u(o),v=u(v);!v[0]&&!(v[1]&128);)v=v.slice(1);var w=[2];c(w,o.length),w=w.concat(o),w.push(2),c(w,v.length);var A=w.concat(v),B=[48];return c(B,A.length),B=B.concat(A),e.encode(B,f)},fi}var ui,Qa;function Tf(){if(Qa)return ui;Qa=1;var n=Dt(),e=Pf(),t=Kt(),r=$a(),a=Ea(),i=t.assert,u=kf(),c=Nf();function h(f){if(!(this instanceof h))return new h(f);typeof f=="string"&&(i(r.hasOwnProperty(f),"Unknown curve "+f),f=r[f]),f instanceof r.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}return ui=h,h.prototype.keyPair=function(o){return new u(this,o)},h.prototype.keyFromPrivate=function(o,v){return u.fromPrivate(this,o,v)},h.prototype.keyFromPublic=function(o,v){return u.fromPublic(this,o,v)},h.prototype.genKeyPair=function(o){o||(o={});var v=new e({hash:this.hash,pers:o.pers,persEnc:o.persEnc||"utf8",entropy:o.entropy||a(this.hash.hmacStrength),entropyEnc:o.entropy&&o.entropyEnc||"utf8",nonce:this.n.toArray()}),w=this.n.byteLength(),A=this.n.sub(new n(2));do{var B=new n(v.generate(w));if(!(B.cmp(A)>0))return B.iaddn(1),this.keyFromPrivate(B)}while(!0)},h.prototype._truncateToN=function(o,v){var w=o.byteLength()*8-this.n.bitLength();return w>0&&(o=o.ushrn(w)),!v&&o.cmp(this.n)>=0?o.sub(this.n):o},h.prototype.sign=function(o,v,w,A){typeof w=="object"&&(A=w,w=null),A||(A={}),v=this.keyFromPrivate(v,w),o=this._truncateToN(new n(o,16));for(var B=this.n.byteLength(),x=v.getPrivate().toArray("be",B),U=o.toArray("be",B),P=new e({hash:this.hash,entropy:x,nonce:U,pers:A.pers,persEnc:A.persEnc||"utf8"}),k=this.n.sub(new n(1)),L=0;;L++){var T=A.k?A.k(L):new n(P.generate(this.n.byteLength()));if(T=this._truncateToN(T,!0),!(T.cmpn(1)<=0||T.cmp(k)>=0)){var I=this.g.mul(T);if(!I.isInfinity()){var F=I.getX(),j=F.umod(this.n);if(j.cmpn(0)!==0){var W=T.invm(this.n).mul(j.mul(v.getPrivate()).iadd(o));if(W=W.umod(this.n),W.cmpn(0)!==0){var Z=(I.getY().isOdd()?1:0)|(F.cmp(j)!==0?2:0);return A.canonical&&W.cmp(this.nh)>0&&(W=this.n.sub(W),Z^=1),new c({r:j,s:W,recoveryParam:Z})}}}}}},h.prototype.verify=function(o,v,w,A){o=this._truncateToN(new n(o,16)),w=this.keyFromPublic(w,A),v=new c(v,"hex");var B=v.r,x=v.s;if(B.cmpn(1)<0||B.cmp(this.n)>=0||x.cmpn(1)<0||x.cmp(this.n)>=0)return!1;var U=x.invm(this.n),P=U.mul(o).umod(this.n),k=U.mul(B).umod(this.n);if(!this.curve._maxwellTrick){var L=this.g.mulAdd(P,w.getPublic(),k);return L.isInfinity()?!1:L.getX().umod(this.n).cmp(B)===0}var L=this.g.jmulAdd(P,w.getPublic(),k);return L.isInfinity()?!1:L.eqXToP(B)},h.prototype.recoverPubKey=function(f,o,v,w){i((3&v)===v,"The recovery param is more than two bits"),o=new c(o,w);var A=this.n,B=new n(f),x=o.r,U=o.s,P=v&1,k=v>>1;if(x.cmp(this.curve.p.umod(this.curve.n))>=0&&k)throw new Error("Unable to find sencond key candinate");k?x=this.curve.pointFromX(x.add(this.curve.n),P):x=this.curve.pointFromX(x,P);var L=o.r.invm(A),T=A.sub(B).mul(L).umod(A),I=U.mul(L).umod(A);return this.g.mulAdd(T,x,I)},h.prototype.getKeyRecoveryParam=function(f,o,v,w){if(o=new c(o,w),o.recoveryParam!==null)return o.recoveryParam;for(var A=0;A<4;A++){var B;try{B=this.recoverPubKey(f,o,A)}catch{continue}if(B.eq(v))return A}throw new Error("Unable to find valid recovery factor")},ui}var Za;function Mf(){return Za||(Za=1,function(n){var e=n;e.version=xf.version,e.utils=Kt(),e.rand=Ea(),e.curve=Pa(),e.curves=$a(),e.ec=Tf()}(Dr)),Dr}var Cf=Mf();const es=$t(Cf);var Ff=ni();const rr=$t(Ff);var mr={},yr={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var ts;function bt(){return ts||(ts=1,function(n,e){var t=Jt(),r=t.Buffer;function a(u,c){for(var h in u)c[h]=u[h]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(a(t,e),e.Buffer=i);function i(u,c,h){return r(u,c,h)}i.prototype=Object.create(r.prototype),a(r,i),i.from=function(u,c,h){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,c,h)},i.alloc=function(u,c,h){if(typeof u!="number")throw new TypeError("Argument must be a number");var f=r(u);return c!==void 0?typeof h=="string"?f.fill(c,h):f.fill(c):f.fill(0),f},i.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},i.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}}(yr,yr.exports)),yr.exports}var ci,rs;function is(){if(rs)return ci;rs=1;var n=isFinite,e=Math.pow(2,30)-1;return ci=function(t,r){if(typeof t!="number")throw new TypeError("Iterations not a number");if(t<0||!n(t))throw new TypeError("Bad iterations");if(typeof r!="number")throw new TypeError("Key length not a number");if(r<0||r>e||r!==r)throw new TypeError("Bad key length")},ci}function Lf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ns={exports:{}},nt=ns.exports={},Pt,kt;function hi(){throw new Error("setTimeout has not been defined")}function li(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Pt=setTimeout:Pt=hi}catch{Pt=hi}try{typeof clearTimeout=="function"?kt=clearTimeout:kt=li}catch{kt=li}})();function as(n){if(Pt===setTimeout)return setTimeout(n,0);if((Pt===hi||!Pt)&&setTimeout)return Pt=setTimeout,setTimeout(n,0);try{return Pt(n,0)}catch{try{return Pt.call(null,n,0)}catch{return Pt.call(this,n,0)}}}function Uf(n){if(kt===clearTimeout)return clearTimeout(n);if((kt===li||!kt)&&clearTimeout)return kt=clearTimeout,clearTimeout(n);try{return kt(n)}catch{try{return kt.call(null,n)}catch{return kt.call(this,n)}}}var Ct=[],Wt=!1,jt,gr=-1;function Hf(){!Wt||!jt||(Wt=!1,jt.length?Ct=jt.concat(Ct):gr=-1,Ct.length&&ss())}function ss(){if(!Wt){var n=as(Hf);Wt=!0;for(var e=Ct.length;e;){for(jt=Ct,Ct=[];++gr<e;)jt&&jt[gr].run();gr=-1,e=Ct.length}jt=null,Wt=!1,Uf(n)}}nt.nextTick=function(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Ct.push(new os(n,e)),Ct.length===1&&!Wt&&as(ss)};function os(n,e){this.fun=n,this.array=e}os.prototype.run=function(){this.fun.apply(null,this.array)},nt.title="browser",nt.browser=!0,nt.env={},nt.argv=[],nt.version="",nt.versions={};function Ft(){}nt.on=Ft,nt.addListener=Ft,nt.once=Ft,nt.off=Ft,nt.removeListener=Ft,nt.removeAllListeners=Ft,nt.emit=Ft,nt.prependListener=Ft,nt.prependOnceListener=Ft,nt.listeners=function(n){return[]},nt.binding=function(n){throw new Error("process.binding is not supported")},nt.cwd=function(){return"/"},nt.chdir=function(n){throw new Error("process.chdir is not supported")},nt.umask=function(){return 0};var Df=ns.exports;const ut=Lf(Df);var di,fs;function us(){if(fs)return di;fs=1;var n;if(He.process&&He.process.browser)n="utf-8";else if(He.process&&He.process.version){var e=parseInt(ut.version.split(".")[0].slice(1),10);n=e>=6?"utf-8":"binary"}else n="utf-8";return di=n,di}var pi,cs;function qf(){if(cs)return pi;cs=1;var n={}.toString;return pi=Array.isArray||function(e){return n.call(e)=="[object Array]"},pi}var bi,hs;function ir(){return hs||(hs=1,bi=TypeError),bi}var mi,ls;function ds(){return ls||(ls=1,mi=Object),mi}var yi,ps;function Kf(){return ps||(ps=1,yi=Error),yi}var gi,bs;function Vf(){return bs||(bs=1,gi=EvalError),gi}var vi,ms;function jf(){return ms||(ms=1,vi=RangeError),vi}var wi,ys;function zf(){return ys||(ys=1,wi=ReferenceError),wi}var xi,gs;function vs(){return gs||(gs=1,xi=SyntaxError),xi}var _i,ws;function Gf(){return ws||(ws=1,_i=URIError),_i}var Si,xs;function Yf(){return xs||(xs=1,Si=Math.abs),Si}var Ei,_s;function $f(){return _s||(_s=1,Ei=Math.floor),Ei}var Bi,Ss;function Jf(){return Ss||(Ss=1,Bi=Math.max),Bi}var Ii,Es;function Wf(){return Es||(Es=1,Ii=Math.min),Ii}var Ai,Bs;function Xf(){return Bs||(Bs=1,Ai=Math.pow),Ai}var Oi,Is;function Qf(){return Is||(Is=1,Oi=Math.round),Oi}var Ri,As;function Zf(){return As||(As=1,Ri=Number.isNaN||function(e){return e!==e}),Ri}var Pi,Os;function eu(){if(Os)return Pi;Os=1;var n=Zf();return Pi=function(t){return n(t)||t===0?t:t<0?-1:1},Pi}var ki,Rs;function tu(){return Rs||(Rs=1,ki=Object.getOwnPropertyDescriptor),ki}var Ni,Ps;function nr(){if(Ps)return Ni;Ps=1;var n=tu();if(n)try{n([],"length")}catch{n=null}return Ni=n,Ni}var Ti,ks;function vr(){if(ks)return Ti;ks=1;var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch{n=!1}return Ti=n,Ti}var Mi,Ns;function Ts(){return Ns||(Ns=1,Mi=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(var i in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(e,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0}),Mi}var Ci,Ms;function ru(){if(Ms)return Ci;Ms=1;var n=typeof Symbol<"u"&&Symbol,e=Ts();return Ci=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Ci}var Fi,Cs;function Fs(){return Cs||(Cs=1,Fi=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Fi}var Li,Ls;function Us(){if(Ls)return Li;Ls=1;var n=ds();return Li=n.getPrototypeOf||null,Li}var Ui,Hs;function iu(){if(Hs)return Ui;Hs=1;var n="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,r="[object Function]",a=function(h,f){for(var o=[],v=0;v<h.length;v+=1)o[v]=h[v];for(var w=0;w<f.length;w+=1)o[w+h.length]=f[w];return o},i=function(h,f){for(var o=[],v=f,w=0;v<h.length;v+=1,w+=1)o[w]=h[v];return o},u=function(c,h){for(var f="",o=0;o<c.length;o+=1)f+=c[o],o+1<c.length&&(f+=h);return f};return Ui=function(h){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(n+f);for(var o=i(arguments,1),v,w=function(){if(this instanceof v){var P=f.apply(this,a(o,arguments));return Object(P)===P?P:this}return f.apply(h,a(o,arguments))},A=t(0,f.length-o.length),B=[],x=0;x<A;x++)B[x]="$"+x;if(v=Function("binder","return function ("+u(B,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var U=function(){};U.prototype=f.prototype,v.prototype=new U,U.prototype=null}return v},Ui}var Hi,Ds;function ar(){if(Ds)return Hi;Ds=1;var n=iu();return Hi=Function.prototype.bind||n,Hi}var Di,qs;function qi(){return qs||(qs=1,Di=Function.prototype.call),Di}var Ki,Ks;function Vi(){return Ks||(Ks=1,Ki=Function.prototype.apply),Ki}var ji,Vs;function nu(){return Vs||(Vs=1,ji=typeof Reflect<"u"&&Reflect&&Reflect.apply),ji}var zi,js;function zs(){if(js)return zi;js=1;var n=ar(),e=Vi(),t=qi(),r=nu();return zi=r||n.call(t,e),zi}var Gi,Gs;function Yi(){if(Gs)return Gi;Gs=1;var n=ar(),e=ir(),t=qi(),r=zs();return Gi=function(i){if(i.length<1||typeof i[0]!="function")throw new e("a function is required");return r(n,t,i)},Gi}var $i,Ys;function au(){if(Ys)return $i;Ys=1;var n=Yi(),e=nr(),t;try{t=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var r=!!t&&e&&e(Object.prototype,"__proto__"),a=Object,i=a.getPrototypeOf;return $i=r&&typeof r.get=="function"?n([r.get]):typeof i=="function"?function(c){return i(c==null?c:a(c))}:!1,$i}var Ji,$s;function su(){if($s)return Ji;$s=1;var n=Fs(),e=Us(),t=au();return Ji=n?function(a){return n(a)}:e?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return e(a)}:t?function(a){return t(a)}:null,Ji}var Wi,Js;function ou(){if(Js)return Wi;Js=1;var n=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=ar();return Wi=t.call(n,e),Wi}var Xi,Ws;function Xs(){if(Ws)return Xi;Ws=1;var n,e=ds(),t=Kf(),r=Vf(),a=jf(),i=zf(),u=vs(),c=ir(),h=Gf(),f=Yf(),o=$f(),v=Jf(),w=Wf(),A=Xf(),B=Qf(),x=eu(),U=Function,P=function(te){try{return U('"use strict"; return ('+te+").constructor;")()}catch{}},k=nr(),L=vr(),T=function(){throw new c},I=k?function(){try{return arguments.callee,T}catch{try{return k(arguments,"callee").get}catch{return T}}}():T,F=ru()(),j=su(),W=Us(),Z=Fs(),ne=Vi(),ae=qi(),N={},E=typeof Uint8Array>"u"||!j?n:j(Uint8Array),s={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":F&&j?j([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?n:Float16Array,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":U,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":F&&j?j(j([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!F||!j?n:j(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!F||!j?n:j(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":F&&j?j(""[Symbol.iterator]()):n,"%Symbol%":F?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":I,"%TypedArray%":E,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":ae,"%Function.prototype.apply%":ne,"%Object.defineProperty%":L,"%Object.getPrototypeOf%":W,"%Math.abs%":f,"%Math.floor%":o,"%Math.max%":v,"%Math.min%":w,"%Math.pow%":A,"%Math.round%":B,"%Math.sign%":x,"%Reflect.getPrototypeOf%":Z};if(j)try{null.error}catch(te){var y=j(j(te));s["%Error.prototype%"]=y}var S=function te(se){var le;if(se==="%AsyncFunction%")le=P("async function () {}");else if(se==="%GeneratorFunction%")le=P("function* () {}");else if(se==="%AsyncGeneratorFunction%")le=P("async function* () {}");else if(se==="%AsyncGenerator%"){var fe=te("%AsyncGeneratorFunction%");fe&&(le=fe.prototype)}else if(se==="%AsyncIteratorPrototype%"){var pe=te("%AsyncGenerator%");pe&&j&&(le=j(pe.prototype))}return s[se]=le,le},g={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=ar(),M=ou(),G=_.call(ae,Array.prototype.concat),C=_.call(ne,Array.prototype.splice),p=_.call(ae,String.prototype.replace),q=_.call(ae,String.prototype.slice),ue=_.call(ae,RegExp.prototype.exec),he=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,de=/\\(\\)?/g,V=function(se){var le=q(se,0,1),fe=q(se,-1);if(le==="%"&&fe!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(fe==="%"&&le!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var pe=[];return p(se,he,function(xe,Ie,Me,Re){pe[pe.length]=Me?p(Re,de,"$1"):Ie||xe}),pe},K=function(se,le){var fe=se,pe;if(M(g,fe)&&(pe=g[fe],fe="%"+pe[0]+"%"),M(s,fe)){var xe=s[fe];if(xe===N&&(xe=S(fe)),typeof xe>"u"&&!le)throw new c("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:pe,name:fe,value:xe}}throw new u("intrinsic "+se+" does not exist!")};return Xi=function(se,le){if(typeof se!="string"||se.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof le!="boolean")throw new c('"allowMissing" argument must be a boolean');if(ue(/^%?[^%]*%?$/,se)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var fe=V(se),pe=fe.length>0?fe[0]:"",xe=K("%"+pe+"%",le),Ie=xe.name,Me=xe.value,Re=!1,Ce=xe.alias;Ce&&(pe=Ce[0],C(fe,G([0,1],Ce)));for(var ft=1,ke=!0;ft<fe.length;ft+=1){var me=fe[ft],Oe=q(me,0,1),ye=q(me,-1);if((Oe==='"'||Oe==="'"||Oe==="`"||ye==='"'||ye==="'"||ye==="`")&&Oe!==ye)throw new u("property names with quotes must have matching quotes");if((me==="constructor"||!ke)&&(Re=!0),pe+="."+me,Ie="%"+pe+"%",M(s,Ie))Me=s[Ie];else if(Me!=null){if(!(me in Me)){if(!le)throw new c("base intrinsic for "+se+" exists, but the property is not available.");return}if(k&&ft+1>=fe.length){var Se=k(Me,me);ke=!!Se,ke&&"get"in Se&&!("originalValue"in Se.get)?Me=Se.get:Me=Me[me]}else ke=M(Me,me),Me=Me[me];ke&&!Re&&(s[Ie]=Me)}}return Me},Xi}var Qi,Qs;function Zs(){if(Qs)return Qi;Qs=1;var n=Xs(),e=Yi(),t=e([n("%String.prototype.indexOf%")]);return Qi=function(a,i){var u=n(a,!!i);return typeof u=="function"&&t(a,".prototype.")>-1?e([u]):u},Qi}var Zi,eo;function fu(){if(eo)return Zi;eo=1;var n=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,t)}catch(k){k!==r&&(e=null)}else e=null;var a=/^\s*class\b/,i=function(L){try{var T=n.call(L);return a.test(T)}catch{return!1}},u=function(L){try{return i(L)?!1:(n.call(L),!0)}catch{return!1}},c=Object.prototype.toString,h="[object Object]",f="[object Function]",o="[object GeneratorFunction]",v="[object HTMLAllCollection]",w="[object HTML document.all class]",A="[object HTMLCollection]",B=typeof Symbol=="function"&&!!Symbol.toStringTag,x=!(0 in[,]),U=function(){return!1};if(typeof document=="object"){var P=document.all;c.call(P)===c.call(document.all)&&(U=function(L){if((x||!L)&&(typeof L>"u"||typeof L=="object"))try{var T=c.call(L);return(T===v||T===w||T===A||T===h)&&L("")==null}catch{}return!1})}return Zi=e?function(L){if(U(L))return!0;if(!L||typeof L!="function"&&typeof L!="object")return!1;try{e(L,null,t)}catch(T){if(T!==r)return!1}return!i(L)&&u(L)}:function(L){if(U(L))return!0;if(!L||typeof L!="function"&&typeof L!="object")return!1;if(B)return u(L);if(i(L))return!1;var T=c.call(L);return T!==f&&T!==o&&!/^\[object HTML/.test(T)?!1:u(L)},Zi}var en,to;function uu(){if(to)return en;to=1;var n=fu(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,r=function(h,f,o){for(var v=0,w=h.length;v<w;v++)t.call(h,v)&&(o==null?f(h[v],v,h):f.call(o,h[v],v,h))},a=function(h,f,o){for(var v=0,w=h.length;v<w;v++)o==null?f(h.charAt(v),v,h):f.call(o,h.charAt(v),v,h)},i=function(h,f,o){for(var v in h)t.call(h,v)&&(o==null?f(h[v],v,h):f.call(o,h[v],v,h))},u=function(h,f,o){if(!n(f))throw new TypeError("iterator must be a function");var v;arguments.length>=3&&(v=o),e.call(h)==="[object Array]"?r(h,f,v):typeof h=="string"?a(h,f,v):i(h,f,v)};return en=u,en}var tn,ro;function cu(){return ro||(ro=1,tn=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),tn}var rn,io;function hu(){if(io)return rn;io=1;var n=cu(),e=typeof globalThis>"u"?He:globalThis;return rn=function(){for(var r=[],a=0;a<n.length;a++)typeof e[n[a]]=="function"&&(r[r.length]=n[a]);return r},rn}var nn={exports:{}},an,no;function lu(){if(no)return an;no=1;var n=vr(),e=vs(),t=ir(),r=nr();return an=function(i,u,c){if(!i||typeof i!="object"&&typeof i!="function")throw new t("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var h=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,v=arguments.length>6?arguments[6]:!1,w=!!r&&r(i,u);if(n)n(i,u,{configurable:o===null&&w?w.configurable:!o,enumerable:h===null&&w?w.enumerable:!h,value:c,writable:f===null&&w?w.writable:!f});else if(v||!h&&!f&&!o)i[u]=c;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},an}var sn,ao;function du(){if(ao)return sn;ao=1;var n=vr(),e=function(){return!!n};return e.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],"length",{value:1}).length!==1}catch{return!0}},sn=e,sn}var on,so;function pu(){if(so)return on;so=1;var n=Xs(),e=lu(),t=du()(),r=nr(),a=ir(),i=n("%Math.floor%");return on=function(c,h){if(typeof c!="function")throw new a("`fn` is not a function");if(typeof h!="number"||h<0||h>4294967295||i(h)!==h)throw new a("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],o=!0,v=!0;if("length"in c&&r){var w=r(c,"length");w&&!w.configurable&&(o=!1),w&&!w.writable&&(v=!1)}return(o||v||!f)&&(t?e(c,"length",h,!0,!0):e(c,"length",h)),c},on}var fn,oo;function bu(){if(oo)return fn;oo=1;var n=ar(),e=Vi(),t=zs();return fn=function(){return t(n,e,arguments)},fn}var fo;function mu(){return fo||(fo=1,function(n){var e=pu(),t=vr(),r=Yi(),a=bu();n.exports=function(u){var c=r(arguments),h=u.length-(arguments.length-1);return e(c,1+(h>0?h:0),!0)},t?t(n.exports,"apply",{value:a}):n.exports.apply=a}(nn)),nn.exports}var un,uo;function yu(){if(uo)return un;uo=1;var n=Ts();return un=function(){return n()&&!!Symbol.toStringTag},un}var cn,co;function gu(){if(co)return cn;co=1;var n=uu(),e=hu(),t=mu(),r=Zs(),a=nr(),i=r("Object.prototype.toString"),u=yu()(),c=typeof globalThis>"u"?He:globalThis,h=e(),f=r("String.prototype.slice"),o=Object.getPrototypeOf,v=r("Array.prototype.indexOf",!0)||function(U,P){for(var k=0;k<U.length;k+=1)if(U[k]===P)return k;return-1},w={__proto__:null};u&&a&&o?n(h,function(x){var U=new c[x];if(Symbol.toStringTag in U){var P=o(U),k=a(P,Symbol.toStringTag);if(!k){var L=o(P);k=a(L,Symbol.toStringTag)}w["$"+x]=t(k.get)}}):n(h,function(x){var U=new c[x],P=U.slice||U.set;P&&(w["$"+x]=t(P))});var A=function(U){var P=!1;return n(w,function(k,L){if(!P)try{"$"+k(U)===L&&(P=f(L,1))}catch{}}),P},B=function(U){var P=!1;return n(w,function(k,L){if(!P)try{k(U),P=f(L,1)}catch{}}),P};return cn=function(U){if(!U||typeof U!="object")return!1;if(!u){var P=f(i(U),8,-1);return v(h,P)>-1?P:P!=="Object"?!1:B(U)}return a?A(U):null},cn}var hn,ho;function vu(){if(ho)return hn;ho=1;var n=gu();return hn=function(t){return!!n(t)},hn}var ln,lo;function wu(){if(lo)return ln;lo=1;var n=ir(),e=Zs(),t=e("TypedArray.prototype.buffer",!0),r=vu();return ln=t||function(i){if(!r(i))throw new n("Not a Typed Array");return i.buffer},ln}var dn,po;function pn(){if(po)return dn;po=1;var n=bt().Buffer,e=qf(),t=wu(),r=ArrayBuffer.isView||function(h){try{return t(h),!0}catch{return!1}},a=typeof Uint8Array<"u",i=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u=i&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);return dn=function(h,f){if(n.isBuffer(h))return h.constructor&&!("isBuffer"in h)?n.from(h):h;if(typeof h=="string")return n.from(h,f);if(i&&r(h)){if(h.byteLength===0)return n.alloc(0);if(u){var o=n.from(h.buffer,h.byteOffset,h.byteLength);if(o.byteLength===h.byteLength)return o}var v=h instanceof Uint8Array?h:new Uint8Array(h.buffer,h.byteOffset,h.byteLength),w=n.from(v);if(w.length===h.byteLength)return w}if(a&&h instanceof Uint8Array)return n.from(h);var A=e(h);if(A)for(var B=0;B<h.length;B+=1){var x=h[B];if(typeof x!="number"||x<0||x>255||~~x!==x)throw new RangeError("Array items must be numbers in the range 0-255.")}if(A||n.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return n.from(h);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},dn}var bn,bo;function xu(){if(bo)return bn;bo=1;var n=bt().Buffer,e=pn(),t=typeof Uint8Array<"u",r=t&&typeof ArrayBuffer<"u",a=r&&ArrayBuffer.isView;return bn=function(i,u){if(typeof i=="string"||n.isBuffer(i)||t&&i instanceof Uint8Array||a&&a(i))return e(i,u);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},bn}var wr={exports:{}},xr={exports:{}},mo;function _r(){if(mo)return xr.exports;mo=1,typeof ut>"u"||!ut.version||ut.version.indexOf("v0.")===0||ut.version.indexOf("v1.")===0&&ut.version.indexOf("v1.8.")!==0?xr.exports={nextTick:n}:xr.exports=ut;function n(e,t,r,a){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var i=arguments.length,u,c;switch(i){case 0:case 1:return ut.nextTick(e);case 2:return ut.nextTick(function(){e.call(null,t)});case 3:return ut.nextTick(function(){e.call(null,t,r)});case 4:return ut.nextTick(function(){e.call(null,t,r,a)});default:for(u=new Array(i-1),c=0;c<u.length;)u[c++]=arguments[c];return ut.nextTick(function(){e.apply(null,u)})}}return xr.exports}var mn,yo;function _u(){if(yo)return mn;yo=1;var n={}.toString;return mn=Array.isArray||function(e){return n.call(e)=="[object Array]"},mn}var Sr={exports:{}},go;function vo(){if(go)return Sr.exports;go=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(I,F,j){return Function.prototype.apply.call(I,F,j)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:t=function(I){return Object.getOwnPropertyNames(I)};function r(T){console&&console.warn&&console.warn(T)}var a=Number.isNaN||function(I){return I!==I};function i(){i.init.call(this)}Sr.exports=i,Sr.exports.once=P,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var u=10;function c(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(T){if(typeof T!="number"||T<0||a(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");u=T}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||a(I))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+I+".");return this._maxListeners=I,this};function h(T){return T._maxListeners===void 0?i.defaultMaxListeners:T._maxListeners}i.prototype.getMaxListeners=function(){return h(this)},i.prototype.emit=function(I){for(var F=[],j=1;j<arguments.length;j++)F.push(arguments[j]);var W=I==="error",Z=this._events;if(Z!==void 0)W=W&&Z.error===void 0;else if(!W)return!1;if(W){var ne;if(F.length>0&&(ne=F[0]),ne instanceof Error)throw ne;var ae=new Error("Unhandled error."+(ne?" ("+ne.message+")":""));throw ae.context=ne,ae}var N=Z[I];if(N===void 0)return!1;if(typeof N=="function")e(N,this,F);else for(var E=N.length,s=B(N,E),j=0;j<E;++j)e(s[j],this,F);return!0};function f(T,I,F,j){var W,Z,ne;if(c(F),Z=T._events,Z===void 0?(Z=T._events=Object.create(null),T._eventsCount=0):(Z.newListener!==void 0&&(T.emit("newListener",I,F.listener?F.listener:F),Z=T._events),ne=Z[I]),ne===void 0)ne=Z[I]=F,++T._eventsCount;else if(typeof ne=="function"?ne=Z[I]=j?[F,ne]:[ne,F]:j?ne.unshift(F):ne.push(F),W=h(T),W>0&&ne.length>W&&!ne.warned){ne.warned=!0;var ae=new Error("Possible EventEmitter memory leak detected. "+ne.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");ae.name="MaxListenersExceededWarning",ae.emitter=T,ae.type=I,ae.count=ne.length,r(ae)}return T}i.prototype.addListener=function(I,F){return f(this,I,F,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(I,F){return f(this,I,F,!0)};function o(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(T,I,F){var j={fired:!1,wrapFn:void 0,target:T,type:I,listener:F},W=o.bind(j);return W.listener=F,j.wrapFn=W,W}i.prototype.once=function(I,F){return c(F),this.on(I,v(this,I,F)),this},i.prototype.prependOnceListener=function(I,F){return c(F),this.prependListener(I,v(this,I,F)),this},i.prototype.removeListener=function(I,F){var j,W,Z,ne,ae;if(c(F),W=this._events,W===void 0)return this;if(j=W[I],j===void 0)return this;if(j===F||j.listener===F)--this._eventsCount===0?this._events=Object.create(null):(delete W[I],W.removeListener&&this.emit("removeListener",I,j.listener||F));else if(typeof j!="function"){for(Z=-1,ne=j.length-1;ne>=0;ne--)if(j[ne]===F||j[ne].listener===F){ae=j[ne].listener,Z=ne;break}if(Z<0)return this;Z===0?j.shift():x(j,Z),j.length===1&&(W[I]=j[0]),W.removeListener!==void 0&&this.emit("removeListener",I,ae||F)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(I){var F,j,W;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[I]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[I]),this;if(arguments.length===0){var Z=Object.keys(j),ne;for(W=0;W<Z.length;++W)ne=Z[W],ne!=="removeListener"&&this.removeAllListeners(ne);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(F=j[I],typeof F=="function")this.removeListener(I,F);else if(F!==void 0)for(W=F.length-1;W>=0;W--)this.removeListener(I,F[W]);return this};function w(T,I,F){var j=T._events;if(j===void 0)return[];var W=j[I];return W===void 0?[]:typeof W=="function"?F?[W.listener||W]:[W]:F?U(W):B(W,W.length)}i.prototype.listeners=function(I){return w(this,I,!0)},i.prototype.rawListeners=function(I){return w(this,I,!1)},i.listenerCount=function(T,I){return typeof T.listenerCount=="function"?T.listenerCount(I):A.call(T,I)},i.prototype.listenerCount=A;function A(T){var I=this._events;if(I!==void 0){var F=I[T];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function B(T,I){for(var F=new Array(I),j=0;j<I;++j)F[j]=T[j];return F}function x(T,I){for(;I+1<T.length;I++)T[I]=T[I+1];T.pop()}function U(T){for(var I=new Array(T.length),F=0;F<I.length;++F)I[F]=T[F].listener||T[F];return I}function P(T,I){return new Promise(function(F,j){function W(ne){T.removeListener(I,Z),j(ne)}function Z(){typeof T.removeListener=="function"&&T.removeListener("error",W),F([].slice.call(arguments))}L(T,I,Z,{once:!0}),I!=="error"&&k(T,W,{once:!0})})}function k(T,I,F){typeof T.on=="function"&&L(T,"error",I,F)}function L(T,I,F,j){if(typeof T.on=="function")j.once?T.once(I,F):T.on(I,F);else if(typeof T.addEventListener=="function")T.addEventListener(I,function W(Z){j.once&&T.removeEventListener(I,W),F(Z)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return Sr.exports}var yn,wo;function xo(){return wo||(wo=1,yn=vo().EventEmitter),yn}var Er={exports:{}},_o;function gn(){return _o||(_o=1,function(n,e){var t=Jt(),r=t.Buffer;function a(u,c){for(var h in u)c[h]=u[h]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(a(t,e),e.Buffer=i);function i(u,c,h){return r(u,c,h)}a(r,i),i.from=function(u,c,h){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,c,h)},i.alloc=function(u,c,h){if(typeof u!="number")throw new TypeError("Argument must be a number");var f=r(u);return c!==void 0?typeof h=="string"?f.fill(c,h):f.fill(c):f.fill(0),f},i.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},i.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}}(Er,Er.exports)),Er.exports}var ct={},So;function sr(){if(So)return ct;So=1;function n(x){return Array.isArray?Array.isArray(x):B(x)==="[object Array]"}ct.isArray=n;function e(x){return typeof x=="boolean"}ct.isBoolean=e;function t(x){return x===null}ct.isNull=t;function r(x){return x==null}ct.isNullOrUndefined=r;function a(x){return typeof x=="number"}ct.isNumber=a;function i(x){return typeof x=="string"}ct.isString=i;function u(x){return typeof x=="symbol"}ct.isSymbol=u;function c(x){return x===void 0}ct.isUndefined=c;function h(x){return B(x)==="[object RegExp]"}ct.isRegExp=h;function f(x){return typeof x=="object"&&x!==null}ct.isObject=f;function o(x){return B(x)==="[object Date]"}ct.isDate=o;function v(x){return B(x)==="[object Error]"||x instanceof Error}ct.isError=v;function w(x){return typeof x=="function"}ct.isFunction=w;function A(x){return x===null||typeof x=="boolean"||typeof x=="number"||typeof x=="string"||typeof x=="symbol"||typeof x>"u"}ct.isPrimitive=A,ct.isBuffer=Jt().Buffer.isBuffer;function B(x){return Object.prototype.toString.call(x)}return ct}var vn={exports:{}},Eo;function Su(){return Eo||(Eo=1,function(n){function e(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}var t=gn().Buffer,r=jr;function a(i,u,c){i.copy(u,c)}n.exports=function(){function i(){e(this,i),this.head=null,this.tail=null,this.length=0}return i.prototype.push=function(c){var h={data:c,next:null};this.length>0?this.tail.next=h:this.head=h,this.tail=h,++this.length},i.prototype.unshift=function(c){var h={data:c,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length},i.prototype.shift=function(){if(this.length!==0){var c=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,c}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(c){if(this.length===0)return"";for(var h=this.head,f=""+h.data;h=h.next;)f+=c+h.data;return f},i.prototype.concat=function(c){if(this.length===0)return t.alloc(0);for(var h=t.allocUnsafe(c>>>0),f=this.head,o=0;f;)a(f.data,h,o),o+=f.data.length,f=f.next;return h},i}(),r&&r.inspect&&r.inspect.custom&&(n.exports.prototype[r.inspect.custom]=function(){var i=r.inspect({length:this.length});return this.constructor.name+" "+i})}(vn)),vn.exports}var wn,Bo;function Io(){if(Bo)return wn;Bo=1;var n=_r();function e(a,i){var u=this,c=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return c||h?(i?i(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(r,this,a)):n.nextTick(r,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(f){!i&&f?u._writableState?u._writableState.errorEmitted||(u._writableState.errorEmitted=!0,n.nextTick(r,u,f)):n.nextTick(r,u,f):i&&i(f)}),this)}function t(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function r(a,i){a.emit("error",i)}return wn={destroy:e,undestroy:t},wn}var xn,Ao;function Eu(){if(Ao)return xn;Ao=1,xn=n;function n(t,r){if(e("noDeprecation"))return t;var a=!1;function i(){if(!a){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),a=!0}return t.apply(this,arguments)}return i}function e(t){try{if(!He.localStorage)return!1}catch{return!1}var r=He.localStorage[t];return r==null?!1:String(r).toLowerCase()==="true"}return xn}var _n,Oo;function Ro(){if(Oo)return _n;Oo=1;var n=_r();_n=x;function e(g){var _=this;this.next=null,this.entry=null,this.finish=function(){S(_,g)}}var t=!ut.browser&&["v0.10","v0.9."].indexOf(ut.version.slice(0,5))>-1?setImmediate:n.nextTick,r;x.WritableState=A;var a=Object.create(sr());a.inherits=dt();var i={deprecate:Eu()},u=xo(),c=gn().Buffer,h=(typeof He<"u"?He:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(g){return c.from(g)}function o(g){return c.isBuffer(g)||g instanceof h}var v=Io();a.inherits(x,u);function w(){}function A(g,_){r=r||Xt(),g=g||{};var M=_ instanceof r;this.objectMode=!!g.objectMode,M&&(this.objectMode=this.objectMode||!!g.writableObjectMode);var G=g.highWaterMark,C=g.writableHighWaterMark,p=this.objectMode?16:16*1024;G||G===0?this.highWaterMark=G:M&&(C||C===0)?this.highWaterMark=C:this.highWaterMark=p,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var q=g.decodeStrings===!1;this.decodeStrings=!q,this.defaultEncoding=g.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ue){j(_,ue)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}A.prototype.getBuffer=function(){for(var _=this.bufferedRequest,M=[];_;)M.push(_),_=_.next;return M},function(){try{Object.defineProperty(A.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var B;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(B=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(g){return B.call(this,g)?!0:this!==x?!1:g&&g._writableState instanceof A}})):B=function(g){return g instanceof this};function x(g){if(r=r||Xt(),!B.call(x,this)&&!(this instanceof r))return new x(g);this._writableState=new A(g,this),this.writable=!0,g&&(typeof g.write=="function"&&(this._write=g.write),typeof g.writev=="function"&&(this._writev=g.writev),typeof g.destroy=="function"&&(this._destroy=g.destroy),typeof g.final=="function"&&(this._final=g.final)),u.call(this)}x.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function U(g,_){var M=new Error("write after end");g.emit("error",M),n.nextTick(_,M)}function P(g,_,M,G){var C=!0,p=!1;return M===null?p=new TypeError("May not write null values to stream"):typeof M!="string"&&M!==void 0&&!_.objectMode&&(p=new TypeError("Invalid non-string/buffer chunk")),p&&(g.emit("error",p),n.nextTick(G,p),C=!1),C}x.prototype.write=function(g,_,M){var G=this._writableState,C=!1,p=!G.objectMode&&o(g);return p&&!c.isBuffer(g)&&(g=f(g)),typeof _=="function"&&(M=_,_=null),p?_="buffer":_||(_=G.defaultEncoding),typeof M!="function"&&(M=w),G.ended?U(this,M):(p||P(this,G,g,M))&&(G.pendingcb++,C=L(this,G,p,g,_,M)),C},x.prototype.cork=function(){var g=this._writableState;g.corked++},x.prototype.uncork=function(){var g=this._writableState;g.corked&&(g.corked--,!g.writing&&!g.corked&&!g.bufferProcessing&&g.bufferedRequest&&ne(this,g))},x.prototype.setDefaultEncoding=function(_){if(typeof _=="string"&&(_=_.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((_+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+_);return this._writableState.defaultEncoding=_,this};function k(g,_,M){return!g.objectMode&&g.decodeStrings!==!1&&typeof _=="string"&&(_=c.from(_,M)),_}Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function L(g,_,M,G,C,p){if(!M){var q=k(_,G,C);G!==q&&(M=!0,C="buffer",G=q)}var ue=_.objectMode?1:G.length;_.length+=ue;var he=_.length<_.highWaterMark;if(he||(_.needDrain=!0),_.writing||_.corked){var de=_.lastBufferedRequest;_.lastBufferedRequest={chunk:G,encoding:C,isBuf:M,callback:p,next:null},de?de.next=_.lastBufferedRequest:_.bufferedRequest=_.lastBufferedRequest,_.bufferedRequestCount+=1}else T(g,_,!1,ue,G,C,p);return he}function T(g,_,M,G,C,p,q){_.writelen=G,_.writecb=q,_.writing=!0,_.sync=!0,M?g._writev(C,_.onwrite):g._write(C,p,_.onwrite),_.sync=!1}function I(g,_,M,G,C){--_.pendingcb,M?(n.nextTick(C,G),n.nextTick(s,g,_),g._writableState.errorEmitted=!0,g.emit("error",G)):(C(G),g._writableState.errorEmitted=!0,g.emit("error",G),s(g,_))}function F(g){g.writing=!1,g.writecb=null,g.length-=g.writelen,g.writelen=0}function j(g,_){var M=g._writableState,G=M.sync,C=M.writecb;if(F(M),_)I(g,M,G,_,C);else{var p=ae(M);!p&&!M.corked&&!M.bufferProcessing&&M.bufferedRequest&&ne(g,M),G?t(W,g,M,p,C):W(g,M,p,C)}}function W(g,_,M,G){M||Z(g,_),_.pendingcb--,G(),s(g,_)}function Z(g,_){_.length===0&&_.needDrain&&(_.needDrain=!1,g.emit("drain"))}function ne(g,_){_.bufferProcessing=!0;var M=_.bufferedRequest;if(g._writev&&M&&M.next){var G=_.bufferedRequestCount,C=new Array(G),p=_.corkedRequestsFree;p.entry=M;for(var q=0,ue=!0;M;)C[q]=M,M.isBuf||(ue=!1),M=M.next,q+=1;C.allBuffers=ue,T(g,_,!0,_.length,C,"",p.finish),_.pendingcb++,_.lastBufferedRequest=null,p.next?(_.corkedRequestsFree=p.next,p.next=null):_.corkedRequestsFree=new e(_),_.bufferedRequestCount=0}else{for(;M;){var he=M.chunk,de=M.encoding,V=M.callback,K=_.objectMode?1:he.length;if(T(g,_,!1,K,he,de,V),M=M.next,_.bufferedRequestCount--,_.writing)break}M===null&&(_.lastBufferedRequest=null)}_.bufferedRequest=M,_.bufferProcessing=!1}x.prototype._write=function(g,_,M){M(new Error("_write() is not implemented"))},x.prototype._writev=null,x.prototype.end=function(g,_,M){var G=this._writableState;typeof g=="function"?(M=g,g=null,_=null):typeof _=="function"&&(M=_,_=null),g!=null&&this.write(g,_),G.corked&&(G.corked=1,this.uncork()),G.ending||y(this,G,M)};function ae(g){return g.ending&&g.length===0&&g.bufferedRequest===null&&!g.finished&&!g.writing}function N(g,_){g._final(function(M){_.pendingcb--,M&&g.emit("error",M),_.prefinished=!0,g.emit("prefinish"),s(g,_)})}function E(g,_){!_.prefinished&&!_.finalCalled&&(typeof g._final=="function"?(_.pendingcb++,_.finalCalled=!0,n.nextTick(N,g,_)):(_.prefinished=!0,g.emit("prefinish")))}function s(g,_){var M=ae(_);return M&&(E(g,_),_.pendingcb===0&&(_.finished=!0,g.emit("finish"))),M}function y(g,_,M){_.ending=!0,s(g,_),M&&(_.finished?n.nextTick(M):g.once("finish",M)),_.ended=!0,g.writable=!1}function S(g,_,M){var G=g.entry;for(g.entry=null;G;){var C=G.callback;_.pendingcb--,C(M),G=G.next}_.corkedRequestsFree.next=g}return Object.defineProperty(x.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(g){this._writableState&&(this._writableState.destroyed=g)}}),x.prototype.destroy=v.destroy,x.prototype._undestroy=v.undestroy,x.prototype._destroy=function(g,_){this.end(),_(g)},_n}var Sn,Po;function Xt(){if(Po)return Sn;Po=1;var n=_r(),e=Object.keys||function(v){var w=[];for(var A in v)w.push(A);return w};Sn=h;var t=Object.create(sr());t.inherits=dt();var r=Co(),a=Ro();t.inherits(h,r);for(var i=e(a.prototype),u=0;u<i.length;u++){var c=i[u];h.prototype[c]||(h.prototype[c]=a.prototype[c])}function h(v){if(!(this instanceof h))return new h(v);r.call(this,v),a.call(this,v),v&&v.readable===!1&&(this.readable=!1),v&&v.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,v&&v.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",f)}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function f(){this.allowHalfOpen||this._writableState.ended||n.nextTick(o,this)}function o(v){v.end()}return Object.defineProperty(h.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(v){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=v,this._writableState.destroyed=v)}}),h.prototype._destroy=function(v,w){this.push(null),this.end(),n.nextTick(w,v)},Sn}var En={},Br={exports:{}},ko;function Bu(){return ko||(ko=1,function(n,e){var t=Jt(),r=t.Buffer;function a(u,c){for(var h in u)c[h]=u[h]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(a(t,e),e.Buffer=i);function i(u,c,h){return r(u,c,h)}a(r,i),i.from=function(u,c,h){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,c,h)},i.alloc=function(u,c,h){if(typeof u!="number")throw new TypeError("Argument must be a number");var f=r(u);return c!==void 0?typeof h=="string"?f.fill(c,h):f.fill(c):f.fill(0),f},i.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},i.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}}(Br,Br.exports)),Br.exports}var No;function To(){if(No)return En;No=1;var n=Bu().Buffer,e=n.isEncoding||function(P){switch(P=""+P,P&&P.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(P){if(!P)return"utf8";for(var k;;)switch(P){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return P;default:if(k)return;P=(""+P).toLowerCase(),k=!0}}function r(P){var k=t(P);if(typeof k!="string"&&(n.isEncoding===e||!e(P)))throw new Error("Unknown encoding: "+P);return k||P}En.StringDecoder=a;function a(P){this.encoding=r(P);var k;switch(this.encoding){case"utf16le":this.text=v,this.end=w,k=4;break;case"utf8":this.fillLast=h,k=4;break;case"base64":this.text=A,this.end=B,k=3;break;default:this.write=x,this.end=U;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(k)}a.prototype.write=function(P){if(P.length===0)return"";var k,L;if(this.lastNeed){if(k=this.fillLast(P),k===void 0)return"";L=this.lastNeed,this.lastNeed=0}else L=0;return L<P.length?k?k+this.text(P,L):this.text(P,L):k||""},a.prototype.end=o,a.prototype.text=f,a.prototype.fillLast=function(P){if(this.lastNeed<=P.length)return P.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);P.copy(this.lastChar,this.lastTotal-this.lastNeed,0,P.length),this.lastNeed-=P.length};function i(P){return P<=127?0:P>>5===6?2:P>>4===14?3:P>>3===30?4:P>>6===2?-1:-2}function u(P,k,L){var T=k.length-1;if(T<L)return 0;var I=i(k[T]);return I>=0?(I>0&&(P.lastNeed=I-1),I):--T<L||I===-2?0:(I=i(k[T]),I>=0?(I>0&&(P.lastNeed=I-2),I):--T<L||I===-2?0:(I=i(k[T]),I>=0?(I>0&&(I===2?I=0:P.lastNeed=I-3),I):0))}function c(P,k,L){if((k[0]&192)!==128)return P.lastNeed=0,"�";if(P.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return P.lastNeed=1,"�";if(P.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return P.lastNeed=2,"�"}}function h(P){var k=this.lastTotal-this.lastNeed,L=c(this,P);if(L!==void 0)return L;if(this.lastNeed<=P.length)return P.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);P.copy(this.lastChar,k,0,P.length),this.lastNeed-=P.length}function f(P,k){var L=u(this,P,k);if(!this.lastNeed)return P.toString("utf8",k);this.lastTotal=L;var T=P.length-(L-this.lastNeed);return P.copy(this.lastChar,0,T),P.toString("utf8",k,T)}function o(P){var k=P&&P.length?this.write(P):"";return this.lastNeed?k+"�":k}function v(P,k){if((P.length-k)%2===0){var L=P.toString("utf16le",k);if(L){var T=L.charCodeAt(L.length-1);if(T>=55296&&T<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=P[P.length-2],this.lastChar[1]=P[P.length-1],L.slice(0,-1)}return L}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=P[P.length-1],P.toString("utf16le",k,P.length-1)}function w(P){var k=P&&P.length?this.write(P):"";if(this.lastNeed){var L=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,L)}return k}function A(P,k){var L=(P.length-k)%3;return L===0?P.toString("base64",k):(this.lastNeed=3-L,this.lastTotal=3,L===1?this.lastChar[0]=P[P.length-1]:(this.lastChar[0]=P[P.length-2],this.lastChar[1]=P[P.length-1]),P.toString("base64",k,P.length-L))}function B(P){var k=P&&P.length?this.write(P):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function x(P){return P.toString(this.encoding)}function U(P){return P&&P.length?this.write(P):""}return En}var Bn,Mo;function Co(){if(Mo)return Bn;Mo=1;var n=_r();Bn=k;var e=_u(),t;k.ReadableState=P,vo().EventEmitter;var r=function(V,K){return V.listeners(K).length},a=xo(),i=gn().Buffer,u=(typeof He<"u"?He:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(V){return i.from(V)}function h(V){return i.isBuffer(V)||V instanceof u}var f=Object.create(sr());f.inherits=dt();var o=jr,v=void 0;o&&o.debuglog?v=o.debuglog("stream"):v=function(){};var w=Su(),A=Io(),B;f.inherits(k,a);var x=["error","close","destroy","pause","resume"];function U(V,K,te){if(typeof V.prependListener=="function")return V.prependListener(K,te);!V._events||!V._events[K]?V.on(K,te):e(V._events[K])?V._events[K].unshift(te):V._events[K]=[te,V._events[K]]}function P(V,K){t=t||Xt(),V=V||{};var te=K instanceof t;this.objectMode=!!V.objectMode,te&&(this.objectMode=this.objectMode||!!V.readableObjectMode);var se=V.highWaterMark,le=V.readableHighWaterMark,fe=this.objectMode?16:16*1024;se||se===0?this.highWaterMark=se:te&&(le||le===0)?this.highWaterMark=le:this.highWaterMark=fe,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new w,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=V.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,V.encoding&&(B||(B=To().StringDecoder),this.decoder=new B(V.encoding),this.encoding=V.encoding)}function k(V){if(t=t||Xt(),!(this instanceof k))return new k(V);this._readableState=new P(V,this),this.readable=!0,V&&(typeof V.read=="function"&&(this._read=V.read),typeof V.destroy=="function"&&(this._destroy=V.destroy)),a.call(this)}Object.defineProperty(k.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(V){this._readableState&&(this._readableState.destroyed=V)}}),k.prototype.destroy=A.destroy,k.prototype._undestroy=A.undestroy,k.prototype._destroy=function(V,K){this.push(null),K(V)},k.prototype.push=function(V,K){var te=this._readableState,se;return te.objectMode?se=!0:typeof V=="string"&&(K=K||te.defaultEncoding,K!==te.encoding&&(V=i.from(V,K),K=""),se=!0),L(this,V,K,!1,se)},k.prototype.unshift=function(V){return L(this,V,null,!0,!1)};function L(V,K,te,se,le){var fe=V._readableState;if(K===null)fe.reading=!1,ne(V,fe);else{var pe;le||(pe=I(fe,K)),pe?V.emit("error",pe):fe.objectMode||K&&K.length>0?(typeof K!="string"&&!fe.objectMode&&Object.getPrototypeOf(K)!==i.prototype&&(K=c(K)),se?fe.endEmitted?V.emit("error",new Error("stream.unshift() after end event")):T(V,fe,K,!0):fe.ended?V.emit("error",new Error("stream.push() after EOF")):(fe.reading=!1,fe.decoder&&!te?(K=fe.decoder.write(K),fe.objectMode||K.length!==0?T(V,fe,K,!1):E(V,fe)):T(V,fe,K,!1))):se||(fe.reading=!1)}return F(fe)}function T(V,K,te,se){K.flowing&&K.length===0&&!K.sync?(V.emit("data",te),V.read(0)):(K.length+=K.objectMode?1:te.length,se?K.buffer.unshift(te):K.buffer.push(te),K.needReadable&&ae(V)),E(V,K)}function I(V,K){var te;return!h(K)&&typeof K!="string"&&K!==void 0&&!V.objectMode&&(te=new TypeError("Invalid non-string/buffer chunk")),te}function F(V){return!V.ended&&(V.needReadable||V.length<V.highWaterMark||V.length===0)}k.prototype.isPaused=function(){return this._readableState.flowing===!1},k.prototype.setEncoding=function(V){return B||(B=To().StringDecoder),this._readableState.decoder=new B(V),this._readableState.encoding=V,this};var j=8388608;function W(V){return V>=j?V=j:(V--,V|=V>>>1,V|=V>>>2,V|=V>>>4,V|=V>>>8,V|=V>>>16,V++),V}function Z(V,K){return V<=0||K.length===0&&K.ended?0:K.objectMode?1:V!==V?K.flowing&&K.length?K.buffer.head.data.length:K.length:(V>K.highWaterMark&&(K.highWaterMark=W(V)),V<=K.length?V:K.ended?K.length:(K.needReadable=!0,0))}k.prototype.read=function(V){v("read",V),V=parseInt(V,10);var K=this._readableState,te=V;if(V!==0&&(K.emittedReadable=!1),V===0&&K.needReadable&&(K.length>=K.highWaterMark||K.ended))return v("read: emitReadable",K.length,K.ended),K.length===0&&K.ended?ue(this):ae(this),null;if(V=Z(V,K),V===0&&K.ended)return K.length===0&&ue(this),null;var se=K.needReadable;v("need readable",se),(K.length===0||K.length-V<K.highWaterMark)&&(se=!0,v("length less than watermark",se)),K.ended||K.reading?(se=!1,v("reading or ended",se)):se&&(v("do read"),K.reading=!0,K.sync=!0,K.length===0&&(K.needReadable=!0),this._read(K.highWaterMark),K.sync=!1,K.reading||(V=Z(te,K)));var le;return V>0?le=G(V,K):le=null,le===null?(K.needReadable=!0,V=0):K.length-=V,K.length===0&&(K.ended||(K.needReadable=!0),te!==V&&K.ended&&ue(this)),le!==null&&this.emit("data",le),le};function ne(V,K){if(!K.ended){if(K.decoder){var te=K.decoder.end();te&&te.length&&(K.buffer.push(te),K.length+=K.objectMode?1:te.length)}K.ended=!0,ae(V)}}function ae(V){var K=V._readableState;K.needReadable=!1,K.emittedReadable||(v("emitReadable",K.flowing),K.emittedReadable=!0,K.sync?n.nextTick(N,V):N(V))}function N(V){v("emit readable"),V.emit("readable"),M(V)}function E(V,K){K.readingMore||(K.readingMore=!0,n.nextTick(s,V,K))}function s(V,K){for(var te=K.length;!K.reading&&!K.flowing&&!K.ended&&K.length<K.highWaterMark&&(v("maybeReadMore read 0"),V.read(0),te!==K.length);)te=K.length;K.readingMore=!1}k.prototype._read=function(V){this.emit("error",new Error("_read() is not implemented"))},k.prototype.pipe=function(V,K){var te=this,se=this._readableState;switch(se.pipesCount){case 0:se.pipes=V;break;case 1:se.pipes=[se.pipes,V];break;default:se.pipes.push(V);break}se.pipesCount+=1,v("pipe count=%d opts=%j",se.pipesCount,K);var le=(!K||K.end!==!1)&&V!==ut.stdout&&V!==ut.stderr,fe=le?xe:ye;se.endEmitted?n.nextTick(fe):te.once("end",fe),V.on("unpipe",pe);function pe(Se,Ye){v("onunpipe"),Se===te&&Ye&&Ye.hasUnpiped===!1&&(Ye.hasUnpiped=!0,Re())}function xe(){v("onend"),V.end()}var Ie=y(te);V.on("drain",Ie);var Me=!1;function Re(){v("cleanup"),V.removeListener("close",me),V.removeListener("finish",Oe),V.removeListener("drain",Ie),V.removeListener("error",ke),V.removeListener("unpipe",pe),te.removeListener("end",xe),te.removeListener("end",ye),te.removeListener("data",ft),Me=!0,se.awaitDrain&&(!V._writableState||V._writableState.needDrain)&&Ie()}var Ce=!1;te.on("data",ft);function ft(Se){v("ondata"),Ce=!1;var Ye=V.write(Se);Ye===!1&&!Ce&&((se.pipesCount===1&&se.pipes===V||se.pipesCount>1&&de(se.pipes,V)!==-1)&&!Me&&(v("false write response, pause",se.awaitDrain),se.awaitDrain++,Ce=!0),te.pause())}function ke(Se){v("onerror",Se),ye(),V.removeListener("error",ke),r(V,"error")===0&&V.emit("error",Se)}U(V,"error",ke);function me(){V.removeListener("finish",Oe),ye()}V.once("close",me);function Oe(){v("onfinish"),V.removeListener("close",me),ye()}V.once("finish",Oe);function ye(){v("unpipe"),te.unpipe(V)}return V.emit("pipe",te),se.flowing||(v("pipe resume"),te.resume()),V};function y(V){return function(){var K=V._readableState;v("pipeOnDrain",K.awaitDrain),K.awaitDrain&&K.awaitDrain--,K.awaitDrain===0&&r(V,"data")&&(K.flowing=!0,M(V))}}k.prototype.unpipe=function(V){var K=this._readableState,te={hasUnpiped:!1};if(K.pipesCount===0)return this;if(K.pipesCount===1)return V&&V!==K.pipes?this:(V||(V=K.pipes),K.pipes=null,K.pipesCount=0,K.flowing=!1,V&&V.emit("unpipe",this,te),this);if(!V){var se=K.pipes,le=K.pipesCount;K.pipes=null,K.pipesCount=0,K.flowing=!1;for(var fe=0;fe<le;fe++)se[fe].emit("unpipe",this,{hasUnpiped:!1});return this}var pe=de(K.pipes,V);return pe===-1?this:(K.pipes.splice(pe,1),K.pipesCount-=1,K.pipesCount===1&&(K.pipes=K.pipes[0]),V.emit("unpipe",this,te),this)},k.prototype.on=function(V,K){var te=a.prototype.on.call(this,V,K);if(V==="data")this._readableState.flowing!==!1&&this.resume();else if(V==="readable"){var se=this._readableState;!se.endEmitted&&!se.readableListening&&(se.readableListening=se.needReadable=!0,se.emittedReadable=!1,se.reading?se.length&&ae(this):n.nextTick(S,this))}return te},k.prototype.addListener=k.prototype.on;function S(V){v("readable nexttick read 0"),V.read(0)}k.prototype.resume=function(){var V=this._readableState;return V.flowing||(v("resume"),V.flowing=!0,g(this,V)),this};function g(V,K){K.resumeScheduled||(K.resumeScheduled=!0,n.nextTick(_,V,K))}function _(V,K){K.reading||(v("resume read 0"),V.read(0)),K.resumeScheduled=!1,K.awaitDrain=0,V.emit("resume"),M(V),K.flowing&&!K.reading&&V.read(0)}k.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function M(V){var K=V._readableState;for(v("flow",K.flowing);K.flowing&&V.read()!==null;);}k.prototype.wrap=function(V){var K=this,te=this._readableState,se=!1;V.on("end",function(){if(v("wrapped end"),te.decoder&&!te.ended){var pe=te.decoder.end();pe&&pe.length&&K.push(pe)}K.push(null)}),V.on("data",function(pe){if(v("wrapped data"),te.decoder&&(pe=te.decoder.write(pe)),!(te.objectMode&&pe==null)&&!(!te.objectMode&&(!pe||!pe.length))){var xe=K.push(pe);xe||(se=!0,V.pause())}});for(var le in V)this[le]===void 0&&typeof V[le]=="function"&&(this[le]=function(pe){return function(){return V[pe].apply(V,arguments)}}(le));for(var fe=0;fe<x.length;fe++)V.on(x[fe],this.emit.bind(this,x[fe]));return this._read=function(pe){v("wrapped _read",pe),se&&(se=!1,V.resume())},this},Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),k._fromList=G;function G(V,K){if(K.length===0)return null;var te;return K.objectMode?te=K.buffer.shift():!V||V>=K.length?(K.decoder?te=K.buffer.join(""):K.buffer.length===1?te=K.buffer.head.data:te=K.buffer.concat(K.length),K.buffer.clear()):te=C(V,K.buffer,K.decoder),te}function C(V,K,te){var se;return V<K.head.data.length?(se=K.head.data.slice(0,V),K.head.data=K.head.data.slice(V)):V===K.head.data.length?se=K.shift():se=te?p(V,K):q(V,K),se}function p(V,K){var te=K.head,se=1,le=te.data;for(V-=le.length;te=te.next;){var fe=te.data,pe=V>fe.length?fe.length:V;if(pe===fe.length?le+=fe:le+=fe.slice(0,V),V-=pe,V===0){pe===fe.length?(++se,te.next?K.head=te.next:K.head=K.tail=null):(K.head=te,te.data=fe.slice(pe));break}++se}return K.length-=se,le}function q(V,K){var te=i.allocUnsafe(V),se=K.head,le=1;for(se.data.copy(te),V-=se.data.length;se=se.next;){var fe=se.data,pe=V>fe.length?fe.length:V;if(fe.copy(te,te.length-V,0,pe),V-=pe,V===0){pe===fe.length?(++le,se.next?K.head=se.next:K.head=K.tail=null):(K.head=se,se.data=fe.slice(pe));break}++le}return K.length-=le,te}function ue(V){var K=V._readableState;if(K.length>0)throw new Error('"endReadable()" called on non-empty stream');K.endEmitted||(K.ended=!0,n.nextTick(he,K,V))}function he(V,K){!V.endEmitted&&V.length===0&&(V.endEmitted=!0,K.readable=!1,K.emit("end"))}function de(V,K){for(var te=0,se=V.length;te<se;te++)if(V[te]===K)return te;return-1}return Bn}var In,Fo;function Lo(){if(Fo)return In;Fo=1,In=r;var n=Xt(),e=Object.create(sr());e.inherits=dt(),e.inherits(r,n);function t(u,c){var h=this._transformState;h.transforming=!1;var f=h.writecb;if(!f)return this.emit("error",new Error("write callback called multiple times"));h.writechunk=null,h.writecb=null,c!=null&&this.push(c),f(u);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function r(u){if(!(this instanceof r))return new r(u);n.call(this,u),this._transformState={afterTransform:t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",a)}function a(){var u=this;typeof this._flush=="function"?this._flush(function(c,h){i(u,c,h)}):i(this,null,null)}r.prototype.push=function(u,c){return this._transformState.needTransform=!1,n.prototype.push.call(this,u,c)},r.prototype._transform=function(u,c,h){throw new Error("_transform() is not implemented")},r.prototype._write=function(u,c,h){var f=this._transformState;if(f.writecb=h,f.writechunk=u,f.writeencoding=c,!f.transforming){var o=this._readableState;(f.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},r.prototype._read=function(u){var c=this._transformState;c.writechunk!==null&&c.writecb&&!c.transforming?(c.transforming=!0,this._transform(c.writechunk,c.writeencoding,c.afterTransform)):c.needTransform=!0},r.prototype._destroy=function(u,c){var h=this;n.prototype._destroy.call(this,u,function(f){c(f),h.emit("close")})};function i(u,c,h){if(c)return u.emit("error",c);if(h!=null&&u.push(h),u._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(u._transformState.transforming)throw new Error("Calling transform done when still transforming");return u.push(null)}return In}var An,Uo;function Iu(){if(Uo)return An;Uo=1,An=t;var n=Lo(),e=Object.create(sr());e.inherits=dt(),e.inherits(t,n);function t(r){if(!(this instanceof t))return new t(r);n.call(this,r)}return t.prototype._transform=function(r,a,i){i(null,r)},An}var Ho;function Au(){return Ho||(Ho=1,function(n,e){e=n.exports=Co(),e.Stream=e,e.Readable=e,e.Writable=Ro(),e.Duplex=Xt(),e.Transform=Lo(),e.PassThrough=Iu()}(wr,wr.exports)),wr.exports}var On,Do;function qo(){if(Do)return On;Do=1;var n=bt().Buffer,e=xu(),t=Au().Transform,r=dt();function a(i){t.call(this),this._block=n.allocUnsafe(i),this._blockSize=i,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return r(a,t),a.prototype._transform=function(i,u,c){var h=null;try{this.update(i,u)}catch(f){h=f}c(h)},a.prototype._flush=function(i){var u=null;try{this.push(this.digest())}catch(c){u=c}i(u)},a.prototype.update=function(i,u){if(this._finalized)throw new Error("Digest already called");for(var c=e(i,u),h=this._block,f=0;this._blockOffset+c.length-f>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)h[o]=c[f],o+=1,f+=1;this._update(),this._blockOffset=0}for(;f<c.length;)h[this._blockOffset]=c[f],this._blockOffset+=1,f+=1;for(var v=0,w=c.length*8;w>0;++v)this._length[v]+=w,w=this._length[v]/4294967296|0,w>0&&(this._length[v]-=4294967296*w);return this},a.prototype._update=function(){throw new Error("_update is not implemented")},a.prototype.digest=function(i){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var u=this._digest();i!==void 0&&(u=u.toString(i)),this._block.fill(0),this._blockOffset=0;for(var c=0;c<4;++c)this._length[c]=0;return u},a.prototype._digest=function(){throw new Error("_digest is not implemented")},On=a,On}var Rn,Ko;function Ou(){if(Ko)return Rn;Ko=1;var n=dt(),e=qo(),t=bt().Buffer,r=new Array(16);function a(){e.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}n(a,e),a.prototype._update=function(){for(var o=r,v=0;v<16;++v)o[v]=this._block.readInt32LE(v*4);var w=this._a,A=this._b,B=this._c,x=this._d;w=u(w,A,B,x,o[0],3614090360,7),x=u(x,w,A,B,o[1],3905402710,12),B=u(B,x,w,A,o[2],606105819,17),A=u(A,B,x,w,o[3],3250441966,22),w=u(w,A,B,x,o[4],4118548399,7),x=u(x,w,A,B,o[5],1200080426,12),B=u(B,x,w,A,o[6],2821735955,17),A=u(A,B,x,w,o[7],4249261313,22),w=u(w,A,B,x,o[8],1770035416,7),x=u(x,w,A,B,o[9],2336552879,12),B=u(B,x,w,A,o[10],4294925233,17),A=u(A,B,x,w,o[11],2304563134,22),w=u(w,A,B,x,o[12],1804603682,7),x=u(x,w,A,B,o[13],4254626195,12),B=u(B,x,w,A,o[14],2792965006,17),A=u(A,B,x,w,o[15],1236535329,22),w=c(w,A,B,x,o[1],4129170786,5),x=c(x,w,A,B,o[6],3225465664,9),B=c(B,x,w,A,o[11],643717713,14),A=c(A,B,x,w,o[0],3921069994,20),w=c(w,A,B,x,o[5],3593408605,5),x=c(x,w,A,B,o[10],38016083,9),B=c(B,x,w,A,o[15],3634488961,14),A=c(A,B,x,w,o[4],3889429448,20),w=c(w,A,B,x,o[9],568446438,5),x=c(x,w,A,B,o[14],3275163606,9),B=c(B,x,w,A,o[3],4107603335,14),A=c(A,B,x,w,o[8],1163531501,20),w=c(w,A,B,x,o[13],2850285829,5),x=c(x,w,A,B,o[2],4243563512,9),B=c(B,x,w,A,o[7],1735328473,14),A=c(A,B,x,w,o[12],2368359562,20),w=h(w,A,B,x,o[5],4294588738,4),x=h(x,w,A,B,o[8],2272392833,11),B=h(B,x,w,A,o[11],1839030562,16),A=h(A,B,x,w,o[14],4259657740,23),w=h(w,A,B,x,o[1],2763975236,4),x=h(x,w,A,B,o[4],1272893353,11),B=h(B,x,w,A,o[7],4139469664,16),A=h(A,B,x,w,o[10],3200236656,23),w=h(w,A,B,x,o[13],681279174,4),x=h(x,w,A,B,o[0],3936430074,11),B=h(B,x,w,A,o[3],3572445317,16),A=h(A,B,x,w,o[6],76029189,23),w=h(w,A,B,x,o[9],3654602809,4),x=h(x,w,A,B,o[12],3873151461,11),B=h(B,x,w,A,o[15],530742520,16),A=h(A,B,x,w,o[2],3299628645,23),w=f(w,A,B,x,o[0],4096336452,6),x=f(x,w,A,B,o[7],1126891415,10),B=f(B,x,w,A,o[14],2878612391,15),A=f(A,B,x,w,o[5],4237533241,21),w=f(w,A,B,x,o[12],1700485571,6),x=f(x,w,A,B,o[3],2399980690,10),B=f(B,x,w,A,o[10],4293915773,15),A=f(A,B,x,w,o[1],2240044497,21),w=f(w,A,B,x,o[8],1873313359,6),x=f(x,w,A,B,o[15],4264355552,10),B=f(B,x,w,A,o[6],2734768916,15),A=f(A,B,x,w,o[13],1309151649,21),w=f(w,A,B,x,o[4],4149444226,6),x=f(x,w,A,B,o[11],3174756917,10),B=f(B,x,w,A,o[2],718787259,15),A=f(A,B,x,w,o[9],3951481745,21),this._a=this._a+w|0,this._b=this._b+A|0,this._c=this._c+B|0,this._d=this._d+x|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var o=t.allocUnsafe(16);return o.writeInt32LE(this._a,0),o.writeInt32LE(this._b,4),o.writeInt32LE(this._c,8),o.writeInt32LE(this._d,12),o};function i(o,v){return o<<v|o>>>32-v}function u(o,v,w,A,B,x,U){return i(o+(v&w|~v&A)+B+x|0,U)+v|0}function c(o,v,w,A,B,x,U){return i(o+(v&A|w&~A)+B+x|0,U)+v|0}function h(o,v,w,A,B,x,U){return i(o+(v^w^A)+B+x|0,U)+v|0}function f(o,v,w,A,B,x,U){return i(o+(w^(v|~A))+B+x|0,U)+v|0}return Rn=a,Rn}var Pn,Vo;function Ru(){if(Vo)return Pn;Vo=1;var n=Ou();return Pn=function(e){return new n().update(e).digest()},Pn}var kn,jo;function Pu(){if(jo)return kn;jo=1;var n=Jt().Buffer,e=dt(),t=qo(),r=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],i=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function o(P,k){return P<<k|P>>>32-k}function v(P,k,L,T,I,F,j,W){return o(P+(k^L^T)+F+j|0,W)+I|0}function w(P,k,L,T,I,F,j,W){return o(P+(k&L|~k&T)+F+j|0,W)+I|0}function A(P,k,L,T,I,F,j,W){return o(P+((k|~L)^T)+F+j|0,W)+I|0}function B(P,k,L,T,I,F,j,W){return o(P+(k&T|L&~T)+F+j|0,W)+I|0}function x(P,k,L,T,I,F,j,W){return o(P+(k^(L|~T))+F+j|0,W)+I|0}function U(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return e(U,t),U.prototype._update=function(){for(var P=r,k=0;k<16;++k)P[k]=this._block.readInt32LE(k*4);for(var L=this._a|0,T=this._b|0,I=this._c|0,F=this._d|0,j=this._e|0,W=this._a|0,Z=this._b|0,ne=this._c|0,ae=this._d|0,N=this._e|0,E=0;E<80;E+=1){var s,y;E<16?(s=v(L,T,I,F,j,P[a[E]],h[0],u[E]),y=x(W,Z,ne,ae,N,P[i[E]],f[0],c[E])):E<32?(s=w(L,T,I,F,j,P[a[E]],h[1],u[E]),y=B(W,Z,ne,ae,N,P[i[E]],f[1],c[E])):E<48?(s=A(L,T,I,F,j,P[a[E]],h[2],u[E]),y=A(W,Z,ne,ae,N,P[i[E]],f[2],c[E])):E<64?(s=B(L,T,I,F,j,P[a[E]],h[3],u[E]),y=w(W,Z,ne,ae,N,P[i[E]],f[3],c[E])):(s=x(L,T,I,F,j,P[a[E]],h[4],u[E]),y=v(W,Z,ne,ae,N,P[i[E]],f[4],c[E])),L=j,j=F,F=o(I,10),I=T,T=s,W=N,N=ae,ae=o(ne,10),ne=Z,Z=y}var S=this._b+I+ae|0;this._b=this._c+F+N|0,this._c=this._d+j+W|0,this._d=this._e+L+Z|0,this._e=this._a+T+ne|0,this._a=S},U.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var P=n.alloc?n.alloc(20):new n(20);return P.writeInt32LE(this._a,0),P.writeInt32LE(this._b,4),P.writeInt32LE(this._c,8),P.writeInt32LE(this._d,12),P.writeInt32LE(this._e,16),P},kn=U,kn}var Nn={exports:{}},Tn,zo;function Qt(){if(zo)return Tn;zo=1;var n=bt().Buffer,e=pn();function t(r,a){this._block=n.alloc(r),this._finalSize=a,this._blockSize=r,this._len=0}return t.prototype.update=function(r,a){r=e(r,a||"utf8");for(var i=this._block,u=this._blockSize,c=r.length,h=this._len,f=0;f<c;){for(var o=h%u,v=Math.min(c-f,u-o),w=0;w<v;w++)i[o+w]=r[f+w];h+=v,f+=v,h%u===0&&this._update(i)}return this._len+=c,this},t.prototype.digest=function(r){var a=this._len%this._blockSize;this._block[a]=128,this._block.fill(0,a+1),a>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=this._len*8;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var u=(i&4294967295)>>>0,c=(i-u)/4294967296;this._block.writeUInt32BE(c,this._blockSize-8),this._block.writeUInt32BE(u,this._blockSize-4)}this._update(this._block);var h=this._hash();return r?h.toString(r):h},t.prototype._update=function(){throw new Error("_update must be implemented by subclass")},Tn=t,Tn}var Mn,Go;function ku(){if(Go)return Mn;Go=1;var n=dt(),e=Qt(),t=bt().Buffer,r=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function i(){this.init(),this._w=a,e.call(this,64,56)}n(i,e),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(f){return f<<5|f>>>27}function c(f){return f<<30|f>>>2}function h(f,o,v,w){return f===0?o&v|~o&w:f===2?o&v|o&w|v&w:o^v^w}return i.prototype._update=function(f){for(var o=this._w,v=this._a|0,w=this._b|0,A=this._c|0,B=this._d|0,x=this._e|0,U=0;U<16;++U)o[U]=f.readInt32BE(U*4);for(;U<80;++U)o[U]=o[U-3]^o[U-8]^o[U-14]^o[U-16];for(var P=0;P<80;++P){var k=~~(P/20),L=u(v)+h(k,w,A,B)+x+o[P]+r[k]|0;x=B,B=A,A=c(w),w=v,v=L}this._a=v+this._a|0,this._b=w+this._b|0,this._c=A+this._c|0,this._d=B+this._d|0,this._e=x+this._e|0},i.prototype._hash=function(){var f=t.allocUnsafe(20);return f.writeInt32BE(this._a|0,0),f.writeInt32BE(this._b|0,4),f.writeInt32BE(this._c|0,8),f.writeInt32BE(this._d|0,12),f.writeInt32BE(this._e|0,16),f},Mn=i,Mn}var Cn,Yo;function Nu(){if(Yo)return Cn;Yo=1;var n=dt(),e=Qt(),t=bt().Buffer,r=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function i(){this.init(),this._w=a,e.call(this,64,56)}n(i,e),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(o){return o<<1|o>>>31}function c(o){return o<<5|o>>>27}function h(o){return o<<30|o>>>2}function f(o,v,w,A){return o===0?v&w|~v&A:o===2?v&w|v&A|w&A:v^w^A}return i.prototype._update=function(o){for(var v=this._w,w=this._a|0,A=this._b|0,B=this._c|0,x=this._d|0,U=this._e|0,P=0;P<16;++P)v[P]=o.readInt32BE(P*4);for(;P<80;++P)v[P]=u(v[P-3]^v[P-8]^v[P-14]^v[P-16]);for(var k=0;k<80;++k){var L=~~(k/20),T=c(w)+f(L,A,B,x)+U+v[k]+r[L]|0;U=x,x=B,B=h(A),A=w,w=T}this._a=w+this._a|0,this._b=A+this._b|0,this._c=B+this._c|0,this._d=x+this._d|0,this._e=U+this._e|0},i.prototype._hash=function(){var o=t.allocUnsafe(20);return o.writeInt32BE(this._a|0,0),o.writeInt32BE(this._b|0,4),o.writeInt32BE(this._c|0,8),o.writeInt32BE(this._d|0,12),o.writeInt32BE(this._e|0,16),o},Cn=i,Cn}var Fn,$o;function Jo(){if($o)return Fn;$o=1;var n=dt(),e=Qt(),t=bt().Buffer,r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function i(){this.init(),this._w=a,e.call(this,64,56)}n(i,e),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function u(w,A,B){return B^w&(A^B)}function c(w,A,B){return w&A|B&(w|A)}function h(w){return(w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10)}function f(w){return(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7)}function o(w){return(w>>>7|w<<25)^(w>>>18|w<<14)^w>>>3}function v(w){return(w>>>17|w<<15)^(w>>>19|w<<13)^w>>>10}return i.prototype._update=function(w){for(var A=this._w,B=this._a|0,x=this._b|0,U=this._c|0,P=this._d|0,k=this._e|0,L=this._f|0,T=this._g|0,I=this._h|0,F=0;F<16;++F)A[F]=w.readInt32BE(F*4);for(;F<64;++F)A[F]=v(A[F-2])+A[F-7]+o(A[F-15])+A[F-16]|0;for(var j=0;j<64;++j){var W=I+f(k)+u(k,L,T)+r[j]+A[j]|0,Z=h(B)+c(B,x,U)|0;I=T,T=L,L=k,k=P+W|0,P=U,U=x,x=B,B=W+Z|0}this._a=B+this._a|0,this._b=x+this._b|0,this._c=U+this._c|0,this._d=P+this._d|0,this._e=k+this._e|0,this._f=L+this._f|0,this._g=T+this._g|0,this._h=I+this._h|0},i.prototype._hash=function(){var w=t.allocUnsafe(32);return w.writeInt32BE(this._a,0),w.writeInt32BE(this._b,4),w.writeInt32BE(this._c,8),w.writeInt32BE(this._d,12),w.writeInt32BE(this._e,16),w.writeInt32BE(this._f,20),w.writeInt32BE(this._g,24),w.writeInt32BE(this._h,28),w},Fn=i,Fn}var Ln,Wo;function Tu(){if(Wo)return Ln;Wo=1;var n=dt(),e=Jo(),t=Qt(),r=bt().Buffer,a=new Array(64);function i(){this.init(),this._w=a,t.call(this,64,56)}return n(i,e),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var u=r.allocUnsafe(28);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u},Ln=i,Ln}var Un,Xo;function Qo(){if(Xo)return Un;Xo=1;var n=dt(),e=Qt(),t=bt().Buffer,r=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function i(){this.init(),this._w=a,e.call(this,128,112)}n(i,e),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function u(x,U,P){return P^x&(U^P)}function c(x,U,P){return x&U|P&(x|U)}function h(x,U){return(x>>>28|U<<4)^(U>>>2|x<<30)^(U>>>7|x<<25)}function f(x,U){return(x>>>14|U<<18)^(x>>>18|U<<14)^(U>>>9|x<<23)}function o(x,U){return(x>>>1|U<<31)^(x>>>8|U<<24)^x>>>7}function v(x,U){return(x>>>1|U<<31)^(x>>>8|U<<24)^(x>>>7|U<<25)}function w(x,U){return(x>>>19|U<<13)^(U>>>29|x<<3)^x>>>6}function A(x,U){return(x>>>19|U<<13)^(U>>>29|x<<3)^(x>>>6|U<<26)}function B(x,U){return x>>>0<U>>>0?1:0}return i.prototype._update=function(x){for(var U=this._w,P=this._ah|0,k=this._bh|0,L=this._ch|0,T=this._dh|0,I=this._eh|0,F=this._fh|0,j=this._gh|0,W=this._hh|0,Z=this._al|0,ne=this._bl|0,ae=this._cl|0,N=this._dl|0,E=this._el|0,s=this._fl|0,y=this._gl|0,S=this._hl|0,g=0;g<32;g+=2)U[g]=x.readInt32BE(g*4),U[g+1]=x.readInt32BE(g*4+4);for(;g<160;g+=2){var _=U[g-30],M=U[g-15*2+1],G=o(_,M),C=v(M,_);_=U[g-2*2],M=U[g-2*2+1];var p=w(_,M),q=A(M,_),ue=U[g-7*2],he=U[g-7*2+1],de=U[g-16*2],V=U[g-16*2+1],K=C+he|0,te=G+ue+B(K,C)|0;K=K+q|0,te=te+p+B(K,q)|0,K=K+V|0,te=te+de+B(K,V)|0,U[g]=te,U[g+1]=K}for(var se=0;se<160;se+=2){te=U[se],K=U[se+1];var le=c(P,k,L),fe=c(Z,ne,ae),pe=h(P,Z),xe=h(Z,P),Ie=f(I,E),Me=f(E,I),Re=r[se],Ce=r[se+1],ft=u(I,F,j),ke=u(E,s,y),me=S+Me|0,Oe=W+Ie+B(me,S)|0;me=me+ke|0,Oe=Oe+ft+B(me,ke)|0,me=me+Ce|0,Oe=Oe+Re+B(me,Ce)|0,me=me+K|0,Oe=Oe+te+B(me,K)|0;var ye=xe+fe|0,Se=pe+le+B(ye,xe)|0;W=j,S=y,j=F,y=s,F=I,s=E,E=N+me|0,I=T+Oe+B(E,N)|0,T=L,N=ae,L=k,ae=ne,k=P,ne=Z,Z=me+ye|0,P=Oe+Se+B(Z,me)|0}this._al=this._al+Z|0,this._bl=this._bl+ne|0,this._cl=this._cl+ae|0,this._dl=this._dl+N|0,this._el=this._el+E|0,this._fl=this._fl+s|0,this._gl=this._gl+y|0,this._hl=this._hl+S|0,this._ah=this._ah+P+B(this._al,Z)|0,this._bh=this._bh+k+B(this._bl,ne)|0,this._ch=this._ch+L+B(this._cl,ae)|0,this._dh=this._dh+T+B(this._dl,N)|0,this._eh=this._eh+I+B(this._el,E)|0,this._fh=this._fh+F+B(this._fl,s)|0,this._gh=this._gh+j+B(this._gl,y)|0,this._hh=this._hh+W+B(this._hl,S)|0},i.prototype._hash=function(){var x=t.allocUnsafe(64);function U(P,k,L){x.writeInt32BE(P,L),x.writeInt32BE(k,L+4)}return U(this._ah,this._al,0),U(this._bh,this._bl,8),U(this._ch,this._cl,16),U(this._dh,this._dl,24),U(this._eh,this._el,32),U(this._fh,this._fl,40),U(this._gh,this._gl,48),U(this._hh,this._hl,56),x},Un=i,Un}var Hn,Zo;function Mu(){if(Zo)return Hn;Zo=1;var n=dt(),e=Qo(),t=Qt(),r=bt().Buffer,a=new Array(160);function i(){this.init(),this._w=a,t.call(this,128,112)}return n(i,e),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){var u=r.allocUnsafe(48);function c(h,f,o){u.writeInt32BE(h,o),u.writeInt32BE(f,o+4)}return c(this._ah,this._al,0),c(this._bh,this._bl,8),c(this._ch,this._cl,16),c(this._dh,this._dl,24),c(this._eh,this._el,32),c(this._fh,this._fl,40),u},Hn=i,Hn}var ef;function Cu(){return ef||(ef=1,function(n){n.exports=function(t){var r=t.toLowerCase(),a=n.exports[r];if(!a)throw new Error(r+" is not supported (we accept pull requests)");return new a},n.exports.sha=ku(),n.exports.sha1=Nu(),n.exports.sha224=Tu(),n.exports.sha256=Jo(),n.exports.sha384=Mu(),n.exports.sha512=Qo()}(Nn)),Nn.exports}var Dn,tf;function rf(){if(tf)return Dn;tf=1;var n=bt().Buffer,e=pn(),t=typeof Uint8Array<"u",r=t&&typeof ArrayBuffer<"u",a=r&&ArrayBuffer.isView;return Dn=function(i,u,c){if(typeof i=="string"||n.isBuffer(i)||t&&i instanceof Uint8Array||a&&a(i))return e(i,u);throw new TypeError(c+" must be a string, a Buffer, a Uint8Array, or a DataView")},Dn}var qn,nf;function af(){if(nf)return qn;nf=1;var n=Ru(),e=Pu(),t=Cu(),r=bt().Buffer,a=is(),i=us(),u=rf(),c=r.alloc(128),h={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},f={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function o(B){return new e().update(B).digest()}function v(B){function x(U){return t(B).update(U).digest()}return B==="rmd160"||B==="ripemd160"?o:B==="md5"?n:x}function w(B,x,U){var P=v(B),k=B==="sha512"||B==="sha384"?128:64;x.length>k?x=P(x):x.length<k&&(x=r.concat([x,c],k));for(var L=r.allocUnsafe(k+h[B]),T=r.allocUnsafe(k+h[B]),I=0;I<k;I++)L[I]=x[I]^54,T[I]=x[I]^92;var F=r.allocUnsafe(k+U+4);L.copy(F,0,0,k),this.ipad1=F,this.ipad2=L,this.opad=T,this.alg=B,this.blocksize=k,this.hash=P,this.size=h[B]}w.prototype.run=function(B,x){B.copy(x,this.blocksize);var U=this.hash(x);return U.copy(this.opad,this.blocksize),this.hash(this.opad)};function A(B,x,U,P,k){a(U,P),B=u(B,i,"Password"),x=u(x,i,"Salt");var L=(k||"sha1").toLowerCase(),T=f[L]||L,I=h[T];if(typeof I!="number"||!I)throw new TypeError("Digest algorithm not supported: "+k);var F=new w(T,B,x.length),j=r.allocUnsafe(P),W=r.allocUnsafe(x.length+4);x.copy(W,0,0,x.length);for(var Z=0,ne=I,ae=Math.ceil(P/ne),N=1;N<=ae;N++){W.writeUInt32BE(N,x.length);for(var E=F.run(W,F.ipad1),s=E,y=1;y<U;y++){s=F.run(s,F.ipad2);for(var S=0;S<ne;S++)E[S]^=s[S]}E.copy(j,Z),Z+=ne}return j}return qn=A,qn}var Kn,sf;function Fu(){if(sf)return Kn;sf=1;var n=bt().Buffer,e=is(),t=us(),r=af(),a=rf(),i,u=He.crypto&&He.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[],f;function o(){return f||(He.process&&He.process.nextTick?f=He.process.nextTick:He.queueMicrotask?f=He.queueMicrotask:He.setImmediate?f=He.setImmediate:f=He.setTimeout,f)}function v(B,x,U,P,k){return u.importKey("raw",B,{name:"PBKDF2"},!1,["deriveBits"]).then(function(L){return u.deriveBits({name:"PBKDF2",salt:x,iterations:U,hash:{name:k}},L,P<<3)}).then(function(L){return n.from(L)})}function w(B){if(He.process&&!He.process.browser||!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(h[B]!==void 0)return h[B];i=i||n.alloc(8);var x=v(i,i,10,128,B).then(function(){return!0},function(){return!1});return h[B]=x,x}function A(B,x){B.then(function(U){o()(function(){x(null,U)})},function(U){o()(function(){x(U)})})}return Kn=function(B,x,U,P,k,L){if(typeof k=="function"&&(L=k,k=void 0),e(U,P),B=a(B,t,"Password"),x=a(x,t,"Salt"),typeof L!="function")throw new Error("No callback provided to pbkdf2");k=k||"sha1";var T=c[k.toLowerCase()];if(!T||typeof He.Promise!="function"){o()(function(){var I;try{I=r(B,x,U,P,k)}catch(F){L(F);return}L(null,I)});return}A(w(T).then(function(I){return I?v(B,x,U,P,T):r(B,x,U,P,k)}),L)},Kn}var of;function Lu(){return of||(of=1,mr.pbkdf2=Fu(),mr.pbkdf2Sync=af()),mr}var Uu=Lu();const ff=$t(Uu);var Vn={},Ir={};Ir.byteLength=qu,Ir.toByteArray=Vu,Ir.fromByteArray=Gu;for(var Nt=[],wt=[],Hu=typeof Uint8Array<"u"?Uint8Array:Array,jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zt=0,Du=jn.length;Zt<Du;++Zt)Nt[Zt]=jn[Zt],wt[jn.charCodeAt(Zt)]=Zt;wt[45]=62,wt[95]=63;function uf(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function qu(n){var e=uf(n),t=e[0],r=e[1];return(t+r)*3/4-r}function Ku(n,e,t){return(e+t)*3/4-t}function Vu(n){var e,t=uf(n),r=t[0],a=t[1],i=new Hu(Ku(n,r,a)),u=0,c=a>0?r-4:r,h;for(h=0;h<c;h+=4)e=wt[n.charCodeAt(h)]<<18|wt[n.charCodeAt(h+1)]<<12|wt[n.charCodeAt(h+2)]<<6|wt[n.charCodeAt(h+3)],i[u++]=e>>16&255,i[u++]=e>>8&255,i[u++]=e&255;return a===2&&(e=wt[n.charCodeAt(h)]<<2|wt[n.charCodeAt(h+1)]>>4,i[u++]=e&255),a===1&&(e=wt[n.charCodeAt(h)]<<10|wt[n.charCodeAt(h+1)]<<4|wt[n.charCodeAt(h+2)]>>2,i[u++]=e>>8&255,i[u++]=e&255),i}function ju(n){return Nt[n>>18&63]+Nt[n>>12&63]+Nt[n>>6&63]+Nt[n&63]}function zu(n,e,t){for(var r,a=[],i=e;i<t;i+=3)r=(n[i]<<16&16711680)+(n[i+1]<<8&65280)+(n[i+2]&255),a.push(ju(r));return a.join("")}function Gu(n){for(var e,t=n.length,r=t%3,a=[],i=16383,u=0,c=t-r;u<c;u+=i)a.push(zu(n,u,u+i>c?c:u+i));return r===1?(e=n[t-1],a.push(Nt[e>>2]+Nt[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],a.push(Nt[e>>10]+Nt[e>>4&63]+Nt[e<<2&63]+"=")),a.join("")}var zn={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */zn.read=function(n,e,t,r,a){var i,u,c=a*8-r-1,h=(1<<c)-1,f=h>>1,o=-7,v=t?a-1:0,w=t?-1:1,A=n[e+v];for(v+=w,i=A&(1<<-o)-1,A>>=-o,o+=c;o>0;i=i*256+n[e+v],v+=w,o-=8);for(u=i&(1<<-o)-1,i>>=-o,o+=r;o>0;u=u*256+n[e+v],v+=w,o-=8);if(i===0)i=1-f;else{if(i===h)return u?NaN:(A?-1:1)*(1/0);u=u+Math.pow(2,r),i=i-f}return(A?-1:1)*u*Math.pow(2,i-r)},zn.write=function(n,e,t,r,a,i){var u,c,h,f=i*8-a-1,o=(1<<f)-1,v=o>>1,w=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:i-1,B=r?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,u=o):(u=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+v>=1?e+=w/h:e+=w*Math.pow(2,1-v),e*h>=2&&(u++,h/=2),u+v>=o?(c=0,u=o):u+v>=1?(c=(e*h-1)*Math.pow(2,a),u=u+v):(c=e*Math.pow(2,v-1)*Math.pow(2,a),u=0));a>=8;n[t+A]=c&255,A+=B,c/=256,a-=8);for(u=u<<a|c,f+=a;f>0;n[t+A]=u&255,A+=B,u/=256,f-=8);n[t+A-B]|=x*128};/*!
17
7
  * The buffer module from node.js, for the browser.
18
8
  *
19
9
  * @author Feross Aboukhadijeh <https://feross.org>
20
10
  * @license MIT
21
- */(function(M){const a=gi,c=bf,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;M.Buffer=d,M.SlowBuffer=L,M.INSPECT_MAX_BYTES=50;const x=2147483647;M.kMaxLength=x;const{Uint8Array:n,ArrayBuffer:g,SharedArrayBuffer:y}=globalThis;d.TYPED_ARRAY_SUPPORT=b(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function b(){try{const z=new n(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,n.prototype),Object.setPrototypeOf(z,T),z.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function v(z){if(z>x)throw new RangeError('The value "'+z+'" is invalid for option "size"');const T=new n(z);return Object.setPrototypeOf(T,d.prototype),T}function d(z,T,D){if(typeof z=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(z)}return w(z,T,D)}d.poolSize=8192;function w(z,T,D){if(typeof z=="string")return A(z,T);if(g.isView(z))return I(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(_e(z,g)||z&&_e(z.buffer,g)||typeof y<"u"&&(_e(z,y)||z&&_e(z.buffer,y)))return k(z,T,D);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const W=z.valueOf&&z.valueOf();if(W!=null&&W!==z)return d.from(W,T,D);const re=F(z);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return d.from(z[Symbol.toPrimitive]("string"),T,D);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}d.from=function(z,T,D){return w(z,T,D)},Object.setPrototypeOf(d.prototype,n.prototype),Object.setPrototypeOf(d,n);function _(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function E(z,T,D){return _(z),z<=0?v(z):T!==void 0?typeof D=="string"?v(z).fill(T,D):v(z).fill(T):v(z)}d.alloc=function(z,T,D){return E(z,T,D)};function B(z){return _(z),v(z<0?0:q(z)|0)}d.allocUnsafe=function(z){return B(z)},d.allocUnsafeSlow=function(z){return B(z)};function A(z,T){if((typeof T!="string"||T==="")&&(T="utf8"),!d.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const D=V(z,T)|0;let W=v(D);const re=W.write(z,T);return re!==D&&(W=W.slice(0,re)),W}function P(z){const T=z.length<0?0:q(z.length)|0,D=v(T);for(let W=0;W<T;W+=1)D[W]=z[W]&255;return D}function I(z){if(_e(z,n)){const T=new n(z);return k(T.buffer,T.byteOffset,T.byteLength)}return P(z)}function k(z,T,D){if(T<0||z.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<T+(D||0))throw new RangeError('"length" is outside of buffer bounds');let W;return T===void 0&&D===void 0?W=new n(z):D===void 0?W=new n(z,T):W=new n(z,T,D),Object.setPrototypeOf(W,d.prototype),W}function F(z){if(d.isBuffer(z)){const T=q(z.length)|0,D=v(T);return D.length===0||z.copy(D,0,0,T),D}if(z.length!==void 0)return typeof z.length!="number"||Ge(z.length)?v(0):P(z);if(z.type==="Buffer"&&Array.isArray(z.data))return P(z.data)}function q(z){if(z>=x)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+x.toString(16)+" bytes");return z|0}function L(z){return+z!=z&&(z=0),d.alloc(+z)}d.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==d.prototype},d.compare=function(T,D){if(_e(T,n)&&(T=d.from(T,T.offset,T.byteLength)),_e(D,n)&&(D=d.from(D,D.offset,D.byteLength)),!d.isBuffer(T)||!d.isBuffer(D))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===D)return 0;let W=T.length,re=D.length;for(let pe=0,ae=Math.min(W,re);pe<ae;++pe)if(T[pe]!==D[pe]){W=T[pe],re=D[pe];break}return W<re?-1:re<W?1:0},d.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}},d.concat=function(T,D){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return d.alloc(0);let W;if(D===void 0)for(D=0,W=0;W<T.length;++W)D+=T[W].length;const re=d.allocUnsafe(D);let pe=0;for(W=0;W<T.length;++W){let ae=T[W];if(_e(ae,n))pe+ae.length>re.length?(d.isBuffer(ae)||(ae=d.from(ae)),ae.copy(re,pe)):n.prototype.set.call(re,ae,pe);else if(d.isBuffer(ae))ae.copy(re,pe);else throw new TypeError('"list" argument must be an Array of Buffers');pe+=ae.length}return re};function V(z,T){if(d.isBuffer(z))return z.length;if(g.isView(z)||_e(z,g))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);const D=z.length,W=arguments.length>2&&arguments[2]===!0;if(!W&&D===0)return 0;let re=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return D;case"utf8":case"utf-8":return Ue(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D*2;case"hex":return D>>>1;case"base64":return De(z).length;default:if(re)return W?-1:Ue(z).length;T=(""+T).toLowerCase(),re=!0}}d.byteLength=V;function ee(z,T,D){let W=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((D===void 0||D>this.length)&&(D=this.length),D<=0)||(D>>>=0,T>>>=0,D<=T))return"";for(z||(z="utf8");;)switch(z){case"hex":return S(this,T,D);case"utf8":case"utf-8":return l(this,T,D);case"ascii":return t(this,T,D);case"latin1":case"binary":return u(this,T,D);case"base64":return h(this,T,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,T,D);default:if(W)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),W=!0}}d.prototype._isBuffer=!0;function ne(z,T,D){const W=z[T];z[T]=z[D],z[D]=W}d.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let D=0;D<T;D+=2)ne(this,D,D+1);return this},d.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let D=0;D<T;D+=4)ne(this,D,D+3),ne(this,D+1,D+2);return this},d.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let D=0;D<T;D+=8)ne(this,D,D+7),ne(this,D+1,D+6),ne(this,D+2,D+5),ne(this,D+3,D+4);return this},d.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?l(this,0,T):ee.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(T){if(!d.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:d.compare(this,T)===0},d.prototype.inspect=function(){let T="";const D=M.INSPECT_MAX_BYTES;return T=this.toString("hex",0,D).replace(/(.{2})/g,"$1 ").trim(),this.length>D&&(T+=" ... "),"<Buffer "+T+">"},o&&(d.prototype[o]=d.prototype.inspect),d.prototype.compare=function(T,D,W,re,pe){if(_e(T,n)&&(T=d.from(T,T.offset,T.byteLength)),!d.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(D===void 0&&(D=0),W===void 0&&(W=T?T.length:0),re===void 0&&(re=0),pe===void 0&&(pe=this.length),D<0||W>T.length||re<0||pe>this.length)throw new RangeError("out of range index");if(re>=pe&&D>=W)return 0;if(re>=pe)return-1;if(D>=W)return 1;if(D>>>=0,W>>>=0,re>>>=0,pe>>>=0,this===T)return 0;let ae=pe-re,Me=W-D;const ze=Math.min(ae,Me),ye=this.slice(re,pe),Be=T.slice(D,W);for(let He=0;He<ze;++He)if(ye[He]!==Be[He]){ae=ye[He],Me=Be[He];break}return ae<Me?-1:Me<ae?1:0};function J(z,T,D,W,re){if(z.length===0)return-1;if(typeof D=="string"?(W=D,D=0):D>2147483647?D=2147483647:D<-2147483648&&(D=-2147483648),D=+D,Ge(D)&&(D=re?0:z.length-1),D<0&&(D=z.length+D),D>=z.length){if(re)return-1;D=z.length-1}else if(D<0)if(re)D=0;else return-1;if(typeof T=="string"&&(T=d.from(T,W)),d.isBuffer(T))return T.length===0?-1:ue(z,T,D,W,re);if(typeof T=="number")return T=T&255,typeof n.prototype.indexOf=="function"?re?n.prototype.indexOf.call(z,T,D):n.prototype.lastIndexOf.call(z,T,D):ue(z,[T],D,W,re);throw new TypeError("val must be string, number or Buffer")}function ue(z,T,D,W,re){let pe=1,ae=z.length,Me=T.length;if(W!==void 0&&(W=String(W).toLowerCase(),W==="ucs2"||W==="ucs-2"||W==="utf16le"||W==="utf-16le")){if(z.length<2||T.length<2)return-1;pe=2,ae/=2,Me/=2,D/=2}function ze(Be,He){return pe===1?Be[He]:Be.readUInt16BE(He*pe)}let ye;if(re){let Be=-1;for(ye=D;ye<ae;ye++)if(ze(z,ye)===ze(T,Be===-1?0:ye-Be)){if(Be===-1&&(Be=ye),ye-Be+1===Me)return Be*pe}else Be!==-1&&(ye-=ye-Be),Be=-1}else for(D+Me>ae&&(D=ae-Me),ye=D;ye>=0;ye--){let Be=!0;for(let He=0;He<Me;He++)if(ze(z,ye+He)!==ze(T,He)){Be=!1;break}if(Be)return ye}return-1}d.prototype.includes=function(T,D,W){return this.indexOf(T,D,W)!==-1},d.prototype.indexOf=function(T,D,W){return J(this,T,D,W,!0)},d.prototype.lastIndexOf=function(T,D,W){return J(this,T,D,W,!1)};function m(z,T,D,W){D=Number(D)||0;const re=z.length-D;W?(W=Number(W),W>re&&(W=re)):W=re;const pe=T.length;W>pe/2&&(W=pe/2);let ae;for(ae=0;ae<W;++ae){const Me=parseInt(T.substr(ae*2,2),16);if(Ge(Me))return ae;z[D+ae]=Me}return ae}function e(z,T,D,W){return ve(Ue(T,z.length-D),z,D,W)}function r(z,T,D,W){return ve(de(T),z,D,W)}function i(z,T,D,W){return ve(De(T),z,D,W)}function f(z,T,D,W){return ve(ge(T,z.length-D),z,D,W)}d.prototype.write=function(T,D,W,re){if(D===void 0)re="utf8",W=this.length,D=0;else if(W===void 0&&typeof D=="string")re=D,W=this.length,D=0;else if(isFinite(D))D=D>>>0,isFinite(W)?(W=W>>>0,re===void 0&&(re="utf8")):(re=W,W=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const pe=this.length-D;if((W===void 0||W>pe)&&(W=pe),T.length>0&&(W<0||D<0)||D>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let ae=!1;for(;;)switch(re){case"hex":return m(this,T,D,W);case"utf8":case"utf-8":return e(this,T,D,W);case"ascii":case"latin1":case"binary":return r(this,T,D,W);case"base64":return i(this,T,D,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,T,D,W);default:if(ae)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),ae=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function h(z,T,D){return T===0&&D===z.length?a.fromByteArray(z):a.fromByteArray(z.slice(T,D))}function l(z,T,D){D=Math.min(z.length,D);const W=[];let re=T;for(;re<D;){const pe=z[re];let ae=null,Me=pe>239?4:pe>223?3:pe>191?2:1;if(re+Me<=D){let ze,ye,Be,He;switch(Me){case 1:pe<128&&(ae=pe);break;case 2:ze=z[re+1],(ze&192)===128&&(He=(pe&31)<<6|ze&63,He>127&&(ae=He));break;case 3:ze=z[re+1],ye=z[re+2],(ze&192)===128&&(ye&192)===128&&(He=(pe&15)<<12|(ze&63)<<6|ye&63,He>2047&&(He<55296||He>57343)&&(ae=He));break;case 4:ze=z[re+1],ye=z[re+2],Be=z[re+3],(ze&192)===128&&(ye&192)===128&&(Be&192)===128&&(He=(pe&15)<<18|(ze&63)<<12|(ye&63)<<6|Be&63,He>65535&&He<1114112&&(ae=He))}}ae===null?(ae=65533,Me=1):ae>65535&&(ae-=65536,W.push(ae>>>10&1023|55296),ae=56320|ae&1023),W.push(ae),re+=Me}return s(W)}const p=4096;function s(z){const T=z.length;if(T<=p)return String.fromCharCode.apply(String,z);let D="",W=0;for(;W<T;)D+=String.fromCharCode.apply(String,z.slice(W,W+=p));return D}function t(z,T,D){let W="";D=Math.min(z.length,D);for(let re=T;re<D;++re)W+=String.fromCharCode(z[re]&127);return W}function u(z,T,D){let W="";D=Math.min(z.length,D);for(let re=T;re<D;++re)W+=String.fromCharCode(z[re]);return W}function S(z,T,D){const W=z.length;(!T||T<0)&&(T=0),(!D||D<0||D>W)&&(D=W);let re="";for(let pe=T;pe<D;++pe)re+=Se[z[pe]];return re}function O(z,T,D){const W=z.slice(T,D);let re="";for(let pe=0;pe<W.length-1;pe+=2)re+=String.fromCharCode(W[pe]+W[pe+1]*256);return re}d.prototype.slice=function(T,D){const W=this.length;T=~~T,D=D===void 0?W:~~D,T<0?(T+=W,T<0&&(T=0)):T>W&&(T=W),D<0?(D+=W,D<0&&(D=0)):D>W&&(D=W),D<T&&(D=T);const re=this.subarray(T,D);return Object.setPrototypeOf(re,d.prototype),re};function H(z,T,D){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+T>D)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(T,D,W){T=T>>>0,D=D>>>0,W||H(T,D,this.length);let re=this[T],pe=1,ae=0;for(;++ae<D&&(pe*=256);)re+=this[T+ae]*pe;return re},d.prototype.readUintBE=d.prototype.readUIntBE=function(T,D,W){T=T>>>0,D=D>>>0,W||H(T,D,this.length);let re=this[T+--D],pe=1;for(;D>0&&(pe*=256);)re+=this[T+--D]*pe;return re},d.prototype.readUint8=d.prototype.readUInt8=function(T,D){return T=T>>>0,D||H(T,1,this.length),this[T]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(T,D){return T=T>>>0,D||H(T,2,this.length),this[T]|this[T+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(T,D){return T=T>>>0,D||H(T,2,this.length),this[T]<<8|this[T+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(T,D){return T=T>>>0,D||H(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(T,D){return T=T>>>0,D||H(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},d.prototype.readBigUInt64LE=Oe(function(T){T=T>>>0,ce(T,"offset");const D=this[T],W=this[T+7];(D===void 0||W===void 0)&&Le(T,this.length-8);const re=D+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,pe=this[++T]+this[++T]*2**8+this[++T]*2**16+W*2**24;return BigInt(re)+(BigInt(pe)<<BigInt(32))}),d.prototype.readBigUInt64BE=Oe(function(T){T=T>>>0,ce(T,"offset");const D=this[T],W=this[T+7];(D===void 0||W===void 0)&&Le(T,this.length-8);const re=D*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],pe=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+W;return(BigInt(re)<<BigInt(32))+BigInt(pe)}),d.prototype.readIntLE=function(T,D,W){T=T>>>0,D=D>>>0,W||H(T,D,this.length);let re=this[T],pe=1,ae=0;for(;++ae<D&&(pe*=256);)re+=this[T+ae]*pe;return pe*=128,re>=pe&&(re-=Math.pow(2,8*D)),re},d.prototype.readIntBE=function(T,D,W){T=T>>>0,D=D>>>0,W||H(T,D,this.length);let re=D,pe=1,ae=this[T+--re];for(;re>0&&(pe*=256);)ae+=this[T+--re]*pe;return pe*=128,ae>=pe&&(ae-=Math.pow(2,8*D)),ae},d.prototype.readInt8=function(T,D){return T=T>>>0,D||H(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},d.prototype.readInt16LE=function(T,D){T=T>>>0,D||H(T,2,this.length);const W=this[T]|this[T+1]<<8;return W&32768?W|4294901760:W},d.prototype.readInt16BE=function(T,D){T=T>>>0,D||H(T,2,this.length);const W=this[T+1]|this[T]<<8;return W&32768?W|4294901760:W},d.prototype.readInt32LE=function(T,D){return T=T>>>0,D||H(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},d.prototype.readInt32BE=function(T,D){return T=T>>>0,D||H(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},d.prototype.readBigInt64LE=Oe(function(T){T=T>>>0,ce(T,"offset");const D=this[T],W=this[T+7];(D===void 0||W===void 0)&&Le(T,this.length-8);const re=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(W<<24);return(BigInt(re)<<BigInt(32))+BigInt(D+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),d.prototype.readBigInt64BE=Oe(function(T){T=T>>>0,ce(T,"offset");const D=this[T],W=this[T+7];(D===void 0||W===void 0)&&Le(T,this.length-8);const re=(D<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(re)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+W)}),d.prototype.readFloatLE=function(T,D){return T=T>>>0,D||H(T,4,this.length),c.read(this,T,!0,23,4)},d.prototype.readFloatBE=function(T,D){return T=T>>>0,D||H(T,4,this.length),c.read(this,T,!1,23,4)},d.prototype.readDoubleLE=function(T,D){return T=T>>>0,D||H(T,8,this.length),c.read(this,T,!0,52,8)},d.prototype.readDoubleBE=function(T,D){return T=T>>>0,D||H(T,8,this.length),c.read(this,T,!1,52,8)};function Q(z,T,D,W,re,pe){if(!d.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>re||T<pe)throw new RangeError('"value" argument is out of bounds');if(D+W>z.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(T,D,W,re){if(T=+T,D=D>>>0,W=W>>>0,!re){const Me=Math.pow(2,8*W)-1;Q(this,T,D,W,Me,0)}let pe=1,ae=0;for(this[D]=T&255;++ae<W&&(pe*=256);)this[D+ae]=T/pe&255;return D+W},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(T,D,W,re){if(T=+T,D=D>>>0,W=W>>>0,!re){const Me=Math.pow(2,8*W)-1;Q(this,T,D,W,Me,0)}let pe=W-1,ae=1;for(this[D+pe]=T&255;--pe>=0&&(ae*=256);)this[D+pe]=T/ae&255;return D+W},d.prototype.writeUint8=d.prototype.writeUInt8=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,1,255,0),this[D]=T&255,D+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,2,65535,0),this[D]=T&255,this[D+1]=T>>>8,D+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,2,65535,0),this[D]=T>>>8,this[D+1]=T&255,D+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,4,4294967295,0),this[D+3]=T>>>24,this[D+2]=T>>>16,this[D+1]=T>>>8,this[D]=T&255,D+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,4,4294967295,0),this[D]=T>>>24,this[D+1]=T>>>16,this[D+2]=T>>>8,this[D+3]=T&255,D+4};function G(z,T,D,W,re){le(T,W,re,z,D,7);let pe=Number(T&BigInt(4294967295));z[D++]=pe,pe=pe>>8,z[D++]=pe,pe=pe>>8,z[D++]=pe,pe=pe>>8,z[D++]=pe;let ae=Number(T>>BigInt(32)&BigInt(4294967295));return z[D++]=ae,ae=ae>>8,z[D++]=ae,ae=ae>>8,z[D++]=ae,ae=ae>>8,z[D++]=ae,D}function R(z,T,D,W,re){le(T,W,re,z,D,7);let pe=Number(T&BigInt(4294967295));z[D+7]=pe,pe=pe>>8,z[D+6]=pe,pe=pe>>8,z[D+5]=pe,pe=pe>>8,z[D+4]=pe;let ae=Number(T>>BigInt(32)&BigInt(4294967295));return z[D+3]=ae,ae=ae>>8,z[D+2]=ae,ae=ae>>8,z[D+1]=ae,ae=ae>>8,z[D]=ae,D+8}d.prototype.writeBigUInt64LE=Oe(function(T,D=0){return G(this,T,D,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=Oe(function(T,D=0){return R(this,T,D,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(T,D,W,re){if(T=+T,D=D>>>0,!re){const ze=Math.pow(2,8*W-1);Q(this,T,D,W,ze-1,-ze)}let pe=0,ae=1,Me=0;for(this[D]=T&255;++pe<W&&(ae*=256);)T<0&&Me===0&&this[D+pe-1]!==0&&(Me=1),this[D+pe]=(T/ae>>0)-Me&255;return D+W},d.prototype.writeIntBE=function(T,D,W,re){if(T=+T,D=D>>>0,!re){const ze=Math.pow(2,8*W-1);Q(this,T,D,W,ze-1,-ze)}let pe=W-1,ae=1,Me=0;for(this[D+pe]=T&255;--pe>=0&&(ae*=256);)T<0&&Me===0&&this[D+pe+1]!==0&&(Me=1),this[D+pe]=(T/ae>>0)-Me&255;return D+W},d.prototype.writeInt8=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,1,127,-128),T<0&&(T=255+T+1),this[D]=T&255,D+1},d.prototype.writeInt16LE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,2,32767,-32768),this[D]=T&255,this[D+1]=T>>>8,D+2},d.prototype.writeInt16BE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,2,32767,-32768),this[D]=T>>>8,this[D+1]=T&255,D+2},d.prototype.writeInt32LE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,4,2147483647,-2147483648),this[D]=T&255,this[D+1]=T>>>8,this[D+2]=T>>>16,this[D+3]=T>>>24,D+4},d.prototype.writeInt32BE=function(T,D,W){return T=+T,D=D>>>0,W||Q(this,T,D,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[D]=T>>>24,this[D+1]=T>>>16,this[D+2]=T>>>8,this[D+3]=T&255,D+4},d.prototype.writeBigInt64LE=Oe(function(T,D=0){return G(this,T,D,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=Oe(function(T,D=0){return R(this,T,D,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(z,T,D,W,re,pe){if(D+W>z.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("Index out of range")}function $(z,T,D,W,re){return T=+T,D=D>>>0,re||C(z,T,D,4),c.write(z,T,D,W,23,4),D+4}d.prototype.writeFloatLE=function(T,D,W){return $(this,T,D,!0,W)},d.prototype.writeFloatBE=function(T,D,W){return $(this,T,D,!1,W)};function X(z,T,D,W,re){return T=+T,D=D>>>0,re||C(z,T,D,8),c.write(z,T,D,W,52,8),D+8}d.prototype.writeDoubleLE=function(T,D,W){return X(this,T,D,!0,W)},d.prototype.writeDoubleBE=function(T,D,W){return X(this,T,D,!1,W)},d.prototype.copy=function(T,D,W,re){if(!d.isBuffer(T))throw new TypeError("argument should be a Buffer");if(W||(W=0),!re&&re!==0&&(re=this.length),D>=T.length&&(D=T.length),D||(D=0),re>0&&re<W&&(re=W),re===W||T.length===0||this.length===0)return 0;if(D<0)throw new RangeError("targetStart out of bounds");if(W<0||W>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),T.length-D<re-W&&(re=T.length-D+W);const pe=re-W;return this===T&&typeof n.prototype.copyWithin=="function"?this.copyWithin(D,W,re):n.prototype.set.call(T,this.subarray(W,re),D),pe},d.prototype.fill=function(T,D,W,re){if(typeof T=="string"){if(typeof D=="string"?(re=D,D=0,W=this.length):typeof W=="string"&&(re=W,W=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!d.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(T.length===1){const ae=T.charCodeAt(0);(re==="utf8"&&ae<128||re==="latin1")&&(T=ae)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(D<0||this.length<D||this.length<W)throw new RangeError("Out of range index");if(W<=D)return this;D=D>>>0,W=W===void 0?this.length:W>>>0,T||(T=0);let pe;if(typeof T=="number")for(pe=D;pe<W;++pe)this[pe]=T;else{const ae=d.isBuffer(T)?T:d.from(T,re),Me=ae.length;if(Me===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(pe=0;pe<W-D;++pe)this[pe+D]=ae[pe%Me]}return this};const Z={};function K(z,T,D){Z[z]=class extends D{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${z}]`,this.stack,delete this.name}get code(){return z}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${z}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?`${z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(z,T){return`The "${z}" argument must be of type number. Received type ${typeof T}`},TypeError),K("ERR_OUT_OF_RANGE",function(z,T,D){let W=`The value of "${z}" is out of range.`,re=D;return Number.isInteger(D)&&Math.abs(D)>2**32?re=te(String(D)):typeof D=="bigint"&&(re=String(D),(D>BigInt(2)**BigInt(32)||D<-(BigInt(2)**BigInt(32)))&&(re=te(re)),re+="n"),W+=` It must be ${T}. Received ${re}`,W},RangeError);function te(z){let T="",D=z.length;const W=z[0]==="-"?1:0;for(;D>=W+4;D-=3)T=`_${z.slice(D-3,D)}${T}`;return`${z.slice(0,D)}${T}`}function Pe(z,T,D){ce(T,"offset"),(z[T]===void 0||z[T+D]===void 0)&&Le(T,z.length-(D+1))}function le(z,T,D,W,re,pe){if(z>D||z<T){const ae=typeof T=="bigint"?"n":"";let Me;throw T===0||T===BigInt(0)?Me=`>= 0${ae} and < 2${ae} ** ${(pe+1)*8}${ae}`:Me=`>= -(2${ae} ** ${(pe+1)*8-1}${ae}) and < 2 ** ${(pe+1)*8-1}${ae}`,new Z.ERR_OUT_OF_RANGE("value",Me,z)}Pe(W,re,pe)}function ce(z,T){if(typeof z!="number")throw new Z.ERR_INVALID_ARG_TYPE(T,"number",z)}function Le(z,T,D){throw Math.floor(z)!==z?(ce(z,D),new Z.ERR_OUT_OF_RANGE("offset","an integer",z)):T<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${T}`,z)}const be=/[^+/0-9A-Za-z-_]/g;function se(z){if(z=z.split("=")[0],z=z.trim().replace(be,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function Ue(z,T){T=T||1/0;let D;const W=z.length;let re=null;const pe=[];for(let ae=0;ae<W;++ae){if(D=z.charCodeAt(ae),D>55295&&D<57344){if(!re){if(D>56319){(T-=3)>-1&&pe.push(239,191,189);continue}else if(ae+1===W){(T-=3)>-1&&pe.push(239,191,189);continue}re=D;continue}if(D<56320){(T-=3)>-1&&pe.push(239,191,189),re=D;continue}D=(re-55296<<10|D-56320)+65536}else re&&(T-=3)>-1&&pe.push(239,191,189);if(re=null,D<128){if((T-=1)<0)break;pe.push(D)}else if(D<2048){if((T-=2)<0)break;pe.push(D>>6|192,D&63|128)}else if(D<65536){if((T-=3)<0)break;pe.push(D>>12|224,D>>6&63|128,D&63|128)}else if(D<1114112){if((T-=4)<0)break;pe.push(D>>18|240,D>>12&63|128,D>>6&63|128,D&63|128)}else throw new Error("Invalid code point")}return pe}function de(z){const T=[];for(let D=0;D<z.length;++D)T.push(z.charCodeAt(D)&255);return T}function ge(z,T){let D,W,re;const pe=[];for(let ae=0;ae<z.length&&!((T-=2)<0);++ae)D=z.charCodeAt(ae),W=D>>8,re=D%256,pe.push(re),pe.push(W);return pe}function De(z){return a.toByteArray(se(z))}function ve(z,T,D,W){let re;for(re=0;re<W&&!(re+D>=T.length||re>=z.length);++re)T[re+D]=z[re];return re}function _e(z,T){return z instanceof T||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===T.name}function Ge(z){return z!==z}const Se=function(){const z="0123456789abcdef",T=new Array(256);for(let D=0;D<16;++D){const W=D*16;for(let re=0;re<16;++re)T[W+re]=z[D]+z[re]}return T}();function Oe(z){return typeof BigInt>"u"?Ze:z}function Ze(){throw new Error("BigInt not supported")}})(vf);const he=vf.Buffer,mp=vf.Buffer;var gf,vu;function zr(){return vu||(vu=1,gf=function(a,c){for(var o=Math.min(a.length,c.length),x=new he(o),n=0;n<o;++n)x[n]=a[n]^c[n];return x}),gf}var mu;function bp(){if(mu)return bi;mu=1;var M=zr();return bi.encrypt=function(a,c){var o=M(c,a._prev);return a._prev=a._cipher.encryptBlock(o),a._prev},bi.decrypt=function(a,c){var o=a._prev;a._prev=c;var x=a._cipher.decryptBlock(c);return M(x,o)},bi}var yf={},bu;function gp(){if(bu)return yf;bu=1;var M=tt().Buffer,a=zr();function c(o,x,n){var g=x.length,y=a(x,o._cache);return o._cache=o._cache.slice(g),o._prev=M.concat([o._prev,n?x:y]),y}return yf.encrypt=function(o,x,n){for(var g=M.allocUnsafe(0),y;x.length;)if(o._cache.length===0&&(o._cache=o._cipher.encryptBlock(o._prev),o._prev=M.allocUnsafe(0)),o._cache.length<=x.length)y=o._cache.length,g=M.concat([g,c(o,x.slice(0,y),n)]),x=x.slice(y);else{g=M.concat([g,c(o,x,n)]);break}return g},yf}var wf={},gu;function yp(){if(gu)return wf;gu=1;var M=tt().Buffer;function a(c,o,x){var n=c._cipher.encryptBlock(c._prev),g=n[0]^o;return c._prev=M.concat([c._prev.slice(1),M.from([x?o:g])]),g}return wf.encrypt=function(c,o,x){for(var n=o.length,g=M.allocUnsafe(n),y=-1;++y<n;)g[y]=a(c,o[y],x);return g},wf}var Mf={},yu;function wp(){if(yu)return Mf;yu=1;var M=tt().Buffer;function a(o,x,n){for(var g,y=-1,b=8,v=0,d,w;++y<b;)g=o._cipher.encryptBlock(o._prev),d=x&1<<7-y?128:0,w=g[0]^d,v+=(w&128)>>y%8,o._prev=c(o._prev,n?d:w);return v}function c(o,x){var n=o.length,g=-1,y=M.allocUnsafe(o.length);for(o=M.concat([o,M.from([x])]);++g<n;)y[g]=o[g]<<1|o[g+1]>>7;return y}return Mf.encrypt=function(o,x,n){for(var g=x.length,y=M.allocUnsafe(g),b=-1;++b<g;)y[b]=a(o,x[b],n);return y},Mf}var xf={},wu;function Mp(){if(wu)return xf;wu=1;var M=zr();function a(c){return c._prev=c._cipher.encryptBlock(c._prev),c._prev}return xf.encrypt=function(c,o){for(;c._cache.length<o.length;)c._cache=he.concat([c._cache,a(c)]);var x=c._cache.slice(0,o.length);return c._cache=c._cache.slice(o.length),M(o,x)},xf}var _f={},Sf,Mu;function xu(){if(Mu)return Sf;Mu=1;function M(a){for(var c=a.length,o;c--;)if(o=a.readUInt8(c),o===255)a.writeUInt8(0,c);else{o++,a.writeUInt8(o,c);break}}return Sf=M,Sf}var _u;function Su(){if(_u)return _f;_u=1;var M=zr(),a=tt().Buffer,c=xu();function o(n){var g=n._cipher.encryptBlockRaw(n._prev);return c(n._prev),g}var x=16;return _f.encrypt=function(n,g){var y=Math.ceil(g.length/x),b=n._cache.length;n._cache=a.concat([n._cache,a.allocUnsafe(y*x)]);for(var v=0;v<y;v++){var d=o(n),w=b+v*x;n._cache.writeUInt32BE(d[0],w+0),n._cache.writeUInt32BE(d[1],w+4),n._cache.writeUInt32BE(d[2],w+8),n._cache.writeUInt32BE(d[3],w+12)}var _=n._cache.slice(0,g.length);return n._cache=n._cache.slice(g.length),M(g,_)},_f}const Eu={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var Ef,Bu;function Bf(){if(Bu)return Ef;Bu=1;var M={ECB:sp(),CBC:bp(),CFB:gp(),CFB8:yp(),CFB1:wp(),OFB:Mp(),CTR:Su(),GCM:Su()},a=Eu;for(var c in a)a[c].module=M[a[c].mode];return Ef=a,Ef}var Af={},Au;function yi(){if(Au)return Af;Au=1;var M=tt().Buffer;function a(y){M.isBuffer(y)||(y=M.from(y));for(var b=y.length/4|0,v=new Array(b),d=0;d<b;d++)v[d]=y.readUInt32BE(d*4);return v}function c(y){for(var b=0;b<y.length;y++)y[b]=0}function o(y,b,v,d,w){for(var _=v[0],E=v[1],B=v[2],A=v[3],P=y[0]^b[0],I=y[1]^b[1],k=y[2]^b[2],F=y[3]^b[3],q,L,V,ee,ne=4,J=1;J<w;J++)q=_[P>>>24]^E[I>>>16&255]^B[k>>>8&255]^A[F&255]^b[ne++],L=_[I>>>24]^E[k>>>16&255]^B[F>>>8&255]^A[P&255]^b[ne++],V=_[k>>>24]^E[F>>>16&255]^B[P>>>8&255]^A[I&255]^b[ne++],ee=_[F>>>24]^E[P>>>16&255]^B[I>>>8&255]^A[k&255]^b[ne++],P=q,I=L,k=V,F=ee;return q=(d[P>>>24]<<24|d[I>>>16&255]<<16|d[k>>>8&255]<<8|d[F&255])^b[ne++],L=(d[I>>>24]<<24|d[k>>>16&255]<<16|d[F>>>8&255]<<8|d[P&255])^b[ne++],V=(d[k>>>24]<<24|d[F>>>16&255]<<16|d[P>>>8&255]<<8|d[I&255])^b[ne++],ee=(d[F>>>24]<<24|d[P>>>16&255]<<16|d[I>>>8&255]<<8|d[k&255])^b[ne++],q=q>>>0,L=L>>>0,V=V>>>0,ee=ee>>>0,[q,L,V,ee]}var x=[0,1,2,4,8,16,32,64,128,27,54],n=function(){for(var y=new Array(256),b=0;b<256;b++)b<128?y[b]=b<<1:y[b]=b<<1^283;for(var v=[],d=[],w=[[],[],[],[]],_=[[],[],[],[]],E=0,B=0,A=0;A<256;++A){var P=B^B<<1^B<<2^B<<3^B<<4;P=P>>>8^P&255^99,v[E]=P,d[P]=E;var I=y[E],k=y[I],F=y[k],q=y[P]*257^P*16843008;w[0][E]=q<<24|q>>>8,w[1][E]=q<<16|q>>>16,w[2][E]=q<<8|q>>>24,w[3][E]=q,q=F*16843009^k*65537^I*257^E*16843008,_[0][P]=q<<24|q>>>8,_[1][P]=q<<16|q>>>16,_[2][P]=q<<8|q>>>24,_[3][P]=q,E===0?E=B=1:(E=I^y[y[y[F^I]]],B^=y[y[B]])}return{SBOX:v,INV_SBOX:d,SUB_MIX:w,INV_SUB_MIX:_}}();function g(y){this._key=a(y),this._reset()}return g.blockSize=4*4,g.keySize=256/8,g.prototype.blockSize=g.blockSize,g.prototype.keySize=g.keySize,g.prototype._reset=function(){for(var y=this._key,b=y.length,v=b+6,d=(v+1)*4,w=[],_=0;_<b;_++)w[_]=y[_];for(_=b;_<d;_++){var E=w[_-1];_%b===0?(E=E<<8|E>>>24,E=n.SBOX[E>>>24]<<24|n.SBOX[E>>>16&255]<<16|n.SBOX[E>>>8&255]<<8|n.SBOX[E&255],E^=x[_/b|0]<<24):b>6&&_%b===4&&(E=n.SBOX[E>>>24]<<24|n.SBOX[E>>>16&255]<<16|n.SBOX[E>>>8&255]<<8|n.SBOX[E&255]),w[_]=w[_-b]^E}for(var B=[],A=0;A<d;A++){var P=d-A,I=w[P-(A%4?0:4)];A<4||P<=4?B[A]=I:B[A]=n.INV_SUB_MIX[0][n.SBOX[I>>>24]]^n.INV_SUB_MIX[1][n.SBOX[I>>>16&255]]^n.INV_SUB_MIX[2][n.SBOX[I>>>8&255]]^n.INV_SUB_MIX[3][n.SBOX[I&255]]}this._nRounds=v,this._keySchedule=w,this._invKeySchedule=B},g.prototype.encryptBlockRaw=function(y){return y=a(y),o(y,this._keySchedule,n.SUB_MIX,n.SBOX,this._nRounds)},g.prototype.encryptBlock=function(y){var b=this.encryptBlockRaw(y),v=M.allocUnsafe(16);return v.writeUInt32BE(b[0],0),v.writeUInt32BE(b[1],4),v.writeUInt32BE(b[2],8),v.writeUInt32BE(b[3],12),v},g.prototype.decryptBlock=function(y){y=a(y);var b=y[1];y[1]=y[3],y[3]=b;var v=o(y,this._invKeySchedule,n.INV_SUB_MIX,n.INV_SBOX,this._nRounds),d=M.allocUnsafe(16);return d.writeUInt32BE(v[0],0),d.writeUInt32BE(v[3],4),d.writeUInt32BE(v[2],8),d.writeUInt32BE(v[1],12),d},g.prototype.scrub=function(){c(this._keySchedule),c(this._invKeySchedule),c(this._key)},Af.AES=g,Af}var Rf,Ru;function xp(){if(Ru)return Rf;Ru=1;var M=tt().Buffer,a=M.alloc(16,0);function c(n){return[n.readUInt32BE(0),n.readUInt32BE(4),n.readUInt32BE(8),n.readUInt32BE(12)]}function o(n){var g=M.allocUnsafe(16);return g.writeUInt32BE(n[0]>>>0,0),g.writeUInt32BE(n[1]>>>0,4),g.writeUInt32BE(n[2]>>>0,8),g.writeUInt32BE(n[3]>>>0,12),g}function x(n){this.h=n,this.state=M.alloc(16,0),this.cache=M.allocUnsafe(0)}return x.prototype.ghash=function(n){for(var g=-1;++g<n.length;)this.state[g]^=n[g];this._multiply()},x.prototype._multiply=function(){for(var n=c(this.h),g=[0,0,0,0],y,b,v,d=-1;++d<128;){for(b=(this.state[~~(d/8)]&1<<7-d%8)!==0,b&&(g[0]^=n[0],g[1]^=n[1],g[2]^=n[2],g[3]^=n[3]),v=(n[3]&1)!==0,y=3;y>0;y--)n[y]=n[y]>>>1|(n[y-1]&1)<<31;n[0]=n[0]>>>1,v&&(n[0]=n[0]^225<<24)}this.state=o(g)},x.prototype.update=function(n){this.cache=M.concat([this.cache,n]);for(var g;this.cache.length>=16;)g=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(g)},x.prototype.final=function(n,g){return this.cache.length&&this.ghash(M.concat([this.cache,a],16)),this.ghash(o([0,n,0,g])),this.state},Rf=x,Rf}var If,Iu;function Ou(){if(Iu)return If;Iu=1;var M=yi(),a=tt().Buffer,c=pr(),o=Ye(),x=xp(),n=zr(),g=xu();function y(d,w){var _=0;d.length!==w.length&&_++;for(var E=Math.min(d.length,w.length),B=0;B<E;++B)_+=d[B]^w[B];return _}function b(d,w,_){if(w.length===12)return d._finID=a.concat([w,a.from([0,0,0,1])]),a.concat([w,a.from([0,0,0,2])]);var E=new x(_),B=w.length,A=B%16;E.update(w),A&&(A=16-A,E.update(a.alloc(A,0))),E.update(a.alloc(8,0));var P=B*8,I=a.alloc(8);I.writeUIntBE(P,0,8),E.update(I),d._finID=E.state;var k=a.from(d._finID);return g(k),k}function v(d,w,_,E){c.call(this);var B=a.alloc(4,0);this._cipher=new M.AES(w);var A=this._cipher.encryptBlock(B);this._ghash=new x(A),_=b(this,_,A),this._prev=a.from(_),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=E,this._alen=0,this._len=0,this._mode=d,this._authTag=null,this._called=!1}return o(v,c),v.prototype._update=function(d){if(!this._called&&this._alen){var w=16-this._alen%16;w<16&&(w=a.alloc(w,0),this._ghash.update(w))}this._called=!0;var _=this._mode.encrypt(this,d);return this._decrypt?this._ghash.update(d):this._ghash.update(_),this._len+=d.length,_},v.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var d=n(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&y(d,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=d,this._cipher.scrub()},v.prototype.getAuthTag=function(){if(this._decrypt||!a.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},v.prototype.setAuthTag=function(w){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=w},v.prototype.setAAD=function(w){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(w),this._alen+=w.length},If=v,If}var Of,ku;function Pu(){if(ku)return Of;ku=1;var M=yi(),a=tt().Buffer,c=pr(),o=Ye();function x(n,g,y,b){c.call(this),this._cipher=new M.AES(g),this._prev=a.from(y),this._cache=a.allocUnsafe(0),this._secCache=a.allocUnsafe(0),this._decrypt=b,this._mode=n}return o(x,c),x.prototype._update=function(n){return this._mode.encrypt(this,n,this._decrypt)},x.prototype._final=function(){this._cipher.scrub()},Of=x,Of}var kf,Tu;function wi(){if(Tu)return kf;Tu=1;var M=tt().Buffer,a=xa();function c(o,x,n,g){if(M.isBuffer(o)||(o=M.from(o,"binary")),x&&(M.isBuffer(x)||(x=M.from(x,"binary")),x.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var y=n/8,b=M.alloc(y),v=M.alloc(g||0),d=M.alloc(0);y>0||g>0;){var w=new a;w.update(d),w.update(o),x&&w.update(x),d=w.digest();var _=0;if(y>0){var E=b.length-y;_=Math.min(y,d.length),d.copy(b,E,0,_),y-=_}if(_<d.length&&g>0){var B=v.length-g,A=Math.min(g,d.length-_);d.copy(v,B,_,_+A),g-=A}}return d.fill(0),{key:b,iv:v}}return kf=c,kf}var Nu;function _p(){if(Nu)return vi;Nu=1;var M=Bf(),a=Ou(),c=tt().Buffer,o=Pu(),x=pr(),n=yi(),g=wi(),y=Ye();function b(E,B,A){x.call(this),this._cache=new d,this._cipher=new n.AES(B),this._prev=c.from(A),this._mode=E,this._autopadding=!0}y(b,x),b.prototype._update=function(E){this._cache.add(E);for(var B,A,P=[];B=this._cache.get();)A=this._mode.encrypt(this,B),P.push(A);return c.concat(P)};var v=c.alloc(16,16);b.prototype._final=function(){var E=this._cache.flush();if(this._autopadding)return E=this._mode.encrypt(this,E),this._cipher.scrub(),E;if(!E.equals(v))throw this._cipher.scrub(),new Error("data not multiple of block length")},b.prototype.setAutoPadding=function(E){return this._autopadding=!!E,this};function d(){this.cache=c.allocUnsafe(0)}d.prototype.add=function(E){this.cache=c.concat([this.cache,E])},d.prototype.get=function(){if(this.cache.length>15){var E=this.cache.slice(0,16);return this.cache=this.cache.slice(16),E}return null},d.prototype.flush=function(){for(var E=16-this.cache.length,B=c.allocUnsafe(E),A=-1;++A<E;)B.writeUInt8(E,A);return c.concat([this.cache,B])};function w(E,B,A){var P=M[E.toLowerCase()];if(!P)throw new TypeError("invalid suite type");if(typeof B=="string"&&(B=c.from(B)),B.length!==P.key/8)throw new TypeError("invalid key length "+B.length);if(typeof A=="string"&&(A=c.from(A)),P.mode!=="GCM"&&A.length!==P.iv)throw new TypeError("invalid iv length "+A.length);return P.type==="stream"?new o(P.module,B,A):P.type==="auth"?new a(P.module,B,A):new b(P.module,B,A)}function _(E,B){var A=M[E.toLowerCase()];if(!A)throw new TypeError("invalid suite type");var P=g(B,!1,A.key,A.iv);return w(E,P.key,P.iv)}return vi.createCipheriv=w,vi.createCipher=_,vi}var Mi={},Cu;function Sp(){if(Cu)return Mi;Cu=1;var M=Ou(),a=tt().Buffer,c=Bf(),o=Pu(),x=pr(),n=yi(),g=wi(),y=Ye();function b(E,B,A){x.call(this),this._cache=new v,this._last=void 0,this._cipher=new n.AES(B),this._prev=a.from(A),this._mode=E,this._autopadding=!0}y(b,x),b.prototype._update=function(E){this._cache.add(E);for(var B,A,P=[];B=this._cache.get(this._autopadding);)A=this._mode.decrypt(this,B),P.push(A);return a.concat(P)},b.prototype._final=function(){var E=this._cache.flush();if(this._autopadding)return d(this._mode.decrypt(this,E));if(E)throw new Error("data not multiple of block length")},b.prototype.setAutoPadding=function(E){return this._autopadding=!!E,this};function v(){this.cache=a.allocUnsafe(0)}v.prototype.add=function(E){this.cache=a.concat([this.cache,E])},v.prototype.get=function(E){var B;if(E){if(this.cache.length>16)return B=this.cache.slice(0,16),this.cache=this.cache.slice(16),B}else if(this.cache.length>=16)return B=this.cache.slice(0,16),this.cache=this.cache.slice(16),B;return null},v.prototype.flush=function(){if(this.cache.length)return this.cache};function d(E){var B=E[15];if(B<1||B>16)throw new Error("unable to decrypt data");for(var A=-1;++A<B;)if(E[A+(16-B)]!==B)throw new Error("unable to decrypt data");if(B!==16)return E.slice(0,16-B)}function w(E,B,A){var P=c[E.toLowerCase()];if(!P)throw new TypeError("invalid suite type");if(typeof A=="string"&&(A=a.from(A)),P.mode!=="GCM"&&A.length!==P.iv)throw new TypeError("invalid iv length "+A.length);if(typeof B=="string"&&(B=a.from(B)),B.length!==P.key/8)throw new TypeError("invalid key length "+B.length);return P.type==="stream"?new o(P.module,B,A,!0):P.type==="auth"?new M(P.module,B,A,!0):new b(P.module,B,A)}function _(E,B){var A=c[E.toLowerCase()];if(!A)throw new TypeError("invalid suite type");var P=g(B,!1,A.key,A.iv);return w(E,P.key,P.iv)}return Mi.createDecipher=_,Mi.createDecipheriv=w,Mi}var qu;function Pf(){if(qu)return jt;qu=1;var M=_p(),a=Sp(),c=Eu;function o(){return Object.keys(c)}return jt.createCipher=jt.Cipher=M.createCipher,jt.createCipheriv=jt.Cipheriv=M.createCipheriv,jt.createDecipher=jt.Decipher=a.createDecipher,jt.createDecipheriv=jt.Decipheriv=a.createDecipheriv,jt.listCiphers=jt.getCiphers=o,jt}var Tf={},Lu;function Ep(){return Lu||(Lu=1,function(M){M["des-ecb"]={key:8,iv:0},M["des-cbc"]=M.des={key:8,iv:8},M["des-ede3-cbc"]=M.des3={key:24,iv:8},M["des-ede3"]={key:24,iv:0},M["des-ede-cbc"]={key:16,iv:8},M["des-ede"]={key:16,iv:0}}(Tf)),Tf}var Fu;function Bp(){if(Fu)return zt;Fu=1;var M=fp(),a=Pf(),c=Bf(),o=Ep(),x=wi();function n(d,w){d=d.toLowerCase();var _,E;if(c[d])_=c[d].key,E=c[d].iv;else if(o[d])_=o[d].key*8,E=o[d].iv;else throw new TypeError("invalid suite type");var B=x(w,!1,_,E);return y(d,B.key,B.iv)}function g(d,w){d=d.toLowerCase();var _,E;if(c[d])_=c[d].key,E=c[d].iv;else if(o[d])_=o[d].key*8,E=o[d].iv;else throw new TypeError("invalid suite type");var B=x(w,!1,_,E);return b(d,B.key,B.iv)}function y(d,w,_){if(d=d.toLowerCase(),c[d])return a.createCipheriv(d,w,_);if(o[d])return new M({key:w,iv:_,mode:d});throw new TypeError("invalid suite type")}function b(d,w,_){if(d=d.toLowerCase(),c[d])return a.createDecipheriv(d,w,_);if(o[d])return new M({key:w,iv:_,mode:d,decrypt:!0});throw new TypeError("invalid suite type")}function v(){return Object.keys(o).concat(a.getCiphers())}return zt.createCipher=zt.Cipher=n,zt.createCipheriv=zt.Cipheriv=y,zt.createDecipher=zt.Decipher=g,zt.createDecipheriv=zt.Decipheriv=b,zt.listCiphers=zt.getCiphers=v,zt}var _r={},xi={exports:{}},Ap=xi.exports,Du;function Uu(){return Du||(Du=1,function(M){(function(a,c){function o(m,e){if(!m)throw new Error(e||"Assertion failed")}function x(m,e){m.super_=e;var r=function(){};r.prototype=e.prototype,m.prototype=new r,m.prototype.constructor=m}function n(m,e,r){if(n.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((e==="le"||e==="be")&&(r=e,e=10),this._init(m||0,e||10,r||"be"))}typeof a=="object"?a.exports=n:c.BN=n,n.BN=n,n.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=Nt().Buffer}catch{}n.isBN=function(e){return e instanceof n?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp(r)>0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var f=0;e[0]==="-"&&(f++,this.negative=1),f<e.length&&(r===16?this._parseHex(e,f,i):(this._parseBase(e,r,f),i==="le"&&this._initArray(this.toArray(),r,i)))},n.prototype._initNumber=function(e,r,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(o(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},n.prototype._initArray=function(e,r,i){if(o(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h,l,p=0;if(i==="be")for(f=e.length-1,h=0;f>=0;f-=3)l=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);else if(i==="le")for(f=0,h=0;f<e.length;f+=3)l=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);return this.strip()};function y(m,e){var r=m.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function b(m,e,r){var i=y(m,r);return r-1>=e&&(i|=y(m,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h=0,l=0,p;if(i==="be")for(f=e.length-1;f>=r;f-=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8;else{var s=e.length-r;for(f=s%2===0?r+1:r;f<e.length;f+=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8}this.strip()};function v(m,e,r,i){for(var f=0,h=Math.min(m.length,r),l=e;l<h;l++){var p=m.charCodeAt(l)-48;f*=i,p>=49?f+=p-49+10:p>=17?f+=p-17+10:f+=p}return f}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=r)f++;f--,h=h/r|0;for(var l=e.length-i,p=l%f,s=Math.min(l,l-p)+i,t=0,u=i;u<s;u+=f)t=v(e,u,u+f,r),this.imuln(h),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t);if(p!==0){var S=1;for(t=v(e,u,e.length,r),u=0;u<p;u++)S*=r;this.imuln(S),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],w=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var f=0,h=0,l=0;l<this.length;l++){var p=this.words[l],s=((p<<f|h)&16777215).toString(16);h=p>>>24-f&16777215,f+=2,f>=26&&(f-=26,l--),h!==0||l!==this.length-1?i=d[6-s.length]+s+i:i=s+i}for(h!==0&&(i=h.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=w[e],u=_[e];i="";var S=this.clone();for(S.negative=0;!S.isZero();){var O=S.modn(u).toString(e);S=S.idivn(u),S.isZero()?i=O+i:i=d[t-O.length]+O+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return o(typeof g<"u"),this.toArrayLike(g,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var f=this.byteLength(),h=i||Math.max(1,f);o(f<=h,"byte array longer than desired length"),o(h>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(h),s,t,u=this.clone();if(l){for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[t]=s;for(;t<h;t++)p[t]=0}else{for(t=0;t<h-f;t++)p[t]=0;for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[h-t-1]=s}return p},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return(r&8191)===0&&(i+=13,r>>>=13),(r&127)===0&&(i+=7,r>>>=7),(r&15)===0&&(i+=4,r>>>=4),(r&3)===0&&(i+=2,r>>>=2),(r&1)===0&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function E(m){for(var e=new Array(m.bitLength()),r=0;r<e.length;r++){var i=r/26|0,f=r%26;e[r]=(m.words[i]&1<<f)>>>f}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,i!==26)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},n.prototype.ior=function(e){return o((this.negative|e.negative)===0),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},n.prototype.iand=function(e){return o((this.negative|e.negative)===0),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var f=0;f<i.length;f++)this.words[f]=r.words[f]^i.words[f];if(this!==r)for(;f<r.length;f++)this.words[f]=r.words[f];return this.length=r.length,this.strip()},n.prototype.ixor=function(e){return o((this.negative|e.negative)===0),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){o(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var f=0;f<r;f++)this.words[f]=~this.words[f]&67108863;return i>0&&(this.words[f]=~this.words[f]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){o(typeof e=="number"&&e>=0);var i=e/26|0,f=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<f:this.words[i]=this.words[i]&~(1<<f),this.strip()},n.prototype.iadd=function(e){var r;if(this.negative!==0&&e.negative===0)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();var i,f;this.length>e.length?(i=this,f=e):(i=e,f=this);for(var h=0,l=0;l<f.length;l++)r=(i.words[l]|0)+(f.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;for(;h!==0&&l<i.length;l++)r=(i.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;if(this.length=i.length,h!==0)this.words[this.length]=h,this.length++;else if(i!==this)for(;l<i.length;l++)this.words[l]=i.words[l];return this},n.prototype.add=function(e){var r;return e.negative!==0&&this.negative===0?(e.negative=0,r=this.sub(e),e.negative^=1,r):e.negative===0&&this.negative!==0?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;i>0?(f=this,h=e):(f=e,h=this);for(var l=0,p=0;p<h.length;p++)r=(f.words[p]|0)-(h.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;for(;l!==0&&p<f.length;p++)r=(f.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;if(l===0&&p<f.length&&f!==this)for(;p<f.length;p++)this.words[p]=f.words[p];return this.length=Math.max(this.length,p),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};function B(m,e,r){r.negative=e.negative^m.negative;var i=m.length+e.length|0;r.length=i,i=i-1|0;var f=m.words[0]|0,h=e.words[0]|0,l=f*h,p=l&67108863,s=l/67108864|0;r.words[0]=p;for(var t=1;t<i;t++){for(var u=s>>>26,S=s&67108863,O=Math.min(t,e.length-1),H=Math.max(0,t-m.length+1);H<=O;H++){var Q=t-H|0;f=m.words[Q]|0,h=e.words[H]|0,l=f*h+S,u+=l/67108864|0,S=l&67108863}r.words[t]=S|0,s=u|0}return s!==0?r.words[t]=s|0:r.length--,r.strip()}var A=function(e,r,i){var f=e.words,h=r.words,l=i.words,p=0,s,t,u,S=f[0]|0,O=S&8191,H=S>>>13,Q=f[1]|0,G=Q&8191,R=Q>>>13,C=f[2]|0,$=C&8191,X=C>>>13,Z=f[3]|0,K=Z&8191,te=Z>>>13,Pe=f[4]|0,le=Pe&8191,ce=Pe>>>13,Le=f[5]|0,be=Le&8191,se=Le>>>13,Ue=f[6]|0,de=Ue&8191,ge=Ue>>>13,De=f[7]|0,ve=De&8191,_e=De>>>13,Ge=f[8]|0,Se=Ge&8191,Oe=Ge>>>13,Ze=f[9]|0,z=Ze&8191,T=Ze>>>13,D=h[0]|0,W=D&8191,re=D>>>13,pe=h[1]|0,ae=pe&8191,Me=pe>>>13,ze=h[2]|0,ye=ze&8191,Be=ze>>>13,He=h[3]|0,Ae=He&8191,Te=He>>>13,rt=h[4]|0,Ie=rt&8191,Ne=rt>>>13,nt=h[5]|0,j=nt&8191,N=nt>>>13,U=h[6]|0,Y=U&8191,ie=U>>>13,me=h[7]|0,fe=me&8191,xe=me>>>13,Ve=h[8]|0,we=Ve&8191,Re=Ve>>>13,Ke=h[9]|0,ke=Ke&8191,Ce=Ke>>>13;i.negative=e.negative^r.negative,i.length=19,s=Math.imul(O,W),t=Math.imul(O,re),t=t+Math.imul(H,W)|0,u=Math.imul(H,re);var Xe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,s=Math.imul(G,W),t=Math.imul(G,re),t=t+Math.imul(R,W)|0,u=Math.imul(R,re),s=s+Math.imul(O,ae)|0,t=t+Math.imul(O,Me)|0,t=t+Math.imul(H,ae)|0,u=u+Math.imul(H,Me)|0;var Qe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,s=Math.imul($,W),t=Math.imul($,re),t=t+Math.imul(X,W)|0,u=Math.imul(X,re),s=s+Math.imul(G,ae)|0,t=t+Math.imul(G,Me)|0,t=t+Math.imul(R,ae)|0,u=u+Math.imul(R,Me)|0,s=s+Math.imul(O,ye)|0,t=t+Math.imul(O,Be)|0,t=t+Math.imul(H,ye)|0,u=u+Math.imul(H,Be)|0;var lt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(lt>>>26)|0,lt&=67108863,s=Math.imul(K,W),t=Math.imul(K,re),t=t+Math.imul(te,W)|0,u=Math.imul(te,re),s=s+Math.imul($,ae)|0,t=t+Math.imul($,Me)|0,t=t+Math.imul(X,ae)|0,u=u+Math.imul(X,Me)|0,s=s+Math.imul(G,ye)|0,t=t+Math.imul(G,Be)|0,t=t+Math.imul(R,ye)|0,u=u+Math.imul(R,Be)|0,s=s+Math.imul(O,Ae)|0,t=t+Math.imul(O,Te)|0,t=t+Math.imul(H,Ae)|0,u=u+Math.imul(H,Te)|0;var dt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(dt>>>26)|0,dt&=67108863,s=Math.imul(le,W),t=Math.imul(le,re),t=t+Math.imul(ce,W)|0,u=Math.imul(ce,re),s=s+Math.imul(K,ae)|0,t=t+Math.imul(K,Me)|0,t=t+Math.imul(te,ae)|0,u=u+Math.imul(te,Me)|0,s=s+Math.imul($,ye)|0,t=t+Math.imul($,Be)|0,t=t+Math.imul(X,ye)|0,u=u+Math.imul(X,Be)|0,s=s+Math.imul(G,Ae)|0,t=t+Math.imul(G,Te)|0,t=t+Math.imul(R,Ae)|0,u=u+Math.imul(R,Te)|0,s=s+Math.imul(O,Ie)|0,t=t+Math.imul(O,Ne)|0,t=t+Math.imul(H,Ie)|0,u=u+Math.imul(H,Ne)|0;var pt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(be,W),t=Math.imul(be,re),t=t+Math.imul(se,W)|0,u=Math.imul(se,re),s=s+Math.imul(le,ae)|0,t=t+Math.imul(le,Me)|0,t=t+Math.imul(ce,ae)|0,u=u+Math.imul(ce,Me)|0,s=s+Math.imul(K,ye)|0,t=t+Math.imul(K,Be)|0,t=t+Math.imul(te,ye)|0,u=u+Math.imul(te,Be)|0,s=s+Math.imul($,Ae)|0,t=t+Math.imul($,Te)|0,t=t+Math.imul(X,Ae)|0,u=u+Math.imul(X,Te)|0,s=s+Math.imul(G,Ie)|0,t=t+Math.imul(G,Ne)|0,t=t+Math.imul(R,Ie)|0,u=u+Math.imul(R,Ne)|0,s=s+Math.imul(O,j)|0,t=t+Math.imul(O,N)|0,t=t+Math.imul(H,j)|0,u=u+Math.imul(H,N)|0;var vt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(de,W),t=Math.imul(de,re),t=t+Math.imul(ge,W)|0,u=Math.imul(ge,re),s=s+Math.imul(be,ae)|0,t=t+Math.imul(be,Me)|0,t=t+Math.imul(se,ae)|0,u=u+Math.imul(se,Me)|0,s=s+Math.imul(le,ye)|0,t=t+Math.imul(le,Be)|0,t=t+Math.imul(ce,ye)|0,u=u+Math.imul(ce,Be)|0,s=s+Math.imul(K,Ae)|0,t=t+Math.imul(K,Te)|0,t=t+Math.imul(te,Ae)|0,u=u+Math.imul(te,Te)|0,s=s+Math.imul($,Ie)|0,t=t+Math.imul($,Ne)|0,t=t+Math.imul(X,Ie)|0,u=u+Math.imul(X,Ne)|0,s=s+Math.imul(G,j)|0,t=t+Math.imul(G,N)|0,t=t+Math.imul(R,j)|0,u=u+Math.imul(R,N)|0,s=s+Math.imul(O,Y)|0,t=t+Math.imul(O,ie)|0,t=t+Math.imul(H,Y)|0,u=u+Math.imul(H,ie)|0;var mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(ve,W),t=Math.imul(ve,re),t=t+Math.imul(_e,W)|0,u=Math.imul(_e,re),s=s+Math.imul(de,ae)|0,t=t+Math.imul(de,Me)|0,t=t+Math.imul(ge,ae)|0,u=u+Math.imul(ge,Me)|0,s=s+Math.imul(be,ye)|0,t=t+Math.imul(be,Be)|0,t=t+Math.imul(se,ye)|0,u=u+Math.imul(se,Be)|0,s=s+Math.imul(le,Ae)|0,t=t+Math.imul(le,Te)|0,t=t+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Te)|0,s=s+Math.imul(K,Ie)|0,t=t+Math.imul(K,Ne)|0,t=t+Math.imul(te,Ie)|0,u=u+Math.imul(te,Ne)|0,s=s+Math.imul($,j)|0,t=t+Math.imul($,N)|0,t=t+Math.imul(X,j)|0,u=u+Math.imul(X,N)|0,s=s+Math.imul(G,Y)|0,t=t+Math.imul(G,ie)|0,t=t+Math.imul(R,Y)|0,u=u+Math.imul(R,ie)|0,s=s+Math.imul(O,fe)|0,t=t+Math.imul(O,xe)|0,t=t+Math.imul(H,fe)|0,u=u+Math.imul(H,xe)|0;var bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(Se,W),t=Math.imul(Se,re),t=t+Math.imul(Oe,W)|0,u=Math.imul(Oe,re),s=s+Math.imul(ve,ae)|0,t=t+Math.imul(ve,Me)|0,t=t+Math.imul(_e,ae)|0,u=u+Math.imul(_e,Me)|0,s=s+Math.imul(de,ye)|0,t=t+Math.imul(de,Be)|0,t=t+Math.imul(ge,ye)|0,u=u+Math.imul(ge,Be)|0,s=s+Math.imul(be,Ae)|0,t=t+Math.imul(be,Te)|0,t=t+Math.imul(se,Ae)|0,u=u+Math.imul(se,Te)|0,s=s+Math.imul(le,Ie)|0,t=t+Math.imul(le,Ne)|0,t=t+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,Ne)|0,s=s+Math.imul(K,j)|0,t=t+Math.imul(K,N)|0,t=t+Math.imul(te,j)|0,u=u+Math.imul(te,N)|0,s=s+Math.imul($,Y)|0,t=t+Math.imul($,ie)|0,t=t+Math.imul(X,Y)|0,u=u+Math.imul(X,ie)|0,s=s+Math.imul(G,fe)|0,t=t+Math.imul(G,xe)|0,t=t+Math.imul(R,fe)|0,u=u+Math.imul(R,xe)|0,s=s+Math.imul(O,we)|0,t=t+Math.imul(O,Re)|0,t=t+Math.imul(H,we)|0,u=u+Math.imul(H,Re)|0;var gt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(gt>>>26)|0,gt&=67108863,s=Math.imul(z,W),t=Math.imul(z,re),t=t+Math.imul(T,W)|0,u=Math.imul(T,re),s=s+Math.imul(Se,ae)|0,t=t+Math.imul(Se,Me)|0,t=t+Math.imul(Oe,ae)|0,u=u+Math.imul(Oe,Me)|0,s=s+Math.imul(ve,ye)|0,t=t+Math.imul(ve,Be)|0,t=t+Math.imul(_e,ye)|0,u=u+Math.imul(_e,Be)|0,s=s+Math.imul(de,Ae)|0,t=t+Math.imul(de,Te)|0,t=t+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,Te)|0,s=s+Math.imul(be,Ie)|0,t=t+Math.imul(be,Ne)|0,t=t+Math.imul(se,Ie)|0,u=u+Math.imul(se,Ne)|0,s=s+Math.imul(le,j)|0,t=t+Math.imul(le,N)|0,t=t+Math.imul(ce,j)|0,u=u+Math.imul(ce,N)|0,s=s+Math.imul(K,Y)|0,t=t+Math.imul(K,ie)|0,t=t+Math.imul(te,Y)|0,u=u+Math.imul(te,ie)|0,s=s+Math.imul($,fe)|0,t=t+Math.imul($,xe)|0,t=t+Math.imul(X,fe)|0,u=u+Math.imul(X,xe)|0,s=s+Math.imul(G,we)|0,t=t+Math.imul(G,Re)|0,t=t+Math.imul(R,we)|0,u=u+Math.imul(R,Re)|0,s=s+Math.imul(O,ke)|0,t=t+Math.imul(O,Ce)|0,t=t+Math.imul(H,ke)|0,u=u+Math.imul(H,Ce)|0;var yt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(z,ae),t=Math.imul(z,Me),t=t+Math.imul(T,ae)|0,u=Math.imul(T,Me),s=s+Math.imul(Se,ye)|0,t=t+Math.imul(Se,Be)|0,t=t+Math.imul(Oe,ye)|0,u=u+Math.imul(Oe,Be)|0,s=s+Math.imul(ve,Ae)|0,t=t+Math.imul(ve,Te)|0,t=t+Math.imul(_e,Ae)|0,u=u+Math.imul(_e,Te)|0,s=s+Math.imul(de,Ie)|0,t=t+Math.imul(de,Ne)|0,t=t+Math.imul(ge,Ie)|0,u=u+Math.imul(ge,Ne)|0,s=s+Math.imul(be,j)|0,t=t+Math.imul(be,N)|0,t=t+Math.imul(se,j)|0,u=u+Math.imul(se,N)|0,s=s+Math.imul(le,Y)|0,t=t+Math.imul(le,ie)|0,t=t+Math.imul(ce,Y)|0,u=u+Math.imul(ce,ie)|0,s=s+Math.imul(K,fe)|0,t=t+Math.imul(K,xe)|0,t=t+Math.imul(te,fe)|0,u=u+Math.imul(te,xe)|0,s=s+Math.imul($,we)|0,t=t+Math.imul($,Re)|0,t=t+Math.imul(X,we)|0,u=u+Math.imul(X,Re)|0,s=s+Math.imul(G,ke)|0,t=t+Math.imul(G,Ce)|0,t=t+Math.imul(R,ke)|0,u=u+Math.imul(R,Ce)|0;var wt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,ye),t=Math.imul(z,Be),t=t+Math.imul(T,ye)|0,u=Math.imul(T,Be),s=s+Math.imul(Se,Ae)|0,t=t+Math.imul(Se,Te)|0,t=t+Math.imul(Oe,Ae)|0,u=u+Math.imul(Oe,Te)|0,s=s+Math.imul(ve,Ie)|0,t=t+Math.imul(ve,Ne)|0,t=t+Math.imul(_e,Ie)|0,u=u+Math.imul(_e,Ne)|0,s=s+Math.imul(de,j)|0,t=t+Math.imul(de,N)|0,t=t+Math.imul(ge,j)|0,u=u+Math.imul(ge,N)|0,s=s+Math.imul(be,Y)|0,t=t+Math.imul(be,ie)|0,t=t+Math.imul(se,Y)|0,u=u+Math.imul(se,ie)|0,s=s+Math.imul(le,fe)|0,t=t+Math.imul(le,xe)|0,t=t+Math.imul(ce,fe)|0,u=u+Math.imul(ce,xe)|0,s=s+Math.imul(K,we)|0,t=t+Math.imul(K,Re)|0,t=t+Math.imul(te,we)|0,u=u+Math.imul(te,Re)|0,s=s+Math.imul($,ke)|0,t=t+Math.imul($,Ce)|0,t=t+Math.imul(X,ke)|0,u=u+Math.imul(X,Ce)|0;var Mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(z,Ae),t=Math.imul(z,Te),t=t+Math.imul(T,Ae)|0,u=Math.imul(T,Te),s=s+Math.imul(Se,Ie)|0,t=t+Math.imul(Se,Ne)|0,t=t+Math.imul(Oe,Ie)|0,u=u+Math.imul(Oe,Ne)|0,s=s+Math.imul(ve,j)|0,t=t+Math.imul(ve,N)|0,t=t+Math.imul(_e,j)|0,u=u+Math.imul(_e,N)|0,s=s+Math.imul(de,Y)|0,t=t+Math.imul(de,ie)|0,t=t+Math.imul(ge,Y)|0,u=u+Math.imul(ge,ie)|0,s=s+Math.imul(be,fe)|0,t=t+Math.imul(be,xe)|0,t=t+Math.imul(se,fe)|0,u=u+Math.imul(se,xe)|0,s=s+Math.imul(le,we)|0,t=t+Math.imul(le,Re)|0,t=t+Math.imul(ce,we)|0,u=u+Math.imul(ce,Re)|0,s=s+Math.imul(K,ke)|0,t=t+Math.imul(K,Ce)|0,t=t+Math.imul(te,ke)|0,u=u+Math.imul(te,Ce)|0;var xt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(z,Ie),t=Math.imul(z,Ne),t=t+Math.imul(T,Ie)|0,u=Math.imul(T,Ne),s=s+Math.imul(Se,j)|0,t=t+Math.imul(Se,N)|0,t=t+Math.imul(Oe,j)|0,u=u+Math.imul(Oe,N)|0,s=s+Math.imul(ve,Y)|0,t=t+Math.imul(ve,ie)|0,t=t+Math.imul(_e,Y)|0,u=u+Math.imul(_e,ie)|0,s=s+Math.imul(de,fe)|0,t=t+Math.imul(de,xe)|0,t=t+Math.imul(ge,fe)|0,u=u+Math.imul(ge,xe)|0,s=s+Math.imul(be,we)|0,t=t+Math.imul(be,Re)|0,t=t+Math.imul(se,we)|0,u=u+Math.imul(se,Re)|0,s=s+Math.imul(le,ke)|0,t=t+Math.imul(le,Ce)|0,t=t+Math.imul(ce,ke)|0,u=u+Math.imul(ce,Ce)|0;var _t=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(z,j),t=Math.imul(z,N),t=t+Math.imul(T,j)|0,u=Math.imul(T,N),s=s+Math.imul(Se,Y)|0,t=t+Math.imul(Se,ie)|0,t=t+Math.imul(Oe,Y)|0,u=u+Math.imul(Oe,ie)|0,s=s+Math.imul(ve,fe)|0,t=t+Math.imul(ve,xe)|0,t=t+Math.imul(_e,fe)|0,u=u+Math.imul(_e,xe)|0,s=s+Math.imul(de,we)|0,t=t+Math.imul(de,Re)|0,t=t+Math.imul(ge,we)|0,u=u+Math.imul(ge,Re)|0,s=s+Math.imul(be,ke)|0,t=t+Math.imul(be,Ce)|0,t=t+Math.imul(se,ke)|0,u=u+Math.imul(se,Ce)|0;var St=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(z,Y),t=Math.imul(z,ie),t=t+Math.imul(T,Y)|0,u=Math.imul(T,ie),s=s+Math.imul(Se,fe)|0,t=t+Math.imul(Se,xe)|0,t=t+Math.imul(Oe,fe)|0,u=u+Math.imul(Oe,xe)|0,s=s+Math.imul(ve,we)|0,t=t+Math.imul(ve,Re)|0,t=t+Math.imul(_e,we)|0,u=u+Math.imul(_e,Re)|0,s=s+Math.imul(de,ke)|0,t=t+Math.imul(de,Ce)|0,t=t+Math.imul(ge,ke)|0,u=u+Math.imul(ge,Ce)|0;var Et=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,fe),t=Math.imul(z,xe),t=t+Math.imul(T,fe)|0,u=Math.imul(T,xe),s=s+Math.imul(Se,we)|0,t=t+Math.imul(Se,Re)|0,t=t+Math.imul(Oe,we)|0,u=u+Math.imul(Oe,Re)|0,s=s+Math.imul(ve,ke)|0,t=t+Math.imul(ve,Ce)|0,t=t+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ce)|0;var Bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,we),t=Math.imul(z,Re),t=t+Math.imul(T,we)|0,u=Math.imul(T,Re),s=s+Math.imul(Se,ke)|0,t=t+Math.imul(Se,Ce)|0,t=t+Math.imul(Oe,ke)|0,u=u+Math.imul(Oe,Ce)|0;var At=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(z,ke),t=Math.imul(z,Ce),t=t+Math.imul(T,ke)|0,u=Math.imul(T,Ce);var Rt=(p+s|0)+((t&8191)<<13)|0;return p=(u+(t>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,l[0]=Xe,l[1]=Qe,l[2]=lt,l[3]=dt,l[4]=pt,l[5]=vt,l[6]=mt,l[7]=bt,l[8]=gt,l[9]=yt,l[10]=wt,l[11]=Mt,l[12]=xt,l[13]=_t,l[14]=St,l[15]=Et,l[16]=Bt,l[17]=At,l[18]=Rt,p!==0&&(l[19]=p,i.length++),i};Math.imul||(A=B);function P(m,e,r){r.negative=e.negative^m.negative,r.length=m.length+e.length;for(var i=0,f=0,h=0;h<r.length-1;h++){var l=f;f=0;for(var p=i&67108863,s=Math.min(h,e.length-1),t=Math.max(0,h-m.length+1);t<=s;t++){var u=h-t,S=m.words[u]|0,O=e.words[t]|0,H=S*O,Q=H&67108863;l=l+(H/67108864|0)|0,Q=Q+p|0,p=Q&67108863,l=l+(Q>>>26)|0,f+=l>>>26,l&=67108863}r.words[h]=p,i=l,l=f}return i!==0?r.words[h]=i:r.length--,r.strip()}function I(m,e,r){var i=new k;return i.mulp(m,e,r)}n.prototype.mulTo=function(e,r){var i,f=this.length+e.length;return this.length===10&&e.length===10?i=A(this,e,r):f<63?i=B(this,e,r):f<1024?i=P(this,e,r):i=I(this,e,r),i};function k(m,e){this.x=m,this.y=e}k.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,f=0;f<e;f++)r[f]=this.revBin(f,i,e);return r},k.prototype.revBin=function(e,r,i){if(e===0||e===i-1)return e;for(var f=0,h=0;h<r;h++)f|=(e&1)<<r-h-1,e>>=1;return f},k.prototype.permute=function(e,r,i,f,h,l){for(var p=0;p<l;p++)f[p]=r[e[p]],h[p]=i[e[p]]},k.prototype.transform=function(e,r,i,f,h,l){this.permute(l,e,r,i,f,h);for(var p=1;p<h;p<<=1)for(var s=p<<1,t=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),S=0;S<h;S+=s)for(var O=t,H=u,Q=0;Q<p;Q++){var G=i[S+Q],R=f[S+Q],C=i[S+Q+p],$=f[S+Q+p],X=O*C-H*$;$=O*$+H*C,C=X,i[S+Q]=G+C,f[S+Q]=R+$,i[S+Q+p]=G-C,f[S+Q+p]=R-$,Q!==s&&(X=t*O-u*H,H=t*H+u*O,O=X)}},k.prototype.guessLen13b=function(e,r){var i=Math.max(r,e)|1,f=i&1,h=0;for(i=i/2|0;i;i=i>>>1)h++;return 1<<h+1+f},k.prototype.conjugate=function(e,r,i){if(!(i<=1))for(var f=0;f<i/2;f++){var h=e[f];e[f]=e[i-f-1],e[i-f-1]=h,h=r[f],r[f]=-r[i-f-1],r[i-f-1]=-h}},k.prototype.normalize13b=function(e,r){for(var i=0,f=0;f<r/2;f++){var h=Math.round(e[2*f+1]/r)*8192+Math.round(e[2*f]/r)+i;e[f]=h&67108863,h<67108864?i=0:i=h/67108864|0}return e},k.prototype.convert13b=function(e,r,i,f){for(var h=0,l=0;l<r;l++)h=h+(e[l]|0),i[2*l]=h&8191,h=h>>>13,i[2*l+1]=h&8191,h=h>>>13;for(l=2*r;l<f;++l)i[l]=0;o(h===0),o((h&-8192)===0)},k.prototype.stub=function(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},k.prototype.mulp=function(e,r,i){var f=2*this.guessLen13b(e.length,r.length),h=this.makeRBT(f),l=this.stub(f),p=new Array(f),s=new Array(f),t=new Array(f),u=new Array(f),S=new Array(f),O=new Array(f),H=i.words;H.length=f,this.convert13b(e.words,e.length,p,f),this.convert13b(r.words,r.length,u,f),this.transform(p,l,s,t,f,h),this.transform(u,l,S,O,f,h);for(var Q=0;Q<f;Q++){var G=s[Q]*S[Q]-t[Q]*O[Q];t[Q]=s[Q]*O[Q]+t[Q]*S[Q],s[Q]=G}return this.conjugate(s,t,f),this.transform(s,t,H,l,f,h),this.conjugate(H,l,f),this.normalize13b(H,f),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},n.prototype.mul=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},n.prototype.mulf=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),I(this,e,r)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){o(typeof e=="number"),o(e<67108864);for(var r=0,i=0;i<this.length;i++){var f=(this.words[i]|0)*e,h=(f&67108863)+(r&67108863);r>>=26,r+=f/67108864|0,r+=h>>>26,this.words[i]=h&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=E(e);if(r.length===0)return new n(1);for(var i=this,f=0;f<r.length&&r[f]===0;f++,i=i.sqr());if(++f<r.length)for(var h=i.sqr();f<r.length;f++,h=h.sqr())r[f]!==0&&(i=i.mul(h));return i},n.prototype.iushln=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r,h;if(r!==0){var l=0;for(h=0;h<this.length;h++){var p=this.words[h]&f,s=(this.words[h]|0)-p<<r;this.words[h]=s|l,l=p>>>26-r}l&&(this.words[h]=l,this.length++)}if(i!==0){for(h=this.length-1;h>=0;h--)this.words[h+i]=this.words[h];for(h=0;h<i;h++)this.words[h]=0;this.length+=i}return this.strip()},n.prototype.ishln=function(e){return o(this.negative===0),this.iushln(e)},n.prototype.iushrn=function(e,r,i){o(typeof e=="number"&&e>=0);var f;r?f=(r-r%26)/26:f=0;var h=e%26,l=Math.min((e-h)/26,this.length),p=67108863^67108863>>>h<<h,s=i;if(f-=l,f=Math.max(0,f),s){for(var t=0;t<l;t++)s.words[t]=this.words[t];s.length=l}if(l!==0)if(this.length>l)for(this.length-=l,t=0;t<this.length;t++)this.words[t]=this.words[t+l];else this.words[0]=0,this.length=1;var u=0;for(t=this.length-1;t>=0&&(u!==0||t>=f);t--){var S=this.words[t]|0;this.words[t]=u<<26-h|S>>>h,u=S&p}return s&&u!==0&&(s.words[s.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return o(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return!1;var h=this.words[i];return!!(h&f)},n.prototype.imaskn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var f=67108863^67108863>>>r<<r;this.words[this.length-1]&=f}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return o(typeof e=="number"),o(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(o(typeof e=="number"),o(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,r,i){var f=e.length+i,h;this._expand(f);var l,p=0;for(h=0;h<e.length;h++){l=(this.words[h+i]|0)+p;var s=(e.words[h]|0)*r;l-=s&67108863,p=(l>>26)-(s/67108864|0),this.words[h+i]=l&67108863}for(;h<this.length-i;h++)l=(this.words[h+i]|0)+p,p=l>>26,this.words[h+i]=l&67108863;if(p===0)return this.strip();for(o(p===-1),p=0,h=0;h<this.length;h++)l=-(this.words[h]|0)+p,p=l>>26,this.words[h]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,f=this.clone(),h=e,l=h.words[h.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(h=h.ushln(i),f.iushln(i),l=h.words[h.length-1]|0);var s=f.length-h.length,t;if(r!=="mod"){t=new n(null),t.length=s+1,t.words=new Array(t.length);for(var u=0;u<t.length;u++)t.words[u]=0}var S=f.clone()._ishlnsubmul(h,1,s);S.negative===0&&(f=S,t&&(t.words[s]=1));for(var O=s-1;O>=0;O--){var H=(f.words[h.length+O]|0)*67108864+(f.words[h.length+O-1]|0);for(H=Math.min(H/l|0,67108863),f._ishlnsubmul(h,H,O);f.negative!==0;)H--,f.negative=0,f._ishlnsubmul(h,1,O),f.isZero()||(f.negative^=1);t&&(t.words[O]=H)}return t&&t.strip(),f.strip(),r!=="div"&&i!==0&&f.iushrn(i),{div:t||null,mod:f}},n.prototype.divmod=function(e,r,i){if(o(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(f=l.div.neg()),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.iadd(e)),{div:f,mod:h}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(f=l.div.neg()),{div:f,mod:l.mod}):(this.negative&e.negative)!==0?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.isub(e)),{div:l.div,mod:h}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,f=e.ushrn(1),h=e.andln(1),l=i.cmp(f);return l<0||h===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){o(e<=67108863);for(var r=(1<<26)%e,i=0,f=this.length-1;f>=0;f--)i=(r*i+(this.words[f]|0))%e;return i},n.prototype.idivn=function(e){o(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var f=(this.words[i]|0)+r*67108864;this.words[i]=f/e|0,r=f%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=new n(0),p=new n(1),s=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++s;for(var t=i.clone(),u=r.clone();!r.isZero();){for(var S=0,O=1;(r.words[0]&O)===0&&S<26;++S,O<<=1);if(S>0)for(r.iushrn(S);S-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(t),h.isub(u)),f.iushrn(1),h.iushrn(1);for(var H=0,Q=1;(i.words[0]&Q)===0&&H<26;++H,Q<<=1);if(H>0)for(i.iushrn(H);H-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(u)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(l),h.isub(p)):(i.isub(r),l.isub(f),p.isub(h))}return{a:l,b:p,gcd:i.iushln(s)}},n.prototype._invmp=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,s=1;(r.words[0]&s)===0&&p<26;++p,s<<=1);if(p>0)for(r.iushrn(p);p-- >0;)f.isOdd()&&f.iadd(l),f.iushrn(1);for(var t=0,u=1;(i.words[0]&u)===0&&t<26;++t,u<<=1);if(t>0)for(i.iushrn(t);t-- >0;)h.isOdd()&&h.iadd(l),h.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(h)):(i.isub(r),h.isub(f))}var S;return r.cmpn(1)===0?S=f:S=h,S.cmpn(0)<0&&S.iadd(e),S},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var f=0;r.isEven()&&i.isEven();f++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var h=r.cmp(i);if(h<0){var l=r;r=i,i=l}else if(h===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(f)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){o(typeof e=="number");var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=f,this;for(var h=f,l=i;h!==0&&l<this.length;l++){var p=this.words[l]|0;p+=h,h=p>>>26,p&=67108863,this.words[l]=p}return h!==0&&(this.words[l]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),o(e<=67108863,"Number is too big");var f=this.words[0]|0;i=f===e?0:f<e?-1:1}return this.negative!==0?-i|0:i},n.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var r=this.ucmp(e);return this.negative!==0?-r|0:r},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var f=this.words[i]|0,h=e.words[i]|0;if(f!==h){f<h?r=-1:f>h&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new J(e)},n.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var F={k256:null,p224:null,p192:null,p25519:null};function q(m,e){this.name=m,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},q.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var f=i<this.n?-1:r.ucmp(this.p);return f===0?(r.words[0]=0,r.length=1):f>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},q.prototype.split=function(e,r){e.iushrn(this.n,0,r)},q.prototype.imulK=function(e){return e.imul(this.k)};function L(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}x(L,q),L.prototype.split=function(e,r){for(var i=4194303,f=Math.min(e.length,9),h=0;h<f;h++)r.words[h]=e.words[h];if(r.length=f,e.length<=9){e.words[0]=0,e.length=1;return}var l=e.words[9];for(r.words[r.length++]=l&i,h=10;h<e.length;h++){var p=e.words[h]|0;e.words[h-10]=(p&i)<<4|l>>>22,l=p}l>>>=22,e.words[h-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var f=e.words[i]|0;r+=f*977,e.words[i]=r&67108863,r=f*64+(r/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function V(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}x(V,q);function ee(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}x(ee,q);function ne(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}x(ne,q),ne.prototype.imulK=function(e){for(var r=0,i=0;i<e.length;i++){var f=(e.words[i]|0)*19+r,h=f&67108863;f>>>=26,e.words[i]=h,r=f}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(F[e])return F[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new V;else if(e==="p192")r=new ee;else if(e==="p25519")r=new ne;else throw new Error("Unknown prime "+e);return F[e]=r,r};function J(m){if(typeof m=="string"){var e=n._prime(m);this.m=e.p,this.prime=e}else o(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}J.prototype._verify1=function(e){o(e.negative===0,"red works only with positives"),o(e.red,"red works only with red numbers")},J.prototype._verify2=function(e,r){o((e.negative|r.negative)===0,"red works only with positives"),o(e.red&&e.red===r.red,"red works only with red numbers")},J.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},J.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},J.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},J.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},J.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},J.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},J.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},J.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},J.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},J.prototype.isqr=function(e){return this.imul(e,e.clone())},J.prototype.sqr=function(e){return this.mul(e,e)},J.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);o(!f.isZero());var l=new n(1).toRed(this),p=l.redNeg(),s=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,s).cmp(p)!==0;)t.redIAdd(p);for(var u=this.pow(t,f),S=this.pow(e,f.addn(1).iushrn(1)),O=this.pow(e,f),H=h;O.cmp(l)!==0;){for(var Q=O,G=0;Q.cmp(l)!==0;G++)Q=Q.redSqr();o(G<H);var R=this.pow(u,new n(1).iushln(H-G-1));S=S.redMul(R),u=R.redSqr(),O=O.redMul(u),H=G}return S},J.prototype.invm=function(e){var r=e._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},J.prototype.pow=function(e,r){if(r.isZero())return new n(1).toRed(this);if(r.cmpn(1)===0)return e.clone();var i=4,f=new Array(1<<i);f[0]=new n(1).toRed(this),f[1]=e;for(var h=2;h<f.length;h++)f[h]=this.mul(f[h-1],e);var l=f[0],p=0,s=0,t=r.bitLength()%26;for(t===0&&(t=26),h=r.length-1;h>=0;h--){for(var u=r.words[h],S=t-1;S>=0;S--){var O=u>>S&1;if(l!==f[0]&&(l=this.sqr(l)),O===0&&p===0){s=0;continue}p<<=1,p|=O,s++,!(s!==i&&(h!==0||S!==0))&&(l=this.mul(l,f[p]),s=0,p=0)}t=26}return l},J.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},J.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new ue(e)};function ue(m){J.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}x(ue,J),ue.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},ue.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},ue.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(M,Ap)}(xi)),xi.exports}var _i={exports:{}},Rp=_i.exports,Hu;function Ip(){return Hu||(Hu=1,function(M){(function(a,c){function o(m,e){if(!m)throw new Error(e||"Assertion failed")}function x(m,e){m.super_=e;var r=function(){};r.prototype=e.prototype,m.prototype=new r,m.prototype.constructor=m}function n(m,e,r){if(n.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((e==="le"||e==="be")&&(r=e,e=10),this._init(m||0,e||10,r||"be"))}typeof a=="object"?a.exports=n:c.BN=n,n.BN=n,n.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=Nt().Buffer}catch{}n.isBN=function(e){return e instanceof n?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp(r)>0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var f=0;e[0]==="-"&&(f++,this.negative=1),f<e.length&&(r===16?this._parseHex(e,f,i):(this._parseBase(e,r,f),i==="le"&&this._initArray(this.toArray(),r,i)))},n.prototype._initNumber=function(e,r,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(o(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},n.prototype._initArray=function(e,r,i){if(o(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h,l,p=0;if(i==="be")for(f=e.length-1,h=0;f>=0;f-=3)l=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);else if(i==="le")for(f=0,h=0;f<e.length;f+=3)l=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);return this.strip()};function y(m,e){var r=m.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function b(m,e,r){var i=y(m,r);return r-1>=e&&(i|=y(m,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h=0,l=0,p;if(i==="be")for(f=e.length-1;f>=r;f-=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8;else{var s=e.length-r;for(f=s%2===0?r+1:r;f<e.length;f+=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8}this.strip()};function v(m,e,r,i){for(var f=0,h=Math.min(m.length,r),l=e;l<h;l++){var p=m.charCodeAt(l)-48;f*=i,p>=49?f+=p-49+10:p>=17?f+=p-17+10:f+=p}return f}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=r)f++;f--,h=h/r|0;for(var l=e.length-i,p=l%f,s=Math.min(l,l-p)+i,t=0,u=i;u<s;u+=f)t=v(e,u,u+f,r),this.imuln(h),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t);if(p!==0){var S=1;for(t=v(e,u,e.length,r),u=0;u<p;u++)S*=r;this.imuln(S),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],w=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var f=0,h=0,l=0;l<this.length;l++){var p=this.words[l],s=((p<<f|h)&16777215).toString(16);h=p>>>24-f&16777215,f+=2,f>=26&&(f-=26,l--),h!==0||l!==this.length-1?i=d[6-s.length]+s+i:i=s+i}for(h!==0&&(i=h.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=w[e],u=_[e];i="";var S=this.clone();for(S.negative=0;!S.isZero();){var O=S.modn(u).toString(e);S=S.idivn(u),S.isZero()?i=O+i:i=d[t-O.length]+O+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return o(typeof g<"u"),this.toArrayLike(g,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var f=this.byteLength(),h=i||Math.max(1,f);o(f<=h,"byte array longer than desired length"),o(h>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(h),s,t,u=this.clone();if(l){for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[t]=s;for(;t<h;t++)p[t]=0}else{for(t=0;t<h-f;t++)p[t]=0;for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[h-t-1]=s}return p},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return(r&8191)===0&&(i+=13,r>>>=13),(r&127)===0&&(i+=7,r>>>=7),(r&15)===0&&(i+=4,r>>>=4),(r&3)===0&&(i+=2,r>>>=2),(r&1)===0&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function E(m){for(var e=new Array(m.bitLength()),r=0;r<e.length;r++){var i=r/26|0,f=r%26;e[r]=(m.words[i]&1<<f)>>>f}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,i!==26)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},n.prototype.ior=function(e){return o((this.negative|e.negative)===0),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},n.prototype.iand=function(e){return o((this.negative|e.negative)===0),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var f=0;f<i.length;f++)this.words[f]=r.words[f]^i.words[f];if(this!==r)for(;f<r.length;f++)this.words[f]=r.words[f];return this.length=r.length,this.strip()},n.prototype.ixor=function(e){return o((this.negative|e.negative)===0),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){o(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var f=0;f<r;f++)this.words[f]=~this.words[f]&67108863;return i>0&&(this.words[f]=~this.words[f]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){o(typeof e=="number"&&e>=0);var i=e/26|0,f=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<f:this.words[i]=this.words[i]&~(1<<f),this.strip()},n.prototype.iadd=function(e){var r;if(this.negative!==0&&e.negative===0)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();var i,f;this.length>e.length?(i=this,f=e):(i=e,f=this);for(var h=0,l=0;l<f.length;l++)r=(i.words[l]|0)+(f.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;for(;h!==0&&l<i.length;l++)r=(i.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;if(this.length=i.length,h!==0)this.words[this.length]=h,this.length++;else if(i!==this)for(;l<i.length;l++)this.words[l]=i.words[l];return this},n.prototype.add=function(e){var r;return e.negative!==0&&this.negative===0?(e.negative=0,r=this.sub(e),e.negative^=1,r):e.negative===0&&this.negative!==0?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;i>0?(f=this,h=e):(f=e,h=this);for(var l=0,p=0;p<h.length;p++)r=(f.words[p]|0)-(h.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;for(;l!==0&&p<f.length;p++)r=(f.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;if(l===0&&p<f.length&&f!==this)for(;p<f.length;p++)this.words[p]=f.words[p];return this.length=Math.max(this.length,p),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};function B(m,e,r){r.negative=e.negative^m.negative;var i=m.length+e.length|0;r.length=i,i=i-1|0;var f=m.words[0]|0,h=e.words[0]|0,l=f*h,p=l&67108863,s=l/67108864|0;r.words[0]=p;for(var t=1;t<i;t++){for(var u=s>>>26,S=s&67108863,O=Math.min(t,e.length-1),H=Math.max(0,t-m.length+1);H<=O;H++){var Q=t-H|0;f=m.words[Q]|0,h=e.words[H]|0,l=f*h+S,u+=l/67108864|0,S=l&67108863}r.words[t]=S|0,s=u|0}return s!==0?r.words[t]=s|0:r.length--,r.strip()}var A=function(e,r,i){var f=e.words,h=r.words,l=i.words,p=0,s,t,u,S=f[0]|0,O=S&8191,H=S>>>13,Q=f[1]|0,G=Q&8191,R=Q>>>13,C=f[2]|0,$=C&8191,X=C>>>13,Z=f[3]|0,K=Z&8191,te=Z>>>13,Pe=f[4]|0,le=Pe&8191,ce=Pe>>>13,Le=f[5]|0,be=Le&8191,se=Le>>>13,Ue=f[6]|0,de=Ue&8191,ge=Ue>>>13,De=f[7]|0,ve=De&8191,_e=De>>>13,Ge=f[8]|0,Se=Ge&8191,Oe=Ge>>>13,Ze=f[9]|0,z=Ze&8191,T=Ze>>>13,D=h[0]|0,W=D&8191,re=D>>>13,pe=h[1]|0,ae=pe&8191,Me=pe>>>13,ze=h[2]|0,ye=ze&8191,Be=ze>>>13,He=h[3]|0,Ae=He&8191,Te=He>>>13,rt=h[4]|0,Ie=rt&8191,Ne=rt>>>13,nt=h[5]|0,j=nt&8191,N=nt>>>13,U=h[6]|0,Y=U&8191,ie=U>>>13,me=h[7]|0,fe=me&8191,xe=me>>>13,Ve=h[8]|0,we=Ve&8191,Re=Ve>>>13,Ke=h[9]|0,ke=Ke&8191,Ce=Ke>>>13;i.negative=e.negative^r.negative,i.length=19,s=Math.imul(O,W),t=Math.imul(O,re),t=t+Math.imul(H,W)|0,u=Math.imul(H,re);var Xe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,s=Math.imul(G,W),t=Math.imul(G,re),t=t+Math.imul(R,W)|0,u=Math.imul(R,re),s=s+Math.imul(O,ae)|0,t=t+Math.imul(O,Me)|0,t=t+Math.imul(H,ae)|0,u=u+Math.imul(H,Me)|0;var Qe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,s=Math.imul($,W),t=Math.imul($,re),t=t+Math.imul(X,W)|0,u=Math.imul(X,re),s=s+Math.imul(G,ae)|0,t=t+Math.imul(G,Me)|0,t=t+Math.imul(R,ae)|0,u=u+Math.imul(R,Me)|0,s=s+Math.imul(O,ye)|0,t=t+Math.imul(O,Be)|0,t=t+Math.imul(H,ye)|0,u=u+Math.imul(H,Be)|0;var lt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(lt>>>26)|0,lt&=67108863,s=Math.imul(K,W),t=Math.imul(K,re),t=t+Math.imul(te,W)|0,u=Math.imul(te,re),s=s+Math.imul($,ae)|0,t=t+Math.imul($,Me)|0,t=t+Math.imul(X,ae)|0,u=u+Math.imul(X,Me)|0,s=s+Math.imul(G,ye)|0,t=t+Math.imul(G,Be)|0,t=t+Math.imul(R,ye)|0,u=u+Math.imul(R,Be)|0,s=s+Math.imul(O,Ae)|0,t=t+Math.imul(O,Te)|0,t=t+Math.imul(H,Ae)|0,u=u+Math.imul(H,Te)|0;var dt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(dt>>>26)|0,dt&=67108863,s=Math.imul(le,W),t=Math.imul(le,re),t=t+Math.imul(ce,W)|0,u=Math.imul(ce,re),s=s+Math.imul(K,ae)|0,t=t+Math.imul(K,Me)|0,t=t+Math.imul(te,ae)|0,u=u+Math.imul(te,Me)|0,s=s+Math.imul($,ye)|0,t=t+Math.imul($,Be)|0,t=t+Math.imul(X,ye)|0,u=u+Math.imul(X,Be)|0,s=s+Math.imul(G,Ae)|0,t=t+Math.imul(G,Te)|0,t=t+Math.imul(R,Ae)|0,u=u+Math.imul(R,Te)|0,s=s+Math.imul(O,Ie)|0,t=t+Math.imul(O,Ne)|0,t=t+Math.imul(H,Ie)|0,u=u+Math.imul(H,Ne)|0;var pt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(be,W),t=Math.imul(be,re),t=t+Math.imul(se,W)|0,u=Math.imul(se,re),s=s+Math.imul(le,ae)|0,t=t+Math.imul(le,Me)|0,t=t+Math.imul(ce,ae)|0,u=u+Math.imul(ce,Me)|0,s=s+Math.imul(K,ye)|0,t=t+Math.imul(K,Be)|0,t=t+Math.imul(te,ye)|0,u=u+Math.imul(te,Be)|0,s=s+Math.imul($,Ae)|0,t=t+Math.imul($,Te)|0,t=t+Math.imul(X,Ae)|0,u=u+Math.imul(X,Te)|0,s=s+Math.imul(G,Ie)|0,t=t+Math.imul(G,Ne)|0,t=t+Math.imul(R,Ie)|0,u=u+Math.imul(R,Ne)|0,s=s+Math.imul(O,j)|0,t=t+Math.imul(O,N)|0,t=t+Math.imul(H,j)|0,u=u+Math.imul(H,N)|0;var vt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(de,W),t=Math.imul(de,re),t=t+Math.imul(ge,W)|0,u=Math.imul(ge,re),s=s+Math.imul(be,ae)|0,t=t+Math.imul(be,Me)|0,t=t+Math.imul(se,ae)|0,u=u+Math.imul(se,Me)|0,s=s+Math.imul(le,ye)|0,t=t+Math.imul(le,Be)|0,t=t+Math.imul(ce,ye)|0,u=u+Math.imul(ce,Be)|0,s=s+Math.imul(K,Ae)|0,t=t+Math.imul(K,Te)|0,t=t+Math.imul(te,Ae)|0,u=u+Math.imul(te,Te)|0,s=s+Math.imul($,Ie)|0,t=t+Math.imul($,Ne)|0,t=t+Math.imul(X,Ie)|0,u=u+Math.imul(X,Ne)|0,s=s+Math.imul(G,j)|0,t=t+Math.imul(G,N)|0,t=t+Math.imul(R,j)|0,u=u+Math.imul(R,N)|0,s=s+Math.imul(O,Y)|0,t=t+Math.imul(O,ie)|0,t=t+Math.imul(H,Y)|0,u=u+Math.imul(H,ie)|0;var mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(ve,W),t=Math.imul(ve,re),t=t+Math.imul(_e,W)|0,u=Math.imul(_e,re),s=s+Math.imul(de,ae)|0,t=t+Math.imul(de,Me)|0,t=t+Math.imul(ge,ae)|0,u=u+Math.imul(ge,Me)|0,s=s+Math.imul(be,ye)|0,t=t+Math.imul(be,Be)|0,t=t+Math.imul(se,ye)|0,u=u+Math.imul(se,Be)|0,s=s+Math.imul(le,Ae)|0,t=t+Math.imul(le,Te)|0,t=t+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Te)|0,s=s+Math.imul(K,Ie)|0,t=t+Math.imul(K,Ne)|0,t=t+Math.imul(te,Ie)|0,u=u+Math.imul(te,Ne)|0,s=s+Math.imul($,j)|0,t=t+Math.imul($,N)|0,t=t+Math.imul(X,j)|0,u=u+Math.imul(X,N)|0,s=s+Math.imul(G,Y)|0,t=t+Math.imul(G,ie)|0,t=t+Math.imul(R,Y)|0,u=u+Math.imul(R,ie)|0,s=s+Math.imul(O,fe)|0,t=t+Math.imul(O,xe)|0,t=t+Math.imul(H,fe)|0,u=u+Math.imul(H,xe)|0;var bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(Se,W),t=Math.imul(Se,re),t=t+Math.imul(Oe,W)|0,u=Math.imul(Oe,re),s=s+Math.imul(ve,ae)|0,t=t+Math.imul(ve,Me)|0,t=t+Math.imul(_e,ae)|0,u=u+Math.imul(_e,Me)|0,s=s+Math.imul(de,ye)|0,t=t+Math.imul(de,Be)|0,t=t+Math.imul(ge,ye)|0,u=u+Math.imul(ge,Be)|0,s=s+Math.imul(be,Ae)|0,t=t+Math.imul(be,Te)|0,t=t+Math.imul(se,Ae)|0,u=u+Math.imul(se,Te)|0,s=s+Math.imul(le,Ie)|0,t=t+Math.imul(le,Ne)|0,t=t+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,Ne)|0,s=s+Math.imul(K,j)|0,t=t+Math.imul(K,N)|0,t=t+Math.imul(te,j)|0,u=u+Math.imul(te,N)|0,s=s+Math.imul($,Y)|0,t=t+Math.imul($,ie)|0,t=t+Math.imul(X,Y)|0,u=u+Math.imul(X,ie)|0,s=s+Math.imul(G,fe)|0,t=t+Math.imul(G,xe)|0,t=t+Math.imul(R,fe)|0,u=u+Math.imul(R,xe)|0,s=s+Math.imul(O,we)|0,t=t+Math.imul(O,Re)|0,t=t+Math.imul(H,we)|0,u=u+Math.imul(H,Re)|0;var gt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(gt>>>26)|0,gt&=67108863,s=Math.imul(z,W),t=Math.imul(z,re),t=t+Math.imul(T,W)|0,u=Math.imul(T,re),s=s+Math.imul(Se,ae)|0,t=t+Math.imul(Se,Me)|0,t=t+Math.imul(Oe,ae)|0,u=u+Math.imul(Oe,Me)|0,s=s+Math.imul(ve,ye)|0,t=t+Math.imul(ve,Be)|0,t=t+Math.imul(_e,ye)|0,u=u+Math.imul(_e,Be)|0,s=s+Math.imul(de,Ae)|0,t=t+Math.imul(de,Te)|0,t=t+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,Te)|0,s=s+Math.imul(be,Ie)|0,t=t+Math.imul(be,Ne)|0,t=t+Math.imul(se,Ie)|0,u=u+Math.imul(se,Ne)|0,s=s+Math.imul(le,j)|0,t=t+Math.imul(le,N)|0,t=t+Math.imul(ce,j)|0,u=u+Math.imul(ce,N)|0,s=s+Math.imul(K,Y)|0,t=t+Math.imul(K,ie)|0,t=t+Math.imul(te,Y)|0,u=u+Math.imul(te,ie)|0,s=s+Math.imul($,fe)|0,t=t+Math.imul($,xe)|0,t=t+Math.imul(X,fe)|0,u=u+Math.imul(X,xe)|0,s=s+Math.imul(G,we)|0,t=t+Math.imul(G,Re)|0,t=t+Math.imul(R,we)|0,u=u+Math.imul(R,Re)|0,s=s+Math.imul(O,ke)|0,t=t+Math.imul(O,Ce)|0,t=t+Math.imul(H,ke)|0,u=u+Math.imul(H,Ce)|0;var yt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(z,ae),t=Math.imul(z,Me),t=t+Math.imul(T,ae)|0,u=Math.imul(T,Me),s=s+Math.imul(Se,ye)|0,t=t+Math.imul(Se,Be)|0,t=t+Math.imul(Oe,ye)|0,u=u+Math.imul(Oe,Be)|0,s=s+Math.imul(ve,Ae)|0,t=t+Math.imul(ve,Te)|0,t=t+Math.imul(_e,Ae)|0,u=u+Math.imul(_e,Te)|0,s=s+Math.imul(de,Ie)|0,t=t+Math.imul(de,Ne)|0,t=t+Math.imul(ge,Ie)|0,u=u+Math.imul(ge,Ne)|0,s=s+Math.imul(be,j)|0,t=t+Math.imul(be,N)|0,t=t+Math.imul(se,j)|0,u=u+Math.imul(se,N)|0,s=s+Math.imul(le,Y)|0,t=t+Math.imul(le,ie)|0,t=t+Math.imul(ce,Y)|0,u=u+Math.imul(ce,ie)|0,s=s+Math.imul(K,fe)|0,t=t+Math.imul(K,xe)|0,t=t+Math.imul(te,fe)|0,u=u+Math.imul(te,xe)|0,s=s+Math.imul($,we)|0,t=t+Math.imul($,Re)|0,t=t+Math.imul(X,we)|0,u=u+Math.imul(X,Re)|0,s=s+Math.imul(G,ke)|0,t=t+Math.imul(G,Ce)|0,t=t+Math.imul(R,ke)|0,u=u+Math.imul(R,Ce)|0;var wt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,ye),t=Math.imul(z,Be),t=t+Math.imul(T,ye)|0,u=Math.imul(T,Be),s=s+Math.imul(Se,Ae)|0,t=t+Math.imul(Se,Te)|0,t=t+Math.imul(Oe,Ae)|0,u=u+Math.imul(Oe,Te)|0,s=s+Math.imul(ve,Ie)|0,t=t+Math.imul(ve,Ne)|0,t=t+Math.imul(_e,Ie)|0,u=u+Math.imul(_e,Ne)|0,s=s+Math.imul(de,j)|0,t=t+Math.imul(de,N)|0,t=t+Math.imul(ge,j)|0,u=u+Math.imul(ge,N)|0,s=s+Math.imul(be,Y)|0,t=t+Math.imul(be,ie)|0,t=t+Math.imul(se,Y)|0,u=u+Math.imul(se,ie)|0,s=s+Math.imul(le,fe)|0,t=t+Math.imul(le,xe)|0,t=t+Math.imul(ce,fe)|0,u=u+Math.imul(ce,xe)|0,s=s+Math.imul(K,we)|0,t=t+Math.imul(K,Re)|0,t=t+Math.imul(te,we)|0,u=u+Math.imul(te,Re)|0,s=s+Math.imul($,ke)|0,t=t+Math.imul($,Ce)|0,t=t+Math.imul(X,ke)|0,u=u+Math.imul(X,Ce)|0;var Mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(z,Ae),t=Math.imul(z,Te),t=t+Math.imul(T,Ae)|0,u=Math.imul(T,Te),s=s+Math.imul(Se,Ie)|0,t=t+Math.imul(Se,Ne)|0,t=t+Math.imul(Oe,Ie)|0,u=u+Math.imul(Oe,Ne)|0,s=s+Math.imul(ve,j)|0,t=t+Math.imul(ve,N)|0,t=t+Math.imul(_e,j)|0,u=u+Math.imul(_e,N)|0,s=s+Math.imul(de,Y)|0,t=t+Math.imul(de,ie)|0,t=t+Math.imul(ge,Y)|0,u=u+Math.imul(ge,ie)|0,s=s+Math.imul(be,fe)|0,t=t+Math.imul(be,xe)|0,t=t+Math.imul(se,fe)|0,u=u+Math.imul(se,xe)|0,s=s+Math.imul(le,we)|0,t=t+Math.imul(le,Re)|0,t=t+Math.imul(ce,we)|0,u=u+Math.imul(ce,Re)|0,s=s+Math.imul(K,ke)|0,t=t+Math.imul(K,Ce)|0,t=t+Math.imul(te,ke)|0,u=u+Math.imul(te,Ce)|0;var xt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(z,Ie),t=Math.imul(z,Ne),t=t+Math.imul(T,Ie)|0,u=Math.imul(T,Ne),s=s+Math.imul(Se,j)|0,t=t+Math.imul(Se,N)|0,t=t+Math.imul(Oe,j)|0,u=u+Math.imul(Oe,N)|0,s=s+Math.imul(ve,Y)|0,t=t+Math.imul(ve,ie)|0,t=t+Math.imul(_e,Y)|0,u=u+Math.imul(_e,ie)|0,s=s+Math.imul(de,fe)|0,t=t+Math.imul(de,xe)|0,t=t+Math.imul(ge,fe)|0,u=u+Math.imul(ge,xe)|0,s=s+Math.imul(be,we)|0,t=t+Math.imul(be,Re)|0,t=t+Math.imul(se,we)|0,u=u+Math.imul(se,Re)|0,s=s+Math.imul(le,ke)|0,t=t+Math.imul(le,Ce)|0,t=t+Math.imul(ce,ke)|0,u=u+Math.imul(ce,Ce)|0;var _t=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(z,j),t=Math.imul(z,N),t=t+Math.imul(T,j)|0,u=Math.imul(T,N),s=s+Math.imul(Se,Y)|0,t=t+Math.imul(Se,ie)|0,t=t+Math.imul(Oe,Y)|0,u=u+Math.imul(Oe,ie)|0,s=s+Math.imul(ve,fe)|0,t=t+Math.imul(ve,xe)|0,t=t+Math.imul(_e,fe)|0,u=u+Math.imul(_e,xe)|0,s=s+Math.imul(de,we)|0,t=t+Math.imul(de,Re)|0,t=t+Math.imul(ge,we)|0,u=u+Math.imul(ge,Re)|0,s=s+Math.imul(be,ke)|0,t=t+Math.imul(be,Ce)|0,t=t+Math.imul(se,ke)|0,u=u+Math.imul(se,Ce)|0;var St=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(z,Y),t=Math.imul(z,ie),t=t+Math.imul(T,Y)|0,u=Math.imul(T,ie),s=s+Math.imul(Se,fe)|0,t=t+Math.imul(Se,xe)|0,t=t+Math.imul(Oe,fe)|0,u=u+Math.imul(Oe,xe)|0,s=s+Math.imul(ve,we)|0,t=t+Math.imul(ve,Re)|0,t=t+Math.imul(_e,we)|0,u=u+Math.imul(_e,Re)|0,s=s+Math.imul(de,ke)|0,t=t+Math.imul(de,Ce)|0,t=t+Math.imul(ge,ke)|0,u=u+Math.imul(ge,Ce)|0;var Et=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,fe),t=Math.imul(z,xe),t=t+Math.imul(T,fe)|0,u=Math.imul(T,xe),s=s+Math.imul(Se,we)|0,t=t+Math.imul(Se,Re)|0,t=t+Math.imul(Oe,we)|0,u=u+Math.imul(Oe,Re)|0,s=s+Math.imul(ve,ke)|0,t=t+Math.imul(ve,Ce)|0,t=t+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ce)|0;var Bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,we),t=Math.imul(z,Re),t=t+Math.imul(T,we)|0,u=Math.imul(T,Re),s=s+Math.imul(Se,ke)|0,t=t+Math.imul(Se,Ce)|0,t=t+Math.imul(Oe,ke)|0,u=u+Math.imul(Oe,Ce)|0;var At=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(z,ke),t=Math.imul(z,Ce),t=t+Math.imul(T,ke)|0,u=Math.imul(T,Ce);var Rt=(p+s|0)+((t&8191)<<13)|0;return p=(u+(t>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,l[0]=Xe,l[1]=Qe,l[2]=lt,l[3]=dt,l[4]=pt,l[5]=vt,l[6]=mt,l[7]=bt,l[8]=gt,l[9]=yt,l[10]=wt,l[11]=Mt,l[12]=xt,l[13]=_t,l[14]=St,l[15]=Et,l[16]=Bt,l[17]=At,l[18]=Rt,p!==0&&(l[19]=p,i.length++),i};Math.imul||(A=B);function P(m,e,r){r.negative=e.negative^m.negative,r.length=m.length+e.length;for(var i=0,f=0,h=0;h<r.length-1;h++){var l=f;f=0;for(var p=i&67108863,s=Math.min(h,e.length-1),t=Math.max(0,h-m.length+1);t<=s;t++){var u=h-t,S=m.words[u]|0,O=e.words[t]|0,H=S*O,Q=H&67108863;l=l+(H/67108864|0)|0,Q=Q+p|0,p=Q&67108863,l=l+(Q>>>26)|0,f+=l>>>26,l&=67108863}r.words[h]=p,i=l,l=f}return i!==0?r.words[h]=i:r.length--,r.strip()}function I(m,e,r){var i=new k;return i.mulp(m,e,r)}n.prototype.mulTo=function(e,r){var i,f=this.length+e.length;return this.length===10&&e.length===10?i=A(this,e,r):f<63?i=B(this,e,r):f<1024?i=P(this,e,r):i=I(this,e,r),i};function k(m,e){this.x=m,this.y=e}k.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,f=0;f<e;f++)r[f]=this.revBin(f,i,e);return r},k.prototype.revBin=function(e,r,i){if(e===0||e===i-1)return e;for(var f=0,h=0;h<r;h++)f|=(e&1)<<r-h-1,e>>=1;return f},k.prototype.permute=function(e,r,i,f,h,l){for(var p=0;p<l;p++)f[p]=r[e[p]],h[p]=i[e[p]]},k.prototype.transform=function(e,r,i,f,h,l){this.permute(l,e,r,i,f,h);for(var p=1;p<h;p<<=1)for(var s=p<<1,t=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),S=0;S<h;S+=s)for(var O=t,H=u,Q=0;Q<p;Q++){var G=i[S+Q],R=f[S+Q],C=i[S+Q+p],$=f[S+Q+p],X=O*C-H*$;$=O*$+H*C,C=X,i[S+Q]=G+C,f[S+Q]=R+$,i[S+Q+p]=G-C,f[S+Q+p]=R-$,Q!==s&&(X=t*O-u*H,H=t*H+u*O,O=X)}},k.prototype.guessLen13b=function(e,r){var i=Math.max(r,e)|1,f=i&1,h=0;for(i=i/2|0;i;i=i>>>1)h++;return 1<<h+1+f},k.prototype.conjugate=function(e,r,i){if(!(i<=1))for(var f=0;f<i/2;f++){var h=e[f];e[f]=e[i-f-1],e[i-f-1]=h,h=r[f],r[f]=-r[i-f-1],r[i-f-1]=-h}},k.prototype.normalize13b=function(e,r){for(var i=0,f=0;f<r/2;f++){var h=Math.round(e[2*f+1]/r)*8192+Math.round(e[2*f]/r)+i;e[f]=h&67108863,h<67108864?i=0:i=h/67108864|0}return e},k.prototype.convert13b=function(e,r,i,f){for(var h=0,l=0;l<r;l++)h=h+(e[l]|0),i[2*l]=h&8191,h=h>>>13,i[2*l+1]=h&8191,h=h>>>13;for(l=2*r;l<f;++l)i[l]=0;o(h===0),o((h&-8192)===0)},k.prototype.stub=function(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},k.prototype.mulp=function(e,r,i){var f=2*this.guessLen13b(e.length,r.length),h=this.makeRBT(f),l=this.stub(f),p=new Array(f),s=new Array(f),t=new Array(f),u=new Array(f),S=new Array(f),O=new Array(f),H=i.words;H.length=f,this.convert13b(e.words,e.length,p,f),this.convert13b(r.words,r.length,u,f),this.transform(p,l,s,t,f,h),this.transform(u,l,S,O,f,h);for(var Q=0;Q<f;Q++){var G=s[Q]*S[Q]-t[Q]*O[Q];t[Q]=s[Q]*O[Q]+t[Q]*S[Q],s[Q]=G}return this.conjugate(s,t,f),this.transform(s,t,H,l,f,h),this.conjugate(H,l,f),this.normalize13b(H,f),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},n.prototype.mul=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},n.prototype.mulf=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),I(this,e,r)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){o(typeof e=="number"),o(e<67108864);for(var r=0,i=0;i<this.length;i++){var f=(this.words[i]|0)*e,h=(f&67108863)+(r&67108863);r>>=26,r+=f/67108864|0,r+=h>>>26,this.words[i]=h&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=E(e);if(r.length===0)return new n(1);for(var i=this,f=0;f<r.length&&r[f]===0;f++,i=i.sqr());if(++f<r.length)for(var h=i.sqr();f<r.length;f++,h=h.sqr())r[f]!==0&&(i=i.mul(h));return i},n.prototype.iushln=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r,h;if(r!==0){var l=0;for(h=0;h<this.length;h++){var p=this.words[h]&f,s=(this.words[h]|0)-p<<r;this.words[h]=s|l,l=p>>>26-r}l&&(this.words[h]=l,this.length++)}if(i!==0){for(h=this.length-1;h>=0;h--)this.words[h+i]=this.words[h];for(h=0;h<i;h++)this.words[h]=0;this.length+=i}return this.strip()},n.prototype.ishln=function(e){return o(this.negative===0),this.iushln(e)},n.prototype.iushrn=function(e,r,i){o(typeof e=="number"&&e>=0);var f;r?f=(r-r%26)/26:f=0;var h=e%26,l=Math.min((e-h)/26,this.length),p=67108863^67108863>>>h<<h,s=i;if(f-=l,f=Math.max(0,f),s){for(var t=0;t<l;t++)s.words[t]=this.words[t];s.length=l}if(l!==0)if(this.length>l)for(this.length-=l,t=0;t<this.length;t++)this.words[t]=this.words[t+l];else this.words[0]=0,this.length=1;var u=0;for(t=this.length-1;t>=0&&(u!==0||t>=f);t--){var S=this.words[t]|0;this.words[t]=u<<26-h|S>>>h,u=S&p}return s&&u!==0&&(s.words[s.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return o(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return!1;var h=this.words[i];return!!(h&f)},n.prototype.imaskn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var f=67108863^67108863>>>r<<r;this.words[this.length-1]&=f}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return o(typeof e=="number"),o(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(o(typeof e=="number"),o(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,r,i){var f=e.length+i,h;this._expand(f);var l,p=0;for(h=0;h<e.length;h++){l=(this.words[h+i]|0)+p;var s=(e.words[h]|0)*r;l-=s&67108863,p=(l>>26)-(s/67108864|0),this.words[h+i]=l&67108863}for(;h<this.length-i;h++)l=(this.words[h+i]|0)+p,p=l>>26,this.words[h+i]=l&67108863;if(p===0)return this.strip();for(o(p===-1),p=0,h=0;h<this.length;h++)l=-(this.words[h]|0)+p,p=l>>26,this.words[h]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,f=this.clone(),h=e,l=h.words[h.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(h=h.ushln(i),f.iushln(i),l=h.words[h.length-1]|0);var s=f.length-h.length,t;if(r!=="mod"){t=new n(null),t.length=s+1,t.words=new Array(t.length);for(var u=0;u<t.length;u++)t.words[u]=0}var S=f.clone()._ishlnsubmul(h,1,s);S.negative===0&&(f=S,t&&(t.words[s]=1));for(var O=s-1;O>=0;O--){var H=(f.words[h.length+O]|0)*67108864+(f.words[h.length+O-1]|0);for(H=Math.min(H/l|0,67108863),f._ishlnsubmul(h,H,O);f.negative!==0;)H--,f.negative=0,f._ishlnsubmul(h,1,O),f.isZero()||(f.negative^=1);t&&(t.words[O]=H)}return t&&t.strip(),f.strip(),r!=="div"&&i!==0&&f.iushrn(i),{div:t||null,mod:f}},n.prototype.divmod=function(e,r,i){if(o(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(f=l.div.neg()),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.iadd(e)),{div:f,mod:h}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(f=l.div.neg()),{div:f,mod:l.mod}):(this.negative&e.negative)!==0?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.isub(e)),{div:l.div,mod:h}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,f=e.ushrn(1),h=e.andln(1),l=i.cmp(f);return l<0||h===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){o(e<=67108863);for(var r=(1<<26)%e,i=0,f=this.length-1;f>=0;f--)i=(r*i+(this.words[f]|0))%e;return i},n.prototype.idivn=function(e){o(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var f=(this.words[i]|0)+r*67108864;this.words[i]=f/e|0,r=f%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=new n(0),p=new n(1),s=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++s;for(var t=i.clone(),u=r.clone();!r.isZero();){for(var S=0,O=1;(r.words[0]&O)===0&&S<26;++S,O<<=1);if(S>0)for(r.iushrn(S);S-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(t),h.isub(u)),f.iushrn(1),h.iushrn(1);for(var H=0,Q=1;(i.words[0]&Q)===0&&H<26;++H,Q<<=1);if(H>0)for(i.iushrn(H);H-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(u)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(l),h.isub(p)):(i.isub(r),l.isub(f),p.isub(h))}return{a:l,b:p,gcd:i.iushln(s)}},n.prototype._invmp=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,s=1;(r.words[0]&s)===0&&p<26;++p,s<<=1);if(p>0)for(r.iushrn(p);p-- >0;)f.isOdd()&&f.iadd(l),f.iushrn(1);for(var t=0,u=1;(i.words[0]&u)===0&&t<26;++t,u<<=1);if(t>0)for(i.iushrn(t);t-- >0;)h.isOdd()&&h.iadd(l),h.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(h)):(i.isub(r),h.isub(f))}var S;return r.cmpn(1)===0?S=f:S=h,S.cmpn(0)<0&&S.iadd(e),S},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var f=0;r.isEven()&&i.isEven();f++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var h=r.cmp(i);if(h<0){var l=r;r=i,i=l}else if(h===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(f)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){o(typeof e=="number");var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=f,this;for(var h=f,l=i;h!==0&&l<this.length;l++){var p=this.words[l]|0;p+=h,h=p>>>26,p&=67108863,this.words[l]=p}return h!==0&&(this.words[l]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),o(e<=67108863,"Number is too big");var f=this.words[0]|0;i=f===e?0:f<e?-1:1}return this.negative!==0?-i|0:i},n.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var r=this.ucmp(e);return this.negative!==0?-r|0:r},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var f=this.words[i]|0,h=e.words[i]|0;if(f!==h){f<h?r=-1:f>h&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new J(e)},n.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var F={k256:null,p224:null,p192:null,p25519:null};function q(m,e){this.name=m,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},q.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var f=i<this.n?-1:r.ucmp(this.p);return f===0?(r.words[0]=0,r.length=1):f>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},q.prototype.split=function(e,r){e.iushrn(this.n,0,r)},q.prototype.imulK=function(e){return e.imul(this.k)};function L(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}x(L,q),L.prototype.split=function(e,r){for(var i=4194303,f=Math.min(e.length,9),h=0;h<f;h++)r.words[h]=e.words[h];if(r.length=f,e.length<=9){e.words[0]=0,e.length=1;return}var l=e.words[9];for(r.words[r.length++]=l&i,h=10;h<e.length;h++){var p=e.words[h]|0;e.words[h-10]=(p&i)<<4|l>>>22,l=p}l>>>=22,e.words[h-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var f=e.words[i]|0;r+=f*977,e.words[i]=r&67108863,r=f*64+(r/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function V(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}x(V,q);function ee(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}x(ee,q);function ne(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}x(ne,q),ne.prototype.imulK=function(e){for(var r=0,i=0;i<e.length;i++){var f=(e.words[i]|0)*19+r,h=f&67108863;f>>>=26,e.words[i]=h,r=f}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(F[e])return F[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new V;else if(e==="p192")r=new ee;else if(e==="p25519")r=new ne;else throw new Error("Unknown prime "+e);return F[e]=r,r};function J(m){if(typeof m=="string"){var e=n._prime(m);this.m=e.p,this.prime=e}else o(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}J.prototype._verify1=function(e){o(e.negative===0,"red works only with positives"),o(e.red,"red works only with red numbers")},J.prototype._verify2=function(e,r){o((e.negative|r.negative)===0,"red works only with positives"),o(e.red&&e.red===r.red,"red works only with red numbers")},J.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},J.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},J.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},J.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},J.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},J.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},J.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},J.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},J.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},J.prototype.isqr=function(e){return this.imul(e,e.clone())},J.prototype.sqr=function(e){return this.mul(e,e)},J.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);o(!f.isZero());var l=new n(1).toRed(this),p=l.redNeg(),s=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,s).cmp(p)!==0;)t.redIAdd(p);for(var u=this.pow(t,f),S=this.pow(e,f.addn(1).iushrn(1)),O=this.pow(e,f),H=h;O.cmp(l)!==0;){for(var Q=O,G=0;Q.cmp(l)!==0;G++)Q=Q.redSqr();o(G<H);var R=this.pow(u,new n(1).iushln(H-G-1));S=S.redMul(R),u=R.redSqr(),O=O.redMul(u),H=G}return S},J.prototype.invm=function(e){var r=e._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},J.prototype.pow=function(e,r){if(r.isZero())return new n(1).toRed(this);if(r.cmpn(1)===0)return e.clone();var i=4,f=new Array(1<<i);f[0]=new n(1).toRed(this),f[1]=e;for(var h=2;h<f.length;h++)f[h]=this.mul(f[h-1],e);var l=f[0],p=0,s=0,t=r.bitLength()%26;for(t===0&&(t=26),h=r.length-1;h>=0;h--){for(var u=r.words[h],S=t-1;S>=0;S--){var O=u>>S&1;if(l!==f[0]&&(l=this.sqr(l)),O===0&&p===0){s=0;continue}p<<=1,p|=O,s++,!(s!==i&&(h!==0||S!==0))&&(l=this.mul(l,f[p]),s=0,p=0)}t=26}return l},J.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},J.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new ue(e)};function ue(m){J.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}x(ue,J),ue.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},ue.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},ue.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(M,Rp)}(_i)),_i.exports}var Nf,Ku;function zu(){if(Ku)return Nf;Ku=1;var M=Ip(),a=Yr();function c(o){this.rand=o||new a.Rand}return Nf=c,c.create=function(x){return new c(x)},c.prototype._randbelow=function(x){var n=x.bitLength(),g=Math.ceil(n/8);do var y=new M(this.rand.generate(g));while(y.cmp(x)>=0);return y},c.prototype._randrange=function(x,n){var g=n.sub(x);return x.add(this._randbelow(g))},c.prototype.test=function(x,n,g){var y=x.bitLength(),b=M.mont(x),v=new M(1).toRed(b);n||(n=Math.max(1,y/48|0));for(var d=x.subn(1),w=0;!d.testn(w);w++);for(var _=x.shrn(w),E=d.toRed(b),B=!0;n>0;n--){var A=this._randrange(new M(2),d);g&&g(A);var P=A.toRed(b).redPow(_);if(!(P.cmp(v)===0||P.cmp(E)===0)){for(var I=1;I<w;I++){if(P=P.redSqr(),P.cmp(v)===0)return!1;if(P.cmp(E)===0)break}if(I===w)return!1}}return B},c.prototype.getDivisor=function(x,n){var g=x.bitLength(),y=M.mont(x),b=new M(1).toRed(y);n||(n=Math.max(1,g/48|0));for(var v=x.subn(1),d=0;!v.testn(d);d++);for(var w=x.shrn(d),_=v.toRed(y);n>0;n--){var E=this._randrange(new M(2),v),B=x.gcd(E);if(B.cmpn(1)!==0)return B;var A=E.toRed(y).redPow(w);if(!(A.cmp(b)===0||A.cmp(_)===0)){for(var P=1;P<d;P++){if(A=A.redSqr(),A.cmp(b)===0)return A.fromRed().subn(1).gcd(x);if(A.cmp(_)===0)break}if(P===d)return A=A.redSqr(),A.fromRed().subn(1).gcd(x)}}return!1},Nf}var Cf,ju;function Vu(){if(ju)return Cf;ju=1;var M=yr();Cf=P,P.simpleSieve=B,P.fermatTest=A;var a=Uu(),c=new a(24),o=zu(),x=new o,n=new a(1),g=new a(2),y=new a(5);new a(16),new a(8);var b=new a(10),v=new a(3);new a(7);var d=new a(11),w=new a(4);new a(12);var _=null;function E(){if(_!==null)return _;var I=1048576,k=[];k[0]=2;for(var F=1,q=3;q<I;q+=2){for(var L=Math.ceil(Math.sqrt(q)),V=0;V<F&&k[V]<=L&&q%k[V]!==0;V++);F!==V&&k[V]<=L||(k[F++]=q)}return _=k,k}function B(I){for(var k=E(),F=0;F<k.length;F++)if(I.modn(k[F])===0)return I.cmpn(k[F])===0;return!0}function A(I){var k=a.mont(I);return g.toRed(k).redPow(I.subn(1)).fromRed().cmpn(1)===0}function P(I,k){if(I<16)return k===2||k===5?new a([140,123]):new a([140,39]);k=new a(k);for(var F,q;;){for(F=new a(M(Math.ceil(I/8)));F.bitLength()>I;)F.ishrn(1);if(F.isEven()&&F.iadd(n),F.testn(1)||F.iadd(g),k.cmp(g)){if(!k.cmp(y))for(;F.mod(b).cmp(v);)F.iadd(w)}else for(;F.mod(c).cmp(d);)F.iadd(w);if(q=F.shrn(1),B(q)&&B(F)&&A(q)&&A(F)&&x.test(q)&&x.test(F))return F}}return Cf}const Op={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}};var qf,$u;function kp(){if($u)return qf;$u=1;var M=Uu(),a=zu(),c=new a,o=new M(24),x=new M(11),n=new M(10),g=new M(3),y=new M(7),b=Vu(),v=yr();qf=B;function d(P,I){return I=I||"utf8",he.isBuffer(P)||(P=new he(P,I)),this._pub=new M(P),this}function w(P,I){return I=I||"utf8",he.isBuffer(P)||(P=new he(P,I)),this._priv=new M(P),this}var _={};function E(P,I){var k=I.toString("hex"),F=[k,P.toString(16)].join("_");if(F in _)return _[F];var q=0;if(P.isEven()||!b.simpleSieve||!b.fermatTest(P)||!c.test(P))return q+=1,k==="02"||k==="05"?q+=8:q+=4,_[F]=q,q;c.test(P.shrn(1))||(q+=2);var L;switch(k){case"02":P.mod(o).cmp(x)&&(q+=8);break;case"05":L=P.mod(n),L.cmp(g)&&L.cmp(y)&&(q+=8);break;default:q+=4}return _[F]=q,q}function B(P,I,k){this.setGenerator(I),this.__prime=new M(P),this._prime=M.mont(this.__prime),this._primeLen=P.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,k?(this.setPublicKey=d,this.setPrivateKey=w):this._primeCode=8}Object.defineProperty(B.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=E(this.__prime,this.__gen)),this._primeCode}}),B.prototype.generateKeys=function(){return this._priv||(this._priv=new M(v(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},B.prototype.computeSecret=function(P){P=new M(P),P=P.toRed(this._prime);var I=P.redPow(this._priv).fromRed(),k=new he(I.toArray()),F=this.getPrime();if(k.length<F.length){var q=new he(F.length-k.length);q.fill(0),k=he.concat([q,k])}return k},B.prototype.getPublicKey=function(I){return A(this._pub,I)},B.prototype.getPrivateKey=function(I){return A(this._priv,I)},B.prototype.getPrime=function(P){return A(this.__prime,P)},B.prototype.getGenerator=function(P){return A(this._gen,P)},B.prototype.setGenerator=function(P,I){return I=I||"utf8",he.isBuffer(P)||(P=new he(P,I)),this.__gen=P,this._gen=new M(P),this};function A(P,I){var k=new he(P.toArray());return I?k.toString(I):k}return qf}var Gu;function Pp(){if(Gu)return _r;Gu=1;var M=Vu(),a=Op,c=kp();function o(g){var y=new he(a[g].prime,"hex"),b=new he(a[g].gen,"hex");return new c(y,b)}var x={binary:!0,hex:!0,base64:!0};function n(g,y,b,v){return he.isBuffer(y)||x[y]===void 0?n(g,"binary",y,b):(y=y||"binary",v=v||"binary",b=b||new he([2]),he.isBuffer(b)||(b=new he(b,v)),typeof g=="number"?new c(M(g,b),b,!0):(he.isBuffer(g)||(g=new he(g,y)),new c(g,b,!0)))}return _r.DiffieHellmanGroup=_r.createDiffieHellmanGroup=_r.getDiffieHellman=o,_r.createDiffieHellman=_r.DiffieHellman=n,_r}var Si={exports:{}},Lf,Wu;function Yu(){return Wu||(Wu=1,Lf=wr().EventEmitter),Lf}var Ei={exports:{}},Ju;function Ff(){return Ju||(Ju=1,function(M,a){var c=Nt(),o=c.Buffer;function x(g,y){for(var b in g)y[b]=g[b]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?M.exports=c:(x(c,a),a.Buffer=n);function n(g,y,b){return o(g,y,b)}x(o,n),n.from=function(g,y,b){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,b)},n.alloc=function(g,y,b){if(typeof g!="number")throw new TypeError("Argument must be a number");var v=o(g);return y!==void 0?typeof b=="string"?v.fill(y,b):v.fill(y):v.fill(0),v},n.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},n.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(g)}}(Ei,Ei.exports)),Ei.exports}var Df={exports:{}},Zu;function Tp(){return Zu||(Zu=1,function(M){function a(n,g){if(!(n instanceof g))throw new TypeError("Cannot call a class as a function")}var c=Ff().Buffer,o=Ir();function x(n,g,y){n.copy(g,y)}M.exports=function(){function n(){a(this,n),this.head=null,this.tail=null,this.length=0}return n.prototype.push=function(y){var b={data:y,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length},n.prototype.unshift=function(y){var b={data:y,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length},n.prototype.shift=function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}},n.prototype.clear=function(){this.head=this.tail=null,this.length=0},n.prototype.join=function(y){if(this.length===0)return"";for(var b=this.head,v=""+b.data;b=b.next;)v+=y+b.data;return v},n.prototype.concat=function(y){if(this.length===0)return c.alloc(0);for(var b=c.allocUnsafe(y>>>0),v=this.head,d=0;v;)x(v.data,b,d),d+=v.data.length,v=v.next;return b},n}(),o&&o.inspect&&o.inspect.custom&&(M.exports.prototype[o.inspect.custom]=function(){var n=o.inspect({length:this.length});return this.constructor.name+" "+n})}(Df)),Df.exports}var Uf,Xu;function Qu(){if(Xu)return Uf;Xu=1;var M=dr();function a(x,n){var g=this,y=this._readableState&&this._readableState.destroyed,b=this._writableState&&this._writableState.destroyed;return y||b?(n?n(x):x&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,M.nextTick(o,this,x)):M.nextTick(o,this,x)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(x||null,function(v){!n&&v?g._writableState?g._writableState.errorEmitted||(g._writableState.errorEmitted=!0,M.nextTick(o,g,v)):M.nextTick(o,g,v):n&&n(v)}),this)}function c(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(x,n){x.emit("error",n)}return Uf={destroy:a,undestroy:c},Uf}var Hf,ec;function tc(){if(ec)return Hf;ec=1;var M=dr();Hf=A;function a(l){var p=this;this.next=null,this.entry=null,this.finish=function(){h(p,l)}}var c=!je.browser&&["v0.10","v0.9."].indexOf(je.version.slice(0,5))>-1?setImmediate:M.nextTick,o;A.WritableState=E;var x=Object.create(ir());x.inherits=Ye();var n={deprecate:da()},g=Yu(),y=Ff().Buffer,b=(typeof et<"u"?et:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function v(l){return y.from(l)}function d(l){return y.isBuffer(l)||l instanceof b}var w=Qu();x.inherits(A,g);function _(){}function E(l,p){o=o||Cr(),l=l||{};var s=p instanceof o;this.objectMode=!!l.objectMode,s&&(this.objectMode=this.objectMode||!!l.writableObjectMode);var t=l.highWaterMark,u=l.writableHighWaterMark,S=this.objectMode?16:16*1024;t||t===0?this.highWaterMark=t:s&&(u||u===0)?this.highWaterMark=u:this.highWaterMark=S,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var O=l.decodeStrings===!1;this.decodeStrings=!O,this.defaultEncoding=l.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(H){ee(p,H)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}E.prototype.getBuffer=function(){for(var p=this.bufferedRequest,s=[];p;)s.push(p),p=p.next;return s},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var B;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(B=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(l){return B.call(this,l)?!0:this!==A?!1:l&&l._writableState instanceof E}})):B=function(l){return l instanceof this};function A(l){if(o=o||Cr(),!B.call(A,this)&&!(this instanceof o))return new A(l);this._writableState=new E(l,this),this.writable=!0,l&&(typeof l.write=="function"&&(this._write=l.write),typeof l.writev=="function"&&(this._writev=l.writev),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.final=="function"&&(this._final=l.final)),g.call(this)}A.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function P(l,p){var s=new Error("write after end");l.emit("error",s),M.nextTick(p,s)}function I(l,p,s,t){var u=!0,S=!1;return s===null?S=new TypeError("May not write null values to stream"):typeof s!="string"&&s!==void 0&&!p.objectMode&&(S=new TypeError("Invalid non-string/buffer chunk")),S&&(l.emit("error",S),M.nextTick(t,S),u=!1),u}A.prototype.write=function(l,p,s){var t=this._writableState,u=!1,S=!t.objectMode&&d(l);return S&&!y.isBuffer(l)&&(l=v(l)),typeof p=="function"&&(s=p,p=null),S?p="buffer":p||(p=t.defaultEncoding),typeof s!="function"&&(s=_),t.ended?P(this,s):(S||I(this,t,l,s))&&(t.pendingcb++,u=F(this,t,S,l,p,s)),u},A.prototype.cork=function(){var l=this._writableState;l.corked++},A.prototype.uncork=function(){var l=this._writableState;l.corked&&(l.corked--,!l.writing&&!l.corked&&!l.bufferProcessing&&l.bufferedRequest&&ue(this,l))},A.prototype.setDefaultEncoding=function(p){if(typeof p=="string"&&(p=p.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((p+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+p);return this._writableState.defaultEncoding=p,this};function k(l,p,s){return!l.objectMode&&l.decodeStrings!==!1&&typeof p=="string"&&(p=y.from(p,s)),p}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(l,p,s,t,u,S){if(!s){var O=k(p,t,u);t!==O&&(s=!0,u="buffer",t=O)}var H=p.objectMode?1:t.length;p.length+=H;var Q=p.length<p.highWaterMark;if(Q||(p.needDrain=!0),p.writing||p.corked){var G=p.lastBufferedRequest;p.lastBufferedRequest={chunk:t,encoding:u,isBuf:s,callback:S,next:null},G?G.next=p.lastBufferedRequest:p.bufferedRequest=p.lastBufferedRequest,p.bufferedRequestCount+=1}else q(l,p,!1,H,t,u,S);return Q}function q(l,p,s,t,u,S,O){p.writelen=t,p.writecb=O,p.writing=!0,p.sync=!0,s?l._writev(u,p.onwrite):l._write(u,S,p.onwrite),p.sync=!1}function L(l,p,s,t,u){--p.pendingcb,s?(M.nextTick(u,t),M.nextTick(i,l,p),l._writableState.errorEmitted=!0,l.emit("error",t)):(u(t),l._writableState.errorEmitted=!0,l.emit("error",t),i(l,p))}function V(l){l.writing=!1,l.writecb=null,l.length-=l.writelen,l.writelen=0}function ee(l,p){var s=l._writableState,t=s.sync,u=s.writecb;if(V(s),p)L(l,s,t,p,u);else{var S=m(s);!S&&!s.corked&&!s.bufferProcessing&&s.bufferedRequest&&ue(l,s),t?c(ne,l,s,S,u):ne(l,s,S,u)}}function ne(l,p,s,t){s||J(l,p),p.pendingcb--,t(),i(l,p)}function J(l,p){p.length===0&&p.needDrain&&(p.needDrain=!1,l.emit("drain"))}function ue(l,p){p.bufferProcessing=!0;var s=p.bufferedRequest;if(l._writev&&s&&s.next){var t=p.bufferedRequestCount,u=new Array(t),S=p.corkedRequestsFree;S.entry=s;for(var O=0,H=!0;s;)u[O]=s,s.isBuf||(H=!1),s=s.next,O+=1;u.allBuffers=H,q(l,p,!0,p.length,u,"",S.finish),p.pendingcb++,p.lastBufferedRequest=null,S.next?(p.corkedRequestsFree=S.next,S.next=null):p.corkedRequestsFree=new a(p),p.bufferedRequestCount=0}else{for(;s;){var Q=s.chunk,G=s.encoding,R=s.callback,C=p.objectMode?1:Q.length;if(q(l,p,!1,C,Q,G,R),s=s.next,p.bufferedRequestCount--,p.writing)break}s===null&&(p.lastBufferedRequest=null)}p.bufferedRequest=s,p.bufferProcessing=!1}A.prototype._write=function(l,p,s){s(new Error("_write() is not implemented"))},A.prototype._writev=null,A.prototype.end=function(l,p,s){var t=this._writableState;typeof l=="function"?(s=l,l=null,p=null):typeof p=="function"&&(s=p,p=null),l!=null&&this.write(l,p),t.corked&&(t.corked=1,this.uncork()),t.ending||f(this,t,s)};function m(l){return l.ending&&l.length===0&&l.bufferedRequest===null&&!l.finished&&!l.writing}function e(l,p){l._final(function(s){p.pendingcb--,s&&l.emit("error",s),p.prefinished=!0,l.emit("prefinish"),i(l,p)})}function r(l,p){!p.prefinished&&!p.finalCalled&&(typeof l._final=="function"?(p.pendingcb++,p.finalCalled=!0,M.nextTick(e,l,p)):(p.prefinished=!0,l.emit("prefinish")))}function i(l,p){var s=m(p);return s&&(r(l,p),p.pendingcb===0&&(p.finished=!0,l.emit("finish"))),s}function f(l,p,s){p.ending=!0,i(l,p),s&&(p.finished?M.nextTick(s):l.once("finish",s)),p.ended=!0,l.writable=!1}function h(l,p,s){var t=l.entry;for(l.entry=null;t;){var u=t.callback;p.pendingcb--,u(s),t=t.next}p.corkedRequestsFree.next=l}return Object.defineProperty(A.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(l){this._writableState&&(this._writableState.destroyed=l)}}),A.prototype.destroy=w.destroy,A.prototype._undestroy=w.undestroy,A.prototype._destroy=function(l,p){this.end(),p(l)},Hf}var Kf,rc;function Cr(){if(rc)return Kf;rc=1;var M=dr(),a=Object.keys||function(w){var _=[];for(var E in w)_.push(E);return _};Kf=b;var c=Object.create(ir());c.inherits=Ye();var o=nc(),x=tc();c.inherits(b,o);for(var n=a(x.prototype),g=0;g<n.length;g++){var y=n[g];b.prototype[y]||(b.prototype[y]=x.prototype[y])}function b(w){if(!(this instanceof b))return new b(w);o.call(this,w),x.call(this,w),w&&w.readable===!1&&(this.readable=!1),w&&w.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,w&&w.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",v)}Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function v(){this.allowHalfOpen||this._writableState.ended||M.nextTick(d,this)}function d(w){w.end()}return Object.defineProperty(b.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(w){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=w,this._writableState.destroyed=w)}}),b.prototype._destroy=function(w,_){this.push(null),this.end(),M.nextTick(_,w)},Kf}var zf,ic;function nc(){if(ic)return zf;ic=1;var M=dr();zf=k;var a=Ph(),c;k.ReadableState=I,wr().EventEmitter;var o=function(R,C){return R.listeners(C).length},x=Yu(),n=Ff().Buffer,g=(typeof et<"u"?et:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function y(R){return n.from(R)}function b(R){return n.isBuffer(R)||R instanceof g}var v=Object.create(ir());v.inherits=Ye();var d=Ir(),w=void 0;d&&d.debuglog?w=d.debuglog("stream"):w=function(){};var _=Tp(),E=Qu(),B;v.inherits(k,x);var A=["error","close","destroy","pause","resume"];function P(R,C,$){if(typeof R.prependListener=="function")return R.prependListener(C,$);!R._events||!R._events[C]?R.on(C,$):a(R._events[C])?R._events[C].unshift($):R._events[C]=[$,R._events[C]]}function I(R,C){c=c||Cr(),R=R||{};var $=C instanceof c;this.objectMode=!!R.objectMode,$&&(this.objectMode=this.objectMode||!!R.readableObjectMode);var X=R.highWaterMark,Z=R.readableHighWaterMark,K=this.objectMode?16:16*1024;X||X===0?this.highWaterMark=X:$&&(Z||Z===0)?this.highWaterMark=Z:this.highWaterMark=K,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(B||(B=Mr().StringDecoder),this.decoder=new B(R.encoding),this.encoding=R.encoding)}function k(R){if(c=c||Cr(),!(this instanceof k))return new k(R);this._readableState=new I(R,this),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),x.call(this)}Object.defineProperty(k.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),k.prototype.destroy=E.destroy,k.prototype._undestroy=E.undestroy,k.prototype._destroy=function(R,C){this.push(null),C(R)},k.prototype.push=function(R,C){var $=this._readableState,X;return $.objectMode?X=!0:typeof R=="string"&&(C=C||$.defaultEncoding,C!==$.encoding&&(R=n.from(R,C),C=""),X=!0),F(this,R,C,!1,X)},k.prototype.unshift=function(R){return F(this,R,null,!0,!1)};function F(R,C,$,X,Z){var K=R._readableState;if(C===null)K.reading=!1,ue(R,K);else{var te;Z||(te=L(K,C)),te?R.emit("error",te):K.objectMode||C&&C.length>0?(typeof C!="string"&&!K.objectMode&&Object.getPrototypeOf(C)!==n.prototype&&(C=y(C)),X?K.endEmitted?R.emit("error",new Error("stream.unshift() after end event")):q(R,K,C,!0):K.ended?R.emit("error",new Error("stream.push() after EOF")):(K.reading=!1,K.decoder&&!$?(C=K.decoder.write(C),K.objectMode||C.length!==0?q(R,K,C,!1):r(R,K)):q(R,K,C,!1))):X||(K.reading=!1)}return V(K)}function q(R,C,$,X){C.flowing&&C.length===0&&!C.sync?(R.emit("data",$),R.read(0)):(C.length+=C.objectMode?1:$.length,X?C.buffer.unshift($):C.buffer.push($),C.needReadable&&m(R)),r(R,C)}function L(R,C){var $;return!b(C)&&typeof C!="string"&&C!==void 0&&!R.objectMode&&($=new TypeError("Invalid non-string/buffer chunk")),$}function V(R){return!R.ended&&(R.needReadable||R.length<R.highWaterMark||R.length===0)}k.prototype.isPaused=function(){return this._readableState.flowing===!1},k.prototype.setEncoding=function(R){return B||(B=Mr().StringDecoder),this._readableState.decoder=new B(R),this._readableState.encoding=R,this};var ee=8388608;function ne(R){return R>=ee?R=ee:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function J(R,C){return R<=0||C.length===0&&C.ended?0:C.objectMode?1:R!==R?C.flowing&&C.length?C.buffer.head.data.length:C.length:(R>C.highWaterMark&&(C.highWaterMark=ne(R)),R<=C.length?R:C.ended?C.length:(C.needReadable=!0,0))}k.prototype.read=function(R){w("read",R),R=parseInt(R,10);var C=this._readableState,$=R;if(R!==0&&(C.emittedReadable=!1),R===0&&C.needReadable&&(C.length>=C.highWaterMark||C.ended))return w("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?H(this):m(this),null;if(R=J(R,C),R===0&&C.ended)return C.length===0&&H(this),null;var X=C.needReadable;w("need readable",X),(C.length===0||C.length-R<C.highWaterMark)&&(X=!0,w("length less than watermark",X)),C.ended||C.reading?(X=!1,w("reading or ended",X)):X&&(w("do read"),C.reading=!0,C.sync=!0,C.length===0&&(C.needReadable=!0),this._read(C.highWaterMark),C.sync=!1,C.reading||(R=J($,C)));var Z;return R>0?Z=t(R,C):Z=null,Z===null?(C.needReadable=!0,R=0):C.length-=R,C.length===0&&(C.ended||(C.needReadable=!0),$!==R&&C.ended&&H(this)),Z!==null&&this.emit("data",Z),Z};function ue(R,C){if(!C.ended){if(C.decoder){var $=C.decoder.end();$&&$.length&&(C.buffer.push($),C.length+=C.objectMode?1:$.length)}C.ended=!0,m(R)}}function m(R){var C=R._readableState;C.needReadable=!1,C.emittedReadable||(w("emitReadable",C.flowing),C.emittedReadable=!0,C.sync?M.nextTick(e,R):e(R))}function e(R){w("emit readable"),R.emit("readable"),s(R)}function r(R,C){C.readingMore||(C.readingMore=!0,M.nextTick(i,R,C))}function i(R,C){for(var $=C.length;!C.reading&&!C.flowing&&!C.ended&&C.length<C.highWaterMark&&(w("maybeReadMore read 0"),R.read(0),$!==C.length);)$=C.length;C.readingMore=!1}k.prototype._read=function(R){this.emit("error",new Error("_read() is not implemented"))},k.prototype.pipe=function(R,C){var $=this,X=this._readableState;switch(X.pipesCount){case 0:X.pipes=R;break;case 1:X.pipes=[X.pipes,R];break;default:X.pipes.push(R);break}X.pipesCount+=1,w("pipe count=%d opts=%j",X.pipesCount,C);var Z=(!C||C.end!==!1)&&R!==je.stdout&&R!==je.stderr,K=Z?Pe:De;X.endEmitted?M.nextTick(K):$.once("end",K),R.on("unpipe",te);function te(ve,_e){w("onunpipe"),ve===$&&_e&&_e.hasUnpiped===!1&&(_e.hasUnpiped=!0,Le())}function Pe(){w("onend"),R.end()}var le=f($);R.on("drain",le);var ce=!1;function Le(){w("cleanup"),R.removeListener("close",de),R.removeListener("finish",ge),R.removeListener("drain",le),R.removeListener("error",Ue),R.removeListener("unpipe",te),$.removeListener("end",Pe),$.removeListener("end",De),$.removeListener("data",se),ce=!0,X.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&le()}var be=!1;$.on("data",se);function se(ve){w("ondata"),be=!1;var _e=R.write(ve);_e===!1&&!be&&((X.pipesCount===1&&X.pipes===R||X.pipesCount>1&&G(X.pipes,R)!==-1)&&!ce&&(w("false write response, pause",X.awaitDrain),X.awaitDrain++,be=!0),$.pause())}function Ue(ve){w("onerror",ve),De(),R.removeListener("error",Ue),o(R,"error")===0&&R.emit("error",ve)}P(R,"error",Ue);function de(){R.removeListener("finish",ge),De()}R.once("close",de);function ge(){w("onfinish"),R.removeListener("close",de),De()}R.once("finish",ge);function De(){w("unpipe"),$.unpipe(R)}return R.emit("pipe",$),X.flowing||(w("pipe resume"),$.resume()),R};function f(R){return function(){var C=R._readableState;w("pipeOnDrain",C.awaitDrain),C.awaitDrain&&C.awaitDrain--,C.awaitDrain===0&&o(R,"data")&&(C.flowing=!0,s(R))}}k.prototype.unpipe=function(R){var C=this._readableState,$={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return R&&R!==C.pipes?this:(R||(R=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,R&&R.emit("unpipe",this,$),this);if(!R){var X=C.pipes,Z=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var K=0;K<Z;K++)X[K].emit("unpipe",this,{hasUnpiped:!1});return this}var te=G(C.pipes,R);return te===-1?this:(C.pipes.splice(te,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),R.emit("unpipe",this,$),this)},k.prototype.on=function(R,C){var $=x.prototype.on.call(this,R,C);if(R==="data")this._readableState.flowing!==!1&&this.resume();else if(R==="readable"){var X=this._readableState;!X.endEmitted&&!X.readableListening&&(X.readableListening=X.needReadable=!0,X.emittedReadable=!1,X.reading?X.length&&m(this):M.nextTick(h,this))}return $},k.prototype.addListener=k.prototype.on;function h(R){w("readable nexttick read 0"),R.read(0)}k.prototype.resume=function(){var R=this._readableState;return R.flowing||(w("resume"),R.flowing=!0,l(this,R)),this};function l(R,C){C.resumeScheduled||(C.resumeScheduled=!0,M.nextTick(p,R,C))}function p(R,C){C.reading||(w("resume read 0"),R.read(0)),C.resumeScheduled=!1,C.awaitDrain=0,R.emit("resume"),s(R),C.flowing&&!C.reading&&R.read(0)}k.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function s(R){var C=R._readableState;for(w("flow",C.flowing);C.flowing&&R.read()!==null;);}k.prototype.wrap=function(R){var C=this,$=this._readableState,X=!1;R.on("end",function(){if(w("wrapped end"),$.decoder&&!$.ended){var te=$.decoder.end();te&&te.length&&C.push(te)}C.push(null)}),R.on("data",function(te){if(w("wrapped data"),$.decoder&&(te=$.decoder.write(te)),!($.objectMode&&te==null)&&!(!$.objectMode&&(!te||!te.length))){var Pe=C.push(te);Pe||(X=!0,R.pause())}});for(var Z in R)this[Z]===void 0&&typeof R[Z]=="function"&&(this[Z]=function(te){return function(){return R[te].apply(R,arguments)}}(Z));for(var K=0;K<A.length;K++)R.on(A[K],this.emit.bind(this,A[K]));return this._read=function(te){w("wrapped _read",te),X&&(X=!1,R.resume())},this},Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),k._fromList=t;function t(R,C){if(C.length===0)return null;var $;return C.objectMode?$=C.buffer.shift():!R||R>=C.length?(C.decoder?$=C.buffer.join(""):C.buffer.length===1?$=C.buffer.head.data:$=C.buffer.concat(C.length),C.buffer.clear()):$=u(R,C.buffer,C.decoder),$}function u(R,C,$){var X;return R<C.head.data.length?(X=C.head.data.slice(0,R),C.head.data=C.head.data.slice(R)):R===C.head.data.length?X=C.shift():X=$?S(R,C):O(R,C),X}function S(R,C){var $=C.head,X=1,Z=$.data;for(R-=Z.length;$=$.next;){var K=$.data,te=R>K.length?K.length:R;if(te===K.length?Z+=K:Z+=K.slice(0,R),R-=te,R===0){te===K.length?(++X,$.next?C.head=$.next:C.head=C.tail=null):(C.head=$,$.data=K.slice(te));break}++X}return C.length-=X,Z}function O(R,C){var $=n.allocUnsafe(R),X=C.head,Z=1;for(X.data.copy($),R-=X.data.length;X=X.next;){var K=X.data,te=R>K.length?K.length:R;if(K.copy($,$.length-R,0,te),R-=te,R===0){te===K.length?(++Z,X.next?C.head=X.next:C.head=C.tail=null):(C.head=X,X.data=K.slice(te));break}++Z}return C.length-=Z,$}function H(R){var C=R._readableState;if(C.length>0)throw new Error('"endReadable()" called on non-empty stream');C.endEmitted||(C.ended=!0,M.nextTick(Q,C,R))}function Q(R,C){!R.endEmitted&&R.length===0&&(R.endEmitted=!0,C.readable=!1,C.emit("end"))}function G(R,C){for(var $=0,X=R.length;$<X;$++)if(R[$]===C)return $;return-1}return zf}var jf,ac;function fc(){if(ac)return jf;ac=1,jf=o;var M=Cr(),a=Object.create(ir());a.inherits=Ye(),a.inherits(o,M);function c(g,y){var b=this._transformState;b.transforming=!1;var v=b.writecb;if(!v)return this.emit("error",new Error("write callback called multiple times"));b.writechunk=null,b.writecb=null,y!=null&&this.push(y),v(g);var d=this._readableState;d.reading=!1,(d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}function o(g){if(!(this instanceof o))return new o(g);M.call(this,g),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,g&&(typeof g.transform=="function"&&(this._transform=g.transform),typeof g.flush=="function"&&(this._flush=g.flush)),this.on("prefinish",x)}function x(){var g=this;typeof this._flush=="function"?this._flush(function(y,b){n(g,y,b)}):n(this,null,null)}o.prototype.push=function(g,y){return this._transformState.needTransform=!1,M.prototype.push.call(this,g,y)},o.prototype._transform=function(g,y,b){throw new Error("_transform() is not implemented")},o.prototype._write=function(g,y,b){var v=this._transformState;if(v.writecb=b,v.writechunk=g,v.writeencoding=y,!v.transforming){var d=this._readableState;(v.needTransform||d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}},o.prototype._read=function(g){var y=this._transformState;y.writechunk!==null&&y.writecb&&!y.transforming?(y.transforming=!0,this._transform(y.writechunk,y.writeencoding,y.afterTransform)):y.needTransform=!0},o.prototype._destroy=function(g,y){var b=this;M.prototype._destroy.call(this,g,function(v){y(v),b.emit("close")})};function n(g,y,b){if(y)return g.emit("error",y);if(b!=null&&g.push(b),g._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(g._transformState.transforming)throw new Error("Calling transform done when still transforming");return g.push(null)}return jf}var Vf,sc;function Np(){if(sc)return Vf;sc=1,Vf=c;var M=fc(),a=Object.create(ir());a.inherits=Ye(),a.inherits(c,M);function c(o){if(!(this instanceof c))return new c(o);M.call(this,o)}return c.prototype._transform=function(o,x,n){n(null,o)},Vf}var oc;function Cp(){return oc||(oc=1,function(M,a){a=M.exports=nc(),a.Stream=a,a.Readable=a,a.Writable=tc(),a.Duplex=Cr(),a.Transform=fc(),a.PassThrough=Np()}(Si,Si.exports)),Si.exports}var jr={exports:{}},$f,hc;function Gf(){if(hc)return $f;hc=1;var M=er(),a=yr(),c=tt().Buffer;function o(g){var y=g.modulus.byteLength(),b;do b=new M(a(y));while(b.cmp(g.modulus)>=0||!b.umod(g.prime1)||!b.umod(g.prime2));return b}function x(g){var y=o(g),b=y.toRed(M.mont(g.modulus)).redPow(new M(g.publicExponent)).fromRed();return{blinder:b,unblinder:y.invm(g.modulus)}}function n(g,y){var b=x(y),v=y.modulus.byteLength(),d=new M(g).mul(b.blinder).umod(y.modulus),w=d.toRed(M.mont(y.prime1)),_=d.toRed(M.mont(y.prime2)),E=y.coefficient,B=y.prime1,A=y.prime2,P=w.redPow(y.exponent1).fromRed(),I=_.redPow(y.exponent2).fromRed(),k=P.isub(I).imul(E).umod(B).imul(A);return I.iadd(k).imul(b.unblinder).umod(y.modulus).toArrayLike(c,"be",v)}return n.getr=o,$f=n,$f}var Wf={};const qp={version:"6.6.1"};var Yf={},Bi={exports:{}},Lp=Bi.exports,uc;function cr(){return uc||(uc=1,function(M){(function(a,c){function o(m,e){if(!m)throw new Error(e||"Assertion failed")}function x(m,e){m.super_=e;var r=function(){};r.prototype=e.prototype,m.prototype=new r,m.prototype.constructor=m}function n(m,e,r){if(n.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((e==="le"||e==="be")&&(r=e,e=10),this._init(m||0,e||10,r||"be"))}typeof a=="object"?a.exports=n:c.BN=n,n.BN=n,n.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=Nt().Buffer}catch{}n.isBN=function(e){return e instanceof n?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp(r)>0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var f=0;e[0]==="-"&&(f++,this.negative=1),f<e.length&&(r===16?this._parseHex(e,f,i):(this._parseBase(e,r,f),i==="le"&&this._initArray(this.toArray(),r,i)))},n.prototype._initNumber=function(e,r,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(o(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},n.prototype._initArray=function(e,r,i){if(o(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h,l,p=0;if(i==="be")for(f=e.length-1,h=0;f>=0;f-=3)l=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);else if(i==="le")for(f=0,h=0;f<e.length;f+=3)l=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);return this.strip()};function y(m,e){var r=m.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function b(m,e,r){var i=y(m,r);return r-1>=e&&(i|=y(m,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h=0,l=0,p;if(i==="be")for(f=e.length-1;f>=r;f-=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8;else{var s=e.length-r;for(f=s%2===0?r+1:r;f<e.length;f+=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8}this.strip()};function v(m,e,r,i){for(var f=0,h=Math.min(m.length,r),l=e;l<h;l++){var p=m.charCodeAt(l)-48;f*=i,p>=49?f+=p-49+10:p>=17?f+=p-17+10:f+=p}return f}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=r)f++;f--,h=h/r|0;for(var l=e.length-i,p=l%f,s=Math.min(l,l-p)+i,t=0,u=i;u<s;u+=f)t=v(e,u,u+f,r),this.imuln(h),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t);if(p!==0){var S=1;for(t=v(e,u,e.length,r),u=0;u<p;u++)S*=r;this.imuln(S),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],w=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var f=0,h=0,l=0;l<this.length;l++){var p=this.words[l],s=((p<<f|h)&16777215).toString(16);h=p>>>24-f&16777215,f+=2,f>=26&&(f-=26,l--),h!==0||l!==this.length-1?i=d[6-s.length]+s+i:i=s+i}for(h!==0&&(i=h.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=w[e],u=_[e];i="";var S=this.clone();for(S.negative=0;!S.isZero();){var O=S.modn(u).toString(e);S=S.idivn(u),S.isZero()?i=O+i:i=d[t-O.length]+O+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return o(typeof g<"u"),this.toArrayLike(g,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var f=this.byteLength(),h=i||Math.max(1,f);o(f<=h,"byte array longer than desired length"),o(h>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(h),s,t,u=this.clone();if(l){for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[t]=s;for(;t<h;t++)p[t]=0}else{for(t=0;t<h-f;t++)p[t]=0;for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[h-t-1]=s}return p},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return(r&8191)===0&&(i+=13,r>>>=13),(r&127)===0&&(i+=7,r>>>=7),(r&15)===0&&(i+=4,r>>>=4),(r&3)===0&&(i+=2,r>>>=2),(r&1)===0&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function E(m){for(var e=new Array(m.bitLength()),r=0;r<e.length;r++){var i=r/26|0,f=r%26;e[r]=(m.words[i]&1<<f)>>>f}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,i!==26)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},n.prototype.ior=function(e){return o((this.negative|e.negative)===0),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},n.prototype.iand=function(e){return o((this.negative|e.negative)===0),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var f=0;f<i.length;f++)this.words[f]=r.words[f]^i.words[f];if(this!==r)for(;f<r.length;f++)this.words[f]=r.words[f];return this.length=r.length,this.strip()},n.prototype.ixor=function(e){return o((this.negative|e.negative)===0),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){o(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var f=0;f<r;f++)this.words[f]=~this.words[f]&67108863;return i>0&&(this.words[f]=~this.words[f]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){o(typeof e=="number"&&e>=0);var i=e/26|0,f=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<f:this.words[i]=this.words[i]&~(1<<f),this.strip()},n.prototype.iadd=function(e){var r;if(this.negative!==0&&e.negative===0)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();var i,f;this.length>e.length?(i=this,f=e):(i=e,f=this);for(var h=0,l=0;l<f.length;l++)r=(i.words[l]|0)+(f.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;for(;h!==0&&l<i.length;l++)r=(i.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;if(this.length=i.length,h!==0)this.words[this.length]=h,this.length++;else if(i!==this)for(;l<i.length;l++)this.words[l]=i.words[l];return this},n.prototype.add=function(e){var r;return e.negative!==0&&this.negative===0?(e.negative=0,r=this.sub(e),e.negative^=1,r):e.negative===0&&this.negative!==0?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;i>0?(f=this,h=e):(f=e,h=this);for(var l=0,p=0;p<h.length;p++)r=(f.words[p]|0)-(h.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;for(;l!==0&&p<f.length;p++)r=(f.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;if(l===0&&p<f.length&&f!==this)for(;p<f.length;p++)this.words[p]=f.words[p];return this.length=Math.max(this.length,p),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};function B(m,e,r){r.negative=e.negative^m.negative;var i=m.length+e.length|0;r.length=i,i=i-1|0;var f=m.words[0]|0,h=e.words[0]|0,l=f*h,p=l&67108863,s=l/67108864|0;r.words[0]=p;for(var t=1;t<i;t++){for(var u=s>>>26,S=s&67108863,O=Math.min(t,e.length-1),H=Math.max(0,t-m.length+1);H<=O;H++){var Q=t-H|0;f=m.words[Q]|0,h=e.words[H]|0,l=f*h+S,u+=l/67108864|0,S=l&67108863}r.words[t]=S|0,s=u|0}return s!==0?r.words[t]=s|0:r.length--,r.strip()}var A=function(e,r,i){var f=e.words,h=r.words,l=i.words,p=0,s,t,u,S=f[0]|0,O=S&8191,H=S>>>13,Q=f[1]|0,G=Q&8191,R=Q>>>13,C=f[2]|0,$=C&8191,X=C>>>13,Z=f[3]|0,K=Z&8191,te=Z>>>13,Pe=f[4]|0,le=Pe&8191,ce=Pe>>>13,Le=f[5]|0,be=Le&8191,se=Le>>>13,Ue=f[6]|0,de=Ue&8191,ge=Ue>>>13,De=f[7]|0,ve=De&8191,_e=De>>>13,Ge=f[8]|0,Se=Ge&8191,Oe=Ge>>>13,Ze=f[9]|0,z=Ze&8191,T=Ze>>>13,D=h[0]|0,W=D&8191,re=D>>>13,pe=h[1]|0,ae=pe&8191,Me=pe>>>13,ze=h[2]|0,ye=ze&8191,Be=ze>>>13,He=h[3]|0,Ae=He&8191,Te=He>>>13,rt=h[4]|0,Ie=rt&8191,Ne=rt>>>13,nt=h[5]|0,j=nt&8191,N=nt>>>13,U=h[6]|0,Y=U&8191,ie=U>>>13,me=h[7]|0,fe=me&8191,xe=me>>>13,Ve=h[8]|0,we=Ve&8191,Re=Ve>>>13,Ke=h[9]|0,ke=Ke&8191,Ce=Ke>>>13;i.negative=e.negative^r.negative,i.length=19,s=Math.imul(O,W),t=Math.imul(O,re),t=t+Math.imul(H,W)|0,u=Math.imul(H,re);var Xe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,s=Math.imul(G,W),t=Math.imul(G,re),t=t+Math.imul(R,W)|0,u=Math.imul(R,re),s=s+Math.imul(O,ae)|0,t=t+Math.imul(O,Me)|0,t=t+Math.imul(H,ae)|0,u=u+Math.imul(H,Me)|0;var Qe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,s=Math.imul($,W),t=Math.imul($,re),t=t+Math.imul(X,W)|0,u=Math.imul(X,re),s=s+Math.imul(G,ae)|0,t=t+Math.imul(G,Me)|0,t=t+Math.imul(R,ae)|0,u=u+Math.imul(R,Me)|0,s=s+Math.imul(O,ye)|0,t=t+Math.imul(O,Be)|0,t=t+Math.imul(H,ye)|0,u=u+Math.imul(H,Be)|0;var lt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(lt>>>26)|0,lt&=67108863,s=Math.imul(K,W),t=Math.imul(K,re),t=t+Math.imul(te,W)|0,u=Math.imul(te,re),s=s+Math.imul($,ae)|0,t=t+Math.imul($,Me)|0,t=t+Math.imul(X,ae)|0,u=u+Math.imul(X,Me)|0,s=s+Math.imul(G,ye)|0,t=t+Math.imul(G,Be)|0,t=t+Math.imul(R,ye)|0,u=u+Math.imul(R,Be)|0,s=s+Math.imul(O,Ae)|0,t=t+Math.imul(O,Te)|0,t=t+Math.imul(H,Ae)|0,u=u+Math.imul(H,Te)|0;var dt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(dt>>>26)|0,dt&=67108863,s=Math.imul(le,W),t=Math.imul(le,re),t=t+Math.imul(ce,W)|0,u=Math.imul(ce,re),s=s+Math.imul(K,ae)|0,t=t+Math.imul(K,Me)|0,t=t+Math.imul(te,ae)|0,u=u+Math.imul(te,Me)|0,s=s+Math.imul($,ye)|0,t=t+Math.imul($,Be)|0,t=t+Math.imul(X,ye)|0,u=u+Math.imul(X,Be)|0,s=s+Math.imul(G,Ae)|0,t=t+Math.imul(G,Te)|0,t=t+Math.imul(R,Ae)|0,u=u+Math.imul(R,Te)|0,s=s+Math.imul(O,Ie)|0,t=t+Math.imul(O,Ne)|0,t=t+Math.imul(H,Ie)|0,u=u+Math.imul(H,Ne)|0;var pt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(be,W),t=Math.imul(be,re),t=t+Math.imul(se,W)|0,u=Math.imul(se,re),s=s+Math.imul(le,ae)|0,t=t+Math.imul(le,Me)|0,t=t+Math.imul(ce,ae)|0,u=u+Math.imul(ce,Me)|0,s=s+Math.imul(K,ye)|0,t=t+Math.imul(K,Be)|0,t=t+Math.imul(te,ye)|0,u=u+Math.imul(te,Be)|0,s=s+Math.imul($,Ae)|0,t=t+Math.imul($,Te)|0,t=t+Math.imul(X,Ae)|0,u=u+Math.imul(X,Te)|0,s=s+Math.imul(G,Ie)|0,t=t+Math.imul(G,Ne)|0,t=t+Math.imul(R,Ie)|0,u=u+Math.imul(R,Ne)|0,s=s+Math.imul(O,j)|0,t=t+Math.imul(O,N)|0,t=t+Math.imul(H,j)|0,u=u+Math.imul(H,N)|0;var vt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(de,W),t=Math.imul(de,re),t=t+Math.imul(ge,W)|0,u=Math.imul(ge,re),s=s+Math.imul(be,ae)|0,t=t+Math.imul(be,Me)|0,t=t+Math.imul(se,ae)|0,u=u+Math.imul(se,Me)|0,s=s+Math.imul(le,ye)|0,t=t+Math.imul(le,Be)|0,t=t+Math.imul(ce,ye)|0,u=u+Math.imul(ce,Be)|0,s=s+Math.imul(K,Ae)|0,t=t+Math.imul(K,Te)|0,t=t+Math.imul(te,Ae)|0,u=u+Math.imul(te,Te)|0,s=s+Math.imul($,Ie)|0,t=t+Math.imul($,Ne)|0,t=t+Math.imul(X,Ie)|0,u=u+Math.imul(X,Ne)|0,s=s+Math.imul(G,j)|0,t=t+Math.imul(G,N)|0,t=t+Math.imul(R,j)|0,u=u+Math.imul(R,N)|0,s=s+Math.imul(O,Y)|0,t=t+Math.imul(O,ie)|0,t=t+Math.imul(H,Y)|0,u=u+Math.imul(H,ie)|0;var mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(ve,W),t=Math.imul(ve,re),t=t+Math.imul(_e,W)|0,u=Math.imul(_e,re),s=s+Math.imul(de,ae)|0,t=t+Math.imul(de,Me)|0,t=t+Math.imul(ge,ae)|0,u=u+Math.imul(ge,Me)|0,s=s+Math.imul(be,ye)|0,t=t+Math.imul(be,Be)|0,t=t+Math.imul(se,ye)|0,u=u+Math.imul(se,Be)|0,s=s+Math.imul(le,Ae)|0,t=t+Math.imul(le,Te)|0,t=t+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Te)|0,s=s+Math.imul(K,Ie)|0,t=t+Math.imul(K,Ne)|0,t=t+Math.imul(te,Ie)|0,u=u+Math.imul(te,Ne)|0,s=s+Math.imul($,j)|0,t=t+Math.imul($,N)|0,t=t+Math.imul(X,j)|0,u=u+Math.imul(X,N)|0,s=s+Math.imul(G,Y)|0,t=t+Math.imul(G,ie)|0,t=t+Math.imul(R,Y)|0,u=u+Math.imul(R,ie)|0,s=s+Math.imul(O,fe)|0,t=t+Math.imul(O,xe)|0,t=t+Math.imul(H,fe)|0,u=u+Math.imul(H,xe)|0;var bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(Se,W),t=Math.imul(Se,re),t=t+Math.imul(Oe,W)|0,u=Math.imul(Oe,re),s=s+Math.imul(ve,ae)|0,t=t+Math.imul(ve,Me)|0,t=t+Math.imul(_e,ae)|0,u=u+Math.imul(_e,Me)|0,s=s+Math.imul(de,ye)|0,t=t+Math.imul(de,Be)|0,t=t+Math.imul(ge,ye)|0,u=u+Math.imul(ge,Be)|0,s=s+Math.imul(be,Ae)|0,t=t+Math.imul(be,Te)|0,t=t+Math.imul(se,Ae)|0,u=u+Math.imul(se,Te)|0,s=s+Math.imul(le,Ie)|0,t=t+Math.imul(le,Ne)|0,t=t+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,Ne)|0,s=s+Math.imul(K,j)|0,t=t+Math.imul(K,N)|0,t=t+Math.imul(te,j)|0,u=u+Math.imul(te,N)|0,s=s+Math.imul($,Y)|0,t=t+Math.imul($,ie)|0,t=t+Math.imul(X,Y)|0,u=u+Math.imul(X,ie)|0,s=s+Math.imul(G,fe)|0,t=t+Math.imul(G,xe)|0,t=t+Math.imul(R,fe)|0,u=u+Math.imul(R,xe)|0,s=s+Math.imul(O,we)|0,t=t+Math.imul(O,Re)|0,t=t+Math.imul(H,we)|0,u=u+Math.imul(H,Re)|0;var gt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(gt>>>26)|0,gt&=67108863,s=Math.imul(z,W),t=Math.imul(z,re),t=t+Math.imul(T,W)|0,u=Math.imul(T,re),s=s+Math.imul(Se,ae)|0,t=t+Math.imul(Se,Me)|0,t=t+Math.imul(Oe,ae)|0,u=u+Math.imul(Oe,Me)|0,s=s+Math.imul(ve,ye)|0,t=t+Math.imul(ve,Be)|0,t=t+Math.imul(_e,ye)|0,u=u+Math.imul(_e,Be)|0,s=s+Math.imul(de,Ae)|0,t=t+Math.imul(de,Te)|0,t=t+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,Te)|0,s=s+Math.imul(be,Ie)|0,t=t+Math.imul(be,Ne)|0,t=t+Math.imul(se,Ie)|0,u=u+Math.imul(se,Ne)|0,s=s+Math.imul(le,j)|0,t=t+Math.imul(le,N)|0,t=t+Math.imul(ce,j)|0,u=u+Math.imul(ce,N)|0,s=s+Math.imul(K,Y)|0,t=t+Math.imul(K,ie)|0,t=t+Math.imul(te,Y)|0,u=u+Math.imul(te,ie)|0,s=s+Math.imul($,fe)|0,t=t+Math.imul($,xe)|0,t=t+Math.imul(X,fe)|0,u=u+Math.imul(X,xe)|0,s=s+Math.imul(G,we)|0,t=t+Math.imul(G,Re)|0,t=t+Math.imul(R,we)|0,u=u+Math.imul(R,Re)|0,s=s+Math.imul(O,ke)|0,t=t+Math.imul(O,Ce)|0,t=t+Math.imul(H,ke)|0,u=u+Math.imul(H,Ce)|0;var yt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(z,ae),t=Math.imul(z,Me),t=t+Math.imul(T,ae)|0,u=Math.imul(T,Me),s=s+Math.imul(Se,ye)|0,t=t+Math.imul(Se,Be)|0,t=t+Math.imul(Oe,ye)|0,u=u+Math.imul(Oe,Be)|0,s=s+Math.imul(ve,Ae)|0,t=t+Math.imul(ve,Te)|0,t=t+Math.imul(_e,Ae)|0,u=u+Math.imul(_e,Te)|0,s=s+Math.imul(de,Ie)|0,t=t+Math.imul(de,Ne)|0,t=t+Math.imul(ge,Ie)|0,u=u+Math.imul(ge,Ne)|0,s=s+Math.imul(be,j)|0,t=t+Math.imul(be,N)|0,t=t+Math.imul(se,j)|0,u=u+Math.imul(se,N)|0,s=s+Math.imul(le,Y)|0,t=t+Math.imul(le,ie)|0,t=t+Math.imul(ce,Y)|0,u=u+Math.imul(ce,ie)|0,s=s+Math.imul(K,fe)|0,t=t+Math.imul(K,xe)|0,t=t+Math.imul(te,fe)|0,u=u+Math.imul(te,xe)|0,s=s+Math.imul($,we)|0,t=t+Math.imul($,Re)|0,t=t+Math.imul(X,we)|0,u=u+Math.imul(X,Re)|0,s=s+Math.imul(G,ke)|0,t=t+Math.imul(G,Ce)|0,t=t+Math.imul(R,ke)|0,u=u+Math.imul(R,Ce)|0;var wt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,ye),t=Math.imul(z,Be),t=t+Math.imul(T,ye)|0,u=Math.imul(T,Be),s=s+Math.imul(Se,Ae)|0,t=t+Math.imul(Se,Te)|0,t=t+Math.imul(Oe,Ae)|0,u=u+Math.imul(Oe,Te)|0,s=s+Math.imul(ve,Ie)|0,t=t+Math.imul(ve,Ne)|0,t=t+Math.imul(_e,Ie)|0,u=u+Math.imul(_e,Ne)|0,s=s+Math.imul(de,j)|0,t=t+Math.imul(de,N)|0,t=t+Math.imul(ge,j)|0,u=u+Math.imul(ge,N)|0,s=s+Math.imul(be,Y)|0,t=t+Math.imul(be,ie)|0,t=t+Math.imul(se,Y)|0,u=u+Math.imul(se,ie)|0,s=s+Math.imul(le,fe)|0,t=t+Math.imul(le,xe)|0,t=t+Math.imul(ce,fe)|0,u=u+Math.imul(ce,xe)|0,s=s+Math.imul(K,we)|0,t=t+Math.imul(K,Re)|0,t=t+Math.imul(te,we)|0,u=u+Math.imul(te,Re)|0,s=s+Math.imul($,ke)|0,t=t+Math.imul($,Ce)|0,t=t+Math.imul(X,ke)|0,u=u+Math.imul(X,Ce)|0;var Mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(z,Ae),t=Math.imul(z,Te),t=t+Math.imul(T,Ae)|0,u=Math.imul(T,Te),s=s+Math.imul(Se,Ie)|0,t=t+Math.imul(Se,Ne)|0,t=t+Math.imul(Oe,Ie)|0,u=u+Math.imul(Oe,Ne)|0,s=s+Math.imul(ve,j)|0,t=t+Math.imul(ve,N)|0,t=t+Math.imul(_e,j)|0,u=u+Math.imul(_e,N)|0,s=s+Math.imul(de,Y)|0,t=t+Math.imul(de,ie)|0,t=t+Math.imul(ge,Y)|0,u=u+Math.imul(ge,ie)|0,s=s+Math.imul(be,fe)|0,t=t+Math.imul(be,xe)|0,t=t+Math.imul(se,fe)|0,u=u+Math.imul(se,xe)|0,s=s+Math.imul(le,we)|0,t=t+Math.imul(le,Re)|0,t=t+Math.imul(ce,we)|0,u=u+Math.imul(ce,Re)|0,s=s+Math.imul(K,ke)|0,t=t+Math.imul(K,Ce)|0,t=t+Math.imul(te,ke)|0,u=u+Math.imul(te,Ce)|0;var xt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(z,Ie),t=Math.imul(z,Ne),t=t+Math.imul(T,Ie)|0,u=Math.imul(T,Ne),s=s+Math.imul(Se,j)|0,t=t+Math.imul(Se,N)|0,t=t+Math.imul(Oe,j)|0,u=u+Math.imul(Oe,N)|0,s=s+Math.imul(ve,Y)|0,t=t+Math.imul(ve,ie)|0,t=t+Math.imul(_e,Y)|0,u=u+Math.imul(_e,ie)|0,s=s+Math.imul(de,fe)|0,t=t+Math.imul(de,xe)|0,t=t+Math.imul(ge,fe)|0,u=u+Math.imul(ge,xe)|0,s=s+Math.imul(be,we)|0,t=t+Math.imul(be,Re)|0,t=t+Math.imul(se,we)|0,u=u+Math.imul(se,Re)|0,s=s+Math.imul(le,ke)|0,t=t+Math.imul(le,Ce)|0,t=t+Math.imul(ce,ke)|0,u=u+Math.imul(ce,Ce)|0;var _t=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(z,j),t=Math.imul(z,N),t=t+Math.imul(T,j)|0,u=Math.imul(T,N),s=s+Math.imul(Se,Y)|0,t=t+Math.imul(Se,ie)|0,t=t+Math.imul(Oe,Y)|0,u=u+Math.imul(Oe,ie)|0,s=s+Math.imul(ve,fe)|0,t=t+Math.imul(ve,xe)|0,t=t+Math.imul(_e,fe)|0,u=u+Math.imul(_e,xe)|0,s=s+Math.imul(de,we)|0,t=t+Math.imul(de,Re)|0,t=t+Math.imul(ge,we)|0,u=u+Math.imul(ge,Re)|0,s=s+Math.imul(be,ke)|0,t=t+Math.imul(be,Ce)|0,t=t+Math.imul(se,ke)|0,u=u+Math.imul(se,Ce)|0;var St=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(z,Y),t=Math.imul(z,ie),t=t+Math.imul(T,Y)|0,u=Math.imul(T,ie),s=s+Math.imul(Se,fe)|0,t=t+Math.imul(Se,xe)|0,t=t+Math.imul(Oe,fe)|0,u=u+Math.imul(Oe,xe)|0,s=s+Math.imul(ve,we)|0,t=t+Math.imul(ve,Re)|0,t=t+Math.imul(_e,we)|0,u=u+Math.imul(_e,Re)|0,s=s+Math.imul(de,ke)|0,t=t+Math.imul(de,Ce)|0,t=t+Math.imul(ge,ke)|0,u=u+Math.imul(ge,Ce)|0;var Et=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,fe),t=Math.imul(z,xe),t=t+Math.imul(T,fe)|0,u=Math.imul(T,xe),s=s+Math.imul(Se,we)|0,t=t+Math.imul(Se,Re)|0,t=t+Math.imul(Oe,we)|0,u=u+Math.imul(Oe,Re)|0,s=s+Math.imul(ve,ke)|0,t=t+Math.imul(ve,Ce)|0,t=t+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ce)|0;var Bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,we),t=Math.imul(z,Re),t=t+Math.imul(T,we)|0,u=Math.imul(T,Re),s=s+Math.imul(Se,ke)|0,t=t+Math.imul(Se,Ce)|0,t=t+Math.imul(Oe,ke)|0,u=u+Math.imul(Oe,Ce)|0;var At=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(z,ke),t=Math.imul(z,Ce),t=t+Math.imul(T,ke)|0,u=Math.imul(T,Ce);var Rt=(p+s|0)+((t&8191)<<13)|0;return p=(u+(t>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,l[0]=Xe,l[1]=Qe,l[2]=lt,l[3]=dt,l[4]=pt,l[5]=vt,l[6]=mt,l[7]=bt,l[8]=gt,l[9]=yt,l[10]=wt,l[11]=Mt,l[12]=xt,l[13]=_t,l[14]=St,l[15]=Et,l[16]=Bt,l[17]=At,l[18]=Rt,p!==0&&(l[19]=p,i.length++),i};Math.imul||(A=B);function P(m,e,r){r.negative=e.negative^m.negative,r.length=m.length+e.length;for(var i=0,f=0,h=0;h<r.length-1;h++){var l=f;f=0;for(var p=i&67108863,s=Math.min(h,e.length-1),t=Math.max(0,h-m.length+1);t<=s;t++){var u=h-t,S=m.words[u]|0,O=e.words[t]|0,H=S*O,Q=H&67108863;l=l+(H/67108864|0)|0,Q=Q+p|0,p=Q&67108863,l=l+(Q>>>26)|0,f+=l>>>26,l&=67108863}r.words[h]=p,i=l,l=f}return i!==0?r.words[h]=i:r.length--,r.strip()}function I(m,e,r){var i=new k;return i.mulp(m,e,r)}n.prototype.mulTo=function(e,r){var i,f=this.length+e.length;return this.length===10&&e.length===10?i=A(this,e,r):f<63?i=B(this,e,r):f<1024?i=P(this,e,r):i=I(this,e,r),i};function k(m,e){this.x=m,this.y=e}k.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,f=0;f<e;f++)r[f]=this.revBin(f,i,e);return r},k.prototype.revBin=function(e,r,i){if(e===0||e===i-1)return e;for(var f=0,h=0;h<r;h++)f|=(e&1)<<r-h-1,e>>=1;return f},k.prototype.permute=function(e,r,i,f,h,l){for(var p=0;p<l;p++)f[p]=r[e[p]],h[p]=i[e[p]]},k.prototype.transform=function(e,r,i,f,h,l){this.permute(l,e,r,i,f,h);for(var p=1;p<h;p<<=1)for(var s=p<<1,t=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),S=0;S<h;S+=s)for(var O=t,H=u,Q=0;Q<p;Q++){var G=i[S+Q],R=f[S+Q],C=i[S+Q+p],$=f[S+Q+p],X=O*C-H*$;$=O*$+H*C,C=X,i[S+Q]=G+C,f[S+Q]=R+$,i[S+Q+p]=G-C,f[S+Q+p]=R-$,Q!==s&&(X=t*O-u*H,H=t*H+u*O,O=X)}},k.prototype.guessLen13b=function(e,r){var i=Math.max(r,e)|1,f=i&1,h=0;for(i=i/2|0;i;i=i>>>1)h++;return 1<<h+1+f},k.prototype.conjugate=function(e,r,i){if(!(i<=1))for(var f=0;f<i/2;f++){var h=e[f];e[f]=e[i-f-1],e[i-f-1]=h,h=r[f],r[f]=-r[i-f-1],r[i-f-1]=-h}},k.prototype.normalize13b=function(e,r){for(var i=0,f=0;f<r/2;f++){var h=Math.round(e[2*f+1]/r)*8192+Math.round(e[2*f]/r)+i;e[f]=h&67108863,h<67108864?i=0:i=h/67108864|0}return e},k.prototype.convert13b=function(e,r,i,f){for(var h=0,l=0;l<r;l++)h=h+(e[l]|0),i[2*l]=h&8191,h=h>>>13,i[2*l+1]=h&8191,h=h>>>13;for(l=2*r;l<f;++l)i[l]=0;o(h===0),o((h&-8192)===0)},k.prototype.stub=function(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},k.prototype.mulp=function(e,r,i){var f=2*this.guessLen13b(e.length,r.length),h=this.makeRBT(f),l=this.stub(f),p=new Array(f),s=new Array(f),t=new Array(f),u=new Array(f),S=new Array(f),O=new Array(f),H=i.words;H.length=f,this.convert13b(e.words,e.length,p,f),this.convert13b(r.words,r.length,u,f),this.transform(p,l,s,t,f,h),this.transform(u,l,S,O,f,h);for(var Q=0;Q<f;Q++){var G=s[Q]*S[Q]-t[Q]*O[Q];t[Q]=s[Q]*O[Q]+t[Q]*S[Q],s[Q]=G}return this.conjugate(s,t,f),this.transform(s,t,H,l,f,h),this.conjugate(H,l,f),this.normalize13b(H,f),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},n.prototype.mul=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},n.prototype.mulf=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),I(this,e,r)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){o(typeof e=="number"),o(e<67108864);for(var r=0,i=0;i<this.length;i++){var f=(this.words[i]|0)*e,h=(f&67108863)+(r&67108863);r>>=26,r+=f/67108864|0,r+=h>>>26,this.words[i]=h&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=E(e);if(r.length===0)return new n(1);for(var i=this,f=0;f<r.length&&r[f]===0;f++,i=i.sqr());if(++f<r.length)for(var h=i.sqr();f<r.length;f++,h=h.sqr())r[f]!==0&&(i=i.mul(h));return i},n.prototype.iushln=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r,h;if(r!==0){var l=0;for(h=0;h<this.length;h++){var p=this.words[h]&f,s=(this.words[h]|0)-p<<r;this.words[h]=s|l,l=p>>>26-r}l&&(this.words[h]=l,this.length++)}if(i!==0){for(h=this.length-1;h>=0;h--)this.words[h+i]=this.words[h];for(h=0;h<i;h++)this.words[h]=0;this.length+=i}return this.strip()},n.prototype.ishln=function(e){return o(this.negative===0),this.iushln(e)},n.prototype.iushrn=function(e,r,i){o(typeof e=="number"&&e>=0);var f;r?f=(r-r%26)/26:f=0;var h=e%26,l=Math.min((e-h)/26,this.length),p=67108863^67108863>>>h<<h,s=i;if(f-=l,f=Math.max(0,f),s){for(var t=0;t<l;t++)s.words[t]=this.words[t];s.length=l}if(l!==0)if(this.length>l)for(this.length-=l,t=0;t<this.length;t++)this.words[t]=this.words[t+l];else this.words[0]=0,this.length=1;var u=0;for(t=this.length-1;t>=0&&(u!==0||t>=f);t--){var S=this.words[t]|0;this.words[t]=u<<26-h|S>>>h,u=S&p}return s&&u!==0&&(s.words[s.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return o(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return!1;var h=this.words[i];return!!(h&f)},n.prototype.imaskn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var f=67108863^67108863>>>r<<r;this.words[this.length-1]&=f}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return o(typeof e=="number"),o(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(o(typeof e=="number"),o(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,r,i){var f=e.length+i,h;this._expand(f);var l,p=0;for(h=0;h<e.length;h++){l=(this.words[h+i]|0)+p;var s=(e.words[h]|0)*r;l-=s&67108863,p=(l>>26)-(s/67108864|0),this.words[h+i]=l&67108863}for(;h<this.length-i;h++)l=(this.words[h+i]|0)+p,p=l>>26,this.words[h+i]=l&67108863;if(p===0)return this.strip();for(o(p===-1),p=0,h=0;h<this.length;h++)l=-(this.words[h]|0)+p,p=l>>26,this.words[h]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,f=this.clone(),h=e,l=h.words[h.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(h=h.ushln(i),f.iushln(i),l=h.words[h.length-1]|0);var s=f.length-h.length,t;if(r!=="mod"){t=new n(null),t.length=s+1,t.words=new Array(t.length);for(var u=0;u<t.length;u++)t.words[u]=0}var S=f.clone()._ishlnsubmul(h,1,s);S.negative===0&&(f=S,t&&(t.words[s]=1));for(var O=s-1;O>=0;O--){var H=(f.words[h.length+O]|0)*67108864+(f.words[h.length+O-1]|0);for(H=Math.min(H/l|0,67108863),f._ishlnsubmul(h,H,O);f.negative!==0;)H--,f.negative=0,f._ishlnsubmul(h,1,O),f.isZero()||(f.negative^=1);t&&(t.words[O]=H)}return t&&t.strip(),f.strip(),r!=="div"&&i!==0&&f.iushrn(i),{div:t||null,mod:f}},n.prototype.divmod=function(e,r,i){if(o(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(f=l.div.neg()),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.iadd(e)),{div:f,mod:h}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(f=l.div.neg()),{div:f,mod:l.mod}):(this.negative&e.negative)!==0?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.isub(e)),{div:l.div,mod:h}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,f=e.ushrn(1),h=e.andln(1),l=i.cmp(f);return l<0||h===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){o(e<=67108863);for(var r=(1<<26)%e,i=0,f=this.length-1;f>=0;f--)i=(r*i+(this.words[f]|0))%e;return i},n.prototype.idivn=function(e){o(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var f=(this.words[i]|0)+r*67108864;this.words[i]=f/e|0,r=f%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=new n(0),p=new n(1),s=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++s;for(var t=i.clone(),u=r.clone();!r.isZero();){for(var S=0,O=1;(r.words[0]&O)===0&&S<26;++S,O<<=1);if(S>0)for(r.iushrn(S);S-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(t),h.isub(u)),f.iushrn(1),h.iushrn(1);for(var H=0,Q=1;(i.words[0]&Q)===0&&H<26;++H,Q<<=1);if(H>0)for(i.iushrn(H);H-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(u)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(l),h.isub(p)):(i.isub(r),l.isub(f),p.isub(h))}return{a:l,b:p,gcd:i.iushln(s)}},n.prototype._invmp=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,s=1;(r.words[0]&s)===0&&p<26;++p,s<<=1);if(p>0)for(r.iushrn(p);p-- >0;)f.isOdd()&&f.iadd(l),f.iushrn(1);for(var t=0,u=1;(i.words[0]&u)===0&&t<26;++t,u<<=1);if(t>0)for(i.iushrn(t);t-- >0;)h.isOdd()&&h.iadd(l),h.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(h)):(i.isub(r),h.isub(f))}var S;return r.cmpn(1)===0?S=f:S=h,S.cmpn(0)<0&&S.iadd(e),S},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var f=0;r.isEven()&&i.isEven();f++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var h=r.cmp(i);if(h<0){var l=r;r=i,i=l}else if(h===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(f)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){o(typeof e=="number");var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=f,this;for(var h=f,l=i;h!==0&&l<this.length;l++){var p=this.words[l]|0;p+=h,h=p>>>26,p&=67108863,this.words[l]=p}return h!==0&&(this.words[l]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),o(e<=67108863,"Number is too big");var f=this.words[0]|0;i=f===e?0:f<e?-1:1}return this.negative!==0?-i|0:i},n.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var r=this.ucmp(e);return this.negative!==0?-r|0:r},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var f=this.words[i]|0,h=e.words[i]|0;if(f!==h){f<h?r=-1:f>h&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new J(e)},n.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var F={k256:null,p224:null,p192:null,p25519:null};function q(m,e){this.name=m,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},q.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var f=i<this.n?-1:r.ucmp(this.p);return f===0?(r.words[0]=0,r.length=1):f>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},q.prototype.split=function(e,r){e.iushrn(this.n,0,r)},q.prototype.imulK=function(e){return e.imul(this.k)};function L(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}x(L,q),L.prototype.split=function(e,r){for(var i=4194303,f=Math.min(e.length,9),h=0;h<f;h++)r.words[h]=e.words[h];if(r.length=f,e.length<=9){e.words[0]=0,e.length=1;return}var l=e.words[9];for(r.words[r.length++]=l&i,h=10;h<e.length;h++){var p=e.words[h]|0;e.words[h-10]=(p&i)<<4|l>>>22,l=p}l>>>=22,e.words[h-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var f=e.words[i]|0;r+=f*977,e.words[i]=r&67108863,r=f*64+(r/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function V(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}x(V,q);function ee(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}x(ee,q);function ne(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}x(ne,q),ne.prototype.imulK=function(e){for(var r=0,i=0;i<e.length;i++){var f=(e.words[i]|0)*19+r,h=f&67108863;f>>>=26,e.words[i]=h,r=f}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(F[e])return F[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new V;else if(e==="p192")r=new ee;else if(e==="p25519")r=new ne;else throw new Error("Unknown prime "+e);return F[e]=r,r};function J(m){if(typeof m=="string"){var e=n._prime(m);this.m=e.p,this.prime=e}else o(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}J.prototype._verify1=function(e){o(e.negative===0,"red works only with positives"),o(e.red,"red works only with red numbers")},J.prototype._verify2=function(e,r){o((e.negative|r.negative)===0,"red works only with positives"),o(e.red&&e.red===r.red,"red works only with red numbers")},J.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},J.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},J.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},J.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},J.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},J.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},J.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},J.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},J.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},J.prototype.isqr=function(e){return this.imul(e,e.clone())},J.prototype.sqr=function(e){return this.mul(e,e)},J.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);o(!f.isZero());var l=new n(1).toRed(this),p=l.redNeg(),s=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,s).cmp(p)!==0;)t.redIAdd(p);for(var u=this.pow(t,f),S=this.pow(e,f.addn(1).iushrn(1)),O=this.pow(e,f),H=h;O.cmp(l)!==0;){for(var Q=O,G=0;Q.cmp(l)!==0;G++)Q=Q.redSqr();o(G<H);var R=this.pow(u,new n(1).iushln(H-G-1));S=S.redMul(R),u=R.redSqr(),O=O.redMul(u),H=G}return S},J.prototype.invm=function(e){var r=e._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},J.prototype.pow=function(e,r){if(r.isZero())return new n(1).toRed(this);if(r.cmpn(1)===0)return e.clone();var i=4,f=new Array(1<<i);f[0]=new n(1).toRed(this),f[1]=e;for(var h=2;h<f.length;h++)f[h]=this.mul(f[h-1],e);var l=f[0],p=0,s=0,t=r.bitLength()%26;for(t===0&&(t=26),h=r.length-1;h>=0;h--){for(var u=r.words[h],S=t-1;S>=0;S--){var O=u>>S&1;if(l!==f[0]&&(l=this.sqr(l)),O===0&&p===0){s=0;continue}p<<=1,p|=O,s++,!(s!==i&&(h!==0||S!==0))&&(l=this.mul(l,f[p]),s=0,p=0)}t=26}return l},J.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},J.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new ue(e)};function ue(m){J.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}x(ue,J),ue.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},ue.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},ue.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(M,Lp)}(Bi)),Bi.exports}var cc;function $t(){return cc||(cc=1,function(M){var a=M,c=cr(),o=Ht(),x=Yi();a.assert=o,a.toArray=x.toArray,a.zero2=x.zero2,a.toHex=x.toHex,a.encode=x.encode;function n(d,w,_){var E=new Array(Math.max(d.bitLength(),_)+1),B;for(B=0;B<E.length;B+=1)E[B]=0;var A=1<<w+1,P=d.clone();for(B=0;B<E.length;B++){var I,k=P.andln(A-1);P.isOdd()?(k>(A>>1)-1?I=(A>>1)-k:I=k,P.isubn(I)):I=0,E[B]=I,P.iushrn(1)}return E}a.getNAF=n;function g(d,w){var _=[[],[]];d=d.clone(),w=w.clone();for(var E=0,B=0,A;d.cmpn(-E)>0||w.cmpn(-B)>0;){var P=d.andln(3)+E&3,I=w.andln(3)+B&3;P===3&&(P=-1),I===3&&(I=-1);var k;(P&1)===0?k=0:(A=d.andln(7)+E&7,(A===3||A===5)&&I===2?k=-P:k=P),_[0].push(k);var F;(I&1)===0?F=0:(A=w.andln(7)+B&7,(A===3||A===5)&&P===2?F=-I:F=I),_[1].push(F),2*E===k+1&&(E=1-E),2*B===F+1&&(B=1-B),d.iushrn(1),w.iushrn(1)}return _}a.getJSF=g;function y(d,w,_){var E="_"+w;d.prototype[w]=function(){return this[E]!==void 0?this[E]:this[E]=_.call(this)}}a.cachedProperty=y;function b(d){return typeof d=="string"?a.toArray(d,"hex"):d}a.parseBytes=b;function v(d){return new c(d,"hex","le")}a.intFromLE=v}(Yf)),Yf}var Jf={},Zf,lc;function Ai(){if(lc)return Zf;lc=1;var M=cr(),a=$t(),c=a.getNAF,o=a.getJSF,x=a.assert;function n(y,b){this.type=y,this.p=new M(b.p,16),this.red=b.prime?M.red(b.prime):M.mont(this.p),this.zero=new M(0).toRed(this.red),this.one=new M(1).toRed(this.red),this.two=new M(2).toRed(this.red),this.n=b.n&&new M(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var v=this.n&&this.p.div(this.n);!v||v.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Zf=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(b,v){x(b.precomputed);var d=b._getDoubles(),w=c(v,1,this._bitLength),_=(1<<d.step+1)-(d.step%2===0?2:1);_/=3;var E=[],B,A;for(B=0;B<w.length;B+=d.step){A=0;for(var P=B+d.step-1;P>=B;P--)A=(A<<1)+w[P];E.push(A)}for(var I=this.jpoint(null,null,null),k=this.jpoint(null,null,null),F=_;F>0;F--){for(B=0;B<E.length;B++)A=E[B],A===F?k=k.mixedAdd(d.points[B]):A===-F&&(k=k.mixedAdd(d.points[B].neg()));I=I.add(k)}return I.toP()},n.prototype._wnafMul=function(b,v){var d=4,w=b._getNAFPoints(d);d=w.wnd;for(var _=w.points,E=c(v,d,this._bitLength),B=this.jpoint(null,null,null),A=E.length-1;A>=0;A--){for(var P=0;A>=0&&E[A]===0;A--)P++;if(A>=0&&P++,B=B.dblp(P),A<0)break;var I=E[A];x(I!==0),b.type==="affine"?I>0?B=B.mixedAdd(_[I-1>>1]):B=B.mixedAdd(_[-I-1>>1].neg()):I>0?B=B.add(_[I-1>>1]):B=B.add(_[-I-1>>1].neg())}return b.type==="affine"?B.toP():B},n.prototype._wnafMulAdd=function(b,v,d,w,_){var E=this._wnafT1,B=this._wnafT2,A=this._wnafT3,P=0,I,k,F;for(I=0;I<w;I++){F=v[I];var q=F._getNAFPoints(b);E[I]=q.wnd,B[I]=q.points}for(I=w-1;I>=1;I-=2){var L=I-1,V=I;if(E[L]!==1||E[V]!==1){A[L]=c(d[L],E[L],this._bitLength),A[V]=c(d[V],E[V],this._bitLength),P=Math.max(A[L].length,P),P=Math.max(A[V].length,P);continue}var ee=[v[L],null,null,v[V]];v[L].y.cmp(v[V].y)===0?(ee[1]=v[L].add(v[V]),ee[2]=v[L].toJ().mixedAdd(v[V].neg())):v[L].y.cmp(v[V].y.redNeg())===0?(ee[1]=v[L].toJ().mixedAdd(v[V]),ee[2]=v[L].add(v[V].neg())):(ee[1]=v[L].toJ().mixedAdd(v[V]),ee[2]=v[L].toJ().mixedAdd(v[V].neg()));var ne=[-3,-1,-5,-7,0,7,5,1,3],J=o(d[L],d[V]);for(P=Math.max(J[0].length,P),A[L]=new Array(P),A[V]=new Array(P),k=0;k<P;k++){var ue=J[0][k]|0,m=J[1][k]|0;A[L][k]=ne[(ue+1)*3+(m+1)],A[V][k]=0,B[L]=ee}}var e=this.jpoint(null,null,null),r=this._wnafT4;for(I=P;I>=0;I--){for(var i=0;I>=0;){var f=!0;for(k=0;k<w;k++)r[k]=A[k][I]|0,r[k]!==0&&(f=!1);if(!f)break;i++,I--}if(I>=0&&i++,e=e.dblp(i),I<0)break;for(k=0;k<w;k++){var h=r[k];h!==0&&(h>0?F=B[k][h-1>>1]:h<0&&(F=B[k][-h-1>>1].neg()),F.type==="affine"?e=e.mixedAdd(F):e=e.add(F))}}for(I=0;I<w;I++)B[I]=null;return _?e:e.toP()};function g(y,b){this.curve=y,this.type=b,this.precomputed=null}return n.BasePoint=g,g.prototype.eq=function(){throw new Error("Not implemented")},g.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(b,v){b=a.toArray(b,v);var d=this.p.byteLength();if((b[0]===4||b[0]===6||b[0]===7)&&b.length-1===2*d){b[0]===6?x(b[b.length-1]%2===0):b[0]===7&&x(b[b.length-1]%2===1);var w=this.point(b.slice(1,1+d),b.slice(1+d,1+2*d));return w}else if((b[0]===2||b[0]===3)&&b.length-1===d)return this.pointFromX(b.slice(1,1+d),b[0]===3);throw new Error("Unknown point format")},g.prototype.encodeCompressed=function(b){return this.encode(b,!0)},g.prototype._encode=function(b){var v=this.curve.p.byteLength(),d=this.getX().toArray("be",v);return b?[this.getY().isEven()?2:3].concat(d):[4].concat(d,this.getY().toArray("be",v))},g.prototype.encode=function(b,v){return a.encode(this._encode(v),b)},g.prototype.precompute=function(b){if(this.precomputed)return this;var v={doubles:null,naf:null,beta:null};return v.naf=this._getNAFPoints(8),v.doubles=this._getDoubles(4,b),v.beta=this._getBeta(),this.precomputed=v,this},g.prototype._hasDoubles=function(b){if(!this.precomputed)return!1;var v=this.precomputed.doubles;return v?v.points.length>=Math.ceil((b.bitLength()+1)/v.step):!1},g.prototype._getDoubles=function(b,v){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var d=[this],w=this,_=0;_<v;_+=b){for(var E=0;E<b;E++)w=w.dbl();d.push(w)}return{step:b,points:d}},g.prototype._getNAFPoints=function(b){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var v=[this],d=(1<<b)-1,w=d===1?null:this.dbl(),_=1;_<d;_++)v[_]=v[_-1].add(w);return{wnd:b,points:v}},g.prototype._getBeta=function(){return null},g.prototype.dblp=function(b){for(var v=this,d=0;d<b;d++)v=v.dbl();return v},Zf}var Xf,dc;function Fp(){if(dc)return Xf;dc=1;var M=$t(),a=cr(),c=Ye(),o=Ai(),x=M.assert;function n(b){o.call(this,"short",b),this.a=new a(b.a,16).toRed(this.red),this.b=new a(b.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(b),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}c(n,o),Xf=n,n.prototype._getEndomorphism=function(v){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var d,w;if(v.beta)d=new a(v.beta,16).toRed(this.red);else{var _=this._getEndoRoots(this.p);d=_[0].cmp(_[1])<0?_[0]:_[1],d=d.toRed(this.red)}if(v.lambda)w=new a(v.lambda,16);else{var E=this._getEndoRoots(this.n);this.g.mul(E[0]).x.cmp(this.g.x.redMul(d))===0?w=E[0]:(w=E[1],x(this.g.mul(w).x.cmp(this.g.x.redMul(d))===0))}var B;return v.basis?B=v.basis.map(function(A){return{a:new a(A.a,16),b:new a(A.b,16)}}):B=this._getEndoBasis(w),{beta:d,lambda:w,basis:B}}},n.prototype._getEndoRoots=function(v){var d=v===this.p?this.red:a.mont(v),w=new a(2).toRed(d).redInvm(),_=w.redNeg(),E=new a(3).toRed(d).redNeg().redSqrt().redMul(w),B=_.redAdd(E).fromRed(),A=_.redSub(E).fromRed();return[B,A]},n.prototype._getEndoBasis=function(v){for(var d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),w=v,_=this.n.clone(),E=new a(1),B=new a(0),A=new a(0),P=new a(1),I,k,F,q,L,V,ee,ne=0,J,ue;w.cmpn(0)!==0;){var m=_.div(w);J=_.sub(m.mul(w)),ue=A.sub(m.mul(E));var e=P.sub(m.mul(B));if(!F&&J.cmp(d)<0)I=ee.neg(),k=E,F=J.neg(),q=ue;else if(F&&++ne===2)break;ee=J,_=w,w=J,A=E,E=ue,P=B,B=e}L=J.neg(),V=ue;var r=F.sqr().add(q.sqr()),i=L.sqr().add(V.sqr());return i.cmp(r)>=0&&(L=I,V=k),F.negative&&(F=F.neg(),q=q.neg()),L.negative&&(L=L.neg(),V=V.neg()),[{a:F,b:q},{a:L,b:V}]},n.prototype._endoSplit=function(v){var d=this.endo.basis,w=d[0],_=d[1],E=_.b.mul(v).divRound(this.n),B=w.b.neg().mul(v).divRound(this.n),A=E.mul(w.a),P=B.mul(_.a),I=E.mul(w.b),k=B.mul(_.b),F=v.sub(A).sub(P),q=I.add(k).neg();return{k1:F,k2:q}},n.prototype.pointFromX=function(v,d){v=new a(v,16),v.red||(v=v.toRed(this.red));var w=v.redSqr().redMul(v).redIAdd(v.redMul(this.a)).redIAdd(this.b),_=w.redSqrt();if(_.redSqr().redSub(w).cmp(this.zero)!==0)throw new Error("invalid point");var E=_.fromRed().isOdd();return(d&&!E||!d&&E)&&(_=_.redNeg()),this.point(v,_)},n.prototype.validate=function(v){if(v.inf)return!0;var d=v.x,w=v.y,_=this.a.redMul(d),E=d.redSqr().redMul(d).redIAdd(_).redIAdd(this.b);return w.redSqr().redISub(E).cmpn(0)===0},n.prototype._endoWnafMulAdd=function(v,d,w){for(var _=this._endoWnafT1,E=this._endoWnafT2,B=0;B<v.length;B++){var A=this._endoSplit(d[B]),P=v[B],I=P._getBeta();A.k1.negative&&(A.k1.ineg(),P=P.neg(!0)),A.k2.negative&&(A.k2.ineg(),I=I.neg(!0)),_[B*2]=P,_[B*2+1]=I,E[B*2]=A.k1,E[B*2+1]=A.k2}for(var k=this._wnafMulAdd(1,_,E,B*2,w),F=0;F<B*2;F++)_[F]=null,E[F]=null;return k};function g(b,v,d,w){o.BasePoint.call(this,b,"affine"),v===null&&d===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(v,16),this.y=new a(d,16),w&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}c(g,o.BasePoint),n.prototype.point=function(v,d,w){return new g(this,v,d,w)},n.prototype.pointFromJSON=function(v,d){return g.fromJSON(this,v,d)},g.prototype._getBeta=function(){if(this.curve.endo){var v=this.precomputed;if(v&&v.beta)return v.beta;var d=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(v){var w=this.curve,_=function(E){return w.point(E.x.redMul(w.endo.beta),E.y)};v.beta=d,d.precomputed={beta:null,naf:v.naf&&{wnd:v.naf.wnd,points:v.naf.points.map(_)},doubles:v.doubles&&{step:v.doubles.step,points:v.doubles.points.map(_)}}}return d}},g.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},g.fromJSON=function(v,d,w){typeof d=="string"&&(d=JSON.parse(d));var _=v.point(d[0],d[1],w);if(!d[2])return _;function E(A){return v.point(A[0],A[1],w)}var B=d[2];return _.precomputed={beta:null,doubles:B.doubles&&{step:B.doubles.step,points:[_].concat(B.doubles.points.map(E))},naf:B.naf&&{wnd:B.naf.wnd,points:[_].concat(B.naf.points.map(E))}},_},g.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},g.prototype.isInfinity=function(){return this.inf},g.prototype.add=function(v){if(this.inf)return v;if(v.inf)return this;if(this.eq(v))return this.dbl();if(this.neg().eq(v))return this.curve.point(null,null);if(this.x.cmp(v.x)===0)return this.curve.point(null,null);var d=this.y.redSub(v.y);d.cmpn(0)!==0&&(d=d.redMul(this.x.redSub(v.x).redInvm()));var w=d.redSqr().redISub(this.x).redISub(v.x),_=d.redMul(this.x.redSub(w)).redISub(this.y);return this.curve.point(w,_)},g.prototype.dbl=function(){if(this.inf)return this;var v=this.y.redAdd(this.y);if(v.cmpn(0)===0)return this.curve.point(null,null);var d=this.curve.a,w=this.x.redSqr(),_=v.redInvm(),E=w.redAdd(w).redIAdd(w).redIAdd(d).redMul(_),B=E.redSqr().redISub(this.x.redAdd(this.x)),A=E.redMul(this.x.redSub(B)).redISub(this.y);return this.curve.point(B,A)},g.prototype.getX=function(){return this.x.fromRed()},g.prototype.getY=function(){return this.y.fromRed()},g.prototype.mul=function(v){return v=new a(v,16),this.isInfinity()?this:this._hasDoubles(v)?this.curve._fixedNafMul(this,v):this.curve.endo?this.curve._endoWnafMulAdd([this],[v]):this.curve._wnafMul(this,v)},g.prototype.mulAdd=function(v,d,w){var _=[this,d],E=[v,w];return this.curve.endo?this.curve._endoWnafMulAdd(_,E):this.curve._wnafMulAdd(1,_,E,2)},g.prototype.jmulAdd=function(v,d,w){var _=[this,d],E=[v,w];return this.curve.endo?this.curve._endoWnafMulAdd(_,E,!0):this.curve._wnafMulAdd(1,_,E,2,!0)},g.prototype.eq=function(v){return this===v||this.inf===v.inf&&(this.inf||this.x.cmp(v.x)===0&&this.y.cmp(v.y)===0)},g.prototype.neg=function(v){if(this.inf)return this;var d=this.curve.point(this.x,this.y.redNeg());if(v&&this.precomputed){var w=this.precomputed,_=function(E){return E.neg()};d.precomputed={naf:w.naf&&{wnd:w.naf.wnd,points:w.naf.points.map(_)},doubles:w.doubles&&{step:w.doubles.step,points:w.doubles.points.map(_)}}}return d},g.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var v=this.curve.jpoint(this.x,this.y,this.curve.one);return v};function y(b,v,d,w){o.BasePoint.call(this,b,"jacobian"),v===null&&d===null&&w===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(v,16),this.y=new a(d,16),this.z=new a(w,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return c(y,o.BasePoint),n.prototype.jpoint=function(v,d,w){return new y(this,v,d,w)},y.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var v=this.z.redInvm(),d=v.redSqr(),w=this.x.redMul(d),_=this.y.redMul(d).redMul(v);return this.curve.point(w,_)},y.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},y.prototype.add=function(v){if(this.isInfinity())return v;if(v.isInfinity())return this;var d=v.z.redSqr(),w=this.z.redSqr(),_=this.x.redMul(d),E=v.x.redMul(w),B=this.y.redMul(d.redMul(v.z)),A=v.y.redMul(w.redMul(this.z)),P=_.redSub(E),I=B.redSub(A);if(P.cmpn(0)===0)return I.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var k=P.redSqr(),F=k.redMul(P),q=_.redMul(k),L=I.redSqr().redIAdd(F).redISub(q).redISub(q),V=I.redMul(q.redISub(L)).redISub(B.redMul(F)),ee=this.z.redMul(v.z).redMul(P);return this.curve.jpoint(L,V,ee)},y.prototype.mixedAdd=function(v){if(this.isInfinity())return v.toJ();if(v.isInfinity())return this;var d=this.z.redSqr(),w=this.x,_=v.x.redMul(d),E=this.y,B=v.y.redMul(d).redMul(this.z),A=w.redSub(_),P=E.redSub(B);if(A.cmpn(0)===0)return P.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var I=A.redSqr(),k=I.redMul(A),F=w.redMul(I),q=P.redSqr().redIAdd(k).redISub(F).redISub(F),L=P.redMul(F.redISub(q)).redISub(E.redMul(k)),V=this.z.redMul(A);return this.curve.jpoint(q,L,V)},y.prototype.dblp=function(v){if(v===0)return this;if(this.isInfinity())return this;if(!v)return this.dbl();var d;if(this.curve.zeroA||this.curve.threeA){var w=this;for(d=0;d<v;d++)w=w.dbl();return w}var _=this.curve.a,E=this.curve.tinv,B=this.x,A=this.y,P=this.z,I=P.redSqr().redSqr(),k=A.redAdd(A);for(d=0;d<v;d++){var F=B.redSqr(),q=k.redSqr(),L=q.redSqr(),V=F.redAdd(F).redIAdd(F).redIAdd(_.redMul(I)),ee=B.redMul(q),ne=V.redSqr().redISub(ee.redAdd(ee)),J=ee.redISub(ne),ue=V.redMul(J);ue=ue.redIAdd(ue).redISub(L);var m=k.redMul(P);d+1<v&&(I=I.redMul(L)),B=ne,P=m,k=ue}return this.curve.jpoint(B,k.redMul(E),P)},y.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},y.prototype._zeroDbl=function(){var v,d,w;if(this.zOne){var _=this.x.redSqr(),E=this.y.redSqr(),B=E.redSqr(),A=this.x.redAdd(E).redSqr().redISub(_).redISub(B);A=A.redIAdd(A);var P=_.redAdd(_).redIAdd(_),I=P.redSqr().redISub(A).redISub(A),k=B.redIAdd(B);k=k.redIAdd(k),k=k.redIAdd(k),v=I,d=P.redMul(A.redISub(I)).redISub(k),w=this.y.redAdd(this.y)}else{var F=this.x.redSqr(),q=this.y.redSqr(),L=q.redSqr(),V=this.x.redAdd(q).redSqr().redISub(F).redISub(L);V=V.redIAdd(V);var ee=F.redAdd(F).redIAdd(F),ne=ee.redSqr(),J=L.redIAdd(L);J=J.redIAdd(J),J=J.redIAdd(J),v=ne.redISub(V).redISub(V),d=ee.redMul(V.redISub(v)).redISub(J),w=this.y.redMul(this.z),w=w.redIAdd(w)}return this.curve.jpoint(v,d,w)},y.prototype._threeDbl=function(){var v,d,w;if(this.zOne){var _=this.x.redSqr(),E=this.y.redSqr(),B=E.redSqr(),A=this.x.redAdd(E).redSqr().redISub(_).redISub(B);A=A.redIAdd(A);var P=_.redAdd(_).redIAdd(_).redIAdd(this.curve.a),I=P.redSqr().redISub(A).redISub(A);v=I;var k=B.redIAdd(B);k=k.redIAdd(k),k=k.redIAdd(k),d=P.redMul(A.redISub(I)).redISub(k),w=this.y.redAdd(this.y)}else{var F=this.z.redSqr(),q=this.y.redSqr(),L=this.x.redMul(q),V=this.x.redSub(F).redMul(this.x.redAdd(F));V=V.redAdd(V).redIAdd(V);var ee=L.redIAdd(L);ee=ee.redIAdd(ee);var ne=ee.redAdd(ee);v=V.redSqr().redISub(ne),w=this.y.redAdd(this.z).redSqr().redISub(q).redISub(F);var J=q.redSqr();J=J.redIAdd(J),J=J.redIAdd(J),J=J.redIAdd(J),d=V.redMul(ee.redISub(v)).redISub(J)}return this.curve.jpoint(v,d,w)},y.prototype._dbl=function(){var v=this.curve.a,d=this.x,w=this.y,_=this.z,E=_.redSqr().redSqr(),B=d.redSqr(),A=w.redSqr(),P=B.redAdd(B).redIAdd(B).redIAdd(v.redMul(E)),I=d.redAdd(d);I=I.redIAdd(I);var k=I.redMul(A),F=P.redSqr().redISub(k.redAdd(k)),q=k.redISub(F),L=A.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L);var V=P.redMul(q).redISub(L),ee=w.redAdd(w).redMul(_);return this.curve.jpoint(F,V,ee)},y.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var v=this.x.redSqr(),d=this.y.redSqr(),w=this.z.redSqr(),_=d.redSqr(),E=v.redAdd(v).redIAdd(v),B=E.redSqr(),A=this.x.redAdd(d).redSqr().redISub(v).redISub(_);A=A.redIAdd(A),A=A.redAdd(A).redIAdd(A),A=A.redISub(B);var P=A.redSqr(),I=_.redIAdd(_);I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var k=E.redIAdd(A).redSqr().redISub(B).redISub(P).redISub(I),F=d.redMul(k);F=F.redIAdd(F),F=F.redIAdd(F);var q=this.x.redMul(P).redISub(F);q=q.redIAdd(q),q=q.redIAdd(q);var L=this.y.redMul(k.redMul(I.redISub(k)).redISub(A.redMul(P)));L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L);var V=this.z.redAdd(A).redSqr().redISub(w).redISub(P);return this.curve.jpoint(q,L,V)},y.prototype.mul=function(v,d){return v=new a(v,d),this.curve._wnafMul(this,v)},y.prototype.eq=function(v){if(v.type==="affine")return this.eq(v.toJ());if(this===v)return!0;var d=this.z.redSqr(),w=v.z.redSqr();if(this.x.redMul(w).redISub(v.x.redMul(d)).cmpn(0)!==0)return!1;var _=d.redMul(this.z),E=w.redMul(v.z);return this.y.redMul(E).redISub(v.y.redMul(_)).cmpn(0)===0},y.prototype.eqXToP=function(v){var d=this.z.redSqr(),w=v.toRed(this.curve.red).redMul(d);if(this.x.cmp(w)===0)return!0;for(var _=v.clone(),E=this.curve.redN.redMul(d);;){if(_.iadd(this.curve.n),_.cmp(this.curve.p)>=0)return!1;if(w.redIAdd(E),this.x.cmp(w)===0)return!0}},y.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},y.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Xf}var Qf,pc;function Dp(){if(pc)return Qf;pc=1;var M=cr(),a=Ye(),c=Ai(),o=$t();function x(g){c.call(this,"mont",g),this.a=new M(g.a,16).toRed(this.red),this.b=new M(g.b,16).toRed(this.red),this.i4=new M(4).toRed(this.red).redInvm(),this.two=new M(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}a(x,c),Qf=x,x.prototype.validate=function(y){var b=y.normalize().x,v=b.redSqr(),d=v.redMul(b).redAdd(v.redMul(this.a)).redAdd(b),w=d.redSqrt();return w.redSqr().cmp(d)===0};function n(g,y,b){c.BasePoint.call(this,g,"projective"),y===null&&b===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new M(y,16),this.z=new M(b,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return a(n,c.BasePoint),x.prototype.decodePoint=function(y,b){return this.point(o.toArray(y,b),1)},x.prototype.point=function(y,b){return new n(this,y,b)},x.prototype.pointFromJSON=function(y){return n.fromJSON(this,y)},n.prototype.precompute=function(){},n.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},n.fromJSON=function(y,b){return new n(y,b[0],b[1]||y.one)},n.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},n.prototype.isInfinity=function(){return this.z.cmpn(0)===0},n.prototype.dbl=function(){var y=this.x.redAdd(this.z),b=y.redSqr(),v=this.x.redSub(this.z),d=v.redSqr(),w=b.redSub(d),_=b.redMul(d),E=w.redMul(d.redAdd(this.curve.a24.redMul(w)));return this.curve.point(_,E)},n.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.diffAdd=function(y,b){var v=this.x.redAdd(this.z),d=this.x.redSub(this.z),w=y.x.redAdd(y.z),_=y.x.redSub(y.z),E=_.redMul(v),B=w.redMul(d),A=b.z.redMul(E.redAdd(B).redSqr()),P=b.x.redMul(E.redISub(B).redSqr());return this.curve.point(A,P)},n.prototype.mul=function(y){for(var b=y.clone(),v=this,d=this.curve.point(null,null),w=this,_=[];b.cmpn(0)!==0;b.iushrn(1))_.push(b.andln(1));for(var E=_.length-1;E>=0;E--)_[E]===0?(v=v.diffAdd(d,w),d=d.dbl()):(d=v.diffAdd(d,w),v=v.dbl());return d},n.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.eq=function(y){return this.getX().cmp(y.getX())===0},n.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Qf}var es,vc;function Up(){if(vc)return es;vc=1;var M=$t(),a=cr(),c=Ye(),o=Ai(),x=M.assert;function n(y){this.twisted=(y.a|0)!==1,this.mOneA=this.twisted&&(y.a|0)===-1,this.extended=this.mOneA,o.call(this,"edwards",y),this.a=new a(y.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new a(y.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(y.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),x(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(y.c|0)===1}c(n,o),es=n,n.prototype._mulA=function(b){return this.mOneA?b.redNeg():this.a.redMul(b)},n.prototype._mulC=function(b){return this.oneC?b:this.c.redMul(b)},n.prototype.jpoint=function(b,v,d,w){return this.point(b,v,d,w)},n.prototype.pointFromX=function(b,v){b=new a(b,16),b.red||(b=b.toRed(this.red));var d=b.redSqr(),w=this.c2.redSub(this.a.redMul(d)),_=this.one.redSub(this.c2.redMul(this.d).redMul(d)),E=w.redMul(_.redInvm()),B=E.redSqrt();if(B.redSqr().redSub(E).cmp(this.zero)!==0)throw new Error("invalid point");var A=B.fromRed().isOdd();return(v&&!A||!v&&A)&&(B=B.redNeg()),this.point(b,B)},n.prototype.pointFromY=function(b,v){b=new a(b,16),b.red||(b=b.toRed(this.red));var d=b.redSqr(),w=d.redSub(this.c2),_=d.redMul(this.d).redMul(this.c2).redSub(this.a),E=w.redMul(_.redInvm());if(E.cmp(this.zero)===0){if(v)throw new Error("invalid point");return this.point(this.zero,b)}var B=E.redSqrt();if(B.redSqr().redSub(E).cmp(this.zero)!==0)throw new Error("invalid point");return B.fromRed().isOdd()!==v&&(B=B.redNeg()),this.point(B,b)},n.prototype.validate=function(b){if(b.isInfinity())return!0;b.normalize();var v=b.x.redSqr(),d=b.y.redSqr(),w=v.redMul(this.a).redAdd(d),_=this.c2.redMul(this.one.redAdd(this.d.redMul(v).redMul(d)));return w.cmp(_)===0};function g(y,b,v,d,w){o.BasePoint.call(this,y,"projective"),b===null&&v===null&&d===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(b,16),this.y=new a(v,16),this.z=d?new a(d,16):this.curve.one,this.t=w&&new a(w,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return c(g,o.BasePoint),n.prototype.pointFromJSON=function(b){return g.fromJSON(this,b)},n.prototype.point=function(b,v,d,w){return new g(this,b,v,d,w)},g.fromJSON=function(b,v){return new g(b,v[0],v[1],v[2])},g.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},g.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},g.prototype._extDbl=function(){var b=this.x.redSqr(),v=this.y.redSqr(),d=this.z.redSqr();d=d.redIAdd(d);var w=this.curve._mulA(b),_=this.x.redAdd(this.y).redSqr().redISub(b).redISub(v),E=w.redAdd(v),B=E.redSub(d),A=w.redSub(v),P=_.redMul(B),I=E.redMul(A),k=_.redMul(A),F=B.redMul(E);return this.curve.point(P,I,F,k)},g.prototype._projDbl=function(){var b=this.x.redAdd(this.y).redSqr(),v=this.x.redSqr(),d=this.y.redSqr(),w,_,E,B,A,P;if(this.curve.twisted){B=this.curve._mulA(v);var I=B.redAdd(d);this.zOne?(w=b.redSub(v).redSub(d).redMul(I.redSub(this.curve.two)),_=I.redMul(B.redSub(d)),E=I.redSqr().redSub(I).redSub(I)):(A=this.z.redSqr(),P=I.redSub(A).redISub(A),w=b.redSub(v).redISub(d).redMul(P),_=I.redMul(B.redSub(d)),E=I.redMul(P))}else B=v.redAdd(d),A=this.curve._mulC(this.z).redSqr(),P=B.redSub(A).redSub(A),w=this.curve._mulC(b.redISub(B)).redMul(P),_=this.curve._mulC(B).redMul(v.redISub(d)),E=B.redMul(P);return this.curve.point(w,_,E)},g.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},g.prototype._extAdd=function(b){var v=this.y.redSub(this.x).redMul(b.y.redSub(b.x)),d=this.y.redAdd(this.x).redMul(b.y.redAdd(b.x)),w=this.t.redMul(this.curve.dd).redMul(b.t),_=this.z.redMul(b.z.redAdd(b.z)),E=d.redSub(v),B=_.redSub(w),A=_.redAdd(w),P=d.redAdd(v),I=E.redMul(B),k=A.redMul(P),F=E.redMul(P),q=B.redMul(A);return this.curve.point(I,k,q,F)},g.prototype._projAdd=function(b){var v=this.z.redMul(b.z),d=v.redSqr(),w=this.x.redMul(b.x),_=this.y.redMul(b.y),E=this.curve.d.redMul(w).redMul(_),B=d.redSub(E),A=d.redAdd(E),P=this.x.redAdd(this.y).redMul(b.x.redAdd(b.y)).redISub(w).redISub(_),I=v.redMul(B).redMul(P),k,F;return this.curve.twisted?(k=v.redMul(A).redMul(_.redSub(this.curve._mulA(w))),F=B.redMul(A)):(k=v.redMul(A).redMul(_.redSub(w)),F=this.curve._mulC(B).redMul(A)),this.curve.point(I,k,F)},g.prototype.add=function(b){return this.isInfinity()?b:b.isInfinity()?this:this.curve.extended?this._extAdd(b):this._projAdd(b)},g.prototype.mul=function(b){return this._hasDoubles(b)?this.curve._fixedNafMul(this,b):this.curve._wnafMul(this,b)},g.prototype.mulAdd=function(b,v,d){return this.curve._wnafMulAdd(1,[this,v],[b,d],2,!1)},g.prototype.jmulAdd=function(b,v,d){return this.curve._wnafMulAdd(1,[this,v],[b,d],2,!0)},g.prototype.normalize=function(){if(this.zOne)return this;var b=this.z.redInvm();return this.x=this.x.redMul(b),this.y=this.y.redMul(b),this.t&&(this.t=this.t.redMul(b)),this.z=this.curve.one,this.zOne=!0,this},g.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()},g.prototype.getY=function(){return this.normalize(),this.y.fromRed()},g.prototype.eq=function(b){return this===b||this.getX().cmp(b.getX())===0&&this.getY().cmp(b.getY())===0},g.prototype.eqXToP=function(b){var v=b.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(v)===0)return!0;for(var d=b.clone(),w=this.curve.redN.redMul(this.z);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(v.redIAdd(w),this.x.cmp(v)===0)return!0}},g.prototype.toP=g.prototype.normalize,g.prototype.mixedAdd=g.prototype.add,es}var mc;function bc(){return mc||(mc=1,function(M){var a=M;a.base=Ai(),a.short=Fp(),a.mont=Dp(),a.edwards=Up()}(Jf)),Jf}var ts={},rs={},ut={},gc;function ar(){if(gc)return ut;gc=1;var M=Ht(),a=Ye();ut.inherits=a;function c(e,r){return(e.charCodeAt(r)&64512)!==55296||r<0||r+1>=e.length?!1:(e.charCodeAt(r+1)&64512)===56320}function o(e,r){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if(typeof e=="string")if(r){if(r==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),h=0;h<e.length;h+=2)i.push(parseInt(e[h]+e[h+1],16))}else for(var f=0,h=0;h<e.length;h++){var l=e.charCodeAt(h);l<128?i[f++]=l:l<2048?(i[f++]=l>>6|192,i[f++]=l&63|128):c(e,h)?(l=65536+((l&1023)<<10)+(e.charCodeAt(++h)&1023),i[f++]=l>>18|240,i[f++]=l>>12&63|128,i[f++]=l>>6&63|128,i[f++]=l&63|128):(i[f++]=l>>12|224,i[f++]=l>>6&63|128,i[f++]=l&63|128)}else for(h=0;h<e.length;h++)i[h]=e[h]|0;return i}ut.toArray=o;function x(e){for(var r="",i=0;i<e.length;i++)r+=y(e[i].toString(16));return r}ut.toHex=x;function n(e){var r=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return r>>>0}ut.htonl=n;function g(e,r){for(var i="",f=0;f<e.length;f++){var h=e[f];r==="little"&&(h=n(h)),i+=b(h.toString(16))}return i}ut.toHex32=g;function y(e){return e.length===1?"0"+e:e}ut.zero2=y;function b(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}ut.zero8=b;function v(e,r,i,f){var h=i-r;M(h%4===0);for(var l=new Array(h/4),p=0,s=r;p<l.length;p++,s+=4){var t;f==="big"?t=e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:t=e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],l[p]=t>>>0}return l}ut.join32=v;function d(e,r){for(var i=new Array(e.length*4),f=0,h=0;f<e.length;f++,h+=4){var l=e[f];r==="big"?(i[h]=l>>>24,i[h+1]=l>>>16&255,i[h+2]=l>>>8&255,i[h+3]=l&255):(i[h+3]=l>>>24,i[h+2]=l>>>16&255,i[h+1]=l>>>8&255,i[h]=l&255)}return i}ut.split32=d;function w(e,r){return e>>>r|e<<32-r}ut.rotr32=w;function _(e,r){return e<<r|e>>>32-r}ut.rotl32=_;function E(e,r){return e+r>>>0}ut.sum32=E;function B(e,r,i){return e+r+i>>>0}ut.sum32_3=B;function A(e,r,i,f){return e+r+i+f>>>0}ut.sum32_4=A;function P(e,r,i,f,h){return e+r+i+f+h>>>0}ut.sum32_5=P;function I(e,r,i,f){var h=e[r],l=e[r+1],p=f+l>>>0,s=(p<f?1:0)+i+h;e[r]=s>>>0,e[r+1]=p}ut.sum64=I;function k(e,r,i,f){var h=r+f>>>0,l=(h<r?1:0)+e+i;return l>>>0}ut.sum64_hi=k;function F(e,r,i,f){var h=r+f;return h>>>0}ut.sum64_lo=F;function q(e,r,i,f,h,l,p,s){var t=0,u=r;u=u+f>>>0,t+=u<r?1:0,u=u+l>>>0,t+=u<l?1:0,u=u+s>>>0,t+=u<s?1:0;var S=e+i+h+p+t;return S>>>0}ut.sum64_4_hi=q;function L(e,r,i,f,h,l,p,s){var t=r+f+l+s;return t>>>0}ut.sum64_4_lo=L;function V(e,r,i,f,h,l,p,s,t,u){var S=0,O=r;O=O+f>>>0,S+=O<r?1:0,O=O+l>>>0,S+=O<l?1:0,O=O+s>>>0,S+=O<s?1:0,O=O+u>>>0,S+=O<u?1:0;var H=e+i+h+p+t+S;return H>>>0}ut.sum64_5_hi=V;function ee(e,r,i,f,h,l,p,s,t,u){var S=r+f+l+s+u;return S>>>0}ut.sum64_5_lo=ee;function ne(e,r,i){var f=r<<32-i|e>>>i;return f>>>0}ut.rotr64_hi=ne;function J(e,r,i){var f=e<<32-i|r>>>i;return f>>>0}ut.rotr64_lo=J;function ue(e,r,i){return e>>>i}ut.shr64_hi=ue;function m(e,r,i){var f=e<<32-i|r>>>i;return f>>>0}return ut.shr64_lo=m,ut}var is={},yc;function Vr(){if(yc)return is;yc=1;var M=ar(),a=Ht();function c(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return is.BlockHash=c,c.prototype.update=function(x,n){if(x=M.toArray(x,n),this.pending?this.pending=this.pending.concat(x):this.pending=x,this.pendingTotal+=x.length,this.pending.length>=this._delta8){x=this.pending;var g=x.length%this._delta8;this.pending=x.slice(x.length-g,x.length),this.pending.length===0&&(this.pending=null),x=M.join32(x,0,x.length-g,this.endian);for(var y=0;y<x.length;y+=this._delta32)this._update(x,y,y+this._delta32)}return this},c.prototype.digest=function(x){return this.update(this._pad()),a(this.pending===null),this._digest(x)},c.prototype._pad=function(){var x=this.pendingTotal,n=this._delta8,g=n-(x+this.padLength)%n,y=new Array(g+this.padLength);y[0]=128;for(var b=1;b<g;b++)y[b]=0;if(x<<=3,this.endian==="big"){for(var v=8;v<this.padLength;v++)y[b++]=0;y[b++]=0,y[b++]=0,y[b++]=0,y[b++]=0,y[b++]=x>>>24&255,y[b++]=x>>>16&255,y[b++]=x>>>8&255,y[b++]=x&255}else for(y[b++]=x&255,y[b++]=x>>>8&255,y[b++]=x>>>16&255,y[b++]=x>>>24&255,y[b++]=0,y[b++]=0,y[b++]=0,y[b++]=0,v=8;v<this.padLength;v++)y[b++]=0;return y},is}var Sr={},fr={},wc;function Mc(){if(wc)return fr;wc=1;var M=ar(),a=M.rotr32;function c(d,w,_,E){if(d===0)return o(w,_,E);if(d===1||d===3)return n(w,_,E);if(d===2)return x(w,_,E)}fr.ft_1=c;function o(d,w,_){return d&w^~d&_}fr.ch32=o;function x(d,w,_){return d&w^d&_^w&_}fr.maj32=x;function n(d,w,_){return d^w^_}fr.p32=n;function g(d){return a(d,2)^a(d,13)^a(d,22)}fr.s0_256=g;function y(d){return a(d,6)^a(d,11)^a(d,25)}fr.s1_256=y;function b(d){return a(d,7)^a(d,18)^d>>>3}fr.g0_256=b;function v(d){return a(d,17)^a(d,19)^d>>>10}return fr.g1_256=v,fr}var ns,xc;function Hp(){if(xc)return ns;xc=1;var M=ar(),a=Vr(),c=Mc(),o=M.rotl32,x=M.sum32,n=M.sum32_5,g=c.ft_1,y=a.BlockHash,b=[1518500249,1859775393,2400959708,3395469782];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return M.inherits(v,y),ns=v,v.blockSize=512,v.outSize=160,v.hmacStrength=80,v.padLength=64,v.prototype._update=function(w,_){for(var E=this.W,B=0;B<16;B++)E[B]=w[_+B];for(;B<E.length;B++)E[B]=o(E[B-3]^E[B-8]^E[B-14]^E[B-16],1);var A=this.h[0],P=this.h[1],I=this.h[2],k=this.h[3],F=this.h[4];for(B=0;B<E.length;B++){var q=~~(B/20),L=n(o(A,5),g(q,P,I,k),F,E[B],b[q]);F=k,k=I,I=o(P,30),P=A,A=L}this.h[0]=x(this.h[0],A),this.h[1]=x(this.h[1],P),this.h[2]=x(this.h[2],I),this.h[3]=x(this.h[3],k),this.h[4]=x(this.h[4],F)},v.prototype._digest=function(w){return w==="hex"?M.toHex32(this.h,"big"):M.split32(this.h,"big")},ns}var as,_c;function Sc(){if(_c)return as;_c=1;var M=ar(),a=Vr(),c=Mc(),o=Ht(),x=M.sum32,n=M.sum32_4,g=M.sum32_5,y=c.ch32,b=c.maj32,v=c.s0_256,d=c.s1_256,w=c.g0_256,_=c.g1_256,E=a.BlockHash,B=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function A(){if(!(this instanceof A))return new A;E.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=B,this.W=new Array(64)}return M.inherits(A,E),as=A,A.blockSize=512,A.outSize=256,A.hmacStrength=192,A.padLength=64,A.prototype._update=function(I,k){for(var F=this.W,q=0;q<16;q++)F[q]=I[k+q];for(;q<F.length;q++)F[q]=n(_(F[q-2]),F[q-7],w(F[q-15]),F[q-16]);var L=this.h[0],V=this.h[1],ee=this.h[2],ne=this.h[3],J=this.h[4],ue=this.h[5],m=this.h[6],e=this.h[7];for(o(this.k.length===F.length),q=0;q<F.length;q++){var r=g(e,d(J),y(J,ue,m),this.k[q],F[q]),i=x(v(L),b(L,V,ee));e=m,m=ue,ue=J,J=x(ne,r),ne=ee,ee=V,V=L,L=x(r,i)}this.h[0]=x(this.h[0],L),this.h[1]=x(this.h[1],V),this.h[2]=x(this.h[2],ee),this.h[3]=x(this.h[3],ne),this.h[4]=x(this.h[4],J),this.h[5]=x(this.h[5],ue),this.h[6]=x(this.h[6],m),this.h[7]=x(this.h[7],e)},A.prototype._digest=function(I){return I==="hex"?M.toHex32(this.h,"big"):M.split32(this.h,"big")},as}var fs,Ec;function Kp(){if(Ec)return fs;Ec=1;var M=ar(),a=Sc();function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return M.inherits(c,a),fs=c,c.blockSize=512,c.outSize=224,c.hmacStrength=192,c.padLength=64,c.prototype._digest=function(x){return x==="hex"?M.toHex32(this.h.slice(0,7),"big"):M.split32(this.h.slice(0,7),"big")},fs}var ss,Bc;function Ac(){if(Bc)return ss;Bc=1;var M=ar(),a=Vr(),c=Ht(),o=M.rotr64_hi,x=M.rotr64_lo,n=M.shr64_hi,g=M.shr64_lo,y=M.sum64,b=M.sum64_hi,v=M.sum64_lo,d=M.sum64_4_hi,w=M.sum64_4_lo,_=M.sum64_5_hi,E=M.sum64_5_lo,B=a.BlockHash,A=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function P(){if(!(this instanceof P))return new P;B.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=A,this.W=new Array(160)}M.inherits(P,B),ss=P,P.blockSize=1024,P.outSize=512,P.hmacStrength=192,P.padLength=128,P.prototype._prepareBlock=function(i,f){for(var h=this.W,l=0;l<32;l++)h[l]=i[f+l];for(;l<h.length;l+=2){var p=m(h[l-4],h[l-3]),s=e(h[l-4],h[l-3]),t=h[l-14],u=h[l-13],S=J(h[l-30],h[l-29]),O=ue(h[l-30],h[l-29]),H=h[l-32],Q=h[l-31];h[l]=d(p,s,t,u,S,O,H,Q),h[l+1]=w(p,s,t,u,S,O,H,Q)}},P.prototype._update=function(i,f){this._prepareBlock(i,f);var h=this.W,l=this.h[0],p=this.h[1],s=this.h[2],t=this.h[3],u=this.h[4],S=this.h[5],O=this.h[6],H=this.h[7],Q=this.h[8],G=this.h[9],R=this.h[10],C=this.h[11],$=this.h[12],X=this.h[13],Z=this.h[14],K=this.h[15];c(this.k.length===h.length);for(var te=0;te<h.length;te+=2){var Pe=Z,le=K,ce=ee(Q,G),Le=ne(Q,G),be=I(Q,G,R,C,$),se=k(Q,G,R,C,$,X),Ue=this.k[te],de=this.k[te+1],ge=h[te],De=h[te+1],ve=_(Pe,le,ce,Le,be,se,Ue,de,ge,De),_e=E(Pe,le,ce,Le,be,se,Ue,de,ge,De);Pe=L(l,p),le=V(l,p),ce=F(l,p,s,t,u),Le=q(l,p,s,t,u,S);var Ge=b(Pe,le,ce,Le),Se=v(Pe,le,ce,Le);Z=$,K=X,$=R,X=C,R=Q,C=G,Q=b(O,H,ve,_e),G=v(H,H,ve,_e),O=u,H=S,u=s,S=t,s=l,t=p,l=b(ve,_e,Ge,Se),p=v(ve,_e,Ge,Se)}y(this.h,0,l,p),y(this.h,2,s,t),y(this.h,4,u,S),y(this.h,6,O,H),y(this.h,8,Q,G),y(this.h,10,R,C),y(this.h,12,$,X),y(this.h,14,Z,K)},P.prototype._digest=function(i){return i==="hex"?M.toHex32(this.h,"big"):M.split32(this.h,"big")};function I(r,i,f,h,l){var p=r&f^~r&l;return p<0&&(p+=4294967296),p}function k(r,i,f,h,l,p){var s=i&h^~i&p;return s<0&&(s+=4294967296),s}function F(r,i,f,h,l){var p=r&f^r&l^f&l;return p<0&&(p+=4294967296),p}function q(r,i,f,h,l,p){var s=i&h^i&p^h&p;return s<0&&(s+=4294967296),s}function L(r,i){var f=o(r,i,28),h=o(i,r,2),l=o(i,r,7),p=f^h^l;return p<0&&(p+=4294967296),p}function V(r,i){var f=x(r,i,28),h=x(i,r,2),l=x(i,r,7),p=f^h^l;return p<0&&(p+=4294967296),p}function ee(r,i){var f=o(r,i,14),h=o(r,i,18),l=o(i,r,9),p=f^h^l;return p<0&&(p+=4294967296),p}function ne(r,i){var f=x(r,i,14),h=x(r,i,18),l=x(i,r,9),p=f^h^l;return p<0&&(p+=4294967296),p}function J(r,i){var f=o(r,i,1),h=o(r,i,8),l=n(r,i,7),p=f^h^l;return p<0&&(p+=4294967296),p}function ue(r,i){var f=x(r,i,1),h=x(r,i,8),l=g(r,i,7),p=f^h^l;return p<0&&(p+=4294967296),p}function m(r,i){var f=o(r,i,19),h=o(i,r,29),l=n(r,i,6),p=f^h^l;return p<0&&(p+=4294967296),p}function e(r,i){var f=x(r,i,19),h=x(i,r,29),l=g(r,i,6),p=f^h^l;return p<0&&(p+=4294967296),p}return ss}var os,Rc;function zp(){if(Rc)return os;Rc=1;var M=ar(),a=Ac();function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return M.inherits(c,a),os=c,c.blockSize=1024,c.outSize=384,c.hmacStrength=192,c.padLength=128,c.prototype._digest=function(x){return x==="hex"?M.toHex32(this.h.slice(0,12),"big"):M.split32(this.h.slice(0,12),"big")},os}var Ic;function jp(){return Ic||(Ic=1,Sr.sha1=Hp(),Sr.sha224=Kp(),Sr.sha256=Sc(),Sr.sha384=zp(),Sr.sha512=Ac()),Sr}var hs={},Oc;function Vp(){if(Oc)return hs;Oc=1;var M=ar(),a=Vr(),c=M.rotl32,o=M.sum32,x=M.sum32_3,n=M.sum32_4,g=a.BlockHash;function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}M.inherits(y,g),hs.ripemd160=y,y.blockSize=512,y.outSize=160,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(P,I){for(var k=this.h[0],F=this.h[1],q=this.h[2],L=this.h[3],V=this.h[4],ee=k,ne=F,J=q,ue=L,m=V,e=0;e<80;e++){var r=o(c(n(k,b(e,F,q,L),P[w[e]+I],v(e)),E[e]),V);k=V,V=L,L=c(q,10),q=F,F=r,r=o(c(n(ee,b(79-e,ne,J,ue),P[_[e]+I],d(e)),B[e]),m),ee=m,m=ue,ue=c(J,10),J=ne,ne=r}r=x(this.h[1],q,ue),this.h[1]=x(this.h[2],L,m),this.h[2]=x(this.h[3],V,ee),this.h[3]=x(this.h[4],k,ne),this.h[4]=x(this.h[0],F,J),this.h[0]=r},y.prototype._digest=function(P){return P==="hex"?M.toHex32(this.h,"little"):M.split32(this.h,"little")};function b(A,P,I,k){return A<=15?P^I^k:A<=31?P&I|~P&k:A<=47?(P|~I)^k:A<=63?P&k|I&~k:P^(I|~k)}function v(A){return A<=15?0:A<=31?1518500249:A<=47?1859775393:A<=63?2400959708:2840853838}function d(A){return A<=15?1352829926:A<=31?1548603684:A<=47?1836072691:A<=63?2053994217:0}var w=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],E=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],B=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return hs}var us,kc;function $p(){if(kc)return us;kc=1;var M=ar(),a=Ht();function c(o,x,n){if(!(this instanceof c))return new c(o,x,n);this.Hash=o,this.blockSize=o.blockSize/8,this.outSize=o.outSize/8,this.inner=null,this.outer=null,this._init(M.toArray(x,n))}return us=c,c.prototype._init=function(x){x.length>this.blockSize&&(x=new this.Hash().update(x).digest()),a(x.length<=this.blockSize);for(var n=x.length;n<this.blockSize;n++)x.push(0);for(n=0;n<x.length;n++)x[n]^=54;for(this.inner=new this.Hash().update(x),n=0;n<x.length;n++)x[n]^=106;this.outer=new this.Hash().update(x)},c.prototype.update=function(x,n){return this.inner.update(x,n),this},c.prototype.digest=function(x){return this.outer.update(this.inner.digest()),this.outer.digest(x)},us}var Pc;function $r(){return Pc||(Pc=1,function(M){var a=M;a.utils=ar(),a.common=Vr(),a.sha=jp(),a.ripemd=Vp(),a.hmac=$p(),a.sha1=a.sha.sha1,a.sha256=a.sha.sha256,a.sha224=a.sha.sha224,a.sha384=a.sha.sha384,a.sha512=a.sha.sha512,a.ripemd160=a.ripemd.ripemd160}(rs)),rs}var cs,Tc;function Gp(){return Tc||(Tc=1,cs={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),cs}var Nc;function ls(){return Nc||(Nc=1,function(M){var a=M,c=$r(),o=bc(),x=$t(),n=x.assert;function g(v){v.type==="short"?this.curve=new o.short(v):v.type==="edwards"?this.curve=new o.edwards(v):this.curve=new o.mont(v),this.g=this.curve.g,this.n=this.curve.n,this.hash=v.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}a.PresetCurve=g;function y(v,d){Object.defineProperty(a,v,{configurable:!0,enumerable:!0,get:function(){var w=new g(d);return Object.defineProperty(a,v,{configurable:!0,enumerable:!0,value:w}),w}})}y("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:c.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),y("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:c.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),y("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:c.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),y("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:c.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),y("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:c.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),y("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:c.sha256,gRed:!1,g:["9"]}),y("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:c.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var b;try{b=Gp()}catch{b=void 0}y("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:c.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",b]})}(ts)),ts}var ds,Cc;function qc(){if(Cc)return ds;Cc=1;var M=$r(),a=Yi(),c=Ht();function o(x){if(!(this instanceof o))return new o(x);this.hash=x.hash,this.predResist=!!x.predResist,this.outLen=this.hash.outSize,this.minEntropy=x.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=a.toArray(x.entropy,x.entropyEnc||"hex"),g=a.toArray(x.nonce,x.nonceEnc||"hex"),y=a.toArray(x.pers,x.persEnc||"hex");c(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,g,y)}return ds=o,o.prototype._init=function(n,g,y){var b=n.concat(g).concat(y);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var v=0;v<this.V.length;v++)this.K[v]=0,this.V[v]=1;this._update(b),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new M.hmac(this.hash,this.K)},o.prototype._update=function(n){var g=this._hmac().update(this.V).update([0]);n&&(g=g.update(n)),this.K=g.digest(),this.V=this._hmac().update(this.V).digest(),n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(n,g,y,b){typeof g!="string"&&(b=y,y=g,g=null),n=a.toArray(n,g),y=a.toArray(y,b),c(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(n.concat(y||[])),this._reseed=1},o.prototype.generate=function(n,g,y,b){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof g!="string"&&(b=y,y=g,g=null),y&&(y=a.toArray(y,b||"hex"),this._update(y));for(var v=[];v.length<n;)this.V=this._hmac().update(this.V).digest(),v=v.concat(this.V);var d=v.slice(0,n);return this._update(y),this._reseed++,a.encode(d,g)},ds}var ps,Lc;function Wp(){if(Lc)return ps;Lc=1;var M=cr(),a=$t(),c=a.assert;function o(x,n){this.ec=x,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}return ps=o,o.fromPublic=function(n,g,y){return g instanceof o?g:new o(n,{pub:g,pubEnc:y})},o.fromPrivate=function(n,g,y){return g instanceof o?g:new o(n,{priv:g,privEnc:y})},o.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(n,g){return typeof n=="string"&&(g=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),g?this.pub.encode(g,n):this.pub},o.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(n,g){this.priv=new M(n,g||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(n,g){if(n.x||n.y){this.ec.curve.type==="mont"?c(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&c(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,g)},o.prototype.derive=function(n){return n.validate()||c(n.validate(),"public point not validated"),n.mul(this.priv).getX()},o.prototype.sign=function(n,g,y){return this.ec.sign(n,this,g,y)},o.prototype.verify=function(n,g,y){return this.ec.verify(n,g,this,void 0,y)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},ps}var vs,Fc;function Yp(){if(Fc)return vs;Fc=1;var M=cr(),a=$t(),c=a.assert;function o(b,v){if(b instanceof o)return b;this._importDER(b,v)||(c(b.r&&b.s,"Signature without r or s"),this.r=new M(b.r,16),this.s=new M(b.s,16),b.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=b.recoveryParam)}vs=o;function x(){this.place=0}function n(b,v){var d=b[v.place++];if(!(d&128))return d;var w=d&15;if(w===0||w>4||b[v.place]===0)return!1;for(var _=0,E=0,B=v.place;E<w;E++,B++)_<<=8,_|=b[B],_>>>=0;return _<=127?!1:(v.place=B,_)}function g(b){for(var v=0,d=b.length-1;!b[v]&&!(b[v+1]&128)&&v<d;)v++;return v===0?b:b.slice(v)}o.prototype._importDER=function(v,d){v=a.toArray(v,d);var w=new x;if(v[w.place++]!==48)return!1;var _=n(v,w);if(_===!1||_+w.place!==v.length||v[w.place++]!==2)return!1;var E=n(v,w);if(E===!1||(v[w.place]&128)!==0)return!1;var B=v.slice(w.place,E+w.place);if(w.place+=E,v[w.place++]!==2)return!1;var A=n(v,w);if(A===!1||v.length!==A+w.place||(v[w.place]&128)!==0)return!1;var P=v.slice(w.place,A+w.place);if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;if(P[0]===0)if(P[1]&128)P=P.slice(1);else return!1;return this.r=new M(B),this.s=new M(P),this.recoveryParam=null,!0};function y(b,v){if(v<128){b.push(v);return}var d=1+(Math.log(v)/Math.LN2>>>3);for(b.push(d|128);--d;)b.push(v>>>(d<<3)&255);b.push(v)}return o.prototype.toDER=function(v){var d=this.r.toArray(),w=this.s.toArray();for(d[0]&128&&(d=[0].concat(d)),w[0]&128&&(w=[0].concat(w)),d=g(d),w=g(w);!w[0]&&!(w[1]&128);)w=w.slice(1);var _=[2];y(_,d.length),_=_.concat(d),_.push(2),y(_,w.length);var E=_.concat(w),B=[48];return y(B,E.length),B=B.concat(E),a.encode(B,v)},vs}var ms,Dc;function Jp(){if(Dc)return ms;Dc=1;var M=cr(),a=qc(),c=$t(),o=ls(),x=Yr(),n=c.assert,g=Wp(),y=Yp();function b(v){if(!(this instanceof b))return new b(v);typeof v=="string"&&(n(Object.prototype.hasOwnProperty.call(o,v),"Unknown curve "+v),v=o[v]),v instanceof o.PresetCurve&&(v={curve:v}),this.curve=v.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=v.curve.g,this.g.precompute(v.curve.n.bitLength()+1),this.hash=v.hash||v.curve.hash}return ms=b,b.prototype.keyPair=function(d){return new g(this,d)},b.prototype.keyFromPrivate=function(d,w){return g.fromPrivate(this,d,w)},b.prototype.keyFromPublic=function(d,w){return g.fromPublic(this,d,w)},b.prototype.genKeyPair=function(d){d||(d={});for(var w=new a({hash:this.hash,pers:d.pers,persEnc:d.persEnc||"utf8",entropy:d.entropy||x(this.hash.hmacStrength),entropyEnc:d.entropy&&d.entropyEnc||"utf8",nonce:this.n.toArray()}),_=this.n.byteLength(),E=this.n.sub(new M(2));;){var B=new M(w.generate(_));if(!(B.cmp(E)>0))return B.iaddn(1),this.keyFromPrivate(B)}},b.prototype._truncateToN=function(d,w,_){var E;if(M.isBN(d)||typeof d=="number")d=new M(d,16),E=d.byteLength();else if(typeof d=="object")E=d.length,d=new M(d,16);else{var B=d.toString();E=B.length+1>>>1,d=new M(B,16)}typeof _!="number"&&(_=E*8);var A=_-this.n.bitLength();return A>0&&(d=d.ushrn(A)),!w&&d.cmp(this.n)>=0?d.sub(this.n):d},b.prototype.sign=function(d,w,_,E){if(typeof _=="object"&&(E=_,_=null),E||(E={}),typeof d!="string"&&typeof d!="number"&&!M.isBN(d)){n(typeof d=="object"&&d&&typeof d.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),n(d.length>>>0===d.length);for(var B=0;B<d.length;B++)n((d[B]&255)===d[B])}w=this.keyFromPrivate(w,_),d=this._truncateToN(d,!1,E.msgBitLength),n(!d.isNeg(),"Can not sign a negative message");var A=this.n.byteLength(),P=w.getPrivate().toArray("be",A),I=d.toArray("be",A);n(new M(I).eq(d),"Can not sign message");for(var k=new a({hash:this.hash,entropy:P,nonce:I,pers:E.pers,persEnc:E.persEnc||"utf8"}),F=this.n.sub(new M(1)),q=0;;q++){var L=E.k?E.k(q):new M(k.generate(this.n.byteLength()));if(L=this._truncateToN(L,!0),!(L.cmpn(1)<=0||L.cmp(F)>=0)){var V=this.g.mul(L);if(!V.isInfinity()){var ee=V.getX(),ne=ee.umod(this.n);if(ne.cmpn(0)!==0){var J=L.invm(this.n).mul(ne.mul(w.getPrivate()).iadd(d));if(J=J.umod(this.n),J.cmpn(0)!==0){var ue=(V.getY().isOdd()?1:0)|(ee.cmp(ne)!==0?2:0);return E.canonical&&J.cmp(this.nh)>0&&(J=this.n.sub(J),ue^=1),new y({r:ne,s:J,recoveryParam:ue})}}}}}},b.prototype.verify=function(d,w,_,E,B){B||(B={}),d=this._truncateToN(d,!1,B.msgBitLength),_=this.keyFromPublic(_,E),w=new y(w,"hex");var A=w.r,P=w.s;if(A.cmpn(1)<0||A.cmp(this.n)>=0||P.cmpn(1)<0||P.cmp(this.n)>=0)return!1;var I=P.invm(this.n),k=I.mul(d).umod(this.n),F=I.mul(A).umod(this.n),q;return this.curve._maxwellTrick?(q=this.g.jmulAdd(k,_.getPublic(),F),q.isInfinity()?!1:q.eqXToP(A)):(q=this.g.mulAdd(k,_.getPublic(),F),q.isInfinity()?!1:q.getX().umod(this.n).cmp(A)===0)},b.prototype.recoverPubKey=function(v,d,w,_){n((3&w)===w,"The recovery param is more than two bits"),d=new y(d,_);var E=this.n,B=new M(v),A=d.r,P=d.s,I=w&1,k=w>>1;if(A.cmp(this.curve.p.umod(this.curve.n))>=0&&k)throw new Error("Unable to find sencond key candinate");k?A=this.curve.pointFromX(A.add(this.curve.n),I):A=this.curve.pointFromX(A,I);var F=d.r.invm(E),q=E.sub(B).mul(F).umod(E),L=P.mul(F).umod(E);return this.g.mulAdd(q,A,L)},b.prototype.getKeyRecoveryParam=function(v,d,w,_){if(d=new y(d,_),d.recoveryParam!==null)return d.recoveryParam;for(var E=0;E<4;E++){var B;try{B=this.recoverPubKey(v,d,E)}catch{continue}if(B.eq(w))return E}throw new Error("Unable to find valid recovery factor")},ms}var bs,Uc;function Zp(){if(Uc)return bs;Uc=1;var M=$t(),a=M.assert,c=M.parseBytes,o=M.cachedProperty;function x(n,g){this.eddsa=n,this._secret=c(g.secret),n.isPoint(g.pub)?this._pub=g.pub:this._pubBytes=c(g.pub)}return x.fromPublic=function(g,y){return y instanceof x?y:new x(g,{pub:y})},x.fromSecret=function(g,y){return y instanceof x?y:new x(g,{secret:y})},x.prototype.secret=function(){return this._secret},o(x,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(x,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(x,"privBytes",function(){var g=this.eddsa,y=this.hash(),b=g.encodingLength-1,v=y.slice(0,g.encodingLength);return v[0]&=248,v[b]&=127,v[b]|=64,v}),o(x,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(x,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(x,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),x.prototype.sign=function(g){return a(this._secret,"KeyPair can only verify"),this.eddsa.sign(g,this)},x.prototype.verify=function(g,y){return this.eddsa.verify(g,y,this)},x.prototype.getSecret=function(g){return a(this._secret,"KeyPair is public only"),M.encode(this.secret(),g)},x.prototype.getPublic=function(g){return M.encode(this.pubBytes(),g)},bs=x,bs}var gs,Hc;function Xp(){if(Hc)return gs;Hc=1;var M=cr(),a=$t(),c=a.assert,o=a.cachedProperty,x=a.parseBytes;function n(g,y){this.eddsa=g,typeof y!="object"&&(y=x(y)),Array.isArray(y)&&(c(y.length===g.encodingLength*2,"Signature has invalid size"),y={R:y.slice(0,g.encodingLength),S:y.slice(g.encodingLength)}),c(y.R&&y.S,"Signature without R or S"),g.isPoint(y.R)&&(this._R=y.R),y.S instanceof M&&(this._S=y.S),this._Rencoded=Array.isArray(y.R)?y.R:y.Rencoded,this._Sencoded=Array.isArray(y.S)?y.S:y.Sencoded}return o(n,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(n,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(n,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(n,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},n.prototype.toHex=function(){return a.encode(this.toBytes(),"hex").toUpperCase()},gs=n,gs}var ys,Kc;function Qp(){if(Kc)return ys;Kc=1;var M=$r(),a=ls(),c=$t(),o=c.assert,x=c.parseBytes,n=Zp(),g=Xp();function y(b){if(o(b==="ed25519","only tested with ed25519 so far"),!(this instanceof y))return new y(b);b=a[b].curve,this.curve=b,this.g=b.g,this.g.precompute(b.n.bitLength()+1),this.pointClass=b.point().constructor,this.encodingLength=Math.ceil(b.n.bitLength()/8),this.hash=M.sha512}return ys=y,y.prototype.sign=function(v,d){v=x(v);var w=this.keyFromSecret(d),_=this.hashInt(w.messagePrefix(),v),E=this.g.mul(_),B=this.encodePoint(E),A=this.hashInt(B,w.pubBytes(),v).mul(w.priv()),P=_.add(A).umod(this.curve.n);return this.makeSignature({R:E,S:P,Rencoded:B})},y.prototype.verify=function(v,d,w){if(v=x(v),d=this.makeSignature(d),d.S().gte(d.eddsa.curve.n)||d.S().isNeg())return!1;var _=this.keyFromPublic(w),E=this.hashInt(d.Rencoded(),_.pubBytes(),v),B=this.g.mul(d.S()),A=d.R().add(_.pub().mul(E));return A.eq(B)},y.prototype.hashInt=function(){for(var v=this.hash(),d=0;d<arguments.length;d++)v.update(arguments[d]);return c.intFromLE(v.digest()).umod(this.curve.n)},y.prototype.keyFromPublic=function(v){return n.fromPublic(this,v)},y.prototype.keyFromSecret=function(v){return n.fromSecret(this,v)},y.prototype.makeSignature=function(v){return v instanceof g?v:new g(this,v)},y.prototype.encodePoint=function(v){var d=v.getY().toArray("le",this.encodingLength);return d[this.encodingLength-1]|=v.getX().isOdd()?128:0,d},y.prototype.decodePoint=function(v){v=c.parseBytes(v);var d=v.length-1,w=v.slice(0,d).concat(v[d]&-129),_=(v[d]&128)!==0,E=c.intFromLE(w);return this.curve.pointFromY(E,_)},y.prototype.encodeInt=function(v){return v.toArray("le",this.encodingLength)},y.prototype.decodeInt=function(v){return c.intFromLE(v)},y.prototype.isPoint=function(v){return v instanceof this.pointClass},ys}var zc;function ws(){return zc||(zc=1,function(M){var a=M;a.version=qp.version,a.utils=$t(),a.rand=Yr(),a.curve=bc(),a.curves=ls(),a.ec=Jp(),a.eddsa=Qp()}(Wf)),Wf}var Gt={},Ms={},Ri={exports:{}},e1=Ri.exports,jc;function t1(){return jc||(jc=1,function(M){(function(a,c){function o(m,e){if(!m)throw new Error(e||"Assertion failed")}function x(m,e){m.super_=e;var r=function(){};r.prototype=e.prototype,m.prototype=new r,m.prototype.constructor=m}function n(m,e,r){if(n.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((e==="le"||e==="be")&&(r=e,e=10),this._init(m||0,e||10,r||"be"))}typeof a=="object"?a.exports=n:c.BN=n,n.BN=n,n.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=Nt().Buffer}catch{}n.isBN=function(e){return e instanceof n?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp(r)>0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var f=0;e[0]==="-"&&(f++,this.negative=1),f<e.length&&(r===16?this._parseHex(e,f,i):(this._parseBase(e,r,f),i==="le"&&this._initArray(this.toArray(),r,i)))},n.prototype._initNumber=function(e,r,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(o(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},n.prototype._initArray=function(e,r,i){if(o(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h,l,p=0;if(i==="be")for(f=e.length-1,h=0;f>=0;f-=3)l=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);else if(i==="le")for(f=0,h=0;f<e.length;f+=3)l=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);return this.strip()};function y(m,e){var r=m.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function b(m,e,r){var i=y(m,r);return r-1>=e&&(i|=y(m,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h=0,l=0,p;if(i==="be")for(f=e.length-1;f>=r;f-=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8;else{var s=e.length-r;for(f=s%2===0?r+1:r;f<e.length;f+=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8}this.strip()};function v(m,e,r,i){for(var f=0,h=Math.min(m.length,r),l=e;l<h;l++){var p=m.charCodeAt(l)-48;f*=i,p>=49?f+=p-49+10:p>=17?f+=p-17+10:f+=p}return f}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=r)f++;f--,h=h/r|0;for(var l=e.length-i,p=l%f,s=Math.min(l,l-p)+i,t=0,u=i;u<s;u+=f)t=v(e,u,u+f,r),this.imuln(h),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t);if(p!==0){var S=1;for(t=v(e,u,e.length,r),u=0;u<p;u++)S*=r;this.imuln(S),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],w=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var f=0,h=0,l=0;l<this.length;l++){var p=this.words[l],s=((p<<f|h)&16777215).toString(16);h=p>>>24-f&16777215,f+=2,f>=26&&(f-=26,l--),h!==0||l!==this.length-1?i=d[6-s.length]+s+i:i=s+i}for(h!==0&&(i=h.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=w[e],u=_[e];i="";var S=this.clone();for(S.negative=0;!S.isZero();){var O=S.modn(u).toString(e);S=S.idivn(u),S.isZero()?i=O+i:i=d[t-O.length]+O+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return o(typeof g<"u"),this.toArrayLike(g,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var f=this.byteLength(),h=i||Math.max(1,f);o(f<=h,"byte array longer than desired length"),o(h>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(h),s,t,u=this.clone();if(l){for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[t]=s;for(;t<h;t++)p[t]=0}else{for(t=0;t<h-f;t++)p[t]=0;for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[h-t-1]=s}return p},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return(r&8191)===0&&(i+=13,r>>>=13),(r&127)===0&&(i+=7,r>>>=7),(r&15)===0&&(i+=4,r>>>=4),(r&3)===0&&(i+=2,r>>>=2),(r&1)===0&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function E(m){for(var e=new Array(m.bitLength()),r=0;r<e.length;r++){var i=r/26|0,f=r%26;e[r]=(m.words[i]&1<<f)>>>f}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,i!==26)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},n.prototype.ior=function(e){return o((this.negative|e.negative)===0),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},n.prototype.iand=function(e){return o((this.negative|e.negative)===0),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var f=0;f<i.length;f++)this.words[f]=r.words[f]^i.words[f];if(this!==r)for(;f<r.length;f++)this.words[f]=r.words[f];return this.length=r.length,this.strip()},n.prototype.ixor=function(e){return o((this.negative|e.negative)===0),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){o(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var f=0;f<r;f++)this.words[f]=~this.words[f]&67108863;return i>0&&(this.words[f]=~this.words[f]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){o(typeof e=="number"&&e>=0);var i=e/26|0,f=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<f:this.words[i]=this.words[i]&~(1<<f),this.strip()},n.prototype.iadd=function(e){var r;if(this.negative!==0&&e.negative===0)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();var i,f;this.length>e.length?(i=this,f=e):(i=e,f=this);for(var h=0,l=0;l<f.length;l++)r=(i.words[l]|0)+(f.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;for(;h!==0&&l<i.length;l++)r=(i.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;if(this.length=i.length,h!==0)this.words[this.length]=h,this.length++;else if(i!==this)for(;l<i.length;l++)this.words[l]=i.words[l];return this},n.prototype.add=function(e){var r;return e.negative!==0&&this.negative===0?(e.negative=0,r=this.sub(e),e.negative^=1,r):e.negative===0&&this.negative!==0?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;i>0?(f=this,h=e):(f=e,h=this);for(var l=0,p=0;p<h.length;p++)r=(f.words[p]|0)-(h.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;for(;l!==0&&p<f.length;p++)r=(f.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;if(l===0&&p<f.length&&f!==this)for(;p<f.length;p++)this.words[p]=f.words[p];return this.length=Math.max(this.length,p),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};function B(m,e,r){r.negative=e.negative^m.negative;var i=m.length+e.length|0;r.length=i,i=i-1|0;var f=m.words[0]|0,h=e.words[0]|0,l=f*h,p=l&67108863,s=l/67108864|0;r.words[0]=p;for(var t=1;t<i;t++){for(var u=s>>>26,S=s&67108863,O=Math.min(t,e.length-1),H=Math.max(0,t-m.length+1);H<=O;H++){var Q=t-H|0;f=m.words[Q]|0,h=e.words[H]|0,l=f*h+S,u+=l/67108864|0,S=l&67108863}r.words[t]=S|0,s=u|0}return s!==0?r.words[t]=s|0:r.length--,r.strip()}var A=function(e,r,i){var f=e.words,h=r.words,l=i.words,p=0,s,t,u,S=f[0]|0,O=S&8191,H=S>>>13,Q=f[1]|0,G=Q&8191,R=Q>>>13,C=f[2]|0,$=C&8191,X=C>>>13,Z=f[3]|0,K=Z&8191,te=Z>>>13,Pe=f[4]|0,le=Pe&8191,ce=Pe>>>13,Le=f[5]|0,be=Le&8191,se=Le>>>13,Ue=f[6]|0,de=Ue&8191,ge=Ue>>>13,De=f[7]|0,ve=De&8191,_e=De>>>13,Ge=f[8]|0,Se=Ge&8191,Oe=Ge>>>13,Ze=f[9]|0,z=Ze&8191,T=Ze>>>13,D=h[0]|0,W=D&8191,re=D>>>13,pe=h[1]|0,ae=pe&8191,Me=pe>>>13,ze=h[2]|0,ye=ze&8191,Be=ze>>>13,He=h[3]|0,Ae=He&8191,Te=He>>>13,rt=h[4]|0,Ie=rt&8191,Ne=rt>>>13,nt=h[5]|0,j=nt&8191,N=nt>>>13,U=h[6]|0,Y=U&8191,ie=U>>>13,me=h[7]|0,fe=me&8191,xe=me>>>13,Ve=h[8]|0,we=Ve&8191,Re=Ve>>>13,Ke=h[9]|0,ke=Ke&8191,Ce=Ke>>>13;i.negative=e.negative^r.negative,i.length=19,s=Math.imul(O,W),t=Math.imul(O,re),t=t+Math.imul(H,W)|0,u=Math.imul(H,re);var Xe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,s=Math.imul(G,W),t=Math.imul(G,re),t=t+Math.imul(R,W)|0,u=Math.imul(R,re),s=s+Math.imul(O,ae)|0,t=t+Math.imul(O,Me)|0,t=t+Math.imul(H,ae)|0,u=u+Math.imul(H,Me)|0;var Qe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,s=Math.imul($,W),t=Math.imul($,re),t=t+Math.imul(X,W)|0,u=Math.imul(X,re),s=s+Math.imul(G,ae)|0,t=t+Math.imul(G,Me)|0,t=t+Math.imul(R,ae)|0,u=u+Math.imul(R,Me)|0,s=s+Math.imul(O,ye)|0,t=t+Math.imul(O,Be)|0,t=t+Math.imul(H,ye)|0,u=u+Math.imul(H,Be)|0;var lt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(lt>>>26)|0,lt&=67108863,s=Math.imul(K,W),t=Math.imul(K,re),t=t+Math.imul(te,W)|0,u=Math.imul(te,re),s=s+Math.imul($,ae)|0,t=t+Math.imul($,Me)|0,t=t+Math.imul(X,ae)|0,u=u+Math.imul(X,Me)|0,s=s+Math.imul(G,ye)|0,t=t+Math.imul(G,Be)|0,t=t+Math.imul(R,ye)|0,u=u+Math.imul(R,Be)|0,s=s+Math.imul(O,Ae)|0,t=t+Math.imul(O,Te)|0,t=t+Math.imul(H,Ae)|0,u=u+Math.imul(H,Te)|0;var dt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(dt>>>26)|0,dt&=67108863,s=Math.imul(le,W),t=Math.imul(le,re),t=t+Math.imul(ce,W)|0,u=Math.imul(ce,re),s=s+Math.imul(K,ae)|0,t=t+Math.imul(K,Me)|0,t=t+Math.imul(te,ae)|0,u=u+Math.imul(te,Me)|0,s=s+Math.imul($,ye)|0,t=t+Math.imul($,Be)|0,t=t+Math.imul(X,ye)|0,u=u+Math.imul(X,Be)|0,s=s+Math.imul(G,Ae)|0,t=t+Math.imul(G,Te)|0,t=t+Math.imul(R,Ae)|0,u=u+Math.imul(R,Te)|0,s=s+Math.imul(O,Ie)|0,t=t+Math.imul(O,Ne)|0,t=t+Math.imul(H,Ie)|0,u=u+Math.imul(H,Ne)|0;var pt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(be,W),t=Math.imul(be,re),t=t+Math.imul(se,W)|0,u=Math.imul(se,re),s=s+Math.imul(le,ae)|0,t=t+Math.imul(le,Me)|0,t=t+Math.imul(ce,ae)|0,u=u+Math.imul(ce,Me)|0,s=s+Math.imul(K,ye)|0,t=t+Math.imul(K,Be)|0,t=t+Math.imul(te,ye)|0,u=u+Math.imul(te,Be)|0,s=s+Math.imul($,Ae)|0,t=t+Math.imul($,Te)|0,t=t+Math.imul(X,Ae)|0,u=u+Math.imul(X,Te)|0,s=s+Math.imul(G,Ie)|0,t=t+Math.imul(G,Ne)|0,t=t+Math.imul(R,Ie)|0,u=u+Math.imul(R,Ne)|0,s=s+Math.imul(O,j)|0,t=t+Math.imul(O,N)|0,t=t+Math.imul(H,j)|0,u=u+Math.imul(H,N)|0;var vt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(de,W),t=Math.imul(de,re),t=t+Math.imul(ge,W)|0,u=Math.imul(ge,re),s=s+Math.imul(be,ae)|0,t=t+Math.imul(be,Me)|0,t=t+Math.imul(se,ae)|0,u=u+Math.imul(se,Me)|0,s=s+Math.imul(le,ye)|0,t=t+Math.imul(le,Be)|0,t=t+Math.imul(ce,ye)|0,u=u+Math.imul(ce,Be)|0,s=s+Math.imul(K,Ae)|0,t=t+Math.imul(K,Te)|0,t=t+Math.imul(te,Ae)|0,u=u+Math.imul(te,Te)|0,s=s+Math.imul($,Ie)|0,t=t+Math.imul($,Ne)|0,t=t+Math.imul(X,Ie)|0,u=u+Math.imul(X,Ne)|0,s=s+Math.imul(G,j)|0,t=t+Math.imul(G,N)|0,t=t+Math.imul(R,j)|0,u=u+Math.imul(R,N)|0,s=s+Math.imul(O,Y)|0,t=t+Math.imul(O,ie)|0,t=t+Math.imul(H,Y)|0,u=u+Math.imul(H,ie)|0;var mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(ve,W),t=Math.imul(ve,re),t=t+Math.imul(_e,W)|0,u=Math.imul(_e,re),s=s+Math.imul(de,ae)|0,t=t+Math.imul(de,Me)|0,t=t+Math.imul(ge,ae)|0,u=u+Math.imul(ge,Me)|0,s=s+Math.imul(be,ye)|0,t=t+Math.imul(be,Be)|0,t=t+Math.imul(se,ye)|0,u=u+Math.imul(se,Be)|0,s=s+Math.imul(le,Ae)|0,t=t+Math.imul(le,Te)|0,t=t+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Te)|0,s=s+Math.imul(K,Ie)|0,t=t+Math.imul(K,Ne)|0,t=t+Math.imul(te,Ie)|0,u=u+Math.imul(te,Ne)|0,s=s+Math.imul($,j)|0,t=t+Math.imul($,N)|0,t=t+Math.imul(X,j)|0,u=u+Math.imul(X,N)|0,s=s+Math.imul(G,Y)|0,t=t+Math.imul(G,ie)|0,t=t+Math.imul(R,Y)|0,u=u+Math.imul(R,ie)|0,s=s+Math.imul(O,fe)|0,t=t+Math.imul(O,xe)|0,t=t+Math.imul(H,fe)|0,u=u+Math.imul(H,xe)|0;var bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(Se,W),t=Math.imul(Se,re),t=t+Math.imul(Oe,W)|0,u=Math.imul(Oe,re),s=s+Math.imul(ve,ae)|0,t=t+Math.imul(ve,Me)|0,t=t+Math.imul(_e,ae)|0,u=u+Math.imul(_e,Me)|0,s=s+Math.imul(de,ye)|0,t=t+Math.imul(de,Be)|0,t=t+Math.imul(ge,ye)|0,u=u+Math.imul(ge,Be)|0,s=s+Math.imul(be,Ae)|0,t=t+Math.imul(be,Te)|0,t=t+Math.imul(se,Ae)|0,u=u+Math.imul(se,Te)|0,s=s+Math.imul(le,Ie)|0,t=t+Math.imul(le,Ne)|0,t=t+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,Ne)|0,s=s+Math.imul(K,j)|0,t=t+Math.imul(K,N)|0,t=t+Math.imul(te,j)|0,u=u+Math.imul(te,N)|0,s=s+Math.imul($,Y)|0,t=t+Math.imul($,ie)|0,t=t+Math.imul(X,Y)|0,u=u+Math.imul(X,ie)|0,s=s+Math.imul(G,fe)|0,t=t+Math.imul(G,xe)|0,t=t+Math.imul(R,fe)|0,u=u+Math.imul(R,xe)|0,s=s+Math.imul(O,we)|0,t=t+Math.imul(O,Re)|0,t=t+Math.imul(H,we)|0,u=u+Math.imul(H,Re)|0;var gt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(gt>>>26)|0,gt&=67108863,s=Math.imul(z,W),t=Math.imul(z,re),t=t+Math.imul(T,W)|0,u=Math.imul(T,re),s=s+Math.imul(Se,ae)|0,t=t+Math.imul(Se,Me)|0,t=t+Math.imul(Oe,ae)|0,u=u+Math.imul(Oe,Me)|0,s=s+Math.imul(ve,ye)|0,t=t+Math.imul(ve,Be)|0,t=t+Math.imul(_e,ye)|0,u=u+Math.imul(_e,Be)|0,s=s+Math.imul(de,Ae)|0,t=t+Math.imul(de,Te)|0,t=t+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,Te)|0,s=s+Math.imul(be,Ie)|0,t=t+Math.imul(be,Ne)|0,t=t+Math.imul(se,Ie)|0,u=u+Math.imul(se,Ne)|0,s=s+Math.imul(le,j)|0,t=t+Math.imul(le,N)|0,t=t+Math.imul(ce,j)|0,u=u+Math.imul(ce,N)|0,s=s+Math.imul(K,Y)|0,t=t+Math.imul(K,ie)|0,t=t+Math.imul(te,Y)|0,u=u+Math.imul(te,ie)|0,s=s+Math.imul($,fe)|0,t=t+Math.imul($,xe)|0,t=t+Math.imul(X,fe)|0,u=u+Math.imul(X,xe)|0,s=s+Math.imul(G,we)|0,t=t+Math.imul(G,Re)|0,t=t+Math.imul(R,we)|0,u=u+Math.imul(R,Re)|0,s=s+Math.imul(O,ke)|0,t=t+Math.imul(O,Ce)|0,t=t+Math.imul(H,ke)|0,u=u+Math.imul(H,Ce)|0;var yt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(z,ae),t=Math.imul(z,Me),t=t+Math.imul(T,ae)|0,u=Math.imul(T,Me),s=s+Math.imul(Se,ye)|0,t=t+Math.imul(Se,Be)|0,t=t+Math.imul(Oe,ye)|0,u=u+Math.imul(Oe,Be)|0,s=s+Math.imul(ve,Ae)|0,t=t+Math.imul(ve,Te)|0,t=t+Math.imul(_e,Ae)|0,u=u+Math.imul(_e,Te)|0,s=s+Math.imul(de,Ie)|0,t=t+Math.imul(de,Ne)|0,t=t+Math.imul(ge,Ie)|0,u=u+Math.imul(ge,Ne)|0,s=s+Math.imul(be,j)|0,t=t+Math.imul(be,N)|0,t=t+Math.imul(se,j)|0,u=u+Math.imul(se,N)|0,s=s+Math.imul(le,Y)|0,t=t+Math.imul(le,ie)|0,t=t+Math.imul(ce,Y)|0,u=u+Math.imul(ce,ie)|0,s=s+Math.imul(K,fe)|0,t=t+Math.imul(K,xe)|0,t=t+Math.imul(te,fe)|0,u=u+Math.imul(te,xe)|0,s=s+Math.imul($,we)|0,t=t+Math.imul($,Re)|0,t=t+Math.imul(X,we)|0,u=u+Math.imul(X,Re)|0,s=s+Math.imul(G,ke)|0,t=t+Math.imul(G,Ce)|0,t=t+Math.imul(R,ke)|0,u=u+Math.imul(R,Ce)|0;var wt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,ye),t=Math.imul(z,Be),t=t+Math.imul(T,ye)|0,u=Math.imul(T,Be),s=s+Math.imul(Se,Ae)|0,t=t+Math.imul(Se,Te)|0,t=t+Math.imul(Oe,Ae)|0,u=u+Math.imul(Oe,Te)|0,s=s+Math.imul(ve,Ie)|0,t=t+Math.imul(ve,Ne)|0,t=t+Math.imul(_e,Ie)|0,u=u+Math.imul(_e,Ne)|0,s=s+Math.imul(de,j)|0,t=t+Math.imul(de,N)|0,t=t+Math.imul(ge,j)|0,u=u+Math.imul(ge,N)|0,s=s+Math.imul(be,Y)|0,t=t+Math.imul(be,ie)|0,t=t+Math.imul(se,Y)|0,u=u+Math.imul(se,ie)|0,s=s+Math.imul(le,fe)|0,t=t+Math.imul(le,xe)|0,t=t+Math.imul(ce,fe)|0,u=u+Math.imul(ce,xe)|0,s=s+Math.imul(K,we)|0,t=t+Math.imul(K,Re)|0,t=t+Math.imul(te,we)|0,u=u+Math.imul(te,Re)|0,s=s+Math.imul($,ke)|0,t=t+Math.imul($,Ce)|0,t=t+Math.imul(X,ke)|0,u=u+Math.imul(X,Ce)|0;var Mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(z,Ae),t=Math.imul(z,Te),t=t+Math.imul(T,Ae)|0,u=Math.imul(T,Te),s=s+Math.imul(Se,Ie)|0,t=t+Math.imul(Se,Ne)|0,t=t+Math.imul(Oe,Ie)|0,u=u+Math.imul(Oe,Ne)|0,s=s+Math.imul(ve,j)|0,t=t+Math.imul(ve,N)|0,t=t+Math.imul(_e,j)|0,u=u+Math.imul(_e,N)|0,s=s+Math.imul(de,Y)|0,t=t+Math.imul(de,ie)|0,t=t+Math.imul(ge,Y)|0,u=u+Math.imul(ge,ie)|0,s=s+Math.imul(be,fe)|0,t=t+Math.imul(be,xe)|0,t=t+Math.imul(se,fe)|0,u=u+Math.imul(se,xe)|0,s=s+Math.imul(le,we)|0,t=t+Math.imul(le,Re)|0,t=t+Math.imul(ce,we)|0,u=u+Math.imul(ce,Re)|0,s=s+Math.imul(K,ke)|0,t=t+Math.imul(K,Ce)|0,t=t+Math.imul(te,ke)|0,u=u+Math.imul(te,Ce)|0;var xt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(z,Ie),t=Math.imul(z,Ne),t=t+Math.imul(T,Ie)|0,u=Math.imul(T,Ne),s=s+Math.imul(Se,j)|0,t=t+Math.imul(Se,N)|0,t=t+Math.imul(Oe,j)|0,u=u+Math.imul(Oe,N)|0,s=s+Math.imul(ve,Y)|0,t=t+Math.imul(ve,ie)|0,t=t+Math.imul(_e,Y)|0,u=u+Math.imul(_e,ie)|0,s=s+Math.imul(de,fe)|0,t=t+Math.imul(de,xe)|0,t=t+Math.imul(ge,fe)|0,u=u+Math.imul(ge,xe)|0,s=s+Math.imul(be,we)|0,t=t+Math.imul(be,Re)|0,t=t+Math.imul(se,we)|0,u=u+Math.imul(se,Re)|0,s=s+Math.imul(le,ke)|0,t=t+Math.imul(le,Ce)|0,t=t+Math.imul(ce,ke)|0,u=u+Math.imul(ce,Ce)|0;var _t=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(z,j),t=Math.imul(z,N),t=t+Math.imul(T,j)|0,u=Math.imul(T,N),s=s+Math.imul(Se,Y)|0,t=t+Math.imul(Se,ie)|0,t=t+Math.imul(Oe,Y)|0,u=u+Math.imul(Oe,ie)|0,s=s+Math.imul(ve,fe)|0,t=t+Math.imul(ve,xe)|0,t=t+Math.imul(_e,fe)|0,u=u+Math.imul(_e,xe)|0,s=s+Math.imul(de,we)|0,t=t+Math.imul(de,Re)|0,t=t+Math.imul(ge,we)|0,u=u+Math.imul(ge,Re)|0,s=s+Math.imul(be,ke)|0,t=t+Math.imul(be,Ce)|0,t=t+Math.imul(se,ke)|0,u=u+Math.imul(se,Ce)|0;var St=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(z,Y),t=Math.imul(z,ie),t=t+Math.imul(T,Y)|0,u=Math.imul(T,ie),s=s+Math.imul(Se,fe)|0,t=t+Math.imul(Se,xe)|0,t=t+Math.imul(Oe,fe)|0,u=u+Math.imul(Oe,xe)|0,s=s+Math.imul(ve,we)|0,t=t+Math.imul(ve,Re)|0,t=t+Math.imul(_e,we)|0,u=u+Math.imul(_e,Re)|0,s=s+Math.imul(de,ke)|0,t=t+Math.imul(de,Ce)|0,t=t+Math.imul(ge,ke)|0,u=u+Math.imul(ge,Ce)|0;var Et=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,fe),t=Math.imul(z,xe),t=t+Math.imul(T,fe)|0,u=Math.imul(T,xe),s=s+Math.imul(Se,we)|0,t=t+Math.imul(Se,Re)|0,t=t+Math.imul(Oe,we)|0,u=u+Math.imul(Oe,Re)|0,s=s+Math.imul(ve,ke)|0,t=t+Math.imul(ve,Ce)|0,t=t+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ce)|0;var Bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,we),t=Math.imul(z,Re),t=t+Math.imul(T,we)|0,u=Math.imul(T,Re),s=s+Math.imul(Se,ke)|0,t=t+Math.imul(Se,Ce)|0,t=t+Math.imul(Oe,ke)|0,u=u+Math.imul(Oe,Ce)|0;var At=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(z,ke),t=Math.imul(z,Ce),t=t+Math.imul(T,ke)|0,u=Math.imul(T,Ce);var Rt=(p+s|0)+((t&8191)<<13)|0;return p=(u+(t>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,l[0]=Xe,l[1]=Qe,l[2]=lt,l[3]=dt,l[4]=pt,l[5]=vt,l[6]=mt,l[7]=bt,l[8]=gt,l[9]=yt,l[10]=wt,l[11]=Mt,l[12]=xt,l[13]=_t,l[14]=St,l[15]=Et,l[16]=Bt,l[17]=At,l[18]=Rt,p!==0&&(l[19]=p,i.length++),i};Math.imul||(A=B);function P(m,e,r){r.negative=e.negative^m.negative,r.length=m.length+e.length;for(var i=0,f=0,h=0;h<r.length-1;h++){var l=f;f=0;for(var p=i&67108863,s=Math.min(h,e.length-1),t=Math.max(0,h-m.length+1);t<=s;t++){var u=h-t,S=m.words[u]|0,O=e.words[t]|0,H=S*O,Q=H&67108863;l=l+(H/67108864|0)|0,Q=Q+p|0,p=Q&67108863,l=l+(Q>>>26)|0,f+=l>>>26,l&=67108863}r.words[h]=p,i=l,l=f}return i!==0?r.words[h]=i:r.length--,r.strip()}function I(m,e,r){var i=new k;return i.mulp(m,e,r)}n.prototype.mulTo=function(e,r){var i,f=this.length+e.length;return this.length===10&&e.length===10?i=A(this,e,r):f<63?i=B(this,e,r):f<1024?i=P(this,e,r):i=I(this,e,r),i};function k(m,e){this.x=m,this.y=e}k.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,f=0;f<e;f++)r[f]=this.revBin(f,i,e);return r},k.prototype.revBin=function(e,r,i){if(e===0||e===i-1)return e;for(var f=0,h=0;h<r;h++)f|=(e&1)<<r-h-1,e>>=1;return f},k.prototype.permute=function(e,r,i,f,h,l){for(var p=0;p<l;p++)f[p]=r[e[p]],h[p]=i[e[p]]},k.prototype.transform=function(e,r,i,f,h,l){this.permute(l,e,r,i,f,h);for(var p=1;p<h;p<<=1)for(var s=p<<1,t=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),S=0;S<h;S+=s)for(var O=t,H=u,Q=0;Q<p;Q++){var G=i[S+Q],R=f[S+Q],C=i[S+Q+p],$=f[S+Q+p],X=O*C-H*$;$=O*$+H*C,C=X,i[S+Q]=G+C,f[S+Q]=R+$,i[S+Q+p]=G-C,f[S+Q+p]=R-$,Q!==s&&(X=t*O-u*H,H=t*H+u*O,O=X)}},k.prototype.guessLen13b=function(e,r){var i=Math.max(r,e)|1,f=i&1,h=0;for(i=i/2|0;i;i=i>>>1)h++;return 1<<h+1+f},k.prototype.conjugate=function(e,r,i){if(!(i<=1))for(var f=0;f<i/2;f++){var h=e[f];e[f]=e[i-f-1],e[i-f-1]=h,h=r[f],r[f]=-r[i-f-1],r[i-f-1]=-h}},k.prototype.normalize13b=function(e,r){for(var i=0,f=0;f<r/2;f++){var h=Math.round(e[2*f+1]/r)*8192+Math.round(e[2*f]/r)+i;e[f]=h&67108863,h<67108864?i=0:i=h/67108864|0}return e},k.prototype.convert13b=function(e,r,i,f){for(var h=0,l=0;l<r;l++)h=h+(e[l]|0),i[2*l]=h&8191,h=h>>>13,i[2*l+1]=h&8191,h=h>>>13;for(l=2*r;l<f;++l)i[l]=0;o(h===0),o((h&-8192)===0)},k.prototype.stub=function(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},k.prototype.mulp=function(e,r,i){var f=2*this.guessLen13b(e.length,r.length),h=this.makeRBT(f),l=this.stub(f),p=new Array(f),s=new Array(f),t=new Array(f),u=new Array(f),S=new Array(f),O=new Array(f),H=i.words;H.length=f,this.convert13b(e.words,e.length,p,f),this.convert13b(r.words,r.length,u,f),this.transform(p,l,s,t,f,h),this.transform(u,l,S,O,f,h);for(var Q=0;Q<f;Q++){var G=s[Q]*S[Q]-t[Q]*O[Q];t[Q]=s[Q]*O[Q]+t[Q]*S[Q],s[Q]=G}return this.conjugate(s,t,f),this.transform(s,t,H,l,f,h),this.conjugate(H,l,f),this.normalize13b(H,f),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},n.prototype.mul=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},n.prototype.mulf=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),I(this,e,r)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){o(typeof e=="number"),o(e<67108864);for(var r=0,i=0;i<this.length;i++){var f=(this.words[i]|0)*e,h=(f&67108863)+(r&67108863);r>>=26,r+=f/67108864|0,r+=h>>>26,this.words[i]=h&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=E(e);if(r.length===0)return new n(1);for(var i=this,f=0;f<r.length&&r[f]===0;f++,i=i.sqr());if(++f<r.length)for(var h=i.sqr();f<r.length;f++,h=h.sqr())r[f]!==0&&(i=i.mul(h));return i},n.prototype.iushln=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r,h;if(r!==0){var l=0;for(h=0;h<this.length;h++){var p=this.words[h]&f,s=(this.words[h]|0)-p<<r;this.words[h]=s|l,l=p>>>26-r}l&&(this.words[h]=l,this.length++)}if(i!==0){for(h=this.length-1;h>=0;h--)this.words[h+i]=this.words[h];for(h=0;h<i;h++)this.words[h]=0;this.length+=i}return this.strip()},n.prototype.ishln=function(e){return o(this.negative===0),this.iushln(e)},n.prototype.iushrn=function(e,r,i){o(typeof e=="number"&&e>=0);var f;r?f=(r-r%26)/26:f=0;var h=e%26,l=Math.min((e-h)/26,this.length),p=67108863^67108863>>>h<<h,s=i;if(f-=l,f=Math.max(0,f),s){for(var t=0;t<l;t++)s.words[t]=this.words[t];s.length=l}if(l!==0)if(this.length>l)for(this.length-=l,t=0;t<this.length;t++)this.words[t]=this.words[t+l];else this.words[0]=0,this.length=1;var u=0;for(t=this.length-1;t>=0&&(u!==0||t>=f);t--){var S=this.words[t]|0;this.words[t]=u<<26-h|S>>>h,u=S&p}return s&&u!==0&&(s.words[s.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return o(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return!1;var h=this.words[i];return!!(h&f)},n.prototype.imaskn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var f=67108863^67108863>>>r<<r;this.words[this.length-1]&=f}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return o(typeof e=="number"),o(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(o(typeof e=="number"),o(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,r,i){var f=e.length+i,h;this._expand(f);var l,p=0;for(h=0;h<e.length;h++){l=(this.words[h+i]|0)+p;var s=(e.words[h]|0)*r;l-=s&67108863,p=(l>>26)-(s/67108864|0),this.words[h+i]=l&67108863}for(;h<this.length-i;h++)l=(this.words[h+i]|0)+p,p=l>>26,this.words[h+i]=l&67108863;if(p===0)return this.strip();for(o(p===-1),p=0,h=0;h<this.length;h++)l=-(this.words[h]|0)+p,p=l>>26,this.words[h]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,f=this.clone(),h=e,l=h.words[h.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(h=h.ushln(i),f.iushln(i),l=h.words[h.length-1]|0);var s=f.length-h.length,t;if(r!=="mod"){t=new n(null),t.length=s+1,t.words=new Array(t.length);for(var u=0;u<t.length;u++)t.words[u]=0}var S=f.clone()._ishlnsubmul(h,1,s);S.negative===0&&(f=S,t&&(t.words[s]=1));for(var O=s-1;O>=0;O--){var H=(f.words[h.length+O]|0)*67108864+(f.words[h.length+O-1]|0);for(H=Math.min(H/l|0,67108863),f._ishlnsubmul(h,H,O);f.negative!==0;)H--,f.negative=0,f._ishlnsubmul(h,1,O),f.isZero()||(f.negative^=1);t&&(t.words[O]=H)}return t&&t.strip(),f.strip(),r!=="div"&&i!==0&&f.iushrn(i),{div:t||null,mod:f}},n.prototype.divmod=function(e,r,i){if(o(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(f=l.div.neg()),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.iadd(e)),{div:f,mod:h}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(f=l.div.neg()),{div:f,mod:l.mod}):(this.negative&e.negative)!==0?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.isub(e)),{div:l.div,mod:h}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,f=e.ushrn(1),h=e.andln(1),l=i.cmp(f);return l<0||h===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){o(e<=67108863);for(var r=(1<<26)%e,i=0,f=this.length-1;f>=0;f--)i=(r*i+(this.words[f]|0))%e;return i},n.prototype.idivn=function(e){o(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var f=(this.words[i]|0)+r*67108864;this.words[i]=f/e|0,r=f%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=new n(0),p=new n(1),s=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++s;for(var t=i.clone(),u=r.clone();!r.isZero();){for(var S=0,O=1;(r.words[0]&O)===0&&S<26;++S,O<<=1);if(S>0)for(r.iushrn(S);S-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(t),h.isub(u)),f.iushrn(1),h.iushrn(1);for(var H=0,Q=1;(i.words[0]&Q)===0&&H<26;++H,Q<<=1);if(H>0)for(i.iushrn(H);H-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(u)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(l),h.isub(p)):(i.isub(r),l.isub(f),p.isub(h))}return{a:l,b:p,gcd:i.iushln(s)}},n.prototype._invmp=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,s=1;(r.words[0]&s)===0&&p<26;++p,s<<=1);if(p>0)for(r.iushrn(p);p-- >0;)f.isOdd()&&f.iadd(l),f.iushrn(1);for(var t=0,u=1;(i.words[0]&u)===0&&t<26;++t,u<<=1);if(t>0)for(i.iushrn(t);t-- >0;)h.isOdd()&&h.iadd(l),h.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(h)):(i.isub(r),h.isub(f))}var S;return r.cmpn(1)===0?S=f:S=h,S.cmpn(0)<0&&S.iadd(e),S},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var f=0;r.isEven()&&i.isEven();f++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var h=r.cmp(i);if(h<0){var l=r;r=i,i=l}else if(h===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(f)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){o(typeof e=="number");var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=f,this;for(var h=f,l=i;h!==0&&l<this.length;l++){var p=this.words[l]|0;p+=h,h=p>>>26,p&=67108863,this.words[l]=p}return h!==0&&(this.words[l]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),o(e<=67108863,"Number is too big");var f=this.words[0]|0;i=f===e?0:f<e?-1:1}return this.negative!==0?-i|0:i},n.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var r=this.ucmp(e);return this.negative!==0?-r|0:r},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var f=this.words[i]|0,h=e.words[i]|0;if(f!==h){f<h?r=-1:f>h&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new J(e)},n.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var F={k256:null,p224:null,p192:null,p25519:null};function q(m,e){this.name=m,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},q.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var f=i<this.n?-1:r.ucmp(this.p);return f===0?(r.words[0]=0,r.length=1):f>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},q.prototype.split=function(e,r){e.iushrn(this.n,0,r)},q.prototype.imulK=function(e){return e.imul(this.k)};function L(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}x(L,q),L.prototype.split=function(e,r){for(var i=4194303,f=Math.min(e.length,9),h=0;h<f;h++)r.words[h]=e.words[h];if(r.length=f,e.length<=9){e.words[0]=0,e.length=1;return}var l=e.words[9];for(r.words[r.length++]=l&i,h=10;h<e.length;h++){var p=e.words[h]|0;e.words[h-10]=(p&i)<<4|l>>>22,l=p}l>>>=22,e.words[h-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var f=e.words[i]|0;r+=f*977,e.words[i]=r&67108863,r=f*64+(r/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function V(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}x(V,q);function ee(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}x(ee,q);function ne(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}x(ne,q),ne.prototype.imulK=function(e){for(var r=0,i=0;i<e.length;i++){var f=(e.words[i]|0)*19+r,h=f&67108863;f>>>=26,e.words[i]=h,r=f}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(F[e])return F[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new V;else if(e==="p192")r=new ee;else if(e==="p25519")r=new ne;else throw new Error("Unknown prime "+e);return F[e]=r,r};function J(m){if(typeof m=="string"){var e=n._prime(m);this.m=e.p,this.prime=e}else o(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}J.prototype._verify1=function(e){o(e.negative===0,"red works only with positives"),o(e.red,"red works only with red numbers")},J.prototype._verify2=function(e,r){o((e.negative|r.negative)===0,"red works only with positives"),o(e.red&&e.red===r.red,"red works only with red numbers")},J.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},J.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},J.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},J.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},J.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},J.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},J.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},J.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},J.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},J.prototype.isqr=function(e){return this.imul(e,e.clone())},J.prototype.sqr=function(e){return this.mul(e,e)},J.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);o(!f.isZero());var l=new n(1).toRed(this),p=l.redNeg(),s=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,s).cmp(p)!==0;)t.redIAdd(p);for(var u=this.pow(t,f),S=this.pow(e,f.addn(1).iushrn(1)),O=this.pow(e,f),H=h;O.cmp(l)!==0;){for(var Q=O,G=0;Q.cmp(l)!==0;G++)Q=Q.redSqr();o(G<H);var R=this.pow(u,new n(1).iushln(H-G-1));S=S.redMul(R),u=R.redSqr(),O=O.redMul(u),H=G}return S},J.prototype.invm=function(e){var r=e._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},J.prototype.pow=function(e,r){if(r.isZero())return new n(1).toRed(this);if(r.cmpn(1)===0)return e.clone();var i=4,f=new Array(1<<i);f[0]=new n(1).toRed(this),f[1]=e;for(var h=2;h<f.length;h++)f[h]=this.mul(f[h-1],e);var l=f[0],p=0,s=0,t=r.bitLength()%26;for(t===0&&(t=26),h=r.length-1;h>=0;h--){for(var u=r.words[h],S=t-1;S>=0;S--){var O=u>>S&1;if(l!==f[0]&&(l=this.sqr(l)),O===0&&p===0){s=0;continue}p<<=1,p|=O,s++,!(s!==i&&(h!==0||S!==0))&&(l=this.mul(l,f[p]),s=0,p=0)}t=26}return l},J.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},J.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new ue(e)};function ue(m){J.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}x(ue,J),ue.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},ue.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},ue.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(M,e1)}(Ri)),Ri.exports}var xs={};const r1=Gl(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Vc;function i1(){return Vc||(Vc=1,function(M){var a=Wr(),c=Ye(),o=M;o.define=function(g,y){return new x(g,y)};function x(n,g){this.name=n,this.body=g,this.decoders={},this.encoders={}}x.prototype._createNamed=function(g){var y;try{y=r1.runInThisContext("(function "+this.name+`(entity) {
22
- this._initNamed(entity);
23
- })`)}catch{y=function(v){this._initNamed(v)}}return c(y,g),y.prototype._initNamed=function(v){g.call(this,v)},new y(this)},x.prototype._getDecoder=function(g){return g=g||"der",this.decoders.hasOwnProperty(g)||(this.decoders[g]=this._createNamed(a.decoders[g])),this.decoders[g]},x.prototype.decode=function(g,y,b){return this._getDecoder(y).decode(g,b)},x.prototype._getEncoder=function(g){return g=g||"der",this.encoders.hasOwnProperty(g)||(this.encoders[g]=this._createNamed(a.encoders[g])),this.encoders[g]},x.prototype.encode=function(g,y,b){return this._getEncoder(y).encode(g,b)}}(xs)),xs}var _s={},Ss={},$c;function n1(){if($c)return Ss;$c=1;var M=Ye();function a(o){this._reporterState={obj:null,path:[],options:o||{},errors:[]}}Ss.Reporter=a,a.prototype.isError=function(x){return x instanceof c},a.prototype.save=function(){var x=this._reporterState;return{obj:x.obj,pathLen:x.path.length}},a.prototype.restore=function(x){var n=this._reporterState;n.obj=x.obj,n.path=n.path.slice(0,x.pathLen)},a.prototype.enterKey=function(x){return this._reporterState.path.push(x)},a.prototype.exitKey=function(x){var n=this._reporterState;n.path=n.path.slice(0,x-1)},a.prototype.leaveKey=function(x,n,g){var y=this._reporterState;this.exitKey(x),y.obj!==null&&(y.obj[n]=g)},a.prototype.path=function(){return this._reporterState.path.join("/")},a.prototype.enterObject=function(){var x=this._reporterState,n=x.obj;return x.obj={},n},a.prototype.leaveObject=function(x){var n=this._reporterState,g=n.obj;return n.obj=x,g},a.prototype.error=function(x){var n,g=this._reporterState,y=x instanceof c;if(y?n=x:n=new c(g.path.map(function(b){return"["+JSON.stringify(b)+"]"}).join(""),x.message||x,x.stack),!g.options.partial)throw n;return y||g.errors.push(n),n},a.prototype.wrapResult=function(x){var n=this._reporterState;return n.options.partial?{result:this.isError(x)?null:x,errors:n.errors}:x};function c(o,x){this.path=o,this.rethrow(x)}return M(c,Error),c.prototype.rethrow=function(x){if(this.message=x+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,c),!this.stack)try{throw new Error(this.message)}catch(n){this.stack=n.stack}return this},Ss}var Ii={},Gc;function Wc(){if(Gc)return Ii;Gc=1;var M=Ye(),a=Gr().Reporter,c=Nt().Buffer;function o(n,g){if(a.call(this,g),!c.isBuffer(n)){this.error("Input not Buffer");return}this.base=n,this.offset=0,this.length=n.length}M(o,a),Ii.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:a.prototype.save.call(this)}},o.prototype.restore=function(g){var y=new o(this.base);return y.offset=g.offset,y.length=this.offset,this.offset=g.offset,a.prototype.restore.call(this,g.reporter),y},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(g){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(g||"DecoderBuffer overrun")},o.prototype.skip=function(g,y){if(!(this.offset+g<=this.length))return this.error(y||"DecoderBuffer overrun");var b=new o(this.base);return b._reporterState=this._reporterState,b.offset=this.offset,b.length=this.offset+g,this.offset+=g,b},o.prototype.raw=function(g){return this.base.slice(g?g.offset:this.offset,this.length)};function x(n,g){if(Array.isArray(n))this.length=0,this.value=n.map(function(y){return y instanceof x||(y=new x(y,g)),this.length+=y.length,y},this);else if(typeof n=="number"){if(!(0<=n&&n<=255))return g.error("non-byte EncoderBuffer value");this.value=n,this.length=1}else if(typeof n=="string")this.value=n,this.length=c.byteLength(n);else if(c.isBuffer(n))this.value=n,this.length=n.length;else return g.error("Unsupported type: "+typeof n)}return Ii.EncoderBuffer=x,x.prototype.join=function(g,y){return g||(g=new c(this.length)),y||(y=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(b){b.join(g,y),y+=b.length}):(typeof this.value=="number"?g[y]=this.value:typeof this.value=="string"?g.write(this.value,y):c.isBuffer(this.value)&&this.value.copy(g,y),y+=this.length)),g},Ii}var Es,Yc;function a1(){if(Yc)return Es;Yc=1;var M=Gr().Reporter,a=Gr().EncoderBuffer,c=Gr().DecoderBuffer,o=Ht(),x=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],n=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(x),g=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function y(v,d){var w={};this._baseState=w,w.enc=v,w.parent=d||null,w.children=null,w.tag=null,w.args=null,w.reverseArgs=null,w.choice=null,w.optional=!1,w.any=!1,w.obj=!1,w.use=null,w.useDecoder=null,w.key=null,w.default=null,w.explicit=null,w.implicit=null,w.contains=null,w.parent||(w.children=[],this._wrap())}Es=y;var b=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return y.prototype.clone=function(){var d=this._baseState,w={};b.forEach(function(E){w[E]=d[E]});var _=new this.constructor(w.parent);return _._baseState=w,_},y.prototype._wrap=function(){var d=this._baseState;n.forEach(function(w){this[w]=function(){var E=new this.constructor(this);return d.children.push(E),E[w].apply(E,arguments)}},this)},y.prototype._init=function(d){var w=this._baseState;o(w.parent===null),d.call(this),w.children=w.children.filter(function(_){return _._baseState.parent===this},this),o.equal(w.children.length,1,"Root node can have only one child")},y.prototype._useArgs=function(d){var w=this._baseState,_=d.filter(function(E){return E instanceof this.constructor},this);d=d.filter(function(E){return!(E instanceof this.constructor)},this),_.length!==0&&(o(w.children===null),w.children=_,_.forEach(function(E){E._baseState.parent=this},this)),d.length!==0&&(o(w.args===null),w.args=d,w.reverseArgs=d.map(function(E){if(typeof E!="object"||E.constructor!==Object)return E;var B={};return Object.keys(E).forEach(function(A){A==(A|0)&&(A|=0);var P=E[A];B[P]=A}),B}))},g.forEach(function(v){y.prototype[v]=function(){var w=this._baseState;throw new Error(v+" not implemented for encoding: "+w.enc)}}),x.forEach(function(v){y.prototype[v]=function(){var w=this._baseState,_=Array.prototype.slice.call(arguments);return o(w.tag===null),w.tag=v,this._useArgs(_),this}}),y.prototype.use=function(d){o(d);var w=this._baseState;return o(w.use===null),w.use=d,this},y.prototype.optional=function(){var d=this._baseState;return d.optional=!0,this},y.prototype.def=function(d){var w=this._baseState;return o(w.default===null),w.default=d,w.optional=!0,this},y.prototype.explicit=function(d){var w=this._baseState;return o(w.explicit===null&&w.implicit===null),w.explicit=d,this},y.prototype.implicit=function(d){var w=this._baseState;return o(w.explicit===null&&w.implicit===null),w.implicit=d,this},y.prototype.obj=function(){var d=this._baseState,w=Array.prototype.slice.call(arguments);return d.obj=!0,w.length!==0&&this._useArgs(w),this},y.prototype.key=function(d){var w=this._baseState;return o(w.key===null),w.key=d,this},y.prototype.any=function(){var d=this._baseState;return d.any=!0,this},y.prototype.choice=function(d){var w=this._baseState;return o(w.choice===null),w.choice=d,this._useArgs(Object.keys(d).map(function(_){return d[_]})),this},y.prototype.contains=function(d){var w=this._baseState;return o(w.use===null),w.contains=d,this},y.prototype._decode=function(d,w){var _=this._baseState;if(_.parent===null)return d.wrapResult(_.children[0]._decode(d,w));var E=_.default,B=!0,A=null;if(_.key!==null&&(A=d.enterKey(_.key)),_.optional){var P=null;if(_.explicit!==null?P=_.explicit:_.implicit!==null?P=_.implicit:_.tag!==null&&(P=_.tag),P===null&&!_.any){var I=d.save();try{_.choice===null?this._decodeGeneric(_.tag,d,w):this._decodeChoice(d,w),B=!0}catch{B=!1}d.restore(I)}else if(B=this._peekTag(d,P,_.any),d.isError(B))return B}var k;if(_.obj&&B&&(k=d.enterObject()),B){if(_.explicit!==null){var F=this._decodeTag(d,_.explicit);if(d.isError(F))return F;d=F}var q=d.offset;if(_.use===null&&_.choice===null){if(_.any)var I=d.save();var L=this._decodeTag(d,_.implicit!==null?_.implicit:_.tag,_.any);if(d.isError(L))return L;_.any?E=d.raw(I):d=L}if(w&&w.track&&_.tag!==null&&w.track(d.path(),q,d.length,"tagged"),w&&w.track&&_.tag!==null&&w.track(d.path(),d.offset,d.length,"content"),_.any?E=E:_.choice===null?E=this._decodeGeneric(_.tag,d,w):E=this._decodeChoice(d,w),d.isError(E))return E;if(!_.any&&_.choice===null&&_.children!==null&&_.children.forEach(function(ne){ne._decode(d,w)}),_.contains&&(_.tag==="octstr"||_.tag==="bitstr")){var V=new c(E);E=this._getUse(_.contains,d._reporterState.obj)._decode(V,w)}}return _.obj&&B&&(E=d.leaveObject(k)),_.key!==null&&(E!==null||B===!0)?d.leaveKey(A,_.key,E):A!==null&&d.exitKey(A),E},y.prototype._decodeGeneric=function(d,w,_){var E=this._baseState;return d==="seq"||d==="set"?null:d==="seqof"||d==="setof"?this._decodeList(w,d,E.args[0],_):/str$/.test(d)?this._decodeStr(w,d,_):d==="objid"&&E.args?this._decodeObjid(w,E.args[0],E.args[1],_):d==="objid"?this._decodeObjid(w,null,null,_):d==="gentime"||d==="utctime"?this._decodeTime(w,d,_):d==="null_"?this._decodeNull(w,_):d==="bool"?this._decodeBool(w,_):d==="objDesc"?this._decodeStr(w,d,_):d==="int"||d==="enum"?this._decodeInt(w,E.args&&E.args[0],_):E.use!==null?this._getUse(E.use,w._reporterState.obj)._decode(w,_):w.error("unknown tag: "+d)},y.prototype._getUse=function(d,w){var _=this._baseState;return _.useDecoder=this._use(d,w),o(_.useDecoder._baseState.parent===null),_.useDecoder=_.useDecoder._baseState.children[0],_.implicit!==_.useDecoder._baseState.implicit&&(_.useDecoder=_.useDecoder.clone(),_.useDecoder._baseState.implicit=_.implicit),_.useDecoder},y.prototype._decodeChoice=function(d,w){var _=this._baseState,E=null,B=!1;return Object.keys(_.choice).some(function(A){var P=d.save(),I=_.choice[A];try{var k=I._decode(d,w);if(d.isError(k))return!1;E={type:A,value:k},B=!0}catch{return d.restore(P),!1}return!0},this),B?E:d.error("Choice not matched")},y.prototype._createEncoderBuffer=function(d){return new a(d,this.reporter)},y.prototype._encode=function(d,w,_){var E=this._baseState;if(!(E.default!==null&&E.default===d)){var B=this._encodeValue(d,w,_);if(B!==void 0&&!this._skipDefault(B,w,_))return B}},y.prototype._encodeValue=function(d,w,_){var E=this._baseState;if(E.parent===null)return E.children[0]._encode(d,w||new M);var I=null;if(this.reporter=w,E.optional&&d===void 0)if(E.default!==null)d=E.default;else return;var B=null,A=!1;if(E.any)I=this._createEncoderBuffer(d);else if(E.choice)I=this._encodeChoice(d,w);else if(E.contains)B=this._getUse(E.contains,_)._encode(d,w),A=!0;else if(E.children)B=E.children.map(function(q){if(q._baseState.tag==="null_")return q._encode(null,w,d);if(q._baseState.key===null)return w.error("Child should have a key");var L=w.enterKey(q._baseState.key);if(typeof d!="object")return w.error("Child expected, but input is not object");var V=q._encode(d[q._baseState.key],w,d);return w.leaveKey(L),V},this).filter(function(q){return q}),B=this._createEncoderBuffer(B);else if(E.tag==="seqof"||E.tag==="setof"){if(!(E.args&&E.args.length===1))return w.error("Too many args for : "+E.tag);if(!Array.isArray(d))return w.error("seqof/setof, but data is not Array");var P=this.clone();P._baseState.implicit=null,B=this._createEncoderBuffer(d.map(function(q){var L=this._baseState;return this._getUse(L.args[0],d)._encode(q,w)},P))}else E.use!==null?I=this._getUse(E.use,_)._encode(d,w):(B=this._encodePrimitive(E.tag,d),A=!0);var I;if(!E.any&&E.choice===null){var k=E.implicit!==null?E.implicit:E.tag,F=E.implicit===null?"universal":"context";k===null?E.use===null&&w.error("Tag could be omitted only for .use()"):E.use===null&&(I=this._encodeComposite(k,A,F,B))}return E.explicit!==null&&(I=this._encodeComposite(E.explicit,!1,"context",I)),I},y.prototype._encodeChoice=function(d,w){var _=this._baseState,E=_.choice[d.type];return E||o(!1,d.type+" not found in "+JSON.stringify(Object.keys(_.choice))),E._encode(d.value,w)},y.prototype._encodePrimitive=function(d,w){var _=this._baseState;if(/str$/.test(d))return this._encodeStr(w,d);if(d==="objid"&&_.args)return this._encodeObjid(w,_.reverseArgs[0],_.args[1]);if(d==="objid")return this._encodeObjid(w,null,null);if(d==="gentime"||d==="utctime")return this._encodeTime(w,d);if(d==="null_")return this._encodeNull();if(d==="int"||d==="enum")return this._encodeInt(w,_.args&&_.reverseArgs[0]);if(d==="bool")return this._encodeBool(w);if(d==="objDesc")return this._encodeStr(w,d);throw new Error("Unsupported tag: "+d)},y.prototype._isNumstr=function(d){return/^[0-9 ]*$/.test(d)},y.prototype._isPrintstr=function(d){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(d)},Es}var Jc;function Gr(){return Jc||(Jc=1,function(M){var a=M;a.Reporter=n1().Reporter,a.DecoderBuffer=Wc().DecoderBuffer,a.EncoderBuffer=Wc().EncoderBuffer,a.Node=a1()}(_s)),_s}var Bs={},As={},Zc;function f1(){return Zc||(Zc=1,function(M){var a=Qc();M.tagClass={0:"universal",1:"application",2:"context",3:"private"},M.tagClassByName=a._reverse(M.tagClass),M.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},M.tagByName=a._reverse(M.tag)}(As)),As}var Xc;function Qc(){return Xc||(Xc=1,function(M){var a=M;a._reverse=function(o){var x={};return Object.keys(o).forEach(function(n){(n|0)==n&&(n=n|0);var g=o[n];x[g]=n}),x},a.der=f1()}(Bs)),Bs}var Rs={},Is,el;function tl(){if(el)return Is;el=1;var M=Ye(),a=Wr(),c=a.base,o=a.bignum,x=a.constants.der;function n(v){this.enc="der",this.name=v.name,this.entity=v,this.tree=new g,this.tree._init(v.body)}Is=n,n.prototype.decode=function(d,w){return d instanceof c.DecoderBuffer||(d=new c.DecoderBuffer(d,w)),this.tree._decode(d,w)};function g(v){c.Node.call(this,"der",v)}M(g,c.Node),g.prototype._peekTag=function(d,w,_){if(d.isEmpty())return!1;var E=d.save(),B=y(d,'Failed to peek tag: "'+w+'"');return d.isError(B)?B:(d.restore(E),B.tag===w||B.tagStr===w||B.tagStr+"of"===w||_)},g.prototype._decodeTag=function(d,w,_){var E=y(d,'Failed to decode tag of "'+w+'"');if(d.isError(E))return E;var B=b(d,E.primitive,'Failed to get length of "'+w+'"');if(d.isError(B))return B;if(!_&&E.tag!==w&&E.tagStr!==w&&E.tagStr+"of"!==w)return d.error('Failed to match tag: "'+w+'"');if(E.primitive||B!==null)return d.skip(B,'Failed to match body of: "'+w+'"');var A=d.save(),P=this._skipUntilEnd(d,'Failed to skip indefinite length body: "'+this.tag+'"');return d.isError(P)?P:(B=d.offset-A.offset,d.restore(A),d.skip(B,'Failed to match body of: "'+w+'"'))},g.prototype._skipUntilEnd=function(d,w){for(;;){var _=y(d,w);if(d.isError(_))return _;var E=b(d,_.primitive,w);if(d.isError(E))return E;var B;if(_.primitive||E!==null?B=d.skip(E):B=this._skipUntilEnd(d,w),d.isError(B))return B;if(_.tagStr==="end")break}},g.prototype._decodeList=function(d,w,_,E){for(var B=[];!d.isEmpty();){var A=this._peekTag(d,"end");if(d.isError(A))return A;var P=_.decode(d,"der",E);if(d.isError(P)&&A)break;B.push(P)}return B},g.prototype._decodeStr=function(d,w){if(w==="bitstr"){var _=d.readUInt8();return d.isError(_)?_:{unused:_,data:d.raw()}}else if(w==="bmpstr"){var E=d.raw();if(E.length%2===1)return d.error("Decoding of string type: bmpstr length mismatch");for(var B="",A=0;A<E.length/2;A++)B+=String.fromCharCode(E.readUInt16BE(A*2));return B}else if(w==="numstr"){var P=d.raw().toString("ascii");return this._isNumstr(P)?P:d.error("Decoding of string type: numstr unsupported characters")}else{if(w==="octstr")return d.raw();if(w==="objDesc")return d.raw();if(w==="printstr"){var I=d.raw().toString("ascii");return this._isPrintstr(I)?I:d.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(w)?d.raw().toString():d.error("Decoding of string type: "+w+" unsupported")}},g.prototype._decodeObjid=function(d,w,_){for(var E,B=[],A=0;!d.isEmpty();){var P=d.readUInt8();A<<=7,A|=P&127,(P&128)===0&&(B.push(A),A=0)}P&128&&B.push(A);var I=B[0]/40|0,k=B[0]%40;if(_?E=B:E=[I,k].concat(B.slice(1)),w){var F=w[E.join(" ")];F===void 0&&(F=w[E.join(".")]),F!==void 0&&(E=F)}return E},g.prototype._decodeTime=function(d,w){var _=d.raw().toString();if(w==="gentime")var E=_.slice(0,4)|0,B=_.slice(4,6)|0,A=_.slice(6,8)|0,P=_.slice(8,10)|0,I=_.slice(10,12)|0,k=_.slice(12,14)|0;else if(w==="utctime"){var E=_.slice(0,2)|0,B=_.slice(2,4)|0,A=_.slice(4,6)|0,P=_.slice(6,8)|0,I=_.slice(8,10)|0,k=_.slice(10,12)|0;E<70?E=2e3+E:E=1900+E}else return d.error("Decoding "+w+" time is not supported yet");return Date.UTC(E,B-1,A,P,I,k,0)},g.prototype._decodeNull=function(d){return null},g.prototype._decodeBool=function(d){var w=d.readUInt8();return d.isError(w)?w:w!==0},g.prototype._decodeInt=function(d,w){var _=d.raw(),E=new o(_);return w&&(E=w[E.toString(10)]||E),E},g.prototype._use=function(d,w){return typeof d=="function"&&(d=d(w)),d._getDecoder("der").tree};function y(v,d){var w=v.readUInt8(d);if(v.isError(w))return w;var _=x.tagClass[w>>6],E=(w&32)===0;if((w&31)===31){var B=w;for(w=0;(B&128)===128;){if(B=v.readUInt8(d),v.isError(B))return B;w<<=7,w|=B&127}}else w&=31;var A=x.tag[w];return{cls:_,primitive:E,tag:w,tagStr:A}}function b(v,d,w){var _=v.readUInt8(w);if(v.isError(_))return _;if(!d&&_===128)return null;if((_&128)===0)return _;var E=_&127;if(E>4)return v.error("length octect is too long");_=0;for(var B=0;B<E;B++){_<<=8;var A=v.readUInt8(w);if(v.isError(A))return A;_|=A}return _}return Is}var Os,rl;function s1(){if(rl)return Os;rl=1;var M=Ye(),a=Nt().Buffer,c=tl();function o(x){c.call(this,x),this.enc="pem"}return M(o,c),Os=o,o.prototype.decode=function(n,g){for(var y=n.toString().split(/[\r\n]+/g),b=g.label.toUpperCase(),v=/^-----(BEGIN|END) ([^-]+)-----$/,d=-1,w=-1,_=0;_<y.length;_++){var E=y[_].match(v);if(E!==null&&E[2]===b)if(d===-1){if(E[1]!=="BEGIN")break;d=_}else{if(E[1]!=="END")break;w=_;break}}if(d===-1||w===-1)throw new Error("PEM section not found for: "+b);var B=y.slice(d+1,w).join("");B.replace(/[^a-z0-9\+\/=]+/gi,"");var A=new a(B,"base64");return c.prototype.decode.call(this,A,g)},Os}var il;function o1(){return il||(il=1,function(M){var a=M;a.der=tl(),a.pem=s1()}(Rs)),Rs}var ks={},Ps,nl;function al(){if(nl)return Ps;nl=1;var M=Ye(),a=Nt().Buffer,c=Wr(),o=c.base,x=c.constants.der;function n(v){this.enc="der",this.name=v.name,this.entity=v,this.tree=new g,this.tree._init(v.body)}Ps=n,n.prototype.encode=function(d,w){return this.tree._encode(d,w).join()};function g(v){o.Node.call(this,"der",v)}M(g,o.Node),g.prototype._encodeComposite=function(d,w,_,E){var B=b(d,w,_,this.reporter);if(E.length<128){var I=new a(2);return I[0]=B,I[1]=E.length,this._createEncoderBuffer([I,E])}for(var A=1,P=E.length;P>=256;P>>=8)A++;var I=new a(2+A);I[0]=B,I[1]=128|A;for(var P=1+A,k=E.length;k>0;P--,k>>=8)I[P]=k&255;return this._createEncoderBuffer([I,E])},g.prototype._encodeStr=function(d,w){if(w==="bitstr")return this._createEncoderBuffer([d.unused|0,d.data]);if(w==="bmpstr"){for(var _=new a(d.length*2),E=0;E<d.length;E++)_.writeUInt16BE(d.charCodeAt(E),E*2);return this._createEncoderBuffer(_)}else return w==="numstr"?this._isNumstr(d)?this._createEncoderBuffer(d):this.reporter.error("Encoding of string type: numstr supports only digits and space"):w==="printstr"?this._isPrintstr(d)?this._createEncoderBuffer(d):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(w)?this._createEncoderBuffer(d):w==="objDesc"?this._createEncoderBuffer(d):this.reporter.error("Encoding of string type: "+w+" unsupported")},g.prototype._encodeObjid=function(d,w,_){if(typeof d=="string"){if(!w)return this.reporter.error("string objid given, but no values map found");if(!w.hasOwnProperty(d))return this.reporter.error("objid not found in values map");d=w[d].split(/[\s\.]+/g);for(var E=0;E<d.length;E++)d[E]|=0}else if(Array.isArray(d)){d=d.slice();for(var E=0;E<d.length;E++)d[E]|=0}if(!Array.isArray(d))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(d));if(!_){if(d[1]>=40)return this.reporter.error("Second objid identifier OOB");d.splice(0,2,d[0]*40+d[1])}for(var B=0,E=0;E<d.length;E++){var A=d[E];for(B++;A>=128;A>>=7)B++}for(var P=new a(B),I=P.length-1,E=d.length-1;E>=0;E--){var A=d[E];for(P[I--]=A&127;(A>>=7)>0;)P[I--]=128|A&127}return this._createEncoderBuffer(P)};function y(v){return v<10?"0"+v:v}g.prototype._encodeTime=function(d,w){var _,E=new Date(d);return w==="gentime"?_=[y(E.getFullYear()),y(E.getUTCMonth()+1),y(E.getUTCDate()),y(E.getUTCHours()),y(E.getUTCMinutes()),y(E.getUTCSeconds()),"Z"].join(""):w==="utctime"?_=[y(E.getFullYear()%100),y(E.getUTCMonth()+1),y(E.getUTCDate()),y(E.getUTCHours()),y(E.getUTCMinutes()),y(E.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+w+" time is not supported yet"),this._encodeStr(_,"octstr")},g.prototype._encodeNull=function(){return this._createEncoderBuffer("")},g.prototype._encodeInt=function(d,w){if(typeof d=="string"){if(!w)return this.reporter.error("String int or enum given, but no values map");if(!w.hasOwnProperty(d))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(d));d=w[d]}if(typeof d!="number"&&!a.isBuffer(d)){var _=d.toArray();!d.sign&&_[0]&128&&_.unshift(0),d=new a(_)}if(a.isBuffer(d)){var E=d.length;d.length===0&&E++;var A=new a(E);return d.copy(A),d.length===0&&(A[0]=0),this._createEncoderBuffer(A)}if(d<128)return this._createEncoderBuffer(d);if(d<256)return this._createEncoderBuffer([0,d]);for(var E=1,B=d;B>=256;B>>=8)E++;for(var A=new Array(E),B=A.length-1;B>=0;B--)A[B]=d&255,d>>=8;return A[0]&128&&A.unshift(0),this._createEncoderBuffer(new a(A))},g.prototype._encodeBool=function(d){return this._createEncoderBuffer(d?255:0)},g.prototype._use=function(d,w){return typeof d=="function"&&(d=d(w)),d._getEncoder("der").tree},g.prototype._skipDefault=function(d,w,_){var E=this._baseState,B;if(E.default===null)return!1;var A=d.join();if(E.defaultBuffer===void 0&&(E.defaultBuffer=this._encodeValue(E.default,w,_).join()),A.length!==E.defaultBuffer.length)return!1;for(B=0;B<A.length;B++)if(A[B]!==E.defaultBuffer[B])return!1;return!0};function b(v,d,w,_){var E;if(v==="seqof"?v="seq":v==="setof"&&(v="set"),x.tagByName.hasOwnProperty(v))E=x.tagByName[v];else if(typeof v=="number"&&(v|0)===v)E=v;else return _.error("Unknown tag: "+v);return E>=31?_.error("Multi-octet tag encoding unsupported"):(d||(E|=32),E|=x.tagClassByName[w||"universal"]<<6,E)}return Ps}var Ts,fl;function h1(){if(fl)return Ts;fl=1;var M=Ye(),a=al();function c(o){a.call(this,o),this.enc="pem"}return M(c,a),Ts=c,c.prototype.encode=function(x,n){for(var g=a.prototype.encode.call(this,x),y=g.toString("base64"),b=["-----BEGIN "+n.label+"-----"],v=0;v<y.length;v+=64)b.push(y.slice(v,v+64));return b.push("-----END "+n.label+"-----"),b.join(`
24
- `)},Ts}var sl;function u1(){return sl||(sl=1,function(M){var a=M;a.der=al(),a.pem=h1()}(ks)),ks}var ol;function Wr(){return ol||(ol=1,function(M){var a=M;a.bignum=t1(),a.define=i1().define,a.base=Gr(),a.constants=Qc(),a.decoders=o1(),a.encoders=u1()}(Ms)),Ms}var Ns,hl;function c1(){if(hl)return Ns;hl=1;var M=Wr(),a=M.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),c=M.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=M.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),x=M.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),n=M.define("RelativeDistinguishedName",function(){this.setof(c)}),g=M.define("RDNSequence",function(){this.seqof(n)}),y=M.define("Name",function(){this.choice({rdnSequence:this.use(g)})}),b=M.define("Validity",function(){this.seq().obj(this.key("notBefore").use(a),this.key("notAfter").use(a))}),v=M.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=M.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(y),this.key("validity").use(b),this.key("subject").use(y),this.key("subjectPublicKeyInfo").use(x),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(v).optional())}),w=M.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});return Ns=w,Ns}var ul;function l1(){if(ul)return Gt;ul=1;var M=Wr();Gt.certificate=c1();var a=M.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});Gt.RSAPrivateKey=a;var c=M.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});Gt.RSAPublicKey=c;var o=M.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),x=M.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())});Gt.PublicKey=x;var n=M.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(o),this.key("subjectPrivateKey").octstr())});Gt.PrivateKey=n;var g=M.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});Gt.EncryptedPrivateKey=g;var y=M.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});Gt.DSAPrivateKey=y,Gt.DSAparam=M.define("DSAparam",function(){this.int()});var b=M.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),v=M.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(b),this.key("publicKey").optional().explicit(1).bitstr())});return Gt.ECPrivateKey=v,Gt.signature=M.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),Gt}const d1={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var Cs,cl;function p1(){if(cl)return Cs;cl=1;var M=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,c=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=wi(),x=Pf(),n=tt().Buffer;return Cs=function(g,y){var b=g.toString(),v=b.match(M),d;if(v){var _="aes"+v[1],E=n.from(v[2],"hex"),B=n.from(v[3].replace(/[\r\n]/g,""),"base64"),A=o(y,E.slice(0,8),parseInt(v[1],10)).key,P=[],I=x.createDecipheriv(_,A,E);P.push(I.update(B)),P.push(I.final()),d=n.concat(P)}else{var w=b.match(c);d=n.from(w[2].replace(/[\r\n]/g,""),"base64")}var k=b.match(a)[1];return{tag:k,data:d}},Cs}var qs,ll;function Oi(){if(ll)return qs;ll=1;var M=l1(),a=d1,c=p1(),o=Pf(),x=of(),n=tt().Buffer;function g(b,v){var d=b.algorithm.decrypt.kde.kdeparams.salt,w=parseInt(b.algorithm.decrypt.kde.kdeparams.iters.toString(),10),_=a[b.algorithm.decrypt.cipher.algo.join(".")],E=b.algorithm.decrypt.cipher.iv,B=b.subjectPrivateKey,A=parseInt(_.split("-")[1],10)/8,P=x.pbkdf2Sync(v,d,w,A,"sha1"),I=o.createDecipheriv(_,P,E),k=[];return k.push(I.update(B)),k.push(I.final()),n.concat(k)}function y(b){var v;typeof b=="object"&&!n.isBuffer(b)&&(v=b.passphrase,b=b.key),typeof b=="string"&&(b=n.from(b));var d=c(b,v),w=d.tag,_=d.data,E,B;switch(w){case"CERTIFICATE":B=M.certificate.decode(_,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(B||(B=M.PublicKey.decode(_,"der")),E=B.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return M.RSAPublicKey.decode(B.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return B.subjectPrivateKey=B.subjectPublicKey,{type:"ec",data:B};case"1.2.840.10040.4.1":return B.algorithm.params.pub_key=M.DSAparam.decode(B.subjectPublicKey.data,"der"),{type:"dsa",data:B.algorithm.params};default:throw new Error("unknown key id "+E)}case"ENCRYPTED PRIVATE KEY":_=M.EncryptedPrivateKey.decode(_,"der"),_=g(_,v);case"PRIVATE KEY":switch(B=M.PrivateKey.decode(_,"der"),E=B.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return M.RSAPrivateKey.decode(B.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:B.algorithm.curve,privateKey:M.ECPrivateKey.decode(B.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return B.algorithm.params.priv_key=M.DSAparam.decode(B.subjectPrivateKey,"der"),{type:"dsa",params:B.algorithm.params};default:throw new Error("unknown key id "+E)}case"RSA PUBLIC KEY":return M.RSAPublicKey.decode(_,"der");case"RSA PRIVATE KEY":return M.RSAPrivateKey.decode(_,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:M.DSAPrivateKey.decode(_,"der")};case"EC PRIVATE KEY":return _=M.ECPrivateKey.decode(_,"der"),{curve:_.parameters.value,privateKey:_.privateKey};default:throw new Error("unknown key type "+w)}}return y.signature=M.signature,qs=y,qs}const dl={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var pl;function v1(){if(pl)return jr.exports;pl=1;var M=tt().Buffer,a=V0(),c=Gf(),o=ws().ec,x=er(),n=Oi(),g=dl,y=1;function b(I,k,F,q,L){var V=n(k);if(V.curve){if(q!=="ecdsa"&&q!=="ecdsa/rsa")throw new Error("wrong private key type");return v(I,V)}else if(V.type==="dsa"){if(q!=="dsa")throw new Error("wrong private key type");return d(I,V,F)}if(q!=="rsa"&&q!=="ecdsa/rsa")throw new Error("wrong private key type");if(k.padding!==void 0&&k.padding!==y)throw new Error("illegal or unsupported padding mode");I=M.concat([L,I]);for(var ee=V.modulus.byteLength(),ne=[0,1];I.length+ne.length+1<ee;)ne.push(255);ne.push(0);for(var J=-1;++J<I.length;)ne.push(I[J]);var ue=c(ne,V);return ue}function v(I,k){var F=g[k.curve.join(".")];if(!F)throw new Error("unknown curve "+k.curve.join("."));var q=new o(F),L=q.keyFromPrivate(k.privateKey),V=L.sign(I);return M.from(V.toDER())}function d(I,k,F){for(var q=k.params.priv_key,L=k.params.p,V=k.params.q,ee=k.params.g,ne=new x(0),J,ue=E(I,V).mod(V),m=!1,e=_(q,V,I,F);m===!1;)J=A(V,e,F),ne=P(ee,J,L,V),m=J.invm(V).imul(ue.add(q.mul(ne))).mod(V),m.cmpn(0)===0&&(m=!1,ne=new x(0));return w(ne,m)}function w(I,k){I=I.toArray(),k=k.toArray(),I[0]&128&&(I=[0].concat(I)),k[0]&128&&(k=[0].concat(k));var F=I.length+k.length+4,q=[48,F,2,I.length];return q=q.concat(I,[2,k.length],k),M.from(q)}function _(I,k,F,q){if(I=M.from(I.toArray()),I.length<k.byteLength()){var L=M.alloc(k.byteLength()-I.length);I=M.concat([L,I])}var V=F.length,ee=B(F,k),ne=M.alloc(V);ne.fill(1);var J=M.alloc(V);return J=a(q,J).update(ne).update(M.from([0])).update(I).update(ee).digest(),ne=a(q,J).update(ne).digest(),J=a(q,J).update(ne).update(M.from([1])).update(I).update(ee).digest(),ne=a(q,J).update(ne).digest(),{k:J,v:ne}}function E(I,k){var F=new x(I),q=(I.length<<3)-k.bitLength();return q>0&&F.ishrn(q),F}function B(I,k){I=E(I,k),I=I.mod(k);var F=M.from(I.toArray());if(F.length<k.byteLength()){var q=M.alloc(k.byteLength()-F.length);F=M.concat([q,F])}return F}function A(I,k,F){var q,L;do{for(q=M.alloc(0);q.length*8<I.bitLength();)k.v=a(F,k.k).update(k.v).digest(),q=M.concat([q,k.v]);L=E(q,I),k.k=a(F,k.k).update(k.v).update(M.from([0])).digest(),k.v=a(F,k.k).update(k.v).digest()}while(L.cmp(I)!==-1);return L}function P(I,k,F,q){return I.toRed(x.mont(F)).redPow(k).fromRed().mod(q)}return jr.exports=b,jr.exports.getKey=_,jr.exports.makeKey=A,jr.exports}var Ls,vl;function m1(){if(vl)return Ls;vl=1;var M=tt().Buffer,a=er(),c=ws().ec,o=Oi(),x=dl;function n(v,d,w,_,E){var B=o(w);if(B.type==="ec"){if(_!=="ecdsa"&&_!=="ecdsa/rsa")throw new Error("wrong public key type");return g(v,d,B)}else if(B.type==="dsa"){if(_!=="dsa")throw new Error("wrong public key type");return y(v,d,B)}if(_!=="rsa"&&_!=="ecdsa/rsa")throw new Error("wrong public key type");d=M.concat([E,d]);for(var A=B.modulus.byteLength(),P=[1],I=0;d.length+P.length+2<A;)P.push(255),I+=1;P.push(0);for(var k=-1;++k<d.length;)P.push(d[k]);P=M.from(P);var F=a.mont(B.modulus);v=new a(v).toRed(F),v=v.redPow(new a(B.publicExponent)),v=M.from(v.fromRed().toArray());var q=I<8?1:0;for(A=Math.min(v.length,P.length),v.length!==P.length&&(q=1),k=-1;++k<A;)q|=v[k]^P[k];return q===0}function g(v,d,w){var _=x[w.data.algorithm.curve.join(".")];if(!_)throw new Error("unknown curve "+w.data.algorithm.curve.join("."));var E=new c(_),B=w.data.subjectPrivateKey.data;return E.verify(d,v,B)}function y(v,d,w){var _=w.data.p,E=w.data.q,B=w.data.g,A=w.data.pub_key,P=o.signature.decode(v,"der"),I=P.s,k=P.r;b(I,E),b(k,E);var F=a.mont(_),q=I.invm(E),L=B.toRed(F).redPow(new a(d).mul(q).mod(E)).fromRed().mul(A.toRed(F).redPow(k.mul(q).mod(E)).fromRed()).mod(_).mod(E);return L.cmp(k)===0}function b(v,d){if(v.cmpn(0)<=0)throw new Error("invalid sig");if(v.cmp(d)>=0)throw new Error("invalid sig")}return Ls=n,Ls}var Fs,ml;function b1(){if(ml)return Fs;ml=1;var M=tt().Buffer,a=Kr(),c=Cp(),o=Ye(),x=v1(),n=m1(),g=$0;Object.keys(g).forEach(function(w){g[w].id=M.from(g[w].id,"hex"),g[w.toLowerCase()]=g[w]});function y(w){c.Writable.call(this);var _=g[w];if(!_)throw new Error("Unknown message digest");this._hashType=_.hash,this._hash=a(_.hash),this._tag=_.id,this._signType=_.sign}o(y,c.Writable),y.prototype._write=function(_,E,B){this._hash.update(_),B()},y.prototype.update=function(_,E){return this._hash.update(typeof _=="string"?M.from(_,E):_),this},y.prototype.sign=function(_,E){this.end();var B=this._hash.digest(),A=x(B,_,this._hashType,this._signType,this._tag);return E?A.toString(E):A};function b(w){c.Writable.call(this);var _=g[w];if(!_)throw new Error("Unknown message digest");this._hash=a(_.hash),this._tag=_.id,this._signType=_.sign}o(b,c.Writable),b.prototype._write=function(_,E,B){this._hash.update(_),B()},b.prototype.update=function(_,E){return this._hash.update(typeof _=="string"?M.from(_,E):_),this},b.prototype.verify=function(_,E,B){var A=typeof E=="string"?M.from(E,B):E;this.end();var P=this._hash.digest();return n(A,P,_,this._signType,this._tag)};function v(w){return new y(w)}function d(w){return new b(w)}return Fs={Sign:v,Verify:d,createSign:v,createVerify:d},Fs}var ki={exports:{}},g1=ki.exports,bl;function y1(){return bl||(bl=1,function(M){(function(a,c){function o(m,e){if(!m)throw new Error(e||"Assertion failed")}function x(m,e){m.super_=e;var r=function(){};r.prototype=e.prototype,m.prototype=new r,m.prototype.constructor=m}function n(m,e,r){if(n.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((e==="le"||e==="be")&&(r=e,e=10),this._init(m||0,e||10,r||"be"))}typeof a=="object"?a.exports=n:c.BN=n,n.BN=n,n.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=Nt().Buffer}catch{}n.isBN=function(e){return e instanceof n?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp(r)>0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var f=0;e[0]==="-"&&(f++,this.negative=1),f<e.length&&(r===16?this._parseHex(e,f,i):(this._parseBase(e,r,f),i==="le"&&this._initArray(this.toArray(),r,i)))},n.prototype._initNumber=function(e,r,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(o(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},n.prototype._initArray=function(e,r,i){if(o(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h,l,p=0;if(i==="be")for(f=e.length-1,h=0;f>=0;f-=3)l=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);else if(i==="le")for(f=0,h=0;f<e.length;f+=3)l=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);return this.strip()};function y(m,e){var r=m.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function b(m,e,r){var i=y(m,r);return r-1>=e&&(i|=y(m,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h=0,l=0,p;if(i==="be")for(f=e.length-1;f>=r;f-=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8;else{var s=e.length-r;for(f=s%2===0?r+1:r;f<e.length;f+=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8}this.strip()};function v(m,e,r,i){for(var f=0,h=Math.min(m.length,r),l=e;l<h;l++){var p=m.charCodeAt(l)-48;f*=i,p>=49?f+=p-49+10:p>=17?f+=p-17+10:f+=p}return f}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=r)f++;f--,h=h/r|0;for(var l=e.length-i,p=l%f,s=Math.min(l,l-p)+i,t=0,u=i;u<s;u+=f)t=v(e,u,u+f,r),this.imuln(h),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t);if(p!==0){var S=1;for(t=v(e,u,e.length,r),u=0;u<p;u++)S*=r;this.imuln(S),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],w=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var f=0,h=0,l=0;l<this.length;l++){var p=this.words[l],s=((p<<f|h)&16777215).toString(16);h=p>>>24-f&16777215,f+=2,f>=26&&(f-=26,l--),h!==0||l!==this.length-1?i=d[6-s.length]+s+i:i=s+i}for(h!==0&&(i=h.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=w[e],u=_[e];i="";var S=this.clone();for(S.negative=0;!S.isZero();){var O=S.modn(u).toString(e);S=S.idivn(u),S.isZero()?i=O+i:i=d[t-O.length]+O+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return o(typeof g<"u"),this.toArrayLike(g,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var f=this.byteLength(),h=i||Math.max(1,f);o(f<=h,"byte array longer than desired length"),o(h>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(h),s,t,u=this.clone();if(l){for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[t]=s;for(;t<h;t++)p[t]=0}else{for(t=0;t<h-f;t++)p[t]=0;for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[h-t-1]=s}return p},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return(r&8191)===0&&(i+=13,r>>>=13),(r&127)===0&&(i+=7,r>>>=7),(r&15)===0&&(i+=4,r>>>=4),(r&3)===0&&(i+=2,r>>>=2),(r&1)===0&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function E(m){for(var e=new Array(m.bitLength()),r=0;r<e.length;r++){var i=r/26|0,f=r%26;e[r]=(m.words[i]&1<<f)>>>f}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,i!==26)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},n.prototype.ior=function(e){return o((this.negative|e.negative)===0),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},n.prototype.iand=function(e){return o((this.negative|e.negative)===0),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var f=0;f<i.length;f++)this.words[f]=r.words[f]^i.words[f];if(this!==r)for(;f<r.length;f++)this.words[f]=r.words[f];return this.length=r.length,this.strip()},n.prototype.ixor=function(e){return o((this.negative|e.negative)===0),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){o(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var f=0;f<r;f++)this.words[f]=~this.words[f]&67108863;return i>0&&(this.words[f]=~this.words[f]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){o(typeof e=="number"&&e>=0);var i=e/26|0,f=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<f:this.words[i]=this.words[i]&~(1<<f),this.strip()},n.prototype.iadd=function(e){var r;if(this.negative!==0&&e.negative===0)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();var i,f;this.length>e.length?(i=this,f=e):(i=e,f=this);for(var h=0,l=0;l<f.length;l++)r=(i.words[l]|0)+(f.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;for(;h!==0&&l<i.length;l++)r=(i.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;if(this.length=i.length,h!==0)this.words[this.length]=h,this.length++;else if(i!==this)for(;l<i.length;l++)this.words[l]=i.words[l];return this},n.prototype.add=function(e){var r;return e.negative!==0&&this.negative===0?(e.negative=0,r=this.sub(e),e.negative^=1,r):e.negative===0&&this.negative!==0?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;i>0?(f=this,h=e):(f=e,h=this);for(var l=0,p=0;p<h.length;p++)r=(f.words[p]|0)-(h.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;for(;l!==0&&p<f.length;p++)r=(f.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;if(l===0&&p<f.length&&f!==this)for(;p<f.length;p++)this.words[p]=f.words[p];return this.length=Math.max(this.length,p),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};function B(m,e,r){r.negative=e.negative^m.negative;var i=m.length+e.length|0;r.length=i,i=i-1|0;var f=m.words[0]|0,h=e.words[0]|0,l=f*h,p=l&67108863,s=l/67108864|0;r.words[0]=p;for(var t=1;t<i;t++){for(var u=s>>>26,S=s&67108863,O=Math.min(t,e.length-1),H=Math.max(0,t-m.length+1);H<=O;H++){var Q=t-H|0;f=m.words[Q]|0,h=e.words[H]|0,l=f*h+S,u+=l/67108864|0,S=l&67108863}r.words[t]=S|0,s=u|0}return s!==0?r.words[t]=s|0:r.length--,r.strip()}var A=function(e,r,i){var f=e.words,h=r.words,l=i.words,p=0,s,t,u,S=f[0]|0,O=S&8191,H=S>>>13,Q=f[1]|0,G=Q&8191,R=Q>>>13,C=f[2]|0,$=C&8191,X=C>>>13,Z=f[3]|0,K=Z&8191,te=Z>>>13,Pe=f[4]|0,le=Pe&8191,ce=Pe>>>13,Le=f[5]|0,be=Le&8191,se=Le>>>13,Ue=f[6]|0,de=Ue&8191,ge=Ue>>>13,De=f[7]|0,ve=De&8191,_e=De>>>13,Ge=f[8]|0,Se=Ge&8191,Oe=Ge>>>13,Ze=f[9]|0,z=Ze&8191,T=Ze>>>13,D=h[0]|0,W=D&8191,re=D>>>13,pe=h[1]|0,ae=pe&8191,Me=pe>>>13,ze=h[2]|0,ye=ze&8191,Be=ze>>>13,He=h[3]|0,Ae=He&8191,Te=He>>>13,rt=h[4]|0,Ie=rt&8191,Ne=rt>>>13,nt=h[5]|0,j=nt&8191,N=nt>>>13,U=h[6]|0,Y=U&8191,ie=U>>>13,me=h[7]|0,fe=me&8191,xe=me>>>13,Ve=h[8]|0,we=Ve&8191,Re=Ve>>>13,Ke=h[9]|0,ke=Ke&8191,Ce=Ke>>>13;i.negative=e.negative^r.negative,i.length=19,s=Math.imul(O,W),t=Math.imul(O,re),t=t+Math.imul(H,W)|0,u=Math.imul(H,re);var Xe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,s=Math.imul(G,W),t=Math.imul(G,re),t=t+Math.imul(R,W)|0,u=Math.imul(R,re),s=s+Math.imul(O,ae)|0,t=t+Math.imul(O,Me)|0,t=t+Math.imul(H,ae)|0,u=u+Math.imul(H,Me)|0;var Qe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,s=Math.imul($,W),t=Math.imul($,re),t=t+Math.imul(X,W)|0,u=Math.imul(X,re),s=s+Math.imul(G,ae)|0,t=t+Math.imul(G,Me)|0,t=t+Math.imul(R,ae)|0,u=u+Math.imul(R,Me)|0,s=s+Math.imul(O,ye)|0,t=t+Math.imul(O,Be)|0,t=t+Math.imul(H,ye)|0,u=u+Math.imul(H,Be)|0;var lt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(lt>>>26)|0,lt&=67108863,s=Math.imul(K,W),t=Math.imul(K,re),t=t+Math.imul(te,W)|0,u=Math.imul(te,re),s=s+Math.imul($,ae)|0,t=t+Math.imul($,Me)|0,t=t+Math.imul(X,ae)|0,u=u+Math.imul(X,Me)|0,s=s+Math.imul(G,ye)|0,t=t+Math.imul(G,Be)|0,t=t+Math.imul(R,ye)|0,u=u+Math.imul(R,Be)|0,s=s+Math.imul(O,Ae)|0,t=t+Math.imul(O,Te)|0,t=t+Math.imul(H,Ae)|0,u=u+Math.imul(H,Te)|0;var dt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(dt>>>26)|0,dt&=67108863,s=Math.imul(le,W),t=Math.imul(le,re),t=t+Math.imul(ce,W)|0,u=Math.imul(ce,re),s=s+Math.imul(K,ae)|0,t=t+Math.imul(K,Me)|0,t=t+Math.imul(te,ae)|0,u=u+Math.imul(te,Me)|0,s=s+Math.imul($,ye)|0,t=t+Math.imul($,Be)|0,t=t+Math.imul(X,ye)|0,u=u+Math.imul(X,Be)|0,s=s+Math.imul(G,Ae)|0,t=t+Math.imul(G,Te)|0,t=t+Math.imul(R,Ae)|0,u=u+Math.imul(R,Te)|0,s=s+Math.imul(O,Ie)|0,t=t+Math.imul(O,Ne)|0,t=t+Math.imul(H,Ie)|0,u=u+Math.imul(H,Ne)|0;var pt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(be,W),t=Math.imul(be,re),t=t+Math.imul(se,W)|0,u=Math.imul(se,re),s=s+Math.imul(le,ae)|0,t=t+Math.imul(le,Me)|0,t=t+Math.imul(ce,ae)|0,u=u+Math.imul(ce,Me)|0,s=s+Math.imul(K,ye)|0,t=t+Math.imul(K,Be)|0,t=t+Math.imul(te,ye)|0,u=u+Math.imul(te,Be)|0,s=s+Math.imul($,Ae)|0,t=t+Math.imul($,Te)|0,t=t+Math.imul(X,Ae)|0,u=u+Math.imul(X,Te)|0,s=s+Math.imul(G,Ie)|0,t=t+Math.imul(G,Ne)|0,t=t+Math.imul(R,Ie)|0,u=u+Math.imul(R,Ne)|0,s=s+Math.imul(O,j)|0,t=t+Math.imul(O,N)|0,t=t+Math.imul(H,j)|0,u=u+Math.imul(H,N)|0;var vt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(de,W),t=Math.imul(de,re),t=t+Math.imul(ge,W)|0,u=Math.imul(ge,re),s=s+Math.imul(be,ae)|0,t=t+Math.imul(be,Me)|0,t=t+Math.imul(se,ae)|0,u=u+Math.imul(se,Me)|0,s=s+Math.imul(le,ye)|0,t=t+Math.imul(le,Be)|0,t=t+Math.imul(ce,ye)|0,u=u+Math.imul(ce,Be)|0,s=s+Math.imul(K,Ae)|0,t=t+Math.imul(K,Te)|0,t=t+Math.imul(te,Ae)|0,u=u+Math.imul(te,Te)|0,s=s+Math.imul($,Ie)|0,t=t+Math.imul($,Ne)|0,t=t+Math.imul(X,Ie)|0,u=u+Math.imul(X,Ne)|0,s=s+Math.imul(G,j)|0,t=t+Math.imul(G,N)|0,t=t+Math.imul(R,j)|0,u=u+Math.imul(R,N)|0,s=s+Math.imul(O,Y)|0,t=t+Math.imul(O,ie)|0,t=t+Math.imul(H,Y)|0,u=u+Math.imul(H,ie)|0;var mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(ve,W),t=Math.imul(ve,re),t=t+Math.imul(_e,W)|0,u=Math.imul(_e,re),s=s+Math.imul(de,ae)|0,t=t+Math.imul(de,Me)|0,t=t+Math.imul(ge,ae)|0,u=u+Math.imul(ge,Me)|0,s=s+Math.imul(be,ye)|0,t=t+Math.imul(be,Be)|0,t=t+Math.imul(se,ye)|0,u=u+Math.imul(se,Be)|0,s=s+Math.imul(le,Ae)|0,t=t+Math.imul(le,Te)|0,t=t+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Te)|0,s=s+Math.imul(K,Ie)|0,t=t+Math.imul(K,Ne)|0,t=t+Math.imul(te,Ie)|0,u=u+Math.imul(te,Ne)|0,s=s+Math.imul($,j)|0,t=t+Math.imul($,N)|0,t=t+Math.imul(X,j)|0,u=u+Math.imul(X,N)|0,s=s+Math.imul(G,Y)|0,t=t+Math.imul(G,ie)|0,t=t+Math.imul(R,Y)|0,u=u+Math.imul(R,ie)|0,s=s+Math.imul(O,fe)|0,t=t+Math.imul(O,xe)|0,t=t+Math.imul(H,fe)|0,u=u+Math.imul(H,xe)|0;var bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(Se,W),t=Math.imul(Se,re),t=t+Math.imul(Oe,W)|0,u=Math.imul(Oe,re),s=s+Math.imul(ve,ae)|0,t=t+Math.imul(ve,Me)|0,t=t+Math.imul(_e,ae)|0,u=u+Math.imul(_e,Me)|0,s=s+Math.imul(de,ye)|0,t=t+Math.imul(de,Be)|0,t=t+Math.imul(ge,ye)|0,u=u+Math.imul(ge,Be)|0,s=s+Math.imul(be,Ae)|0,t=t+Math.imul(be,Te)|0,t=t+Math.imul(se,Ae)|0,u=u+Math.imul(se,Te)|0,s=s+Math.imul(le,Ie)|0,t=t+Math.imul(le,Ne)|0,t=t+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,Ne)|0,s=s+Math.imul(K,j)|0,t=t+Math.imul(K,N)|0,t=t+Math.imul(te,j)|0,u=u+Math.imul(te,N)|0,s=s+Math.imul($,Y)|0,t=t+Math.imul($,ie)|0,t=t+Math.imul(X,Y)|0,u=u+Math.imul(X,ie)|0,s=s+Math.imul(G,fe)|0,t=t+Math.imul(G,xe)|0,t=t+Math.imul(R,fe)|0,u=u+Math.imul(R,xe)|0,s=s+Math.imul(O,we)|0,t=t+Math.imul(O,Re)|0,t=t+Math.imul(H,we)|0,u=u+Math.imul(H,Re)|0;var gt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(gt>>>26)|0,gt&=67108863,s=Math.imul(z,W),t=Math.imul(z,re),t=t+Math.imul(T,W)|0,u=Math.imul(T,re),s=s+Math.imul(Se,ae)|0,t=t+Math.imul(Se,Me)|0,t=t+Math.imul(Oe,ae)|0,u=u+Math.imul(Oe,Me)|0,s=s+Math.imul(ve,ye)|0,t=t+Math.imul(ve,Be)|0,t=t+Math.imul(_e,ye)|0,u=u+Math.imul(_e,Be)|0,s=s+Math.imul(de,Ae)|0,t=t+Math.imul(de,Te)|0,t=t+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,Te)|0,s=s+Math.imul(be,Ie)|0,t=t+Math.imul(be,Ne)|0,t=t+Math.imul(se,Ie)|0,u=u+Math.imul(se,Ne)|0,s=s+Math.imul(le,j)|0,t=t+Math.imul(le,N)|0,t=t+Math.imul(ce,j)|0,u=u+Math.imul(ce,N)|0,s=s+Math.imul(K,Y)|0,t=t+Math.imul(K,ie)|0,t=t+Math.imul(te,Y)|0,u=u+Math.imul(te,ie)|0,s=s+Math.imul($,fe)|0,t=t+Math.imul($,xe)|0,t=t+Math.imul(X,fe)|0,u=u+Math.imul(X,xe)|0,s=s+Math.imul(G,we)|0,t=t+Math.imul(G,Re)|0,t=t+Math.imul(R,we)|0,u=u+Math.imul(R,Re)|0,s=s+Math.imul(O,ke)|0,t=t+Math.imul(O,Ce)|0,t=t+Math.imul(H,ke)|0,u=u+Math.imul(H,Ce)|0;var yt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(z,ae),t=Math.imul(z,Me),t=t+Math.imul(T,ae)|0,u=Math.imul(T,Me),s=s+Math.imul(Se,ye)|0,t=t+Math.imul(Se,Be)|0,t=t+Math.imul(Oe,ye)|0,u=u+Math.imul(Oe,Be)|0,s=s+Math.imul(ve,Ae)|0,t=t+Math.imul(ve,Te)|0,t=t+Math.imul(_e,Ae)|0,u=u+Math.imul(_e,Te)|0,s=s+Math.imul(de,Ie)|0,t=t+Math.imul(de,Ne)|0,t=t+Math.imul(ge,Ie)|0,u=u+Math.imul(ge,Ne)|0,s=s+Math.imul(be,j)|0,t=t+Math.imul(be,N)|0,t=t+Math.imul(se,j)|0,u=u+Math.imul(se,N)|0,s=s+Math.imul(le,Y)|0,t=t+Math.imul(le,ie)|0,t=t+Math.imul(ce,Y)|0,u=u+Math.imul(ce,ie)|0,s=s+Math.imul(K,fe)|0,t=t+Math.imul(K,xe)|0,t=t+Math.imul(te,fe)|0,u=u+Math.imul(te,xe)|0,s=s+Math.imul($,we)|0,t=t+Math.imul($,Re)|0,t=t+Math.imul(X,we)|0,u=u+Math.imul(X,Re)|0,s=s+Math.imul(G,ke)|0,t=t+Math.imul(G,Ce)|0,t=t+Math.imul(R,ke)|0,u=u+Math.imul(R,Ce)|0;var wt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,ye),t=Math.imul(z,Be),t=t+Math.imul(T,ye)|0,u=Math.imul(T,Be),s=s+Math.imul(Se,Ae)|0,t=t+Math.imul(Se,Te)|0,t=t+Math.imul(Oe,Ae)|0,u=u+Math.imul(Oe,Te)|0,s=s+Math.imul(ve,Ie)|0,t=t+Math.imul(ve,Ne)|0,t=t+Math.imul(_e,Ie)|0,u=u+Math.imul(_e,Ne)|0,s=s+Math.imul(de,j)|0,t=t+Math.imul(de,N)|0,t=t+Math.imul(ge,j)|0,u=u+Math.imul(ge,N)|0,s=s+Math.imul(be,Y)|0,t=t+Math.imul(be,ie)|0,t=t+Math.imul(se,Y)|0,u=u+Math.imul(se,ie)|0,s=s+Math.imul(le,fe)|0,t=t+Math.imul(le,xe)|0,t=t+Math.imul(ce,fe)|0,u=u+Math.imul(ce,xe)|0,s=s+Math.imul(K,we)|0,t=t+Math.imul(K,Re)|0,t=t+Math.imul(te,we)|0,u=u+Math.imul(te,Re)|0,s=s+Math.imul($,ke)|0,t=t+Math.imul($,Ce)|0,t=t+Math.imul(X,ke)|0,u=u+Math.imul(X,Ce)|0;var Mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(z,Ae),t=Math.imul(z,Te),t=t+Math.imul(T,Ae)|0,u=Math.imul(T,Te),s=s+Math.imul(Se,Ie)|0,t=t+Math.imul(Se,Ne)|0,t=t+Math.imul(Oe,Ie)|0,u=u+Math.imul(Oe,Ne)|0,s=s+Math.imul(ve,j)|0,t=t+Math.imul(ve,N)|0,t=t+Math.imul(_e,j)|0,u=u+Math.imul(_e,N)|0,s=s+Math.imul(de,Y)|0,t=t+Math.imul(de,ie)|0,t=t+Math.imul(ge,Y)|0,u=u+Math.imul(ge,ie)|0,s=s+Math.imul(be,fe)|0,t=t+Math.imul(be,xe)|0,t=t+Math.imul(se,fe)|0,u=u+Math.imul(se,xe)|0,s=s+Math.imul(le,we)|0,t=t+Math.imul(le,Re)|0,t=t+Math.imul(ce,we)|0,u=u+Math.imul(ce,Re)|0,s=s+Math.imul(K,ke)|0,t=t+Math.imul(K,Ce)|0,t=t+Math.imul(te,ke)|0,u=u+Math.imul(te,Ce)|0;var xt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(z,Ie),t=Math.imul(z,Ne),t=t+Math.imul(T,Ie)|0,u=Math.imul(T,Ne),s=s+Math.imul(Se,j)|0,t=t+Math.imul(Se,N)|0,t=t+Math.imul(Oe,j)|0,u=u+Math.imul(Oe,N)|0,s=s+Math.imul(ve,Y)|0,t=t+Math.imul(ve,ie)|0,t=t+Math.imul(_e,Y)|0,u=u+Math.imul(_e,ie)|0,s=s+Math.imul(de,fe)|0,t=t+Math.imul(de,xe)|0,t=t+Math.imul(ge,fe)|0,u=u+Math.imul(ge,xe)|0,s=s+Math.imul(be,we)|0,t=t+Math.imul(be,Re)|0,t=t+Math.imul(se,we)|0,u=u+Math.imul(se,Re)|0,s=s+Math.imul(le,ke)|0,t=t+Math.imul(le,Ce)|0,t=t+Math.imul(ce,ke)|0,u=u+Math.imul(ce,Ce)|0;var _t=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(z,j),t=Math.imul(z,N),t=t+Math.imul(T,j)|0,u=Math.imul(T,N),s=s+Math.imul(Se,Y)|0,t=t+Math.imul(Se,ie)|0,t=t+Math.imul(Oe,Y)|0,u=u+Math.imul(Oe,ie)|0,s=s+Math.imul(ve,fe)|0,t=t+Math.imul(ve,xe)|0,t=t+Math.imul(_e,fe)|0,u=u+Math.imul(_e,xe)|0,s=s+Math.imul(de,we)|0,t=t+Math.imul(de,Re)|0,t=t+Math.imul(ge,we)|0,u=u+Math.imul(ge,Re)|0,s=s+Math.imul(be,ke)|0,t=t+Math.imul(be,Ce)|0,t=t+Math.imul(se,ke)|0,u=u+Math.imul(se,Ce)|0;var St=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(z,Y),t=Math.imul(z,ie),t=t+Math.imul(T,Y)|0,u=Math.imul(T,ie),s=s+Math.imul(Se,fe)|0,t=t+Math.imul(Se,xe)|0,t=t+Math.imul(Oe,fe)|0,u=u+Math.imul(Oe,xe)|0,s=s+Math.imul(ve,we)|0,t=t+Math.imul(ve,Re)|0,t=t+Math.imul(_e,we)|0,u=u+Math.imul(_e,Re)|0,s=s+Math.imul(de,ke)|0,t=t+Math.imul(de,Ce)|0,t=t+Math.imul(ge,ke)|0,u=u+Math.imul(ge,Ce)|0;var Et=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,fe),t=Math.imul(z,xe),t=t+Math.imul(T,fe)|0,u=Math.imul(T,xe),s=s+Math.imul(Se,we)|0,t=t+Math.imul(Se,Re)|0,t=t+Math.imul(Oe,we)|0,u=u+Math.imul(Oe,Re)|0,s=s+Math.imul(ve,ke)|0,t=t+Math.imul(ve,Ce)|0,t=t+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ce)|0;var Bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,we),t=Math.imul(z,Re),t=t+Math.imul(T,we)|0,u=Math.imul(T,Re),s=s+Math.imul(Se,ke)|0,t=t+Math.imul(Se,Ce)|0,t=t+Math.imul(Oe,ke)|0,u=u+Math.imul(Oe,Ce)|0;var At=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(z,ke),t=Math.imul(z,Ce),t=t+Math.imul(T,ke)|0,u=Math.imul(T,Ce);var Rt=(p+s|0)+((t&8191)<<13)|0;return p=(u+(t>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,l[0]=Xe,l[1]=Qe,l[2]=lt,l[3]=dt,l[4]=pt,l[5]=vt,l[6]=mt,l[7]=bt,l[8]=gt,l[9]=yt,l[10]=wt,l[11]=Mt,l[12]=xt,l[13]=_t,l[14]=St,l[15]=Et,l[16]=Bt,l[17]=At,l[18]=Rt,p!==0&&(l[19]=p,i.length++),i};Math.imul||(A=B);function P(m,e,r){r.negative=e.negative^m.negative,r.length=m.length+e.length;for(var i=0,f=0,h=0;h<r.length-1;h++){var l=f;f=0;for(var p=i&67108863,s=Math.min(h,e.length-1),t=Math.max(0,h-m.length+1);t<=s;t++){var u=h-t,S=m.words[u]|0,O=e.words[t]|0,H=S*O,Q=H&67108863;l=l+(H/67108864|0)|0,Q=Q+p|0,p=Q&67108863,l=l+(Q>>>26)|0,f+=l>>>26,l&=67108863}r.words[h]=p,i=l,l=f}return i!==0?r.words[h]=i:r.length--,r.strip()}function I(m,e,r){var i=new k;return i.mulp(m,e,r)}n.prototype.mulTo=function(e,r){var i,f=this.length+e.length;return this.length===10&&e.length===10?i=A(this,e,r):f<63?i=B(this,e,r):f<1024?i=P(this,e,r):i=I(this,e,r),i};function k(m,e){this.x=m,this.y=e}k.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,f=0;f<e;f++)r[f]=this.revBin(f,i,e);return r},k.prototype.revBin=function(e,r,i){if(e===0||e===i-1)return e;for(var f=0,h=0;h<r;h++)f|=(e&1)<<r-h-1,e>>=1;return f},k.prototype.permute=function(e,r,i,f,h,l){for(var p=0;p<l;p++)f[p]=r[e[p]],h[p]=i[e[p]]},k.prototype.transform=function(e,r,i,f,h,l){this.permute(l,e,r,i,f,h);for(var p=1;p<h;p<<=1)for(var s=p<<1,t=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),S=0;S<h;S+=s)for(var O=t,H=u,Q=0;Q<p;Q++){var G=i[S+Q],R=f[S+Q],C=i[S+Q+p],$=f[S+Q+p],X=O*C-H*$;$=O*$+H*C,C=X,i[S+Q]=G+C,f[S+Q]=R+$,i[S+Q+p]=G-C,f[S+Q+p]=R-$,Q!==s&&(X=t*O-u*H,H=t*H+u*O,O=X)}},k.prototype.guessLen13b=function(e,r){var i=Math.max(r,e)|1,f=i&1,h=0;for(i=i/2|0;i;i=i>>>1)h++;return 1<<h+1+f},k.prototype.conjugate=function(e,r,i){if(!(i<=1))for(var f=0;f<i/2;f++){var h=e[f];e[f]=e[i-f-1],e[i-f-1]=h,h=r[f],r[f]=-r[i-f-1],r[i-f-1]=-h}},k.prototype.normalize13b=function(e,r){for(var i=0,f=0;f<r/2;f++){var h=Math.round(e[2*f+1]/r)*8192+Math.round(e[2*f]/r)+i;e[f]=h&67108863,h<67108864?i=0:i=h/67108864|0}return e},k.prototype.convert13b=function(e,r,i,f){for(var h=0,l=0;l<r;l++)h=h+(e[l]|0),i[2*l]=h&8191,h=h>>>13,i[2*l+1]=h&8191,h=h>>>13;for(l=2*r;l<f;++l)i[l]=0;o(h===0),o((h&-8192)===0)},k.prototype.stub=function(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},k.prototype.mulp=function(e,r,i){var f=2*this.guessLen13b(e.length,r.length),h=this.makeRBT(f),l=this.stub(f),p=new Array(f),s=new Array(f),t=new Array(f),u=new Array(f),S=new Array(f),O=new Array(f),H=i.words;H.length=f,this.convert13b(e.words,e.length,p,f),this.convert13b(r.words,r.length,u,f),this.transform(p,l,s,t,f,h),this.transform(u,l,S,O,f,h);for(var Q=0;Q<f;Q++){var G=s[Q]*S[Q]-t[Q]*O[Q];t[Q]=s[Q]*O[Q]+t[Q]*S[Q],s[Q]=G}return this.conjugate(s,t,f),this.transform(s,t,H,l,f,h),this.conjugate(H,l,f),this.normalize13b(H,f),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},n.prototype.mul=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},n.prototype.mulf=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),I(this,e,r)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){o(typeof e=="number"),o(e<67108864);for(var r=0,i=0;i<this.length;i++){var f=(this.words[i]|0)*e,h=(f&67108863)+(r&67108863);r>>=26,r+=f/67108864|0,r+=h>>>26,this.words[i]=h&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=E(e);if(r.length===0)return new n(1);for(var i=this,f=0;f<r.length&&r[f]===0;f++,i=i.sqr());if(++f<r.length)for(var h=i.sqr();f<r.length;f++,h=h.sqr())r[f]!==0&&(i=i.mul(h));return i},n.prototype.iushln=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r,h;if(r!==0){var l=0;for(h=0;h<this.length;h++){var p=this.words[h]&f,s=(this.words[h]|0)-p<<r;this.words[h]=s|l,l=p>>>26-r}l&&(this.words[h]=l,this.length++)}if(i!==0){for(h=this.length-1;h>=0;h--)this.words[h+i]=this.words[h];for(h=0;h<i;h++)this.words[h]=0;this.length+=i}return this.strip()},n.prototype.ishln=function(e){return o(this.negative===0),this.iushln(e)},n.prototype.iushrn=function(e,r,i){o(typeof e=="number"&&e>=0);var f;r?f=(r-r%26)/26:f=0;var h=e%26,l=Math.min((e-h)/26,this.length),p=67108863^67108863>>>h<<h,s=i;if(f-=l,f=Math.max(0,f),s){for(var t=0;t<l;t++)s.words[t]=this.words[t];s.length=l}if(l!==0)if(this.length>l)for(this.length-=l,t=0;t<this.length;t++)this.words[t]=this.words[t+l];else this.words[0]=0,this.length=1;var u=0;for(t=this.length-1;t>=0&&(u!==0||t>=f);t--){var S=this.words[t]|0;this.words[t]=u<<26-h|S>>>h,u=S&p}return s&&u!==0&&(s.words[s.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return o(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return!1;var h=this.words[i];return!!(h&f)},n.prototype.imaskn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var f=67108863^67108863>>>r<<r;this.words[this.length-1]&=f}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return o(typeof e=="number"),o(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(o(typeof e=="number"),o(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,r,i){var f=e.length+i,h;this._expand(f);var l,p=0;for(h=0;h<e.length;h++){l=(this.words[h+i]|0)+p;var s=(e.words[h]|0)*r;l-=s&67108863,p=(l>>26)-(s/67108864|0),this.words[h+i]=l&67108863}for(;h<this.length-i;h++)l=(this.words[h+i]|0)+p,p=l>>26,this.words[h+i]=l&67108863;if(p===0)return this.strip();for(o(p===-1),p=0,h=0;h<this.length;h++)l=-(this.words[h]|0)+p,p=l>>26,this.words[h]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,f=this.clone(),h=e,l=h.words[h.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(h=h.ushln(i),f.iushln(i),l=h.words[h.length-1]|0);var s=f.length-h.length,t;if(r!=="mod"){t=new n(null),t.length=s+1,t.words=new Array(t.length);for(var u=0;u<t.length;u++)t.words[u]=0}var S=f.clone()._ishlnsubmul(h,1,s);S.negative===0&&(f=S,t&&(t.words[s]=1));for(var O=s-1;O>=0;O--){var H=(f.words[h.length+O]|0)*67108864+(f.words[h.length+O-1]|0);for(H=Math.min(H/l|0,67108863),f._ishlnsubmul(h,H,O);f.negative!==0;)H--,f.negative=0,f._ishlnsubmul(h,1,O),f.isZero()||(f.negative^=1);t&&(t.words[O]=H)}return t&&t.strip(),f.strip(),r!=="div"&&i!==0&&f.iushrn(i),{div:t||null,mod:f}},n.prototype.divmod=function(e,r,i){if(o(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(f=l.div.neg()),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.iadd(e)),{div:f,mod:h}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(f=l.div.neg()),{div:f,mod:l.mod}):(this.negative&e.negative)!==0?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.isub(e)),{div:l.div,mod:h}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,f=e.ushrn(1),h=e.andln(1),l=i.cmp(f);return l<0||h===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){o(e<=67108863);for(var r=(1<<26)%e,i=0,f=this.length-1;f>=0;f--)i=(r*i+(this.words[f]|0))%e;return i},n.prototype.idivn=function(e){o(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var f=(this.words[i]|0)+r*67108864;this.words[i]=f/e|0,r=f%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=new n(0),p=new n(1),s=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++s;for(var t=i.clone(),u=r.clone();!r.isZero();){for(var S=0,O=1;(r.words[0]&O)===0&&S<26;++S,O<<=1);if(S>0)for(r.iushrn(S);S-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(t),h.isub(u)),f.iushrn(1),h.iushrn(1);for(var H=0,Q=1;(i.words[0]&Q)===0&&H<26;++H,Q<<=1);if(H>0)for(i.iushrn(H);H-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(u)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(l),h.isub(p)):(i.isub(r),l.isub(f),p.isub(h))}return{a:l,b:p,gcd:i.iushln(s)}},n.prototype._invmp=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,s=1;(r.words[0]&s)===0&&p<26;++p,s<<=1);if(p>0)for(r.iushrn(p);p-- >0;)f.isOdd()&&f.iadd(l),f.iushrn(1);for(var t=0,u=1;(i.words[0]&u)===0&&t<26;++t,u<<=1);if(t>0)for(i.iushrn(t);t-- >0;)h.isOdd()&&h.iadd(l),h.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(h)):(i.isub(r),h.isub(f))}var S;return r.cmpn(1)===0?S=f:S=h,S.cmpn(0)<0&&S.iadd(e),S},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var f=0;r.isEven()&&i.isEven();f++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var h=r.cmp(i);if(h<0){var l=r;r=i,i=l}else if(h===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(f)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){o(typeof e=="number");var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=f,this;for(var h=f,l=i;h!==0&&l<this.length;l++){var p=this.words[l]|0;p+=h,h=p>>>26,p&=67108863,this.words[l]=p}return h!==0&&(this.words[l]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),o(e<=67108863,"Number is too big");var f=this.words[0]|0;i=f===e?0:f<e?-1:1}return this.negative!==0?-i|0:i},n.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var r=this.ucmp(e);return this.negative!==0?-r|0:r},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var f=this.words[i]|0,h=e.words[i]|0;if(f!==h){f<h?r=-1:f>h&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new J(e)},n.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var F={k256:null,p224:null,p192:null,p25519:null};function q(m,e){this.name=m,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},q.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var f=i<this.n?-1:r.ucmp(this.p);return f===0?(r.words[0]=0,r.length=1):f>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},q.prototype.split=function(e,r){e.iushrn(this.n,0,r)},q.prototype.imulK=function(e){return e.imul(this.k)};function L(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}x(L,q),L.prototype.split=function(e,r){for(var i=4194303,f=Math.min(e.length,9),h=0;h<f;h++)r.words[h]=e.words[h];if(r.length=f,e.length<=9){e.words[0]=0,e.length=1;return}var l=e.words[9];for(r.words[r.length++]=l&i,h=10;h<e.length;h++){var p=e.words[h]|0;e.words[h-10]=(p&i)<<4|l>>>22,l=p}l>>>=22,e.words[h-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var f=e.words[i]|0;r+=f*977,e.words[i]=r&67108863,r=f*64+(r/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function V(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}x(V,q);function ee(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}x(ee,q);function ne(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}x(ne,q),ne.prototype.imulK=function(e){for(var r=0,i=0;i<e.length;i++){var f=(e.words[i]|0)*19+r,h=f&67108863;f>>>=26,e.words[i]=h,r=f}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(F[e])return F[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new V;else if(e==="p192")r=new ee;else if(e==="p25519")r=new ne;else throw new Error("Unknown prime "+e);return F[e]=r,r};function J(m){if(typeof m=="string"){var e=n._prime(m);this.m=e.p,this.prime=e}else o(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}J.prototype._verify1=function(e){o(e.negative===0,"red works only with positives"),o(e.red,"red works only with red numbers")},J.prototype._verify2=function(e,r){o((e.negative|r.negative)===0,"red works only with positives"),o(e.red&&e.red===r.red,"red works only with red numbers")},J.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},J.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},J.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},J.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},J.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},J.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},J.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},J.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},J.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},J.prototype.isqr=function(e){return this.imul(e,e.clone())},J.prototype.sqr=function(e){return this.mul(e,e)},J.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);o(!f.isZero());var l=new n(1).toRed(this),p=l.redNeg(),s=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,s).cmp(p)!==0;)t.redIAdd(p);for(var u=this.pow(t,f),S=this.pow(e,f.addn(1).iushrn(1)),O=this.pow(e,f),H=h;O.cmp(l)!==0;){for(var Q=O,G=0;Q.cmp(l)!==0;G++)Q=Q.redSqr();o(G<H);var R=this.pow(u,new n(1).iushln(H-G-1));S=S.redMul(R),u=R.redSqr(),O=O.redMul(u),H=G}return S},J.prototype.invm=function(e){var r=e._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},J.prototype.pow=function(e,r){if(r.isZero())return new n(1).toRed(this);if(r.cmpn(1)===0)return e.clone();var i=4,f=new Array(1<<i);f[0]=new n(1).toRed(this),f[1]=e;for(var h=2;h<f.length;h++)f[h]=this.mul(f[h-1],e);var l=f[0],p=0,s=0,t=r.bitLength()%26;for(t===0&&(t=26),h=r.length-1;h>=0;h--){for(var u=r.words[h],S=t-1;S>=0;S--){var O=u>>S&1;if(l!==f[0]&&(l=this.sqr(l)),O===0&&p===0){s=0;continue}p<<=1,p|=O,s++,!(s!==i&&(h!==0||S!==0))&&(l=this.mul(l,f[p]),s=0,p=0)}t=26}return l},J.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},J.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new ue(e)};function ue(m){J.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}x(ue,J),ue.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},ue.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},ue.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(M,g1)}(ki)),ki.exports}var Ds,gl;function w1(){if(gl)return Ds;gl=1;var M=ws(),a=y1();Ds=function(g){return new o(g)};var c={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};c.p224=c.secp224r1,c.p256=c.secp256r1=c.prime256v1,c.p192=c.secp192r1=c.prime192v1,c.p384=c.secp384r1,c.p521=c.secp521r1;function o(n){this.curveType=c[n],this.curveType||(this.curveType={name:n}),this.curve=new M.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(n,g){return this.keys=this.curve.genKeyPair(),this.getPublicKey(n,g)},o.prototype.computeSecret=function(n,g,y){g=g||"utf8",he.isBuffer(n)||(n=new he(n,g));var b=this.curve.keyFromPublic(n).getPublic(),v=b.mul(this.keys.getPrivate()).getX();return x(v,y,this.curveType.byteLength)},o.prototype.getPublicKey=function(n,g){var y=this.keys.getPublic(g==="compressed",!0);return g==="hybrid"&&(y[y.length-1]%2?y[0]=7:y[0]=6),x(y,n)},o.prototype.getPrivateKey=function(n){return x(this.keys.getPrivate(),n)},o.prototype.setPublicKey=function(n,g){return g=g||"utf8",he.isBuffer(n)||(n=new he(n,g)),this.keys._importPublic(n),this},o.prototype.setPrivateKey=function(n,g){g=g||"utf8",he.isBuffer(n)||(n=new he(n,g));var y=new a(n);return y=y.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(y),this};function x(n,g,y){Array.isArray(n)||(n=n.toArray());var b=new he(n);if(y&&b.length<y){var v=new he(y-b.length);v.fill(0),b=he.concat([v,b])}return g?b.toString(g):b}return Ds}var Us={},Hs,yl;function wl(){if(yl)return Hs;yl=1;var M=Kr(),a=tt().Buffer;Hs=function(o,x){for(var n=a.alloc(0),g=0,y;n.length<x;)y=c(g++),n=a.concat([n,M("sha1").update(o).update(y).digest()]);return n.slice(0,x)};function c(o){var x=a.allocUnsafe(4);return x.writeUInt32BE(o,0),x}return Hs}var Ks,Ml;function xl(){return Ml||(Ml=1,Ks=function(a,c){for(var o=a.length,x=-1;++x<o;)a[x]^=c[x];return a}),Ks}var Pi={exports:{}},M1=Pi.exports,_l;function zs(){return _l||(_l=1,function(M){(function(a,c){function o(m,e){if(!m)throw new Error(e||"Assertion failed")}function x(m,e){m.super_=e;var r=function(){};r.prototype=e.prototype,m.prototype=new r,m.prototype.constructor=m}function n(m,e,r){if(n.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((e==="le"||e==="be")&&(r=e,e=10),this._init(m||0,e||10,r||"be"))}typeof a=="object"?a.exports=n:c.BN=n,n.BN=n,n.wordSize=26;var g;try{typeof window<"u"&&typeof window.Buffer<"u"?g=window.Buffer:g=Nt().Buffer}catch{}n.isBN=function(e){return e instanceof n?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp(r)>0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var f=0;e[0]==="-"&&(f++,this.negative=1),f<e.length&&(r===16?this._parseHex(e,f,i):(this._parseBase(e,r,f),i==="le"&&this._initArray(this.toArray(),r,i)))},n.prototype._initNumber=function(e,r,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(o(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},n.prototype._initArray=function(e,r,i){if(o(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h,l,p=0;if(i==="be")for(f=e.length-1,h=0;f>=0;f-=3)l=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);else if(i==="le")for(f=0,h=0;f<e.length;f+=3)l=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[h]|=l<<p&67108863,this.words[h+1]=l>>>26-p&67108863,p+=24,p>=26&&(p-=26,h++);return this.strip()};function y(m,e){var r=m.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function b(m,e,r){var i=y(m,r);return r-1>=e&&(i|=y(m,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var h=0,l=0,p;if(i==="be")for(f=e.length-1;f>=r;f-=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8;else{var s=e.length-r;for(f=s%2===0?r+1:r;f<e.length;f+=2)p=b(e,r,f)<<h,this.words[l]|=p&67108863,h>=18?(h-=18,l+=1,this.words[l]|=p>>>26):h+=8}this.strip()};function v(m,e,r,i){for(var f=0,h=Math.min(m.length,r),l=e;l<h;l++){var p=m.charCodeAt(l)-48;f*=i,p>=49?f+=p-49+10:p>=17?f+=p-17+10:f+=p}return f}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var f=0,h=1;h<=67108863;h*=r)f++;f--,h=h/r|0;for(var l=e.length-i,p=l%f,s=Math.min(l,l-p)+i,t=0,u=i;u<s;u+=f)t=v(e,u,u+f,r),this.imuln(h),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t);if(p!==0){var S=1;for(t=v(e,u,e.length,r),u=0;u<p;u++)S*=r;this.imuln(S),this.words[0]+t<67108864?this.words[0]+=t:this._iaddn(t)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var r=0;r<this.length;r++)e.words[r]=this.words[r];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],w=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var f=0,h=0,l=0;l<this.length;l++){var p=this.words[l],s=((p<<f|h)&16777215).toString(16);h=p>>>24-f&16777215,f+=2,f>=26&&(f-=26,l--),h!==0||l!==this.length-1?i=d[6-s.length]+s+i:i=s+i}for(h!==0&&(i=h.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=w[e],u=_[e];i="";var S=this.clone();for(S.negative=0;!S.isZero();){var O=S.modn(u).toString(e);S=S.idivn(u),S.isZero()?i=O+i:i=d[t-O.length]+O+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return o(typeof g<"u"),this.toArrayLike(g,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var f=this.byteLength(),h=i||Math.max(1,f);o(f<=h,"byte array longer than desired length"),o(h>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(h),s,t,u=this.clone();if(l){for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[t]=s;for(;t<h;t++)p[t]=0}else{for(t=0;t<h-f;t++)p[t]=0;for(t=0;!u.isZero();t++)s=u.andln(255),u.iushrn(8),p[h-t-1]=s}return p},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var r=e,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return(r&8191)===0&&(i+=13,r>>>=13),(r&127)===0&&(i+=7,r>>>=7),(r&15)===0&&(i+=4,r>>>=4),(r&3)===0&&(i+=2,r>>>=2),(r&1)===0&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function E(m){for(var e=new Array(m.bitLength()),r=0;r<e.length;r++){var i=r/26|0,f=r%26;e[r]=(m.words[i]&1<<f)>>>f}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(e+=i,i!==26)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]|e.words[r];return this.strip()},n.prototype.ior=function(e){return o((this.negative|e.negative)===0),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=r.length,this.strip()},n.prototype.iand=function(e){return o((this.negative|e.negative)===0),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var f=0;f<i.length;f++)this.words[f]=r.words[f]^i.words[f];if(this!==r)for(;f<r.length;f++)this.words[f]=r.words[f];return this.length=r.length,this.strip()},n.prototype.ixor=function(e){return o((this.negative|e.negative)===0),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){o(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var f=0;f<r;f++)this.words[f]=~this.words[f]&67108863;return i>0&&(this.words[f]=~this.words[f]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){o(typeof e=="number"&&e>=0);var i=e/26|0,f=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<f:this.words[i]=this.words[i]&~(1<<f),this.strip()},n.prototype.iadd=function(e){var r;if(this.negative!==0&&e.negative===0)return this.negative=0,r=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,r=this.isub(e),e.negative=1,r._normSign();var i,f;this.length>e.length?(i=this,f=e):(i=e,f=this);for(var h=0,l=0;l<f.length;l++)r=(i.words[l]|0)+(f.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;for(;h!==0&&l<i.length;l++)r=(i.words[l]|0)+h,this.words[l]=r&67108863,h=r>>>26;if(this.length=i.length,h!==0)this.words[this.length]=h,this.length++;else if(i!==this)for(;l<i.length;l++)this.words[l]=i.words[l];return this},n.prototype.add=function(e){var r;return e.negative!==0&&this.negative===0?(e.negative=0,r=this.sub(e),e.negative^=1,r):e.negative===0&&this.negative!==0?(this.negative=0,r=e.sub(this),this.negative=1,r):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,h;i>0?(f=this,h=e):(f=e,h=this);for(var l=0,p=0;p<h.length;p++)r=(f.words[p]|0)-(h.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;for(;l!==0&&p<f.length;p++)r=(f.words[p]|0)+l,l=r>>26,this.words[p]=r&67108863;if(l===0&&p<f.length&&f!==this)for(;p<f.length;p++)this.words[p]=f.words[p];return this.length=Math.max(this.length,p),f!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};function B(m,e,r){r.negative=e.negative^m.negative;var i=m.length+e.length|0;r.length=i,i=i-1|0;var f=m.words[0]|0,h=e.words[0]|0,l=f*h,p=l&67108863,s=l/67108864|0;r.words[0]=p;for(var t=1;t<i;t++){for(var u=s>>>26,S=s&67108863,O=Math.min(t,e.length-1),H=Math.max(0,t-m.length+1);H<=O;H++){var Q=t-H|0;f=m.words[Q]|0,h=e.words[H]|0,l=f*h+S,u+=l/67108864|0,S=l&67108863}r.words[t]=S|0,s=u|0}return s!==0?r.words[t]=s|0:r.length--,r.strip()}var A=function(e,r,i){var f=e.words,h=r.words,l=i.words,p=0,s,t,u,S=f[0]|0,O=S&8191,H=S>>>13,Q=f[1]|0,G=Q&8191,R=Q>>>13,C=f[2]|0,$=C&8191,X=C>>>13,Z=f[3]|0,K=Z&8191,te=Z>>>13,Pe=f[4]|0,le=Pe&8191,ce=Pe>>>13,Le=f[5]|0,be=Le&8191,se=Le>>>13,Ue=f[6]|0,de=Ue&8191,ge=Ue>>>13,De=f[7]|0,ve=De&8191,_e=De>>>13,Ge=f[8]|0,Se=Ge&8191,Oe=Ge>>>13,Ze=f[9]|0,z=Ze&8191,T=Ze>>>13,D=h[0]|0,W=D&8191,re=D>>>13,pe=h[1]|0,ae=pe&8191,Me=pe>>>13,ze=h[2]|0,ye=ze&8191,Be=ze>>>13,He=h[3]|0,Ae=He&8191,Te=He>>>13,rt=h[4]|0,Ie=rt&8191,Ne=rt>>>13,nt=h[5]|0,j=nt&8191,N=nt>>>13,U=h[6]|0,Y=U&8191,ie=U>>>13,me=h[7]|0,fe=me&8191,xe=me>>>13,Ve=h[8]|0,we=Ve&8191,Re=Ve>>>13,Ke=h[9]|0,ke=Ke&8191,Ce=Ke>>>13;i.negative=e.negative^r.negative,i.length=19,s=Math.imul(O,W),t=Math.imul(O,re),t=t+Math.imul(H,W)|0,u=Math.imul(H,re);var Xe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,s=Math.imul(G,W),t=Math.imul(G,re),t=t+Math.imul(R,W)|0,u=Math.imul(R,re),s=s+Math.imul(O,ae)|0,t=t+Math.imul(O,Me)|0,t=t+Math.imul(H,ae)|0,u=u+Math.imul(H,Me)|0;var Qe=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,s=Math.imul($,W),t=Math.imul($,re),t=t+Math.imul(X,W)|0,u=Math.imul(X,re),s=s+Math.imul(G,ae)|0,t=t+Math.imul(G,Me)|0,t=t+Math.imul(R,ae)|0,u=u+Math.imul(R,Me)|0,s=s+Math.imul(O,ye)|0,t=t+Math.imul(O,Be)|0,t=t+Math.imul(H,ye)|0,u=u+Math.imul(H,Be)|0;var lt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(lt>>>26)|0,lt&=67108863,s=Math.imul(K,W),t=Math.imul(K,re),t=t+Math.imul(te,W)|0,u=Math.imul(te,re),s=s+Math.imul($,ae)|0,t=t+Math.imul($,Me)|0,t=t+Math.imul(X,ae)|0,u=u+Math.imul(X,Me)|0,s=s+Math.imul(G,ye)|0,t=t+Math.imul(G,Be)|0,t=t+Math.imul(R,ye)|0,u=u+Math.imul(R,Be)|0,s=s+Math.imul(O,Ae)|0,t=t+Math.imul(O,Te)|0,t=t+Math.imul(H,Ae)|0,u=u+Math.imul(H,Te)|0;var dt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(dt>>>26)|0,dt&=67108863,s=Math.imul(le,W),t=Math.imul(le,re),t=t+Math.imul(ce,W)|0,u=Math.imul(ce,re),s=s+Math.imul(K,ae)|0,t=t+Math.imul(K,Me)|0,t=t+Math.imul(te,ae)|0,u=u+Math.imul(te,Me)|0,s=s+Math.imul($,ye)|0,t=t+Math.imul($,Be)|0,t=t+Math.imul(X,ye)|0,u=u+Math.imul(X,Be)|0,s=s+Math.imul(G,Ae)|0,t=t+Math.imul(G,Te)|0,t=t+Math.imul(R,Ae)|0,u=u+Math.imul(R,Te)|0,s=s+Math.imul(O,Ie)|0,t=t+Math.imul(O,Ne)|0,t=t+Math.imul(H,Ie)|0,u=u+Math.imul(H,Ne)|0;var pt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(be,W),t=Math.imul(be,re),t=t+Math.imul(se,W)|0,u=Math.imul(se,re),s=s+Math.imul(le,ae)|0,t=t+Math.imul(le,Me)|0,t=t+Math.imul(ce,ae)|0,u=u+Math.imul(ce,Me)|0,s=s+Math.imul(K,ye)|0,t=t+Math.imul(K,Be)|0,t=t+Math.imul(te,ye)|0,u=u+Math.imul(te,Be)|0,s=s+Math.imul($,Ae)|0,t=t+Math.imul($,Te)|0,t=t+Math.imul(X,Ae)|0,u=u+Math.imul(X,Te)|0,s=s+Math.imul(G,Ie)|0,t=t+Math.imul(G,Ne)|0,t=t+Math.imul(R,Ie)|0,u=u+Math.imul(R,Ne)|0,s=s+Math.imul(O,j)|0,t=t+Math.imul(O,N)|0,t=t+Math.imul(H,j)|0,u=u+Math.imul(H,N)|0;var vt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(de,W),t=Math.imul(de,re),t=t+Math.imul(ge,W)|0,u=Math.imul(ge,re),s=s+Math.imul(be,ae)|0,t=t+Math.imul(be,Me)|0,t=t+Math.imul(se,ae)|0,u=u+Math.imul(se,Me)|0,s=s+Math.imul(le,ye)|0,t=t+Math.imul(le,Be)|0,t=t+Math.imul(ce,ye)|0,u=u+Math.imul(ce,Be)|0,s=s+Math.imul(K,Ae)|0,t=t+Math.imul(K,Te)|0,t=t+Math.imul(te,Ae)|0,u=u+Math.imul(te,Te)|0,s=s+Math.imul($,Ie)|0,t=t+Math.imul($,Ne)|0,t=t+Math.imul(X,Ie)|0,u=u+Math.imul(X,Ne)|0,s=s+Math.imul(G,j)|0,t=t+Math.imul(G,N)|0,t=t+Math.imul(R,j)|0,u=u+Math.imul(R,N)|0,s=s+Math.imul(O,Y)|0,t=t+Math.imul(O,ie)|0,t=t+Math.imul(H,Y)|0,u=u+Math.imul(H,ie)|0;var mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(ve,W),t=Math.imul(ve,re),t=t+Math.imul(_e,W)|0,u=Math.imul(_e,re),s=s+Math.imul(de,ae)|0,t=t+Math.imul(de,Me)|0,t=t+Math.imul(ge,ae)|0,u=u+Math.imul(ge,Me)|0,s=s+Math.imul(be,ye)|0,t=t+Math.imul(be,Be)|0,t=t+Math.imul(se,ye)|0,u=u+Math.imul(se,Be)|0,s=s+Math.imul(le,Ae)|0,t=t+Math.imul(le,Te)|0,t=t+Math.imul(ce,Ae)|0,u=u+Math.imul(ce,Te)|0,s=s+Math.imul(K,Ie)|0,t=t+Math.imul(K,Ne)|0,t=t+Math.imul(te,Ie)|0,u=u+Math.imul(te,Ne)|0,s=s+Math.imul($,j)|0,t=t+Math.imul($,N)|0,t=t+Math.imul(X,j)|0,u=u+Math.imul(X,N)|0,s=s+Math.imul(G,Y)|0,t=t+Math.imul(G,ie)|0,t=t+Math.imul(R,Y)|0,u=u+Math.imul(R,ie)|0,s=s+Math.imul(O,fe)|0,t=t+Math.imul(O,xe)|0,t=t+Math.imul(H,fe)|0,u=u+Math.imul(H,xe)|0;var bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(Se,W),t=Math.imul(Se,re),t=t+Math.imul(Oe,W)|0,u=Math.imul(Oe,re),s=s+Math.imul(ve,ae)|0,t=t+Math.imul(ve,Me)|0,t=t+Math.imul(_e,ae)|0,u=u+Math.imul(_e,Me)|0,s=s+Math.imul(de,ye)|0,t=t+Math.imul(de,Be)|0,t=t+Math.imul(ge,ye)|0,u=u+Math.imul(ge,Be)|0,s=s+Math.imul(be,Ae)|0,t=t+Math.imul(be,Te)|0,t=t+Math.imul(se,Ae)|0,u=u+Math.imul(se,Te)|0,s=s+Math.imul(le,Ie)|0,t=t+Math.imul(le,Ne)|0,t=t+Math.imul(ce,Ie)|0,u=u+Math.imul(ce,Ne)|0,s=s+Math.imul(K,j)|0,t=t+Math.imul(K,N)|0,t=t+Math.imul(te,j)|0,u=u+Math.imul(te,N)|0,s=s+Math.imul($,Y)|0,t=t+Math.imul($,ie)|0,t=t+Math.imul(X,Y)|0,u=u+Math.imul(X,ie)|0,s=s+Math.imul(G,fe)|0,t=t+Math.imul(G,xe)|0,t=t+Math.imul(R,fe)|0,u=u+Math.imul(R,xe)|0,s=s+Math.imul(O,we)|0,t=t+Math.imul(O,Re)|0,t=t+Math.imul(H,we)|0,u=u+Math.imul(H,Re)|0;var gt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(gt>>>26)|0,gt&=67108863,s=Math.imul(z,W),t=Math.imul(z,re),t=t+Math.imul(T,W)|0,u=Math.imul(T,re),s=s+Math.imul(Se,ae)|0,t=t+Math.imul(Se,Me)|0,t=t+Math.imul(Oe,ae)|0,u=u+Math.imul(Oe,Me)|0,s=s+Math.imul(ve,ye)|0,t=t+Math.imul(ve,Be)|0,t=t+Math.imul(_e,ye)|0,u=u+Math.imul(_e,Be)|0,s=s+Math.imul(de,Ae)|0,t=t+Math.imul(de,Te)|0,t=t+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,Te)|0,s=s+Math.imul(be,Ie)|0,t=t+Math.imul(be,Ne)|0,t=t+Math.imul(se,Ie)|0,u=u+Math.imul(se,Ne)|0,s=s+Math.imul(le,j)|0,t=t+Math.imul(le,N)|0,t=t+Math.imul(ce,j)|0,u=u+Math.imul(ce,N)|0,s=s+Math.imul(K,Y)|0,t=t+Math.imul(K,ie)|0,t=t+Math.imul(te,Y)|0,u=u+Math.imul(te,ie)|0,s=s+Math.imul($,fe)|0,t=t+Math.imul($,xe)|0,t=t+Math.imul(X,fe)|0,u=u+Math.imul(X,xe)|0,s=s+Math.imul(G,we)|0,t=t+Math.imul(G,Re)|0,t=t+Math.imul(R,we)|0,u=u+Math.imul(R,Re)|0,s=s+Math.imul(O,ke)|0,t=t+Math.imul(O,Ce)|0,t=t+Math.imul(H,ke)|0,u=u+Math.imul(H,Ce)|0;var yt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(z,ae),t=Math.imul(z,Me),t=t+Math.imul(T,ae)|0,u=Math.imul(T,Me),s=s+Math.imul(Se,ye)|0,t=t+Math.imul(Se,Be)|0,t=t+Math.imul(Oe,ye)|0,u=u+Math.imul(Oe,Be)|0,s=s+Math.imul(ve,Ae)|0,t=t+Math.imul(ve,Te)|0,t=t+Math.imul(_e,Ae)|0,u=u+Math.imul(_e,Te)|0,s=s+Math.imul(de,Ie)|0,t=t+Math.imul(de,Ne)|0,t=t+Math.imul(ge,Ie)|0,u=u+Math.imul(ge,Ne)|0,s=s+Math.imul(be,j)|0,t=t+Math.imul(be,N)|0,t=t+Math.imul(se,j)|0,u=u+Math.imul(se,N)|0,s=s+Math.imul(le,Y)|0,t=t+Math.imul(le,ie)|0,t=t+Math.imul(ce,Y)|0,u=u+Math.imul(ce,ie)|0,s=s+Math.imul(K,fe)|0,t=t+Math.imul(K,xe)|0,t=t+Math.imul(te,fe)|0,u=u+Math.imul(te,xe)|0,s=s+Math.imul($,we)|0,t=t+Math.imul($,Re)|0,t=t+Math.imul(X,we)|0,u=u+Math.imul(X,Re)|0,s=s+Math.imul(G,ke)|0,t=t+Math.imul(G,Ce)|0,t=t+Math.imul(R,ke)|0,u=u+Math.imul(R,Ce)|0;var wt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,ye),t=Math.imul(z,Be),t=t+Math.imul(T,ye)|0,u=Math.imul(T,Be),s=s+Math.imul(Se,Ae)|0,t=t+Math.imul(Se,Te)|0,t=t+Math.imul(Oe,Ae)|0,u=u+Math.imul(Oe,Te)|0,s=s+Math.imul(ve,Ie)|0,t=t+Math.imul(ve,Ne)|0,t=t+Math.imul(_e,Ie)|0,u=u+Math.imul(_e,Ne)|0,s=s+Math.imul(de,j)|0,t=t+Math.imul(de,N)|0,t=t+Math.imul(ge,j)|0,u=u+Math.imul(ge,N)|0,s=s+Math.imul(be,Y)|0,t=t+Math.imul(be,ie)|0,t=t+Math.imul(se,Y)|0,u=u+Math.imul(se,ie)|0,s=s+Math.imul(le,fe)|0,t=t+Math.imul(le,xe)|0,t=t+Math.imul(ce,fe)|0,u=u+Math.imul(ce,xe)|0,s=s+Math.imul(K,we)|0,t=t+Math.imul(K,Re)|0,t=t+Math.imul(te,we)|0,u=u+Math.imul(te,Re)|0,s=s+Math.imul($,ke)|0,t=t+Math.imul($,Ce)|0,t=t+Math.imul(X,ke)|0,u=u+Math.imul(X,Ce)|0;var Mt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(z,Ae),t=Math.imul(z,Te),t=t+Math.imul(T,Ae)|0,u=Math.imul(T,Te),s=s+Math.imul(Se,Ie)|0,t=t+Math.imul(Se,Ne)|0,t=t+Math.imul(Oe,Ie)|0,u=u+Math.imul(Oe,Ne)|0,s=s+Math.imul(ve,j)|0,t=t+Math.imul(ve,N)|0,t=t+Math.imul(_e,j)|0,u=u+Math.imul(_e,N)|0,s=s+Math.imul(de,Y)|0,t=t+Math.imul(de,ie)|0,t=t+Math.imul(ge,Y)|0,u=u+Math.imul(ge,ie)|0,s=s+Math.imul(be,fe)|0,t=t+Math.imul(be,xe)|0,t=t+Math.imul(se,fe)|0,u=u+Math.imul(se,xe)|0,s=s+Math.imul(le,we)|0,t=t+Math.imul(le,Re)|0,t=t+Math.imul(ce,we)|0,u=u+Math.imul(ce,Re)|0,s=s+Math.imul(K,ke)|0,t=t+Math.imul(K,Ce)|0,t=t+Math.imul(te,ke)|0,u=u+Math.imul(te,Ce)|0;var xt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(z,Ie),t=Math.imul(z,Ne),t=t+Math.imul(T,Ie)|0,u=Math.imul(T,Ne),s=s+Math.imul(Se,j)|0,t=t+Math.imul(Se,N)|0,t=t+Math.imul(Oe,j)|0,u=u+Math.imul(Oe,N)|0,s=s+Math.imul(ve,Y)|0,t=t+Math.imul(ve,ie)|0,t=t+Math.imul(_e,Y)|0,u=u+Math.imul(_e,ie)|0,s=s+Math.imul(de,fe)|0,t=t+Math.imul(de,xe)|0,t=t+Math.imul(ge,fe)|0,u=u+Math.imul(ge,xe)|0,s=s+Math.imul(be,we)|0,t=t+Math.imul(be,Re)|0,t=t+Math.imul(se,we)|0,u=u+Math.imul(se,Re)|0,s=s+Math.imul(le,ke)|0,t=t+Math.imul(le,Ce)|0,t=t+Math.imul(ce,ke)|0,u=u+Math.imul(ce,Ce)|0;var _t=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(z,j),t=Math.imul(z,N),t=t+Math.imul(T,j)|0,u=Math.imul(T,N),s=s+Math.imul(Se,Y)|0,t=t+Math.imul(Se,ie)|0,t=t+Math.imul(Oe,Y)|0,u=u+Math.imul(Oe,ie)|0,s=s+Math.imul(ve,fe)|0,t=t+Math.imul(ve,xe)|0,t=t+Math.imul(_e,fe)|0,u=u+Math.imul(_e,xe)|0,s=s+Math.imul(de,we)|0,t=t+Math.imul(de,Re)|0,t=t+Math.imul(ge,we)|0,u=u+Math.imul(ge,Re)|0,s=s+Math.imul(be,ke)|0,t=t+Math.imul(be,Ce)|0,t=t+Math.imul(se,ke)|0,u=u+Math.imul(se,Ce)|0;var St=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(z,Y),t=Math.imul(z,ie),t=t+Math.imul(T,Y)|0,u=Math.imul(T,ie),s=s+Math.imul(Se,fe)|0,t=t+Math.imul(Se,xe)|0,t=t+Math.imul(Oe,fe)|0,u=u+Math.imul(Oe,xe)|0,s=s+Math.imul(ve,we)|0,t=t+Math.imul(ve,Re)|0,t=t+Math.imul(_e,we)|0,u=u+Math.imul(_e,Re)|0,s=s+Math.imul(de,ke)|0,t=t+Math.imul(de,Ce)|0,t=t+Math.imul(ge,ke)|0,u=u+Math.imul(ge,Ce)|0;var Et=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,fe),t=Math.imul(z,xe),t=t+Math.imul(T,fe)|0,u=Math.imul(T,xe),s=s+Math.imul(Se,we)|0,t=t+Math.imul(Se,Re)|0,t=t+Math.imul(Oe,we)|0,u=u+Math.imul(Oe,Re)|0,s=s+Math.imul(ve,ke)|0,t=t+Math.imul(ve,Ce)|0,t=t+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ce)|0;var Bt=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,we),t=Math.imul(z,Re),t=t+Math.imul(T,we)|0,u=Math.imul(T,Re),s=s+Math.imul(Se,ke)|0,t=t+Math.imul(Se,Ce)|0,t=t+Math.imul(Oe,ke)|0,u=u+Math.imul(Oe,Ce)|0;var At=(p+s|0)+((t&8191)<<13)|0;p=(u+(t>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(z,ke),t=Math.imul(z,Ce),t=t+Math.imul(T,ke)|0,u=Math.imul(T,Ce);var Rt=(p+s|0)+((t&8191)<<13)|0;return p=(u+(t>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,l[0]=Xe,l[1]=Qe,l[2]=lt,l[3]=dt,l[4]=pt,l[5]=vt,l[6]=mt,l[7]=bt,l[8]=gt,l[9]=yt,l[10]=wt,l[11]=Mt,l[12]=xt,l[13]=_t,l[14]=St,l[15]=Et,l[16]=Bt,l[17]=At,l[18]=Rt,p!==0&&(l[19]=p,i.length++),i};Math.imul||(A=B);function P(m,e,r){r.negative=e.negative^m.negative,r.length=m.length+e.length;for(var i=0,f=0,h=0;h<r.length-1;h++){var l=f;f=0;for(var p=i&67108863,s=Math.min(h,e.length-1),t=Math.max(0,h-m.length+1);t<=s;t++){var u=h-t,S=m.words[u]|0,O=e.words[t]|0,H=S*O,Q=H&67108863;l=l+(H/67108864|0)|0,Q=Q+p|0,p=Q&67108863,l=l+(Q>>>26)|0,f+=l>>>26,l&=67108863}r.words[h]=p,i=l,l=f}return i!==0?r.words[h]=i:r.length--,r.strip()}function I(m,e,r){var i=new k;return i.mulp(m,e,r)}n.prototype.mulTo=function(e,r){var i,f=this.length+e.length;return this.length===10&&e.length===10?i=A(this,e,r):f<63?i=B(this,e,r):f<1024?i=P(this,e,r):i=I(this,e,r),i};function k(m,e){this.x=m,this.y=e}k.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,f=0;f<e;f++)r[f]=this.revBin(f,i,e);return r},k.prototype.revBin=function(e,r,i){if(e===0||e===i-1)return e;for(var f=0,h=0;h<r;h++)f|=(e&1)<<r-h-1,e>>=1;return f},k.prototype.permute=function(e,r,i,f,h,l){for(var p=0;p<l;p++)f[p]=r[e[p]],h[p]=i[e[p]]},k.prototype.transform=function(e,r,i,f,h,l){this.permute(l,e,r,i,f,h);for(var p=1;p<h;p<<=1)for(var s=p<<1,t=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),S=0;S<h;S+=s)for(var O=t,H=u,Q=0;Q<p;Q++){var G=i[S+Q],R=f[S+Q],C=i[S+Q+p],$=f[S+Q+p],X=O*C-H*$;$=O*$+H*C,C=X,i[S+Q]=G+C,f[S+Q]=R+$,i[S+Q+p]=G-C,f[S+Q+p]=R-$,Q!==s&&(X=t*O-u*H,H=t*H+u*O,O=X)}},k.prototype.guessLen13b=function(e,r){var i=Math.max(r,e)|1,f=i&1,h=0;for(i=i/2|0;i;i=i>>>1)h++;return 1<<h+1+f},k.prototype.conjugate=function(e,r,i){if(!(i<=1))for(var f=0;f<i/2;f++){var h=e[f];e[f]=e[i-f-1],e[i-f-1]=h,h=r[f],r[f]=-r[i-f-1],r[i-f-1]=-h}},k.prototype.normalize13b=function(e,r){for(var i=0,f=0;f<r/2;f++){var h=Math.round(e[2*f+1]/r)*8192+Math.round(e[2*f]/r)+i;e[f]=h&67108863,h<67108864?i=0:i=h/67108864|0}return e},k.prototype.convert13b=function(e,r,i,f){for(var h=0,l=0;l<r;l++)h=h+(e[l]|0),i[2*l]=h&8191,h=h>>>13,i[2*l+1]=h&8191,h=h>>>13;for(l=2*r;l<f;++l)i[l]=0;o(h===0),o((h&-8192)===0)},k.prototype.stub=function(e){for(var r=new Array(e),i=0;i<e;i++)r[i]=0;return r},k.prototype.mulp=function(e,r,i){var f=2*this.guessLen13b(e.length,r.length),h=this.makeRBT(f),l=this.stub(f),p=new Array(f),s=new Array(f),t=new Array(f),u=new Array(f),S=new Array(f),O=new Array(f),H=i.words;H.length=f,this.convert13b(e.words,e.length,p,f),this.convert13b(r.words,r.length,u,f),this.transform(p,l,s,t,f,h),this.transform(u,l,S,O,f,h);for(var Q=0;Q<f;Q++){var G=s[Q]*S[Q]-t[Q]*O[Q];t[Q]=s[Q]*O[Q]+t[Q]*S[Q],s[Q]=G}return this.conjugate(s,t,f),this.transform(s,t,H,l,f,h),this.conjugate(H,l,f),this.normalize13b(H,f),i.negative=e.negative^r.negative,i.length=e.length+r.length,i.strip()},n.prototype.mul=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),this.mulTo(e,r)},n.prototype.mulf=function(e){var r=new n(null);return r.words=new Array(this.length+e.length),I(this,e,r)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){o(typeof e=="number"),o(e<67108864);for(var r=0,i=0;i<this.length;i++){var f=(this.words[i]|0)*e,h=(f&67108863)+(r&67108863);r>>=26,r+=f/67108864|0,r+=h>>>26,this.words[i]=h&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=E(e);if(r.length===0)return new n(1);for(var i=this,f=0;f<r.length&&r[f]===0;f++,i=i.sqr());if(++f<r.length)for(var h=i.sqr();f<r.length;f++,h=h.sqr())r[f]!==0&&(i=i.mul(h));return i},n.prototype.iushln=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r,h;if(r!==0){var l=0;for(h=0;h<this.length;h++){var p=this.words[h]&f,s=(this.words[h]|0)-p<<r;this.words[h]=s|l,l=p>>>26-r}l&&(this.words[h]=l,this.length++)}if(i!==0){for(h=this.length-1;h>=0;h--)this.words[h+i]=this.words[h];for(h=0;h<i;h++)this.words[h]=0;this.length+=i}return this.strip()},n.prototype.ishln=function(e){return o(this.negative===0),this.iushln(e)},n.prototype.iushrn=function(e,r,i){o(typeof e=="number"&&e>=0);var f;r?f=(r-r%26)/26:f=0;var h=e%26,l=Math.min((e-h)/26,this.length),p=67108863^67108863>>>h<<h,s=i;if(f-=l,f=Math.max(0,f),s){for(var t=0;t<l;t++)s.words[t]=this.words[t];s.length=l}if(l!==0)if(this.length>l)for(this.length-=l,t=0;t<this.length;t++)this.words[t]=this.words[t+l];else this.words[0]=0,this.length=1;var u=0;for(t=this.length-1;t>=0&&(u!==0||t>=f);t--){var S=this.words[t]|0;this.words[t]=u<<26-h|S>>>h,u=S&p}return s&&u!==0&&(s.words[s.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return o(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return!1;var h=this.words[i];return!!(h&f)},n.prototype.imaskn=function(e){o(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var f=67108863^67108863>>>r<<r;this.words[this.length-1]&=f}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return o(typeof e=="number"),o(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(o(typeof e=="number"),o(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,r,i){var f=e.length+i,h;this._expand(f);var l,p=0;for(h=0;h<e.length;h++){l=(this.words[h+i]|0)+p;var s=(e.words[h]|0)*r;l-=s&67108863,p=(l>>26)-(s/67108864|0),this.words[h+i]=l&67108863}for(;h<this.length-i;h++)l=(this.words[h+i]|0)+p,p=l>>26,this.words[h+i]=l&67108863;if(p===0)return this.strip();for(o(p===-1),p=0,h=0;h<this.length;h++)l=-(this.words[h]|0)+p,p=l>>26,this.words[h]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,f=this.clone(),h=e,l=h.words[h.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(h=h.ushln(i),f.iushln(i),l=h.words[h.length-1]|0);var s=f.length-h.length,t;if(r!=="mod"){t=new n(null),t.length=s+1,t.words=new Array(t.length);for(var u=0;u<t.length;u++)t.words[u]=0}var S=f.clone()._ishlnsubmul(h,1,s);S.negative===0&&(f=S,t&&(t.words[s]=1));for(var O=s-1;O>=0;O--){var H=(f.words[h.length+O]|0)*67108864+(f.words[h.length+O-1]|0);for(H=Math.min(H/l|0,67108863),f._ishlnsubmul(h,H,O);f.negative!==0;)H--,f.negative=0,f._ishlnsubmul(h,1,O),f.isZero()||(f.negative^=1);t&&(t.words[O]=H)}return t&&t.strip(),f.strip(),r!=="div"&&i!==0&&f.iushrn(i),{div:t||null,mod:f}},n.prototype.divmod=function(e,r,i){if(o(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var f,h,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(f=l.div.neg()),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.iadd(e)),{div:f,mod:h}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(f=l.div.neg()),{div:f,mod:l.mod}):(this.negative&e.negative)!==0?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(h=l.mod.neg(),i&&h.negative!==0&&h.isub(e)),{div:l.div,mod:h}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,f=e.ushrn(1),h=e.andln(1),l=i.cmp(f);return l<0||h===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){o(e<=67108863);for(var r=(1<<26)%e,i=0,f=this.length-1;f>=0;f--)i=(r*i+(this.words[f]|0))%e;return i},n.prototype.idivn=function(e){o(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var f=(this.words[i]|0)+r*67108864;this.words[i]=f/e|0,r=f%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=new n(0),p=new n(1),s=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++s;for(var t=i.clone(),u=r.clone();!r.isZero();){for(var S=0,O=1;(r.words[0]&O)===0&&S<26;++S,O<<=1);if(S>0)for(r.iushrn(S);S-- >0;)(f.isOdd()||h.isOdd())&&(f.iadd(t),h.isub(u)),f.iushrn(1),h.iushrn(1);for(var H=0,Q=1;(i.words[0]&Q)===0&&H<26;++H,Q<<=1);if(H>0)for(i.iushrn(H);H-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(u)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(l),h.isub(p)):(i.isub(r),l.isub(f),p.isub(h))}return{a:l,b:p,gcd:i.iushln(s)}},n.prototype._invmp=function(e){o(e.negative===0),o(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var f=new n(1),h=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,s=1;(r.words[0]&s)===0&&p<26;++p,s<<=1);if(p>0)for(r.iushrn(p);p-- >0;)f.isOdd()&&f.iadd(l),f.iushrn(1);for(var t=0,u=1;(i.words[0]&u)===0&&t<26;++t,u<<=1);if(t>0)for(i.iushrn(t);t-- >0;)h.isOdd()&&h.iadd(l),h.iushrn(1);r.cmp(i)>=0?(r.isub(i),f.isub(h)):(i.isub(r),h.isub(f))}var S;return r.cmpn(1)===0?S=f:S=h,S.cmpn(0)<0&&S.iadd(e),S},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var f=0;r.isEven()&&i.isEven();f++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var h=r.cmp(i);if(h<0){var l=r;r=i,i=l}else if(h===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(f)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){o(typeof e=="number");var r=e%26,i=(e-r)/26,f=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=f,this;for(var h=f,l=i;h!==0&&l<this.length;l++){var p=this.words[l]|0;p+=h,h=p>>>26,p&=67108863,this.words[l]=p}return h!==0&&(this.words[l]=h,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),o(e<=67108863,"Number is too big");var f=this.words[0]|0;i=f===e?0:f<e?-1:1}return this.negative!==0?-i|0:i},n.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var r=this.ucmp(e);return this.negative!==0?-r|0:r},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var f=this.words[i]|0,h=e.words[i]|0;if(f!==h){f<h?r=-1:f>h&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new J(e)},n.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var F={k256:null,p224:null,p192:null,p25519:null};function q(m,e){this.name=m,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},q.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var f=i<this.n?-1:r.ucmp(this.p);return f===0?(r.words[0]=0,r.length=1):f>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},q.prototype.split=function(e,r){e.iushrn(this.n,0,r)},q.prototype.imulK=function(e){return e.imul(this.k)};function L(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}x(L,q),L.prototype.split=function(e,r){for(var i=4194303,f=Math.min(e.length,9),h=0;h<f;h++)r.words[h]=e.words[h];if(r.length=f,e.length<=9){e.words[0]=0,e.length=1;return}var l=e.words[9];for(r.words[r.length++]=l&i,h=10;h<e.length;h++){var p=e.words[h]|0;e.words[h-10]=(p&i)<<4|l>>>22,l=p}l>>>=22,e.words[h-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i<e.length;i++){var f=e.words[i]|0;r+=f*977,e.words[i]=r&67108863,r=f*64+(r/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function V(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}x(V,q);function ee(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}x(ee,q);function ne(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}x(ne,q),ne.prototype.imulK=function(e){for(var r=0,i=0;i<e.length;i++){var f=(e.words[i]|0)*19+r,h=f&67108863;f>>>=26,e.words[i]=h,r=f}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(F[e])return F[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new V;else if(e==="p192")r=new ee;else if(e==="p25519")r=new ne;else throw new Error("Unknown prime "+e);return F[e]=r,r};function J(m){if(typeof m=="string"){var e=n._prime(m);this.m=e.p,this.prime=e}else o(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}J.prototype._verify1=function(e){o(e.negative===0,"red works only with positives"),o(e.red,"red works only with red numbers")},J.prototype._verify2=function(e,r){o((e.negative|r.negative)===0,"red works only with positives"),o(e.red&&e.red===r.red,"red works only with red numbers")},J.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},J.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},J.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},J.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},J.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},J.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},J.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},J.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},J.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},J.prototype.isqr=function(e){return this.imul(e,e.clone())},J.prototype.sqr=function(e){return this.mul(e,e)},J.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var f=this.m.subn(1),h=0;!f.isZero()&&f.andln(1)===0;)h++,f.iushrn(1);o(!f.isZero());var l=new n(1).toRed(this),p=l.redNeg(),s=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,s).cmp(p)!==0;)t.redIAdd(p);for(var u=this.pow(t,f),S=this.pow(e,f.addn(1).iushrn(1)),O=this.pow(e,f),H=h;O.cmp(l)!==0;){for(var Q=O,G=0;Q.cmp(l)!==0;G++)Q=Q.redSqr();o(G<H);var R=this.pow(u,new n(1).iushln(H-G-1));S=S.redMul(R),u=R.redSqr(),O=O.redMul(u),H=G}return S},J.prototype.invm=function(e){var r=e._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},J.prototype.pow=function(e,r){if(r.isZero())return new n(1).toRed(this);if(r.cmpn(1)===0)return e.clone();var i=4,f=new Array(1<<i);f[0]=new n(1).toRed(this),f[1]=e;for(var h=2;h<f.length;h++)f[h]=this.mul(f[h-1],e);var l=f[0],p=0,s=0,t=r.bitLength()%26;for(t===0&&(t=26),h=r.length-1;h>=0;h--){for(var u=r.words[h],S=t-1;S>=0;S--){var O=u>>S&1;if(l!==f[0]&&(l=this.sqr(l)),O===0&&p===0){s=0;continue}p<<=1,p|=O,s++,!(s!==i&&(h!==0||S!==0))&&(l=this.mul(l,f[p]),s=0,p=0)}t=26}return l},J.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},J.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new ue(e)};function ue(m){J.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}x(ue,J),ue.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},ue.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},ue.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),f=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(f).iushrn(this.shift),l=h;return h.cmp(this.m)>=0?l=h.isub(this.m):h.cmpn(0)<0&&(l=h.iadd(this.m)),l._forceRed(this)},ue.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(M,M1)}(Pi)),Pi.exports}var js,Sl;function El(){if(Sl)return js;Sl=1;var M=zs(),a=tt().Buffer;function c(o,x){return a.from(o.toRed(M.mont(x.modulus)).redPow(new M(x.publicExponent)).fromRed().toArray())}return js=c,js}var Vs,Bl;function x1(){if(Bl)return Vs;Bl=1;var M=Oi(),a=yr(),c=Kr(),o=wl(),x=xl(),n=zs(),g=El(),y=Gf(),b=tt().Buffer;Vs=function(E,B,A){var P;E.padding?P=E.padding:A?P=1:P=4;var I=M(E),k;if(P===4)k=v(I,B);else if(P===1)k=d(I,B,A);else if(P===3){if(k=new n(B),k.cmp(I.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return A?y(k,I):g(k,I)};function v(_,E){var B=_.modulus.byteLength(),A=E.length,P=c("sha1").update(b.alloc(0)).digest(),I=P.length,k=2*I;if(A>B-k-2)throw new Error("message too long");var F=b.alloc(B-A-k-2),q=B-I-1,L=a(I),V=x(b.concat([P,F,b.alloc(1,1),E],q),o(L,q)),ee=x(L,o(V,I));return new n(b.concat([b.alloc(1),ee,V],B))}function d(_,E,B){var A=E.length,P=_.modulus.byteLength();if(A>P-11)throw new Error("message too long");var I;return B?I=b.alloc(P-A-3,255):I=w(P-A-3),new n(b.concat([b.from([0,B?1:2]),I,b.alloc(1),E],P))}function w(_){for(var E=b.allocUnsafe(_),B=0,A=a(_*2),P=0,I;B<_;)P===A.length&&(A=a(_*2),P=0),I=A[P++],I&&(E[B++]=I);return E}return Vs}var $s,Al;function _1(){if(Al)return $s;Al=1;var M=Oi(),a=wl(),c=xl(),o=zs(),x=Gf(),n=Kr(),g=El(),y=tt().Buffer;$s=function(_,E,B){var A;_.padding?A=_.padding:B?A=1:A=4;var P=M(_),I=P.modulus.byteLength();if(E.length>I||new o(E).cmp(P.modulus)>=0)throw new Error("decryption error");var k;B?k=g(new o(E),P):k=x(E,P);var F=y.alloc(I-k.length);if(k=y.concat([F,k],I),A===4)return b(P,k);if(A===1)return v(P,k,B);if(A===3)return k;throw new Error("unknown padding")};function b(w,_){var E=w.modulus.byteLength(),B=n("sha1").update(y.alloc(0)).digest(),A=B.length;if(_[0]!==0)throw new Error("decryption error");var P=_.slice(1,A+1),I=_.slice(A+1),k=c(P,a(I,A)),F=c(I,a(k,E-A-1));if(d(B,F.slice(0,A)))throw new Error("decryption error");for(var q=A;F[q]===0;)q++;if(F[q++]!==1)throw new Error("decryption error");return F.slice(q)}function v(w,_,E){for(var B=_.slice(0,2),A=2,P=0;_[A++]!==0;)if(A>=_.length){P++;break}var I=_.slice(2,A-1);if((B.toString("hex")!=="0002"&&!E||B.toString("hex")!=="0001"&&E)&&P++,I.length<8&&P++,P)throw new Error("decryption error");return _.slice(A)}function d(w,_){w=y.from(w),_=y.from(_);var E=0,B=w.length;w.length!==_.length&&(E++,B=Math.min(w.length,_.length));for(var A=-1;++A<B;)E+=w[A]^_[A];return E}return $s}var Rl;function S1(){return Rl||(Rl=1,function(M){M.publicEncrypt=x1(),M.privateDecrypt=_1(),M.privateEncrypt=function(c,o){return M.publicEncrypt(c,o,!0)},M.publicDecrypt=function(c,o){return M.privateDecrypt(c,o,!0)}}(Us)),Us}var qr={},Il;function E1(){if(Il)return qr;Il=1;function M(){throw new Error(`secure random number generation not supported by this browser
25
- use chrome, FireFox or Internet Explorer 11`)}var a=tt(),c=yr(),o=a.Buffer,x=a.kMaxLength,n=et.crypto||et.msCrypto,g=Math.pow(2,32)-1;function y(_,E){if(typeof _!="number"||_!==_)throw new TypeError("offset must be a number");if(_>g||_<0)throw new TypeError("offset must be a uint32");if(_>x||_>E)throw new RangeError("offset out of range")}function b(_,E,B){if(typeof _!="number"||_!==_)throw new TypeError("size must be a number");if(_>g||_<0)throw new TypeError("size must be a uint32");if(_+E>B||_>x)throw new RangeError("buffer too small")}n&&n.getRandomValues||!je.browser?(qr.randomFill=v,qr.randomFillSync=w):(qr.randomFill=M,qr.randomFillSync=M);function v(_,E,B,A){if(!o.isBuffer(_)&&!(_ instanceof et.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof E=="function")A=E,E=0,B=_.length;else if(typeof B=="function")A=B,B=_.length-E;else if(typeof A!="function")throw new TypeError('"cb" argument must be a function');return y(E,_.length),b(B,E,_.length),d(_,E,B,A)}function d(_,E,B,A){if(je.browser){var P=_.buffer,I=new Uint8Array(P,E,B);if(n.getRandomValues(I),A){je.nextTick(function(){A(null,_)});return}return _}if(A){c(B,function(F,q){if(F)return A(F);q.copy(_,E),A(null,_)});return}var k=c(B);return k.copy(_,E),_}function w(_,E,B){if(typeof E>"u"&&(E=0),!o.isBuffer(_)&&!(_ instanceof et.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return y(E,_.length),B===void 0&&(B=_.length-E),b(B,E,_.length),d(_,E,B)}return qr}var Ol;function B1(){if(Ol)return it;Ol=1,it.randomBytes=it.rng=it.pseudoRandomBytes=it.prng=yr(),it.createHash=it.Hash=Kr(),it.createHmac=it.Hmac=V0();var M=tp(),a=Object.keys(M),c=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(a);it.getHashes=function(){return c};var o=of();it.pbkdf2=o.pbkdf2,it.pbkdf2Sync=o.pbkdf2Sync;var x=Bp();it.Cipher=x.Cipher,it.createCipher=x.createCipher,it.Cipheriv=x.Cipheriv,it.createCipheriv=x.createCipheriv,it.Decipher=x.Decipher,it.createDecipher=x.createDecipher,it.Decipheriv=x.Decipheriv,it.createDecipheriv=x.createDecipheriv,it.getCiphers=x.getCiphers,it.listCiphers=x.listCiphers;var n=Pp();it.DiffieHellmanGroup=n.DiffieHellmanGroup,it.createDiffieHellmanGroup=n.createDiffieHellmanGroup,it.getDiffieHellman=n.getDiffieHellman,it.createDiffieHellman=n.createDiffieHellman,it.DiffieHellman=n.DiffieHellman;var g=b1();it.createSign=g.createSign,it.Sign=g.Sign,it.createVerify=g.createVerify,it.Verify=g.Verify,it.createECDH=w1();var y=S1();it.publicEncrypt=y.publicEncrypt,it.privateEncrypt=y.privateEncrypt,it.publicDecrypt=y.publicDecrypt,it.privateDecrypt=y.privateDecrypt;var b=E1();return it.randomFill=b.randomFill,it.randomFillSync=b.randomFillSync,it.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
26
- we accept pull requests
27
- https://github.com/browserify/crypto-browserify`)},it.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},it}var kl;function Yr(){if(kl)return ii.exports;kl=1;var M;ii.exports=function(x){return M||(M=new a(null)),M.generate(x)};function a(o){this.rand=o}if(ii.exports.Rand=a,a.prototype.generate=function(x){return this._rand(x)},a.prototype._rand=function(x){if(this.rand.getBytes)return this.rand.getBytes(x);for(var n=new Uint8Array(x),g=0;g<n.length;g++)n[g]=this.rand.getByte();return n},typeof self=="object")self.crypto&&self.crypto.getRandomValues?a.prototype._rand=function(x){var n=new Uint8Array(x);return self.crypto.getRandomValues(n),n}:self.msCrypto&&self.msCrypto.getRandomValues?a.prototype._rand=function(x){var n=new Uint8Array(x);return self.msCrypto.getRandomValues(n),n}:typeof window=="object"&&(a.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var c=B1();if(typeof c.randomBytes!="function")throw new Error("Not supported");a.prototype._rand=function(x){return c.randomBytes(x)}}catch{}return ii.exports}var Gs={},Ws,Pl;function Tl(){if(Pl)return Ws;Pl=1;var M=er(),a=br(),c=a.getNAF,o=a.getJSF,x=a.assert;function n(y,b){this.type=y,this.p=new M(b.p,16),this.red=b.prime?M.red(b.prime):M.mont(this.p),this.zero=new M(0).toRed(this.red),this.one=new M(1).toRed(this.red),this.two=new M(2).toRed(this.red),this.n=b.n&&new M(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var v=this.n&&this.p.div(this.n);!v||v.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Ws=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(b,v){x(b.precomputed);var d=b._getDoubles(),w=c(v,1,this._bitLength),_=(1<<d.step+1)-(d.step%2===0?2:1);_/=3;for(var E=[],B=0;B<w.length;B+=d.step){for(var A=0,v=B+d.step-1;v>=B;v--)A=(A<<1)+w[v];E.push(A)}for(var P=this.jpoint(null,null,null),I=this.jpoint(null,null,null),k=_;k>0;k--){for(var B=0;B<E.length;B++){var A=E[B];A===k?I=I.mixedAdd(d.points[B]):A===-k&&(I=I.mixedAdd(d.points[B].neg()))}P=P.add(I)}return P.toP()},n.prototype._wnafMul=function(b,v){var d=4,w=b._getNAFPoints(d);d=w.wnd;for(var _=w.points,E=c(v,d,this._bitLength),B=this.jpoint(null,null,null),A=E.length-1;A>=0;A--){for(var v=0;A>=0&&E[A]===0;A--)v++;if(A>=0&&v++,B=B.dblp(v),A<0)break;var P=E[A];x(P!==0),b.type==="affine"?P>0?B=B.mixedAdd(_[P-1>>1]):B=B.mixedAdd(_[-P-1>>1].neg()):P>0?B=B.add(_[P-1>>1]):B=B.add(_[-P-1>>1].neg())}return b.type==="affine"?B.toP():B},n.prototype._wnafMulAdd=function(b,v,d,w,_){for(var E=this._wnafT1,B=this._wnafT2,A=this._wnafT3,P=0,I=0;I<w;I++){var k=v[I],F=k._getNAFPoints(b);E[I]=F.wnd,B[I]=F.points}for(var I=w-1;I>=1;I-=2){var q=I-1,L=I;if(E[q]!==1||E[L]!==1){A[q]=c(d[q],E[q],this._bitLength),A[L]=c(d[L],E[L],this._bitLength),P=Math.max(A[q].length,P),P=Math.max(A[L].length,P);continue}var V=[v[q],null,null,v[L]];v[q].y.cmp(v[L].y)===0?(V[1]=v[q].add(v[L]),V[2]=v[q].toJ().mixedAdd(v[L].neg())):v[q].y.cmp(v[L].y.redNeg())===0?(V[1]=v[q].toJ().mixedAdd(v[L]),V[2]=v[q].add(v[L].neg())):(V[1]=v[q].toJ().mixedAdd(v[L]),V[2]=v[q].toJ().mixedAdd(v[L].neg()));var ee=[-3,-1,-5,-7,0,7,5,1,3],ne=o(d[q],d[L]);P=Math.max(ne[0].length,P),A[q]=new Array(P),A[L]=new Array(P);for(var J=0;J<P;J++){var ue=ne[0][J]|0,m=ne[1][J]|0;A[q][J]=ee[(ue+1)*3+(m+1)],A[L][J]=0,B[q]=V}}for(var e=this.jpoint(null,null,null),r=this._wnafT4,I=P;I>=0;I--){for(var i=0;I>=0;){for(var f=!0,J=0;J<w;J++)r[J]=A[J][I]|0,r[J]!==0&&(f=!1);if(!f)break;i++,I--}if(I>=0&&i++,e=e.dblp(i),I<0)break;for(var J=0;J<w;J++){var h=r[J],k;h!==0&&(h>0?k=B[J][h-1>>1]:h<0&&(k=B[J][-h-1>>1].neg()),k.type==="affine"?e=e.mixedAdd(k):e=e.add(k))}}for(var I=0;I<w;I++)B[I]=null;return _?e:e.toP()};function g(y,b){this.curve=y,this.type=b,this.precomputed=null}return n.BasePoint=g,g.prototype.eq=function(){throw new Error("Not implemented")},g.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(b,v){b=a.toArray(b,v);var d=this.p.byteLength();if((b[0]===4||b[0]===6||b[0]===7)&&b.length-1===2*d){b[0]===6?x(b[b.length-1]%2===0):b[0]===7&&x(b[b.length-1]%2===1);var w=this.point(b.slice(1,1+d),b.slice(1+d,1+2*d));return w}else if((b[0]===2||b[0]===3)&&b.length-1===d)return this.pointFromX(b.slice(1,1+d),b[0]===3);throw new Error("Unknown point format")},g.prototype.encodeCompressed=function(b){return this.encode(b,!0)},g.prototype._encode=function(b){var v=this.curve.p.byteLength(),d=this.getX().toArray("be",v);return b?[this.getY().isEven()?2:3].concat(d):[4].concat(d,this.getY().toArray("be",v))},g.prototype.encode=function(b,v){return a.encode(this._encode(v),b)},g.prototype.precompute=function(b){if(this.precomputed)return this;var v={doubles:null,naf:null,beta:null};return v.naf=this._getNAFPoints(8),v.doubles=this._getDoubles(4,b),v.beta=this._getBeta(),this.precomputed=v,this},g.prototype._hasDoubles=function(b){if(!this.precomputed)return!1;var v=this.precomputed.doubles;return v?v.points.length>=Math.ceil((b.bitLength()+1)/v.step):!1},g.prototype._getDoubles=function(b,v){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var d=[this],w=this,_=0;_<v;_+=b){for(var E=0;E<b;E++)w=w.dbl();d.push(w)}return{step:b,points:d}},g.prototype._getNAFPoints=function(b){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var v=[this],d=(1<<b)-1,w=d===1?null:this.dbl(),_=1;_<d;_++)v[_]=v[_-1].add(w);return{wnd:b,points:v}},g.prototype._getBeta=function(){return null},g.prototype.dblp=function(b){for(var v=this,d=0;d<b;d++)v=v.dbl();return v},Ws}var Ys,Nl;function A1(){if(Nl)return Ys;Nl=1;var M=br(),a=er(),c=Ye(),o=Tl(),x=M.assert;function n(b){o.call(this,"short",b),this.a=new a(b.a,16).toRed(this.red),this.b=new a(b.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(b),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}c(n,o),Ys=n,n.prototype._getEndomorphism=function(v){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var d,w;if(v.beta)d=new a(v.beta,16).toRed(this.red);else{var _=this._getEndoRoots(this.p);d=_[0].cmp(_[1])<0?_[0]:_[1],d=d.toRed(this.red)}if(v.lambda)w=new a(v.lambda,16);else{var E=this._getEndoRoots(this.n);this.g.mul(E[0]).x.cmp(this.g.x.redMul(d))===0?w=E[0]:(w=E[1],x(this.g.mul(w).x.cmp(this.g.x.redMul(d))===0))}var B;return v.basis?B=v.basis.map(function(A){return{a:new a(A.a,16),b:new a(A.b,16)}}):B=this._getEndoBasis(w),{beta:d,lambda:w,basis:B}}},n.prototype._getEndoRoots=function(v){var d=v===this.p?this.red:a.mont(v),w=new a(2).toRed(d).redInvm(),_=w.redNeg(),E=new a(3).toRed(d).redNeg().redSqrt().redMul(w),B=_.redAdd(E).fromRed(),A=_.redSub(E).fromRed();return[B,A]},n.prototype._getEndoBasis=function(v){for(var d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),w=v,_=this.n.clone(),E=new a(1),B=new a(0),A=new a(0),P=new a(1),I,k,F,q,L,V,ee,ne=0,J,ue;w.cmpn(0)!==0;){var m=_.div(w);J=_.sub(m.mul(w)),ue=A.sub(m.mul(E));var e=P.sub(m.mul(B));if(!F&&J.cmp(d)<0)I=ee.neg(),k=E,F=J.neg(),q=ue;else if(F&&++ne===2)break;ee=J,_=w,w=J,A=E,E=ue,P=B,B=e}L=J.neg(),V=ue;var r=F.sqr().add(q.sqr()),i=L.sqr().add(V.sqr());return i.cmp(r)>=0&&(L=I,V=k),F.negative&&(F=F.neg(),q=q.neg()),L.negative&&(L=L.neg(),V=V.neg()),[{a:F,b:q},{a:L,b:V}]},n.prototype._endoSplit=function(v){var d=this.endo.basis,w=d[0],_=d[1],E=_.b.mul(v).divRound(this.n),B=w.b.neg().mul(v).divRound(this.n),A=E.mul(w.a),P=B.mul(_.a),I=E.mul(w.b),k=B.mul(_.b),F=v.sub(A).sub(P),q=I.add(k).neg();return{k1:F,k2:q}},n.prototype.pointFromX=function(v,d){v=new a(v,16),v.red||(v=v.toRed(this.red));var w=v.redSqr().redMul(v).redIAdd(v.redMul(this.a)).redIAdd(this.b),_=w.redSqrt();if(_.redSqr().redSub(w).cmp(this.zero)!==0)throw new Error("invalid point");var E=_.fromRed().isOdd();return(d&&!E||!d&&E)&&(_=_.redNeg()),this.point(v,_)},n.prototype.validate=function(v){if(v.inf)return!0;var d=v.x,w=v.y,_=this.a.redMul(d),E=d.redSqr().redMul(d).redIAdd(_).redIAdd(this.b);return w.redSqr().redISub(E).cmpn(0)===0},n.prototype._endoWnafMulAdd=function(v,d,w){for(var _=this._endoWnafT1,E=this._endoWnafT2,B=0;B<v.length;B++){var A=this._endoSplit(d[B]),P=v[B],I=P._getBeta();A.k1.negative&&(A.k1.ineg(),P=P.neg(!0)),A.k2.negative&&(A.k2.ineg(),I=I.neg(!0)),_[B*2]=P,_[B*2+1]=I,E[B*2]=A.k1,E[B*2+1]=A.k2}for(var k=this._wnafMulAdd(1,_,E,B*2,w),F=0;F<B*2;F++)_[F]=null,E[F]=null;return k};function g(b,v,d,w){o.BasePoint.call(this,b,"affine"),v===null&&d===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(v,16),this.y=new a(d,16),w&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}c(g,o.BasePoint),n.prototype.point=function(v,d,w){return new g(this,v,d,w)},n.prototype.pointFromJSON=function(v,d){return g.fromJSON(this,v,d)},g.prototype._getBeta=function(){if(this.curve.endo){var v=this.precomputed;if(v&&v.beta)return v.beta;var d=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(v){var w=this.curve,_=function(E){return w.point(E.x.redMul(w.endo.beta),E.y)};v.beta=d,d.precomputed={beta:null,naf:v.naf&&{wnd:v.naf.wnd,points:v.naf.points.map(_)},doubles:v.doubles&&{step:v.doubles.step,points:v.doubles.points.map(_)}}}return d}},g.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},g.fromJSON=function(v,d,w){typeof d=="string"&&(d=JSON.parse(d));var _=v.point(d[0],d[1],w);if(!d[2])return _;function E(A){return v.point(A[0],A[1],w)}var B=d[2];return _.precomputed={beta:null,doubles:B.doubles&&{step:B.doubles.step,points:[_].concat(B.doubles.points.map(E))},naf:B.naf&&{wnd:B.naf.wnd,points:[_].concat(B.naf.points.map(E))}},_},g.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},g.prototype.isInfinity=function(){return this.inf},g.prototype.add=function(v){if(this.inf)return v;if(v.inf)return this;if(this.eq(v))return this.dbl();if(this.neg().eq(v))return this.curve.point(null,null);if(this.x.cmp(v.x)===0)return this.curve.point(null,null);var d=this.y.redSub(v.y);d.cmpn(0)!==0&&(d=d.redMul(this.x.redSub(v.x).redInvm()));var w=d.redSqr().redISub(this.x).redISub(v.x),_=d.redMul(this.x.redSub(w)).redISub(this.y);return this.curve.point(w,_)},g.prototype.dbl=function(){if(this.inf)return this;var v=this.y.redAdd(this.y);if(v.cmpn(0)===0)return this.curve.point(null,null);var d=this.curve.a,w=this.x.redSqr(),_=v.redInvm(),E=w.redAdd(w).redIAdd(w).redIAdd(d).redMul(_),B=E.redSqr().redISub(this.x.redAdd(this.x)),A=E.redMul(this.x.redSub(B)).redISub(this.y);return this.curve.point(B,A)},g.prototype.getX=function(){return this.x.fromRed()},g.prototype.getY=function(){return this.y.fromRed()},g.prototype.mul=function(v){return v=new a(v,16),this.isInfinity()?this:this._hasDoubles(v)?this.curve._fixedNafMul(this,v):this.curve.endo?this.curve._endoWnafMulAdd([this],[v]):this.curve._wnafMul(this,v)},g.prototype.mulAdd=function(v,d,w){var _=[this,d],E=[v,w];return this.curve.endo?this.curve._endoWnafMulAdd(_,E):this.curve._wnafMulAdd(1,_,E,2)},g.prototype.jmulAdd=function(v,d,w){var _=[this,d],E=[v,w];return this.curve.endo?this.curve._endoWnafMulAdd(_,E,!0):this.curve._wnafMulAdd(1,_,E,2,!0)},g.prototype.eq=function(v){return this===v||this.inf===v.inf&&(this.inf||this.x.cmp(v.x)===0&&this.y.cmp(v.y)===0)},g.prototype.neg=function(v){if(this.inf)return this;var d=this.curve.point(this.x,this.y.redNeg());if(v&&this.precomputed){var w=this.precomputed,_=function(E){return E.neg()};d.precomputed={naf:w.naf&&{wnd:w.naf.wnd,points:w.naf.points.map(_)},doubles:w.doubles&&{step:w.doubles.step,points:w.doubles.points.map(_)}}}return d},g.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var v=this.curve.jpoint(this.x,this.y,this.curve.one);return v};function y(b,v,d,w){o.BasePoint.call(this,b,"jacobian"),v===null&&d===null&&w===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(v,16),this.y=new a(d,16),this.z=new a(w,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return c(y,o.BasePoint),n.prototype.jpoint=function(v,d,w){return new y(this,v,d,w)},y.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var v=this.z.redInvm(),d=v.redSqr(),w=this.x.redMul(d),_=this.y.redMul(d).redMul(v);return this.curve.point(w,_)},y.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},y.prototype.add=function(v){if(this.isInfinity())return v;if(v.isInfinity())return this;var d=v.z.redSqr(),w=this.z.redSqr(),_=this.x.redMul(d),E=v.x.redMul(w),B=this.y.redMul(d.redMul(v.z)),A=v.y.redMul(w.redMul(this.z)),P=_.redSub(E),I=B.redSub(A);if(P.cmpn(0)===0)return I.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var k=P.redSqr(),F=k.redMul(P),q=_.redMul(k),L=I.redSqr().redIAdd(F).redISub(q).redISub(q),V=I.redMul(q.redISub(L)).redISub(B.redMul(F)),ee=this.z.redMul(v.z).redMul(P);return this.curve.jpoint(L,V,ee)},y.prototype.mixedAdd=function(v){if(this.isInfinity())return v.toJ();if(v.isInfinity())return this;var d=this.z.redSqr(),w=this.x,_=v.x.redMul(d),E=this.y,B=v.y.redMul(d).redMul(this.z),A=w.redSub(_),P=E.redSub(B);if(A.cmpn(0)===0)return P.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var I=A.redSqr(),k=I.redMul(A),F=w.redMul(I),q=P.redSqr().redIAdd(k).redISub(F).redISub(F),L=P.redMul(F.redISub(q)).redISub(E.redMul(k)),V=this.z.redMul(A);return this.curve.jpoint(q,L,V)},y.prototype.dblp=function(v){if(v===0)return this;if(this.isInfinity())return this;if(!v)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var d=this,w=0;w<v;w++)d=d.dbl();return d}for(var _=this.curve.a,E=this.curve.tinv,B=this.x,A=this.y,P=this.z,I=P.redSqr().redSqr(),k=A.redAdd(A),w=0;w<v;w++){var F=B.redSqr(),q=k.redSqr(),L=q.redSqr(),V=F.redAdd(F).redIAdd(F).redIAdd(_.redMul(I)),ee=B.redMul(q),ne=V.redSqr().redISub(ee.redAdd(ee)),J=ee.redISub(ne),ue=V.redMul(J);ue=ue.redIAdd(ue).redISub(L);var m=k.redMul(P);w+1<v&&(I=I.redMul(L)),B=ne,P=m,k=ue}return this.curve.jpoint(B,k.redMul(E),P)},y.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},y.prototype._zeroDbl=function(){var v,d,w;if(this.zOne){var _=this.x.redSqr(),E=this.y.redSqr(),B=E.redSqr(),A=this.x.redAdd(E).redSqr().redISub(_).redISub(B);A=A.redIAdd(A);var P=_.redAdd(_).redIAdd(_),I=P.redSqr().redISub(A).redISub(A),k=B.redIAdd(B);k=k.redIAdd(k),k=k.redIAdd(k),v=I,d=P.redMul(A.redISub(I)).redISub(k),w=this.y.redAdd(this.y)}else{var F=this.x.redSqr(),q=this.y.redSqr(),L=q.redSqr(),V=this.x.redAdd(q).redSqr().redISub(F).redISub(L);V=V.redIAdd(V);var ee=F.redAdd(F).redIAdd(F),ne=ee.redSqr(),J=L.redIAdd(L);J=J.redIAdd(J),J=J.redIAdd(J),v=ne.redISub(V).redISub(V),d=ee.redMul(V.redISub(v)).redISub(J),w=this.y.redMul(this.z),w=w.redIAdd(w)}return this.curve.jpoint(v,d,w)},y.prototype._threeDbl=function(){var v,d,w;if(this.zOne){var _=this.x.redSqr(),E=this.y.redSqr(),B=E.redSqr(),A=this.x.redAdd(E).redSqr().redISub(_).redISub(B);A=A.redIAdd(A);var P=_.redAdd(_).redIAdd(_).redIAdd(this.curve.a),I=P.redSqr().redISub(A).redISub(A);v=I;var k=B.redIAdd(B);k=k.redIAdd(k),k=k.redIAdd(k),d=P.redMul(A.redISub(I)).redISub(k),w=this.y.redAdd(this.y)}else{var F=this.z.redSqr(),q=this.y.redSqr(),L=this.x.redMul(q),V=this.x.redSub(F).redMul(this.x.redAdd(F));V=V.redAdd(V).redIAdd(V);var ee=L.redIAdd(L);ee=ee.redIAdd(ee);var ne=ee.redAdd(ee);v=V.redSqr().redISub(ne),w=this.y.redAdd(this.z).redSqr().redISub(q).redISub(F);var J=q.redSqr();J=J.redIAdd(J),J=J.redIAdd(J),J=J.redIAdd(J),d=V.redMul(ee.redISub(v)).redISub(J)}return this.curve.jpoint(v,d,w)},y.prototype._dbl=function(){var v=this.curve.a,d=this.x,w=this.y,_=this.z,E=_.redSqr().redSqr(),B=d.redSqr(),A=w.redSqr(),P=B.redAdd(B).redIAdd(B).redIAdd(v.redMul(E)),I=d.redAdd(d);I=I.redIAdd(I);var k=I.redMul(A),F=P.redSqr().redISub(k.redAdd(k)),q=k.redISub(F),L=A.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L);var V=P.redMul(q).redISub(L),ee=w.redAdd(w).redMul(_);return this.curve.jpoint(F,V,ee)},y.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var v=this.x.redSqr(),d=this.y.redSqr(),w=this.z.redSqr(),_=d.redSqr(),E=v.redAdd(v).redIAdd(v),B=E.redSqr(),A=this.x.redAdd(d).redSqr().redISub(v).redISub(_);A=A.redIAdd(A),A=A.redAdd(A).redIAdd(A),A=A.redISub(B);var P=A.redSqr(),I=_.redIAdd(_);I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var k=E.redIAdd(A).redSqr().redISub(B).redISub(P).redISub(I),F=d.redMul(k);F=F.redIAdd(F),F=F.redIAdd(F);var q=this.x.redMul(P).redISub(F);q=q.redIAdd(q),q=q.redIAdd(q);var L=this.y.redMul(k.redMul(I.redISub(k)).redISub(A.redMul(P)));L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L);var V=this.z.redAdd(A).redSqr().redISub(w).redISub(P);return this.curve.jpoint(q,L,V)},y.prototype.mul=function(v,d){return v=new a(v,d),this.curve._wnafMul(this,v)},y.prototype.eq=function(v){if(v.type==="affine")return this.eq(v.toJ());if(this===v)return!0;var d=this.z.redSqr(),w=v.z.redSqr();if(this.x.redMul(w).redISub(v.x.redMul(d)).cmpn(0)!==0)return!1;var _=d.redMul(this.z),E=w.redMul(v.z);return this.y.redMul(E).redISub(v.y.redMul(_)).cmpn(0)===0},y.prototype.eqXToP=function(v){var d=this.z.redSqr(),w=v.toRed(this.curve.red).redMul(d);if(this.x.cmp(w)===0)return!0;for(var _=v.clone(),E=this.curve.redN.redMul(d);;){if(_.iadd(this.curve.n),_.cmp(this.curve.p)>=0)return!1;if(w.redIAdd(E),this.x.cmp(w)===0)return!0}},y.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},y.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Ys}var Cl;function ql(){return Cl||(Cl=1,function(M){var a=M;a.base=Tl(),a.short=A1()}(Gs)),Gs}var Js={},Zs,Ll;function R1(){return Ll||(Ll=1,Zs={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),Zs}var Fl;function Dl(){return Fl||(Fl=1,function(M){var a=M,c=$r(),o=ql(),x=br(),n=x.assert;function g(v){if(v.type!=="short")throw new Error("invalid curve type");this.curve=new o.short(v),this.g=this.curve.g,this.n=this.curve.n,this.hash=v.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}a.PresetCurve=g;function y(v,d){Object.defineProperty(a,v,{configurable:!0,enumerable:!0,get:function(){var w=new g(d);return Object.defineProperty(a,v,{configurable:!0,enumerable:!0,value:w}),w}})}var b;try{b=R1()}catch{b=void 0}y("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:c.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",b]})}(Js)),Js}var Xs,Ul;function I1(){if(Ul)return Xs;Ul=1;var M=er(),a=br(),c=a.assert;function o(x,n){this.ec=x,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}return Xs=o,o.fromPublic=function(n,g,y){return g instanceof o?g:new o(n,{pub:g,pubEnc:y})},o.fromPrivate=function(n,g,y){return g instanceof o?g:new o(n,{priv:g,privEnc:y})},o.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(n,g){return typeof n=="string"&&(g=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),g?this.pub.encode(g,n):this.pub},o.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(n,g){this.priv=new M(n,g||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(n,g){if(n.x||n.y){this.ec.curve.type==="mont"?c(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&c(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,g)},o.prototype.derive=function(n){return n.mul(this.priv).getX()},o.prototype.sign=function(n,g,y){return this.ec.sign(n,this,g,y)},o.prototype.verify=function(n,g){return this.ec.verify(n,g,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Xs}var Qs,Hl;function O1(){if(Hl)return Qs;Hl=1;var M=er(),a=br(),c=a.assert;function o(b,v){if(b instanceof o)return b;this._importDER(b,v)||(c(b.r&&b.s,"Signature without r or s"),this.r=new M(b.r,16),this.s=new M(b.s,16),b.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=b.recoveryParam)}Qs=o;function x(){this.place=0}function n(b,v){var d=b[v.place++];if(!(d&128))return d;for(var w=d&15,_=0,E=0,B=v.place;E<w;E++,B++)_<<=8,_|=b[B];return v.place=B,_}function g(b){for(var v=0,d=b.length-1;!b[v]&&!(b[v+1]&128)&&v<d;)v++;return v===0?b:b.slice(v)}o.prototype._importDER=function(v,d){v=a.toArray(v,d);var w=new x;if(v[w.place++]!==48)return!1;var _=n(v,w);if(_+w.place!==v.length||v[w.place++]!==2)return!1;var E=n(v,w),B=v.slice(w.place,E+w.place);if(w.place+=E,v[w.place++]!==2)return!1;var A=n(v,w);if(v.length!==A+w.place)return!1;var P=v.slice(w.place,A+w.place);return B[0]===0&&B[1]&128&&(B=B.slice(1)),P[0]===0&&P[1]&128&&(P=P.slice(1)),this.r=new M(B),this.s=new M(P),this.recoveryParam=null,!0};function y(b,v){if(v<128){b.push(v);return}var d=1+(Math.log(v)/Math.LN2>>>3);for(b.push(d|128);--d;)b.push(v>>>(d<<3)&255);b.push(v)}return o.prototype.toDER=function(v){var d=this.r.toArray(),w=this.s.toArray();for(d[0]&128&&(d=[0].concat(d)),w[0]&128&&(w=[0].concat(w)),d=g(d),w=g(w);!w[0]&&!(w[1]&128);)w=w.slice(1);var _=[2];y(_,d.length),_=_.concat(d),_.push(2),y(_,w.length);var E=_.concat(w),B=[48];return y(B,E.length),B=B.concat(E),a.encode(B,v)},Qs}var eo,Kl;function k1(){if(Kl)return eo;Kl=1;var M=er(),a=qc(),c=br(),o=Dl(),x=Yr(),n=c.assert,g=I1(),y=O1();function b(v){if(!(this instanceof b))return new b(v);typeof v=="string"&&(n(o.hasOwnProperty(v),"Unknown curve "+v),v=o[v]),v instanceof o.PresetCurve&&(v={curve:v}),this.curve=v.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=v.curve.g,this.g.precompute(v.curve.n.bitLength()+1),this.hash=v.hash||v.curve.hash}return eo=b,b.prototype.keyPair=function(d){return new g(this,d)},b.prototype.keyFromPrivate=function(d,w){return g.fromPrivate(this,d,w)},b.prototype.keyFromPublic=function(d,w){return g.fromPublic(this,d,w)},b.prototype.genKeyPair=function(d){d||(d={});var w=new a({hash:this.hash,pers:d.pers,persEnc:d.persEnc||"utf8",entropy:d.entropy||x(this.hash.hmacStrength),entropyEnc:d.entropy&&d.entropyEnc||"utf8",nonce:this.n.toArray()}),_=this.n.byteLength(),E=this.n.sub(new M(2));do{var B=new M(w.generate(_));if(!(B.cmp(E)>0))return B.iaddn(1),this.keyFromPrivate(B)}while(!0)},b.prototype._truncateToN=function(d,w){var _=d.byteLength()*8-this.n.bitLength();return _>0&&(d=d.ushrn(_)),!w&&d.cmp(this.n)>=0?d.sub(this.n):d},b.prototype.sign=function(d,w,_,E){typeof _=="object"&&(E=_,_=null),E||(E={}),w=this.keyFromPrivate(w,_),d=this._truncateToN(new M(d,16));for(var B=this.n.byteLength(),A=w.getPrivate().toArray("be",B),P=d.toArray("be",B),I=new a({hash:this.hash,entropy:A,nonce:P,pers:E.pers,persEnc:E.persEnc||"utf8"}),k=this.n.sub(new M(1)),F=0;;F++){var q=E.k?E.k(F):new M(I.generate(this.n.byteLength()));if(q=this._truncateToN(q,!0),!(q.cmpn(1)<=0||q.cmp(k)>=0)){var L=this.g.mul(q);if(!L.isInfinity()){var V=L.getX(),ee=V.umod(this.n);if(ee.cmpn(0)!==0){var ne=q.invm(this.n).mul(ee.mul(w.getPrivate()).iadd(d));if(ne=ne.umod(this.n),ne.cmpn(0)!==0){var J=(L.getY().isOdd()?1:0)|(V.cmp(ee)!==0?2:0);return E.canonical&&ne.cmp(this.nh)>0&&(ne=this.n.sub(ne),J^=1),new y({r:ee,s:ne,recoveryParam:J})}}}}}},b.prototype.verify=function(d,w,_,E){d=this._truncateToN(new M(d,16)),_=this.keyFromPublic(_,E),w=new y(w,"hex");var B=w.r,A=w.s;if(B.cmpn(1)<0||B.cmp(this.n)>=0||A.cmpn(1)<0||A.cmp(this.n)>=0)return!1;var P=A.invm(this.n),I=P.mul(d).umod(this.n),k=P.mul(B).umod(this.n);if(!this.curve._maxwellTrick){var F=this.g.mulAdd(I,_.getPublic(),k);return F.isInfinity()?!1:F.getX().umod(this.n).cmp(B)===0}var F=this.g.jmulAdd(I,_.getPublic(),k);return F.isInfinity()?!1:F.eqXToP(B)},b.prototype.recoverPubKey=function(v,d,w,_){n((3&w)===w,"The recovery param is more than two bits"),d=new y(d,_);var E=this.n,B=new M(v),A=d.r,P=d.s,I=w&1,k=w>>1;if(A.cmp(this.curve.p.umod(this.curve.n))>=0&&k)throw new Error("Unable to find sencond key candinate");k?A=this.curve.pointFromX(A.add(this.curve.n),I):A=this.curve.pointFromX(A,I);var F=d.r.invm(E),q=E.sub(B).mul(F).umod(E),L=P.mul(F).umod(E);return this.g.mulAdd(q,A,L)},b.prototype.getKeyRecoveryParam=function(v,d,w,_){if(d=new y(d,_),d.recoveryParam!==null)return d.recoveryParam;for(var E=0;E<4;E++){var B;try{B=this.recoverPubKey(v,d,E)}catch{continue}if(B.eq(w))return E}throw new Error("Unable to find valid recovery factor")},eo}var zl;function P1(){return zl||(zl=1,function(M){var a=M;a.version=ed.version,a.utils=br(),a.rand=Yr(),a.curve=ql(),a.curves=Dl(),a.ec=k1()}(Vi)),Vi}var T1=P1();const jl=Ar(T1);var N1=$r();const Jr=Ar(N1);var C1=of();const Vl=Ar(C1),q1={version:"2.1.3"};function Ee(M,a,...c){if(!(this instanceof Ee))return new Ee(M,a,...c);qt.call(this,M,a,...c)}Object.keys(qt).forEach(function(M){Ee[M]=qt[M]}),Ee.prototype=Object.create(qt.prototype),Ee.prototype.constructor=Ee;function Ti(M){const a=he.alloc(M.length);for(let c=0;c<M.length;c++)a[c]=M[M.length-1-c];return a}Ee.prototype.fromHex=function(M,a){return this.fromBuffer(he.from(M,"hex"),a)},Ee.prototype.toHex=function(M){return this.toBuffer(M).toString("hex")},Ee.prototype.toJSON=function(){return this.toString()},Ee.prototype.fromJSON=function(M){return Ee(M).copy(this),this},Ee.prototype.fromNumber=function(M){return Ee(M).copy(this),this},Ee.prototype.toNumber=function(){return parseInt(this.toString(10),10)},Ee.prototype.fromString=function(M,a){return Ee(M,a).copy(this),this},Ee.fromBuffer=function(M,a={endian:"big"}){a.endian==="little"&&(M=Ti(M));const c=M.toString("hex");return new Ee(c,16)},Ee.prototype.fromBuffer=function(M,a){return Ee.fromBuffer(M,a).copy(this),this},Ee.prototype.toBuffer=function(M={size:void 0,endian:"big"}){let a;if(M.size){const o=this.toString(16,2),x=o.length/2;if(a=he.from(o,"hex"),x!==M.size){if(x>M.size)a=a.slice(x-a.length,a.length);else if(x<M.size){const n=he.alloc(M.size);for(let g=0;g<a.length;g++)n[n.length-1-g]=a[a.length-1-g];for(let g=0;g<M.size-x;g++)n[g]=0;a=n}}}else{const o=this.toString(16,2);a=he.from(o,"hex")}M.endian==="little"&&(a=Ti(a));const c=he.from([0]);return he.compare(a,c)===0?he.from([]):a},Ee.prototype.toFastBuffer=Ee.prototype.toBuffer,Ee.fromFastBuffer=Ee.fromBuffer,Ee.prototype.fromFastBuffer=Ee.prototype.fromBuffer,Ee.prototype.fromSm=function(M,a={endian:"big"}){return M.length===0&&this.fromBuffer(he.from([0])),a.endian==="little"&&(M=Ti(M)),M[0]&128?(M[0]=M[0]&127,this.fromBuffer(M),this.neg().copy(this)):this.fromBuffer(M),this},Ee.prototype.toSm=function(M={endian:"big"}){const a=M.endian;let c;return this.cmp(0)===-1?(c=this.neg().toBuffer(),c[0]&128?c=he.concat([he.from([128]),c]):c[0]=c[0]|128):(c=this.toBuffer(),c[0]&128&&(c=he.concat([he.from([0]),c]))),c.length===1&c[0]===0&&(c=he.from([])),a==="little"&&(c=Ti(c)),c},Ee.prototype.fromBits=function(M,a={strict:!1}){let c=he.alloc(4);if(c.writeUInt32BE(M,0),M=c.readInt32BE(0),a.strict&&M&8388608)throw new Error("negative bit set");const o=M>>24,x=M&8388607;if(c=he.alloc(4),c.writeInt32BE(x),o<=3)c=c.slice(1,o+1);else{const n=he.alloc(o-3);n.fill(0),c=he.concat([c,n])}return this.fromBuffer(c),M&8388608&&Ee(0).sub(this).copy(this),this},Ee.prototype.toBits=function(){let M;this.lt(0)?M=this.neg().toBuffer():M=this.toBuffer();let a=M.length,c;if(a>3)c=he.concat([he.from([0]),M.slice(0,3)]).readUInt32BE(0);else if(a<=3){const x=he.alloc(3-a+1);x.fill(0),c=he.concat([x,M.slice(0,a)]).readUInt32BE(0)}c&8388608&&(c>>=8,a++),this.lt(0)&&(c|=8388608);const o=a<<24|c;return M=he.alloc(4),M.writeInt32BE(o,0),M.readUInt32BE(0)},Ee.prototype.fromScriptNumBuffer=function(M,a,c,o=!1){if(c===void 0&&(c=4),M.length>c)throw new Error(`script number overflow nMaxNumSize: ${c}`);if(a&&M.length>0&&(M[M.length-1]&127)===0&&(M.length<=1||(M[M.length-2]&128)===0))throw new Error("non-minimally encoded script number");return M.byteLength===0||M.byteLength<=c,this.fromSm(M,{endian:"little"})},Ee.prototype.toScriptNumBuffer=function(M){return this.toSm({endian:"little"})},Ee.prototype.neg=function(){const M=qt.prototype.neg.call(this),a=Object.create(Ee.prototype);return M.copy(a),a},Ee.prototype.add=function(M){const a=qt.prototype.add.call(this,M);return M=Object.create(Ee.prototype),a.copy(M),M},Ee.prototype.sub=function(M){const a=qt.prototype.sub.call(this,M);return M=Object.create(Ee.prototype),a.copy(M),M},Ee.prototype.mul=function(M){const a=qt.prototype.mul.call(this,M);return M=Object.create(Ee.prototype),a.copy(M),M},Ee.prototype.mod=function(M){const a=qt.prototype.mod.call(this,M);return M=Object.create(Ee.prototype),a.copy(M),M},Ee.prototype.umod=function(M){const a=qt.prototype.umod.call(this,M);return M=Object.create(Ee.prototype),a.copy(M),M},Ee.prototype.invm=function(M){const a=qt.prototype.invm.call(this,M);return M=Object.create(Ee.prototype),a.copy(M),M},Ee.prototype.div=function(M){const a=qt.prototype.div.call(this,M);return M=Object.create(Ee.prototype),a.copy(M),M},Ee.prototype.ushln=function(M){const a=qt.prototype.ushln.call(this,M),c=Object.create(Ee.prototype);return a.copy(c),c},Ee.prototype.ushrn=function(M){const a=qt.prototype.ushrn.call(this,M),c=Object.create(Ee.prototype);return a.copy(c),c},Ee.prototype.cmp=function(M){return qt.prototype.cmp.call(this,M)};function Xt(M){Ee.prototype["_"+M]=Ee.prototype[M];const a=function(c){return typeof c=="string"?c=new Ee(c):typeof c=="number"&&(c=new Ee(c.toString())),this["_"+M](c)};Ee.prototype[M]=a}Ee.prototype.eq=function(M){return this.cmp(M)===0},Ee.prototype.neq=function(M){return this.cmp(M)!==0},Ee.prototype.gt=function(M){return this.cmp(M)>0},Ee.prototype.geq=function(M){return this.cmp(M)>=0},Ee.prototype.lt=function(M){return this.cmp(M)<0},Ee.prototype.leq=function(M){return this.cmp(M)<=0},Xt("add"),Xt("sub"),Xt("mul"),Xt("mod"),Xt("invm"),Xt("div"),Xt("cmp"),Xt("gt"),Xt("geq"),Xt("lt"),Xt("leq");class Lt{constructor(a){this.fromObject({buf:a})}fromObject(a){return this.buf=a.buf||this.buf||void 0,this.pos=a.pos||this.pos||0,this}eof(){return this.pos>=this.buf.length}read(a=this.buf.length){const c=this.buf.slice(this.pos,this.pos+a);return this.pos=this.pos+a,c}readReverse(a=this.buf.length){const c=this.buf.slice(this.pos,this.pos+a);this.pos=this.pos+a;const o=he.alloc(c.length);for(let x=0;x<o.length;x++)o[x]=c[c.length-1-x];return o}readUInt8(){const a=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,a}readInt8(){const a=this.buf.readInt8(this.pos);return this.pos=this.pos+1,a}readUInt16BE(){const a=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,a}readInt16BE(){const a=this.buf.readInt16BE(this.pos);return this.pos=this.pos+2,a}readUInt16LE(){const a=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,a}readInt16LE(){const a=this.buf.readInt16LE(this.pos);return this.pos=this.pos+2,a}readUInt32BE(){const a=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,a}readInt32BE(){const a=this.buf.readInt32BE(this.pos);return this.pos=this.pos+4,a}readUInt32LE(){const a=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,a}readInt32LE(){const a=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,a}readUInt64BEBn(){const a=this.buf.slice(this.pos,this.pos+8),c=new Ee().fromBuffer(a);return this.pos=this.pos+8,c}readUInt64LEBn(){const a=this.readReverse(8);return new Ee().fromBuffer(a)}readVarIntNum(){const a=this.readUInt8();let c,o;switch(a){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(c=this.readUInt64LEBn(),o=c.toNumber(),o<=Math.pow(2,53))return o;throw new Error("number too large to retain precision - use readVarIntBn");default:return a}}readVarIntBuf(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){const a=this.readUInt8();switch(a){case 253:return new Ee(this.readUInt16LE());case 254:return new Ee(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new Ee(a)}}}class ot{constructor(a){this.fromObject({bufs:a})}fromObject(a){return this.bufs=a.bufs||this.bufs||[],this}getLength(){let a=0;for(const c in this.bufs){const o=this.bufs[c];a=a+o.length}return a}toBuffer(){return he.concat(this.bufs)}write(a){return this.bufs.push(a),this}writeReverse(a){const c=he.alloc(a.length);for(let o=0;o<c.length;o++)c[o]=a[a.length-1-o];return this.bufs.push(c),this}writeUInt8(a){const c=he.alloc(1);return c.writeUInt8(a,0),this.write(c),this}writeInt8(a){const c=he.alloc(1);return c.writeInt8(a,0),this.write(c),this}writeUInt16BE(a){const c=he.alloc(2);return c.writeUInt16BE(a,0),this.write(c),this}writeInt16BE(a){const c=he.alloc(2);return c.writeInt16BE(a,0),this.write(c),this}writeUInt16LE(a){const c=he.alloc(2);return c.writeUInt16LE(a,0),this.write(c),this}writeInt16LE(a){const c=he.alloc(2);return c.writeInt16LE(a,0),this.write(c),this}writeUInt32BE(a){const c=he.alloc(4);return c.writeUInt32BE(a,0),this.write(c),this}writeInt32BE(a){const c=he.alloc(4);return c.writeInt32BE(a,0),this.write(c),this}writeUInt32LE(a){const c=he.alloc(4);return c.writeUInt32LE(a,0),this.write(c),this}writeInt32LE(a){const c=he.alloc(4);return c.writeInt32LE(a,0),this.write(c),this}writeUInt64BEBn(a){const c=a.toBuffer({size:8});return this.write(c),this}writeUInt64LEBn(a){const c=a.toBuffer({size:8});return this.writeReverse(c),this}writeVarIntNum(a){const c=ot.varIntBufNum(a);return this.write(c),this}writeVarIntBn(a){const c=ot.varIntBufBn(a);return this.write(c),this}static varIntBufNum(a){let c;return a<253?(c=he.alloc(1),c.writeUInt8(a,0)):a<65536?(c=he.alloc(3),c.writeUInt8(253,0),c.writeUInt16LE(a,1)):a<4294967296?(c=he.alloc(5),c.writeUInt8(254,0),c.writeUInt32LE(a,1)):(c=he.alloc(9),c.writeUInt8(255,0),c.writeInt32LE(a&-1,1),c.writeUInt32LE(Math.floor(a/4294967296),5)),c}static varIntBufBn(a){let c;const o=a.toNumber();if(o<253)c=he.alloc(1),c.writeUInt8(o,0);else if(o<65536)c=he.alloc(3),c.writeUInt8(253,0),c.writeUInt16LE(o,1);else if(o<4294967296)c=he.alloc(5),c.writeUInt8(254,0),c.writeUInt32LE(o,1);else{const x=new ot;x.writeUInt8(255),x.writeUInt64LEBn(a),c=x.toBuffer()}return c}}function L1(M){const a=typeof M=="string"?M.charCodeAt(0):M;return a>=97&&a<=102||a>=65&&a<=70||a>=48&&a<=57}const to=L1;class ct{constructor(a){this.fromObject(a)}fromObject(a){if(!a)return this;for(const c of Object.keys(a))a[c]!==void 0&&(this[c]=a[c]);return this}static fromObject(a){return new this().fromObject(a)}fromBr(a){throw a instanceof Lt?new Error("not implemented"):new Error("br must be a buffer reader")}static fromBr(a){return new this().fromBr(a)}asyncFromBr(a){throw a instanceof Lt?new Error("not implemented"):new Error("br must be a buffer reader")}static asyncFromBr(a){return new this().asyncFromBr(a)}toBw(a){throw new Error("not implemented")}asyncToBw(a){throw new Error("not implemented")}*genFromBuffers(){throw new Error("not implemented")}*expect(a,c){let o=c;const x=new ot;let n=0;for(c&&(x.write(c),n+=c.length);n<a;)o=yield a-n,o&&(x.write(o),n+=o.length);o=x.toBuffer();const g=n-a,y=o.slice(o.length-g,o.length);return o=o.slice(0,o.length-g),{buf:o,remainderbuf:y}}fromBuffer(a,...c){if(!he.isBuffer(a))throw new Error("buf must be a buffer");const o=new Lt(a);return this.fromBr(o,...c)}static fromBuffer(...a){return new this().fromBuffer(...a)}asyncFromBuffer(a,...c){if(!he.isBuffer(a))throw new Error("buf must be a buffer");const o=new Lt(a);return this.asyncFromBr(o,...c)}static asyncFromBuffer(a,...c){return new this().asyncFromBuffer(a,...c)}fromFastBuffer(a,...c){return a.length===0?this:this.fromBuffer(a,...c)}static fromFastBuffer(...a){return new this().fromFastBuffer(...a)}toBuffer(...a){return this.toBw(...a).toBuffer()}asyncToBuffer(...a){return this.asyncToBw(...a).then(c=>c.toBuffer())}toFastBuffer(...a){return Object.keys(this).length===0?he.alloc(0):this.toBuffer(...a)}fromHex(a,...c){if(!to(a))throw new Error("invalid hex string");const o=he.from(a,"hex");return this.fromBuffer(o,...c)}static fromHex(a,...c){return new this().fromHex(a,...c)}asyncFromHex(a,...c){if(!to(a))throw new Error("invalid hex string");const o=he.from(a,"hex");return this.asyncFromBuffer(o,...c)}static asyncFromHex(a,...c){return new this().asyncFromHex(a,...c)}fromFastHex(a,...c){if(!to(a))throw new Error("invalid hex string");const o=he.from(a,"hex");return this.fromFastBuffer(o,...c)}static fromFastHex(a,...c){return new this().fromFastHex(a,...c)}toHex(...a){return this.toBuffer(...a).toString("hex")}asyncToHex(...a){return this.asyncToBuffer(...a).then(c=>c.toString("hex"))}toFastHex(...a){return this.toFastBuffer(...a).toString("hex")}fromString(a,...c){if(typeof a!="string")throw new Error("str must be a string");return this.fromHex(a,...c)}static fromString(a,...c){return new this().fromString(a,...c)}asyncFromString(a,...c){if(typeof a!="string")throw new Error("str must be a string");return this.asyncFromHex(a,...c)}static asyncFromString(a,...c){return new this().asyncFromString(a,...c)}toString(...a){return this.toHex(...a)}asyncToString(...a){return this.asyncToHex(...a)}fromJSON(a){throw new Error("not implemented")}static fromJSON(a,...c){return new this().fromJSON(a,...c)}asyncFromJSON(a,...c){throw new Error("not implemented")}static asyncFromJSON(a,...c){return new this().asyncFromJSON(a,...c)}toJSON(){let a={};for(const c in this)if(Array.isArray(this[c])){const o=[];for(const x in this[c])typeof this[c][x].toJSON=="function"?o.push(this[c][x].toJSON()):o.push(JSON.stringify(this[c][x]));a[c]=o}else if(this[c]===null)a[c]=this[c];else if(typeof this[c]=="object"&&typeof this[c].toJSON=="function")a[c]=this[c].toJSON();else if(typeof this[c]=="boolean"||typeof this[c]=="number"||typeof this[c]=="string")a[c]=this[c];else if(he.isBuffer(this[c]))a[c]=this[c].toString("hex");else if(this[c]instanceof Map)a[c]=JSON.stringify(this[c]);else if(typeof this[c]=="object")throw new Error("not implemented");return a}asyncToJSON(){throw new Error("not implemented")}clone(){return this.cloneByJSON()}cloneByBuffer(){return new this.constructor().fromBuffer(this.toBuffer())}cloneByFastBuffer(){return new this.constructor().fromFastBuffer(this.toFastBuffer())}cloneByHex(){return new this.constructor().fromHex(this.toHex())}cloneByString(){return new this.constructor().fromString(this.toString())}cloneByJSON(){return new this.constructor().fromJSON(this.toJSON())}}class Lr extends ct{constructor(a){super({buf:a})}fromHex(a){return this.fromBuffer(he.from(a,"hex"))}toHex(){return this.toBuffer().toString("hex")}static encode(a){if(!he.isBuffer(a))throw new Error("Input should be a buffer");return ji.encode(a)}static decode(a){if(typeof a!="string")throw new Error("Input should be a string");return he.from(ji.decode(a))}fromBuffer(a){return this.buf=a,this}fromString(a){const c=Lr.decode(a);return this.buf=c,this}toBuffer(){return this.buf}toString(){return Lr.encode(this.buf)}}const vr=(M,a)=>{if(!he.isBuffer(M)||!he.isBuffer(a))throw new Error("buf1 and buf2 must be buffers");if(M.length!==a.length)return!1;let c=0;for(let o=0;o<M.length;o++){const x=M[o],n=a[o];c|=x^n}return c===0};class ro extends ct{constructor(a,c,o){super({resbuf:a,isError:c,id:o})}fromResult(a,c){return a.toFastBuffer?this.resbuf=a.toFastBuffer():he.isBuffer(a)?this.resbuf=a:this.resbuf=he.from(JSON.stringify(a)),this.isError=!1,this.id=c,this}static fromResult(a,c){return new this().fromResult(a,c)}fromError(a,c){return this.resbuf=he.from(JSON.stringify(a.message)),this.isError=!0,this.id=c,this}toBw(a){return a||(a=new ot),a.writeVarIntNum(this.resbuf.length),a.write(this.resbuf),a.writeUInt8(Number(this.isError)),a.writeVarIntNum(this.id),a}fromBr(a){const c=a.readVarIntNum();return this.resbuf=a.read(c),this.isError=!!a.readUInt8(),this.id=a.readVarIntNum(),this}}let mr;class Je{constructor(a=[],c=0,o=[],x=new Map){this.nativeWorkers=a,this.lastid=c,this.incompconsteRes=o,this.promisemap=x}asyncObjectMethod(a,c,o,x=this.lastid+1){if(!o)throw new Error("must specify args");const n=a[c](...o);return new ro().fromResult(n,x)}static asyncObjectMethod(a,c,o,x){return mr||(mr=new Je),mr.asyncObjectMethod(a,c,o,x)}asyncClassMethod(a,c,o,x=this.lastid+1){if(!o)throw new Error("must specify args");const n=a[c](...o);return new ro().fromResult(n,x)}static asyncClassMethod(a,c,o,x){return mr||(mr=new Je),mr.asyncClassMethod(a,c,o,x)}static endGlobalWorkers(){mr&&!je.browser&&(mr=void 0)}}class Fe{}Fe.sha1=function(M){if(!he.isBuffer(M))throw new Error("sha1 hash must be of a buffer");const a=Jr.sha1,c=new a().update(M).digest();return he.from(c)},Fe.sha1.blockSize=512,Fe.asyncSha1=async function(M){const a=[M];return(await Je.asyncClassMethod(Fe,"sha1",a)).resbuf},Fe.sha256=function(M){if(!he.isBuffer(M))throw new Error("sha256 hash must be of a buffer");const a=Jr.sha256,c=new a().update(M).digest();return he.from(c)},Fe.sha256.blockSize=512,Fe.asyncSha256=async function(M){const a=[M];return(await Je.asyncClassMethod(Fe,"sha256",a)).resbuf},Fe.sha256Sha256=function(M){try{return Fe.sha256(Fe.sha256(M))}catch(a){throw new Error("sha256Sha256 hash must be of a buffer: "+a)}},Fe.asyncSha256Sha256=async function(M){const a=[M];return(await Je.asyncClassMethod(Fe,"sha256Sha256",a)).resbuf},Fe.ripemd160=function(M){if(!he.isBuffer(M))throw new Error("ripemd160 hash must be of a buffer");const a=Jr.ripemd160,c=new a().update(M).digest();return he.from(c)},Fe.asyncRipemd160=async function(M){const a=[M];return(await Je.asyncClassMethod(Fe,"ripemd160",a)).resbuf},Fe.sha256Ripemd160=function(M){try{return Fe.ripemd160(Fe.sha256(M))}catch(a){throw new Error("sha256Ripemd160 hash must be of a buffer: "+a)}},Fe.asyncSha256Ripemd160=async function(M){const a=[M];return(await Je.asyncClassMethod(Fe,"sha256Ripemd160",a)).resbuf},Fe.sha512=function(M){if(!he.isBuffer(M))throw new Error("sha512 hash must be of a buffer");const a=Jr.sha512,c=new a().update(M).digest();return he.from(c)},Fe.asyncSha512=async function(M){const a=[M];return(await Je.asyncClassMethod(Fe,"sha512",a)).resbuf},Fe.sha512.blockSize=1024,Fe.hmac=function(M,a,c){if(M!=="sha1"&&M!=="sha256"&&M!=="sha512")throw new Error("invalid choice of hash function");const o=Fe[M];if(!he.isBuffer(a)||!he.isBuffer(c))throw new Error("data and key must be buffers");const x=o.blockSize/8;if(c.length>x&&(c=o(c)),c.length<x){const y=he.alloc(x);y.fill(0,c.length),c.copy(y),c=y}const n=he.alloc(x),g=he.alloc(x);for(let y=0;y<x;y++)n[y]=92^c[y],g[y]=54^c[y];return o(he.concat([n,o(he.concat([g,a]))]))},Fe.sha1Hmac=function(M,a){return Fe.hmac("sha1",M,a)},Fe.asyncSha1Hmac=async function(M,a){const c=[M,a];return(await Je.asyncClassMethod(Fe,"sha1Hmac",c)).resbuf},Fe.sha1Hmac.bitsize=160,Fe.sha256Hmac=function(M,a){return Fe.hmac("sha256",M,a)},Fe.asyncSha256Hmac=async function(M,a){const c=[M,a];return(await Je.asyncClassMethod(Fe,"sha256Hmac",c)).resbuf},Fe.sha256Hmac.bitsize=256,Fe.sha512Hmac=function(M,a){return Fe.hmac("sha512",M,a)},Fe.asyncSha512Hmac=async function(M,a){const c=[M,a];return(await Je.asyncClassMethod(Fe,"sha512Hmac",c)).resbuf},Fe.sha512Hmac.bitsize=512;class sr extends ct{constructor(a){super({buf:a})}fromHex(a){return this.fromBuffer(he.from(a,"hex"))}toHex(){return this.toBuffer().toString("hex")}static decode(a){if(typeof a!="string")throw new Error("Input must be a string");const c=Lr.decode(a);if(c.length<4)throw new Error("Input string too short");const o=c.slice(0,-4),x=c.slice(-4),g=Fe.sha256Sha256(o).slice(0,4);if(!vr(x,g))throw new Error("Checksum mismatch");return o}static encode(a){if(!he.isBuffer(a))throw new Error("Input must be a buffer");const c=he.alloc(a.length+4),o=Fe.sha256Sha256(a);return a.copy(c),o.copy(c,a.length),Lr.encode(c)}fromBuffer(a){return this.buf=a,this}fromString(a){const c=sr.decode(a);return this.buf=c,this}toBuffer(){return this.buf}toString(){return sr.encode(this.buf)}}class F1{constructor(a){this.keyDefined=c=>c in a,this.getValue=c=>a[c]}get(a){if(this.keyDefined(a))return this.getValue(a);throw new Error(`Unknown configuration: ${a}`)}}class D1{constructor(){this.variables={}}build(){return new F1(this.variables)}addValue(a,c){if(c===void 0)throw new Error(`Failed to add "${a}" property. The value cannot be undefined`);if(a in this.variables)throw new Error(`"${a}" already has a value defined.`);return this.variables[a]=c,this}addValueWithDefault(a,c,o){if(o===void 0)throw new Error(`Failed to add "${a}" property. Default value cannot be undefined`);return this.addValue(a,c===void 0?o:c)}}const Zr=new D1().addValue("NETWORK","mainnet").build(),ft={};if(ft.Mainnet={MaxSize:33554432,Port:8333,Address:{pubKeyHash:0,payToScriptHash:5},Bip32:{pubKey:76067358,privKey:76066276},Block:{maxNBits:486604799,magicNum:3823236072},Msg:{magicNum:3823236072,versionBytesNum:70015},PrivKey:{versionByteNum:128},TxBuilder:{dust:0,feePerKbNum:1},Workers:{timeout:6e4}},ft.Testnet=Object.assign({},ft.Mainnet,{Port:18333,Address:{pubKeyHash:111,payToScriptHash:196},Bip32:{pubKey:70617039,privKey:70615956},Block:{maxNBits:486604799,magicNum:4108710900},Msg:{magicNum:4108710900,versionBytesNum:70015},PrivKey:{versionByteNum:239}}),ft.Regtest=Object.assign({},ft.Mainnet,{Port:18444,Address:{pubKeyHash:111,payToScriptHash:196},Bip32:{pubKey:70617039,privKey:70615956},Block:{maxNBits:545259519,magicNum:3669344250},Msg:{magicNum:3669344250,versionBytesNum:70015},PrivKey:{versionByteNum:239}}),ft.STN=Object.assign({},ft.Mainnet,{Port:9333,Address:{pubKeyHash:111,payToScriptHash:196},Bip32:{pubKey:70617039,privKey:70615956},Block:{maxNBits:486604799,magicNum:4224632057},Msg:{magicNum:4224632057,versionBytesNum:70015},PrivKey:{versionByteNum:239}}),Zr.get("NETWORK")==="testnet")ft.Default=Object.assign({},ft.Testnet);else if(Zr.get("NETWORK")==="mainnet")ft.Default=Object.assign({},ft.Mainnet);else if(Zr.get("NETWORK")==="regtest")ft.Default=Object.assign({},ft.Regtest);else if(Zr.get("NETWORK")==="stn")ft.Default=Object.assign({},ft.STN);else throw new Error(`must set network in environment variable - mainnet, testnet, regtest or stn?, received ${Zr.get("NETWORK")}`);const U1=M=>ft.Mainnet.Msg.magicNum===M?ft.Mainnet:ft.Testnet.Msg.magicNum===M?ft.Testnet:ft.Regtest.Msg.magicNum===M?ft.Regtest:ft.STN.Msg.magicNum===M?ft.STN:ft.Default,Xr={FALSE:0,0:0,PUSHDATA1:76,PUSHDATA2:77,PUSHDATA4:78,"1NEGATE":79,RESERVED:80,TRUE:81,1:81,2:82,3:83,4:84,5:85,6:86,7:87,8:88,9:89,10:90,11:91,12:92,13:93,14:94,15:95,16:96,NOP:97,VER:98,IF:99,NOTIF:100,VERIF:101,VERNOTIF:102,ELSE:103,ENDIF:104,VERIFY:105,RETURN:106,TOALTSTACK:107,FROMALTSTACK:108,"2DROP":109,"2DUP":110,"3DUP":111,"2OVER":112,"2ROT":113,"2SWAP":114,IFDUP:115,DEPTH:116,DROP:117,DUP:118,NIP:119,OVER:120,PICK:121,ROLL:122,ROT:123,SWAP:124,TUCK:125,CAT:126,SUBSTR:127,SPLIT:127,LEFT:128,NUM2BIN:128,RIGHT:129,BIN2NUM:129,SIZE:130,INVERT:131,AND:132,OR:133,XOR:134,EQUAL:135,EQUALVERIFY:136,RESERVED1:137,RESERVED2:138,"1ADD":139,"1SUB":140,"2MUL":141,"2DIV":142,NEGATE:143,ABS:144,NOT:145,"0NOTEQUAL":146,ADD:147,SUB:148,MUL:149,DIV:150,MOD:151,LSHIFT:152,RSHIFT:153,BOOLAND:154,BOOLOR:155,NUMEQUAL:156,NUMEQUALVERIFY:157,NUMNOTEQUAL:158,LESSTHAN:159,GREATERTHAN:160,LESSTHANOREQUAL:161,GREATERTHANOREQUAL:162,MIN:163,MAX:164,WITHIN:165,RIPEMD160:166,SHA1:167,SHA256:168,HASH160:169,HASH256:170,CODESEPARATOR:171,CHECKSIG:172,CHECKSIGVERIFY:173,CHECKMULTISIG:174,CHECKMULTISIGVERIFY:175,NOP1:176,NOP2:177,CHECKLOCKTIMEVERIFY:177,NOP3:178,CHECKSEQUENCEVERIFY:178,NOP4:179,NOP5:180,NOP6:181,NOP7:182,NOP8:183,NOP9:184,NOP10:185,SMALLDATA:249,SMALLINTEGER:250,PUBKEYS:251,PUBKEYHASH:253,PUBKEY:254,INVALIDOPCODE:255},Qr={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_SPLIT:127,OP_LEFT:128,OP_NUM2BIN:128,OP_RIGHT:129,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_SMALLDATA:249,OP_SMALLINTEGER:250,OP_PUBKEYS:251,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};class oe extends ct{constructor(a){super({num:a})}fromNumber(a){return this.num=a,this}static fromNumber(a){return new this().fromNumber(a)}toNumber(){return this.num}fromString(a){const c=Qr[a];if(c===void 0)throw new Error("Invalid opCodeStr");return this.num=c,this}fromNoOpString(a){const c=Xr[a];if(c===void 0)throw new Error("Invalid opCodeStr");return this.num=c,this}static fromString(a){return new this().fromString(a)}static fromNoOpString(a){return new this().fromNoOpString(a)}toString(){const a=oe.str[this.num];return a===void 0?this.num>0&&this.num<oe.OP_PUSHDATA1?this.num.toString():"OP_"+this.num.toNumber():a}toNoOpString(){const a=oe.noopstr[this.num];return a===void 0?this.num>0&&this.num<oe.OP_PUSHDATA1?this.num.toString():this.num.toNumber():a}}oe.str={},oe.noopstr={};for(const M in Qr)oe[M]=Qr[M],Object.prototype.hasOwnProperty.call(Qr,M)&&(oe.str[Qr[M]]=M);for(const M in Xr)oe[M]=Xr[M],Object.prototype.hasOwnProperty.call(Xr,M)&&(oe.noopstr[Xr[M]]=M);const ei=jl.curves.secp256k1,Er=ei.curve.point().constructor;class st extends Er{constructor(a,c,o){super(ei.curve,a,c,o)}static fromX(a,c){const o=ei.curve.pointFromX(c,a);return Object.create(st.prototype).copyFrom(o)}copyFrom(a){if(!(a instanceof Er))throw new Error("point should be an external point");return Object.keys(a).forEach((function(c){this[c]=a[c]}).bind(this)),this}add(a){return a=Er.prototype.add.call(this,a),Object.create(st.prototype).copyFrom(a)}mul(a){if(!a.lt(st.getN()))throw new Error("point mul out of range");const c=Er.prototype.mul.call(this,a);return Object.create(st.prototype).copyFrom(c)}mulAdd(a,c,o){const x=Er.prototype.mulAdd.call(this,a,c,o);return c=Object.create(st.prototype),c.copyFrom(x)}getX(){const a=Er.prototype.getX.call(this),c=Object.create(Ee.prototype);return a.copy(c),c}getY(){const a=Er.prototype.getY.call(this),c=Object.create(Ee.prototype);return a.copy(c),c}fromX(a,c){const o=st.fromX(a,c);return this.copyFrom(o)}toJSON(){return{x:this.getX().toString(),y:this.getY().toString()}}fromJSON(a){const c=new Ee().fromString(a.x),o=new Ee().fromString(a.y),x=new st(c,o);return this.copyFrom(x)}toString(){return JSON.stringify(this.toJSON())}fromString(a){const c=JSON.parse(a),o=new st().fromJSON(c);return this.copyFrom(o)}static getG(){const a=ei.curve.g;return Object.create(st.prototype).copyFrom(a)}static getN(){return new Ee(ei.curve.n.toArray())}validate(){if(st.fromX(this.getY().isOdd(),this.getX()).getY().cmp(this.getY())!==0)throw new Error("Invalid y value of public key");if(!(this.getX().gt(-1)&&this.getX().lt(st.getN()))||!(this.getY().gt(-1)&&this.getY().lt(st.getN())))throw new Error("Point does not lie on the curve");return this}}class kt extends ct{constructor(a,c){super({point:a,compressed:c})}fromJSON(a){return this.fromFastHex(a),this}toJSON(){return this.toFastHex()}fromPrivKey(a){return this.fromObject({point:st.getG().mul(a.bn),compressed:a.compressed}),this}static fromPrivKey(a){return new this().fromPrivKey(a)}async asyncFromPrivKey(a){const c=await Je.asyncObjectMethod(this,"fromPrivKey",[a]);return this.fromFastBuffer(c.resbuf)}static asyncFromPrivKey(a){return new this().asyncFromPrivKey(a)}fromBuffer(a,c){return this.fromDer(a,c)}async asyncFromBuffer(a,c){const o=[a,c],x=await Je.asyncObjectMethod(this,"fromBuffer",o);return this.fromFastBuffer(x.resbuf)}fromFastBuffer(a){if(a.length===0)return this;const c=!!a[0];return a=a.slice(1),this.fromDer(a),this.compressed=c,this}fromDer(a,c){if(c===void 0?c=!0:c=!1,a[0]===4||!c&&(a[0]===6||a[0]===7)){const o=a.slice(1,33),x=a.slice(33,65);if(o.length!==32||x.length!==32||a.length!==65)throw new Error("LEngth of x and y must be 32 bytes");const n=new Ee(o),g=new Ee(x);this.point=new st(n,g),this.compressed=!1}else if(a[0]===3){const o=a.slice(1),x=new Ee(o);this.fromX(!0,x),this.compressed=!0}else if(a[0]===2){const o=a.slice(1),x=new Ee(o);this.fromX(!1,x),this.compressed=!0}else throw new Error("Invalid DER format pubKey");return this}static fromDer(a,c){return new this().fromDer(a,c)}fromString(a){return this.fromDer(he.from(a,"hex")),this}fromX(a,c){if(typeof a!="boolean")throw new Error("Must specify whether y is odd or not (true or false)");return this.point=st.fromX(a,c),this}static fromX(a,c){return new this().fromX(a,c)}toBuffer(){const a=this.compressed===void 0?!0:this.compressed;return this.toDer(a)}toFastBuffer(){if(!this.point)return he.alloc(0);const a=new ot,c=this.compressed===void 0?!0:!!this.compressed;return a.writeUInt8(Number(c)),a.write(this.toDer(!1)),a.toBuffer()}toDer(a){if(a=a===void 0?this.compressed:a,typeof a!="boolean")throw new Error("Must specify whether the public key is compressed or not (true or false)");const c=this.point.getX(),o=this.point.getY(),x=c.toBuffer({size:32}),n=o.toBuffer({size:32});let g;return a?(n[n.length-1]%2?g=he.from([3]):g=he.from([2]),he.concat([g,x])):(g=he.from([4]),he.concat([g,x,n]))}toString(){const a=this.compressed===void 0?!0:this.compressed;return this.toDer(a).toString("hex")}static isCompressedOrUncompressed(a){if(a.length<33)return!1;if(a[0]===4){if(a.length!==65)return!1}else if(a[0]===2||a[0]===3){if(a.length!==33)return!1}else return!1;return!0}validate(){if(this.point.isInfinity())throw new Error("point: Point cannot be equal to Infinity");if(this.point.eq(new st(new Ee(0),new Ee(0))))throw new Error("point: Point cannot be equal to 0, 0");return this.point.validate(),this}}var H1=yr();const K1=Ar(H1);class or{}or.getRandomBuffer=function(M){return K1(M)};class Wt extends ct{constructor(a,c,o=null){super({bn:a,compressed:c}),o=o||ft.Default.PrivKey,this.Constants=o}fromJSON(a){return this.fromHex(a),this}toJSON(){return this.toHex()}fromRandom(){let a,c,o;do a=or.getRandomBuffer(32),c=new Ee().fromBuffer(a),o=c.lt(st.getN());while(!o);return this.fromObject({bn:c,compressed:!0}),this}static fromRandom(){return new this().fromRandom()}toBuffer(){let a=this.compressed;a===void 0&&(a=!0);const c=this.bn.toBuffer({size:32});let o;return a?o=he.concat([he.from([this.Constants.versionByteNum]),c,he.from([1])]):o=he.concat([he.from([this.Constants.versionByteNum]),c]),o}fromBuffer(a){if(a.length===34&&a[33]===1)this.compressed=!0;else if(a.length===33)this.compressed=!1;else throw new Error("Length of privKey buffer must be 33 (uncompressed pubKey) or 34 (compressed pubKey)");if(a[0]!==this.Constants.versionByteNum)throw new Error("Invalid versionByteNum byte");return this.fromBn(new Ee().fromBuffer(a.slice(1,33)))}toBn(){return this.bn}fromBn(a){return this.bn=a,this}static fromBn(a){return new this().fromBn(a)}validate(){if(!this.bn.lt(st.getN()))throw new Error("Number must be less than N");if(typeof this.compressed!="boolean")throw new Error("Must specify whether the corresponding public key is compressed or not (true or false)");return this}toWif(){return sr.encode(this.toBuffer())}fromWif(a){return this.fromBuffer(sr.decode(a))}static fromWif(a){return new this().fromWif(a)}toString(){return this.toWif()}fromString(a){return this.fromWif(a)}}Wt.Mainnet=class extends Wt{constructor(M,a){super(M,a,ft.Mainnet.PrivKey)}},Wt.Testnet=class extends Wt{constructor(M,a){super(M,a,ft.Testnet.PrivKey)}};class $e extends ct{constructor(a,c,o,x,n){super({r:a,s:c,nHashType:o,recovery:x,compressed:n})}fromBuffer(a){try{return this.fromDer(a,!0)}catch{}try{return this.fromCompact(a)}catch{}return this.fromTxFormat(a)}toBuffer(){return this.nHashType!==void 0?this.toTxFormat():this.recovery!==void 0?this.toCompact():this.toDer()}fromCompact(a){let c=!0,o=a.slice(0,1)[0]-27-4;if(o<0&&(c=!1,o=o+4),!(o===0||o===1||o===2||o===3))throw new Error("i must be 0, 1, 2, or 3");this.compressed=c,this.recovery=o;const x=a.slice(1);return this.fromRS(x),this}static fromCompact(a){return new this().fromCompact(a)}fromRS(a){const c=a.slice(0,32),o=a.slice(32,64);if(c.length!==32)throw new Error("r must be 32 bytes");if(o.length!==32||a.length>64)throw new Error("s must be 32 bytes");return this.r=new Ee().fromBuffer(c),this.s=new Ee().fromBuffer(o),this}static fromRS(a){return new this().fromRS(a)}fromDer(a,c){const o=$e.parseDer(a,c);return this.r=o.r,this.s=o.s,this}static fromDer(a,c){return new this().fromDer(a,c)}fromTxFormat(a){if(a.length===0)return this.r=new Ee(1),this.s=new Ee(1),this.nHashType=1,this;const c=a.readUInt8(a.length-1),o=a.slice(0,a.length-1);return this.fromDer(o,!1),this.nHashType=c,this}static fromTxFormat(a){return new this().fromTxFormat(a)}fromString(a){return this.fromHex(a)}static parseDer(a,c){if(c===void 0&&(c=!0),!he.isBuffer(a))throw new Error("DER formatted signature should be a buffer");const o=a[0];if(o!==48)throw new Error("Header byte should be 0x30");let x=a[1];const n=a.slice(2).length;if(c&&x!==n)throw new Error("LEngth byte should length of what follows");x=x<n?x:n;const g=a[2];if(g!==2)throw new Error("Integer byte for r should be 0x02");const y=a[3],b=a.slice(4,4+y),v=new Ee().fromBuffer(b),d=a[4]===0;if(y!==b.length)throw new Error("LEngth of r incorrect");const w=a[4+y+0];if(w!==2)throw new Error("Integer byte for s should be 0x02");const _=a[4+y+1],E=a.slice(4+y+2,4+y+2+_),B=new Ee().fromBuffer(E),A=a[4+y+2+2]===0;if(_!==E.length)throw new Error("LEngth of s incorrect");const P=4+y+2+_;if(x!==P-2)throw new Error("LEngth of signature incorrect");return{header:o,length:x,rheader:g,rlength:y,rneg:d,rbuf:b,r:v,sheader:w,slength:_,sneg:A,sbuf:E,s:B}}static IsTxDer(a){if(a.length<9||a.length>73||a[0]!==48||a[1]!==a.length-3)return!1;const c=a[3];if(5+c>=a.length)return!1;const o=a[5+c];if(c+o+7!==a.length)return!1;const x=a.slice(4);if(a[2]!==2||c===0||x[0]&128||c>1&&x[0]===0&&!(x[1]&128))return!1;const n=a.slice(6+c);return!(a[6+c-2]!==2||o===0||n[0]&128||o>1&&n[0]===0&&!(n[1]&128))}hasLowS(){return!(this.s.lt(1)||this.s.gt(Ee.fromBuffer(he.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))))}hasDefinedHashType(){return!(this.nHashType<$e.SIGHASH_ALL||this.nHashType>$e.SIGHASH_SINGLE)}toCompact(a,c){if(a=typeof a=="number"?a:this.recovery,c=typeof c=="boolean"?c:this.compressed,!(a===0||a===1||a===2||a===3))throw new Error("recovery must be equal to 0, 1, 2, or 3");let o=a+27+4;c===!1&&(o=o-4);const x=he.from([o]),n=this.r.toBuffer({size:32}),g=this.s.toBuffer({size:32});return he.concat([x,n,g])}toRS(){return he.concat([this.r.toBuffer({size:32}),this.s.toBuffer({size:32})])}toDer(){const a=this.r.toBuffer(),c=this.s.toBuffer(),o=a[0]&128,x=c[0]&128,n=o?he.concat([he.from([0]),a]):a,g=x?he.concat([he.from([0]),c]):c,y=2+n.length+2+g.length,b=n.length,v=g.length;return he.concat([he.from([48,y,2,b]),n,he.from([2,v]),g])}toTxFormat(){const a=this.toDer(),c=he.alloc(1);return c.writeUInt8(this.nHashType,0),he.concat([a,c])}toString(){return this.toHex()}}$e.SIGHASH_ALL=1,$e.SIGHASH_NONE=2,$e.SIGHASH_SINGLE=3,$e.SIGHASH_FORKID=64,$e.SIGHASH_ANYONECANPAY=128;class at extends ct{constructor(a=[]){super({chunks:a})}fromJSON(a){return this.fromString(a)}toJSON(){return this.toString()}fromBuffer(a){this.chunks=[];const c=new Lt(a);for(;!c.eof();){const o=c.readUInt8();let x=0,n=he.from([]);if(o>0&&o<oe.OP_PUSHDATA1)x=o,this.chunks.push({buf:c.read(x),len:x,opCodeNum:o});else if(o===oe.OP_PUSHDATA1){try{x=c.readUInt8(),n=c.read(x)}catch{c.read()}this.chunks.push({buf:n,len:x,opCodeNum:o})}else if(o===oe.OP_PUSHDATA2){try{x=c.readUInt16LE(),n=c.read(x)}catch{c.read()}this.chunks.push({buf:n,len:x,opCodeNum:o})}else if(o===oe.OP_PUSHDATA4){try{x=c.readUInt32LE(),n=c.read(x)}catch{c.read()}this.chunks.push({buf:n,len:x,opCodeNum:o})}else this.chunks.push({opCodeNum:o})}return this}toBuffer(){const a=new ot;for(let c=0;c<this.chunks.length;c++){const o=this.chunks[c],x=o.opCodeNum;a.writeUInt8(x),o.buf&&(x<oe.OP_PUSHDATA1?a.write(o.buf):x===oe.OP_PUSHDATA1?(a.writeUInt8(o.len),a.write(o.buf)):x===oe.OP_PUSHDATA2?(a.writeUInt16LE(o.len),a.write(o.buf)):x===oe.OP_PUSHDATA4&&(a.writeUInt32LE(o.len),a.write(o.buf)))}return a.toBuffer()}fromString(a){if(this.chunks=[],a===""||a===void 0)return this;const c=a.split(" ");let o=0;for(;o<c.length;){const x=c[o];let n;try{n=new oe().fromString(x).toNumber()}catch{}if(n===void 0)if(n=parseInt(x,10),n>0&&n<oe.OP_PUSHDATA1)this.chunks.push({buf:he.from(c[o+1].slice(2),"hex"),len:n,opCodeNum:n}),o=o+2;else if(n===0)this.chunks.push({opCodeNum:0}),o=o+1;else throw new Error("Invalid script");else if(n===oe.OP_PUSHDATA1||n===oe.OP_PUSHDATA2||n===oe.OP_PUSHDATA4){if(c[o+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");this.chunks.push({buf:he.from(c[o+2].slice(2),"hex"),len:parseInt(c[o+1],10),opCodeNum:n}),o=o+3}else this.chunks.push({opCodeNum:n}),o=o+1}return this}toString(a={noOp:!1}){var o;let c="";for(let x=0;x<this.chunks.length;x++){const n=this.chunks[x],g=(o=n.opCodeNum)!=null&&o.num?n.opCodeNum.num:n.opCodeNum;n.buf?((g===oe.OP_PUSHDATA1||g===oe.OP_PUSHDATA2||g===oe.OP_PUSHDATA4)&&(c=a.noOp?c+" "+new oe(g).toNoOpString():c+" "+new oe(g).toString()),c=c+" "+n.len,c=c+" 0x"+n.buf.toString("hex")):oe.str[g]!==void 0||oe.noopstr[g]!==void 0?c=a.noOp?c+" "+new oe(g).toNoOpString():c+" "+new oe(g).toString():c=c+" 0x"+g.toString(16)}return c.substr(1)}fromBitcoindString(a){const c=new ot,o=a.split(" ");let x;for(x=0;x<o.length;x++){const g=o[x];if(g!=="")if(g[0]==="0"&&g[1]==="x"){const y=g.slice(2);c.write(he.from(y,"hex"))}else if(g[0]==="'"){const y=g.slice(1,g.length-1),b=he.from(y),v=new at().writeBuffer(b).toBuffer();c.write(v)}else if(oe["OP_"+g]!==void 0){const y="OP_"+g,b=oe[y];c.writeUInt8(b)}else if(typeof oe[g]=="number"){const b=oe[g];c.writeUInt8(b)}else{if(isNaN(parseInt(g,10)))throw new Error("Could not determine type of script value");{const y=new Ee(g),v=new at().writeBn(y).toBuffer();c.write(v)}}}const n=c.toBuffer();return this.fromBuffer(n)}static fromBitcoindString(a){return new this().fromBitcoindString(a)}toBitcoindString(){let a="";for(let c=0;c<this.chunks.length;c++){const o=this.chunks[c];if(o.buf){const n=new at([o]).toBuffer().toString("hex");a=a+" 0x"+n}else if(oe.str[o.opCodeNum]!==void 0){const x=new oe(o.opCodeNum).toString();a=a+" "+x.slice(3)}else a=a+" 0x"+o.opCodeNum.toString(16)}return a.substr(1)}fromAsmString(a){this.chunks=[];const c=a.split(" ");let o=0;for(;o<c.length;){const x=c[o];let n,g;try{n=oe.fromString(x),g=n.toNumber()}catch{n=void 0,g=void 0}if(x==="0")g=0,this.chunks.push({opCodeNum:g}),o=o+1;else if(x==="-1")g=oe.OP_1NEGATE,this.chunks.push({opCodeNum:g}),o=o+1;else if(n===void 0){const y=c[o],b=he.from(y,"hex");if(b.toString("hex")!==y)throw new Error("invalid hex string in script");const v=b.length;v>=0&&v<oe.OP_PUSHDATA1?g=v:v<Math.pow(2,8)?g=oe.OP_PUSHDATA1:v<Math.pow(2,16)?g=oe.OP_PUSHDATA2:v<Math.pow(2,32)&&(g=oe.OP_PUSHDATA4),this.chunks.push({buf:b,len:b.length,opCodeNum:g}),o=o+1}else this.chunks.push({opCodeNum:g}),o=o+1}return this}static fromAsmString(a){return new this().fromAsmString(a)}toAsmString(a={noOp:!1}){let c="";for(let o=0;o<this.chunks.length;o++){const x=this.chunks[o];c+=this._chunkToString(x,a)}return c.substr(1)}_chunkToString(a,c={noOp:!1}){const o=a.opCodeNum;let x="";if(a.buf)a.len>0&&(x=x+" "+a.buf.toString("hex"));else if(typeof oe.str[o]<"u")o===0?x=x+" 0":o===79?x=x+" -1":x=c.noOp?x+" "+new oe(o).toNoOpString():x+" "+new oe(o).toString();else{let n=o.toString(16);n.length%2!==0&&(n="0"+n),x=x+" "+n}return x}fromOpReturnData(a){return this.writeOpCode(oe.OP_RETURN),this.writeBuffer(a),this}static fromOpReturnData(a){return new this().fromOpReturnData(a)}fromSafeData(a){return this.writeOpCode(oe.OP_FALSE),this.writeOpCode(oe.OP_RETURN),this.writeBuffer(a),this}static fromSafeData(a){return new this().fromSafeData(a)}fromSafeDataArray(a){this.writeOpCode(oe.OP_FALSE),this.writeOpCode(oe.OP_RETURN);for(const c in a){const o=a[c];this.writeBuffer(o)}return this}static fromSafeDataArray(a){return new this().fromSafeDataArray(a)}getData(){if(this.isSafeDataOut())return this.chunks.slice(2).map(o=>o.buf);if(this.isOpReturn())return this.chunks.slice(1).map(o=>o.buf);throw new Error("Unrecognized script type to get data from")}fromPubKeyHash(a){if(a.length!==20)throw new Error("hashBuf must be a 20 byte buffer");return this.writeOpCode(oe.OP_DUP),this.writeOpCode(oe.OP_HASH160),this.writeBuffer(a),this.writeOpCode(oe.OP_EQUALVERIFY),this.writeOpCode(oe.OP_CHECKSIG),this}static fromPubKeyHash(a){return new this().fromPubKeyHash(a)}static sortPubKeys(a){return a.slice().sort((c,o)=>{const x=c.toBuffer(),n=o.toBuffer(),g=Math.max(x.length,n.length);for(let y=0;y<=g;y++){if(x[y]===void 0)return-1;if(n[y]===void 0)return 1;if(x[y]<n[y])return-1;if(x[y]>n[y])return 1}})}fromPubKeys(a,c,o=!0){if(typeof a!="number")throw new Error("m must be a number");o===!0&&(c=at.sortPubKeys(c)),this.writeOpCode(a+oe.OP_1-1);for(const x in c)this.writeBuffer(c[x].toBuffer());return this.writeOpCode(c.length+oe.OP_1-1),this.writeOpCode(oe.OP_CHECKMULTISIG),this}static fromPubKeys(a,c,o){return new this().fromPubKeys(a,c,o)}removeCodeseparators(){const a=[];for(let c=0;c<this.chunks.length;c++)this.chunks[c].opCodeNum!==oe.OP_CODESEPARATOR&&a.push(this.chunks[c]);return this.chunks=a,this}isPushOnly(){for(let a=0;a<this.chunks.length;a++)if(this.chunks[a].opCodeNum>oe.OP_16)return!1;return!0}isNonSpendable(){const a=this.chunks[0].opCodeNum===oe.OP_FALSE,c=this.chunks[1]&&this.chunks[1].opCodeNum===oe.OP_RETURN;return!!a&&!!c}isOpReturn(){return this.chunks[0].opCodeNum===oe.OP_RETURN&&this.chunks.filter(a=>he.isBuffer(a.buf)).length===this.chunks.slice(1).length}isSafeDataOut(){if(this.chunks.length<2||this.chunks[0].opCodeNum!==oe.OP_FALSE)return!1;const a=this.chunks.slice(1);return new at(a).isOpReturn()}isPubKeyHashOut(){return!!(this.chunks[0]&&this.chunks[0].opCodeNum===oe.OP_DUP&&this.chunks[1]&&this.chunks[1].opCodeNum===oe.OP_HASH160&&this.chunks[2].buf&&this.chunks[3]&&this.chunks[3].opCodeNum===oe.OP_EQUALVERIFY&&this.chunks[4]&&this.chunks[4].opCodeNum===oe.OP_CHECKSIG)}isPubKeyHashIn(){return!!(this.chunks.length===2&&(this.chunks[0].buf||this.chunks[0].opCodeNum===oe.OP_0)&&(this.chunks[1].buf||this.chunks[0].opCodeNum===oe.OP_0))}isScriptHashOut(){const a=this.toBuffer();return a.length===23&&a[0]===oe.OP_HASH160&&a[1]===20&&a[22]===oe.OP_EQUAL}isScriptHashIn(){if(!this.isPushOnly())return!1;try{new at().fromBuffer(this.chunks[this.chunks.length-1].buf)}catch{return!1}return!0}isMultiSigOut(){const a=this.chunks[0].opCodeNum-oe.OP_1+1;if(!(a>=1&&a<=16)||!this.chunks.slice(1,this.chunks.length-2).every(x=>{try{const n=x.buf;return new kt().fromDer(n).validate(),!0}catch{return!1}}))return!1;const o=this.chunks[this.chunks.length-2].opCodeNum-oe.OP_1+1;return!(!(o>=a&&o<=16)||this.chunks[1+o+1].opCodeNum!==oe.OP_CHECKMULTISIG)}isMultiSigIn(){if(this.chunks[0].opCodeNum!==oe.OP_0)return!1;const a=this.chunks.slice(1);return a.length<1?!1:a.every(c=>he.isBuffer(c.buf)&&$e.IsTxDer(c.buf))}findAndDelete(a){const c=a.toBuffer();for(let o=0;o<this.chunks.length;o++){const n=new at([this.chunks[o]]).toBuffer();vr(c,n)&&this.chunks.splice(o,1)}return this}writeScript(a){return this.chunks=this.chunks.concat(a.chunks),this}static writeScript(a){return new this().writeScript(a)}writeString(a){const c=new at().fromString(a);return this.chunks=this.chunks.concat(c.chunks),this}static writeString(a){return new this().writeString(a)}writeOpCode(a){return this.chunks.push({opCodeNum:a}),this}static writeOpCode(a){return new this().writeOpCode(a)}setChunkOpCode(a,c){return this.chunks[a]={opCodeNum:c},this}writeBn(a){if(a.cmp(0)===oe.OP_0)this.chunks.push({opCodeNum:oe.OP_0});else if(a.cmp(-1)===0)this.chunks.push({opCodeNum:oe.OP_1NEGATE});else if(a.cmp(1)>=0&&a.cmp(16)<=0)this.chunks.push({opCodeNum:a.toNumber()+oe.OP_1-1});else{const c=a.toSm({endian:"little"});this.writeBuffer(c)}return this}static writeBn(a){return new this().writeBn(a)}writeNumber(a){return this.writeBn(new Ee().fromNumber(a)),this}static writeNumber(a){return new this().writeNumber(a)}setChunkBn(a,c){return this.chunks[a]=new at().writeBn(c).chunks[0],this}writeBuffer(a){let c;const o=a.length;if(a.length>0&&a.length<oe.OP_PUSHDATA1)c=a.length;else if(a.length===0)c=oe.OP_0;else if(a.length<Math.pow(2,8))c=oe.OP_PUSHDATA1;else if(a.length<Math.pow(2,16))c=oe.OP_PUSHDATA2;else if(a.length<Math.pow(2,32))c=oe.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this.chunks.push({buf:a,len:o,opCodeNum:c}),this}static writeBuffer(a){return new this().writeBuffer(a)}setChunkBuffer(a,c){return this.chunks[a]=new at().writeBuffer(c).chunks[0],this}checkMinimalPush(a){const c=this.chunks[a],o=c.buf,x=c.opCodeNum;return o?o.length===0?x===oe.OP_0:o.length===1&&o[0]>=1&&o[0]<=16?x===oe.OP_1+(o[0]-1):o.length===1&&o[0]===129?x===oe.OP_1NEGATE:o.length<=75?x===o.length:o.length<=255?x===oe.OP_PUSHDATA1:o.length<=65535?x===oe.OP_PUSHDATA2:!0:!0}}class Qt extends ct{constructor(a,c,o=null){super({versionByteNum:a,hashBuf:c}),o=o||ft.Default.Address,this.Constants=o}fromBuffer(a){if(a.length!==21)throw new Error("address buffers must be exactly 21 bytes");if(a[0]!==this.Constants.pubKeyHash)throw new Error("address: invalid versionByteNum byte");return this.versionByteNum=a[0],this.hashBuf=a.slice(1),this}fromPubKeyHashBuf(a){return this.hashBuf=a,this.versionByteNum=this.Constants.pubKeyHash,this}static fromPubKeyHashBuf(a){return new this().fromPubKeyHashBuf(a)}fromPubKey(a){const c=Fe.sha256Ripemd160(a.toBuffer());return this.fromPubKeyHashBuf(c)}static fromPubKey(a){return new this().fromPubKey(a)}async asyncFromPubKey(a){const c=[a],o=await Je.asyncObjectMethod(this,"fromPubKey",c);return this.fromFastBuffer(o.resbuf)}static asyncFromPubKey(a){return new this().asyncFromPubKey(a)}fromPrivKey(a){const c=new kt().fromPrivKey(a),o=Fe.sha256Ripemd160(c.toBuffer());return this.fromPubKeyHashBuf(o)}static fromPrivKey(a){return new this().fromPrivKey(a)}async asyncFromPrivKey(a){const c=[a],o=await Je.asyncObjectMethod(this,"fromPrivKey",c);return this.fromFastBuffer(o.resbuf)}static asyncFromPrivKey(a){return new this().fromPrivKey(a)}fromRandom(){const a=new Wt().fromRandom();return this.fromPrivKey(a)}static fromRandom(){return new this().fromRandom()}async asyncFromRandom(){const a=[],c=await Je.asyncObjectMethod(this,"fromRandom",a);return this.fromFastBuffer(c.resbuf)}static asyncFromRandom(){return new this().fromRandom()}fromString(a){const c=sr.decode(a);return this.fromBuffer(c)}async asyncFromString(a){const c=[a],o=await Je.asyncObjectMethod(this,"fromString",c);return this.fromFastBuffer(o.resbuf)}static asyncFromString(a){return new this().asyncFromString(a)}static isValid(a){let c;try{c=new Qt().fromString(a)}catch{return!1}return c.isValid()}isValid(){try{return this.validate(),!0}catch{return!1}}toTxOutScript(){const a=new at;return a.writeOpCode(oe.OP_DUP),a.writeOpCode(oe.OP_HASH160),a.writeBuffer(this.hashBuf),a.writeOpCode(oe.OP_EQUALVERIFY),a.writeOpCode(oe.OP_CHECKSIG),a}fromTxInScript(a){const c=Fe.sha256Ripemd160(a.chunks[1].buf||he.from("00".repeat(32),"hex"));return this.fromPubKeyHashBuf(c)}static fromTxInScript(a){return new this().fromTxInScript(a)}fromTxOutScript(a){return this.fromPubKeyHashBuf(a.chunks[2].buf)}static fromTxOutScript(a){return new this().fromTxOutScript(a)}toBuffer(){const a=he.from([this.versionByteNum]);return he.concat([a,this.hashBuf])}toJSON(){const a={};return this.hashBuf&&(a.hashBuf=this.hashBuf.toString("hex")),typeof this.versionByteNum<"u"&&(a.versionByteNum=this.versionByteNum),a}fromJSON(a){return a.hashBuf&&(this.hashBuf=he.from(a.hashBuf,"hex")),typeof a.versionByteNum<"u"&&(this.versionByteNum=a.versionByteNum),this}toString(){return sr.encode(this.toBuffer())}async asyncToString(){const a=[],c=await Je.asyncObjectMethod(this,"toString",a);return JSON.parse(c.resbuf.toString())}validate(){if(!he.isBuffer(this.hashBuf)||this.hashBuf.length!==20)throw new Error("hashBuf must be a buffer of 20 bytes");if(this.versionByteNum!==this.Constants.pubKeyHash)throw new Error("invalid versionByteNum");return this}}Qt.Mainnet=class extends Qt{constructor(M,a){super(M,a,ft.Mainnet.Address)}},Qt.Testnet=class extends Qt{constructor(M,a){super(M,a,ft.Testnet.Address)}};class ti extends ct{constructor(a,c,o,x,n,g,y,b=null,v=Wt){super({versionBytesNum:a,depth:c,parentFingerPrint:o,childIndex:x,chainCode:n,privKey:g,pubKey:y}),b=b||ft.Default.Bip32,this.Constants=b,this.PrivKey=v}fromRandom(){return this.versionBytesNum=this.Constants.privKey,this.depth=0,this.parentFingerPrint=he.from([0,0,0,0]),this.childIndex=0,this.chainCode=or.getRandomBuffer(32),this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new kt().fromPrivKey(this.privKey),this}static fromRandom(){return new this().fromRandom()}fromString(a){return this.fromBuffer(sr.decode(a))}async asyncFromString(a){const c=[a],o=await Je.asyncObjectMethod(this,"fromString",c);return this.fromFastBuffer(o.resbuf)}fromSeed(a){if(!he.isBuffer(a))throw new Error("bytes must be a buffer");if(a.length<128/8)throw new Error("Need more than 128 bits of entropy");if(a.length>512/8)throw new Error("More than 512 bits of entropy is nonstandard");const c=Fe.sha512Hmac(a,he.from("Bitcoin seed"));return this.depth=0,this.parentFingerPrint=he.from([0,0,0,0]),this.childIndex=0,this.chainCode=c.slice(32,64),this.versionBytesNum=this.Constants.privKey,this.privKey=new this.PrivKey().fromBn(Ee().fromBuffer(c.slice(0,32))),this.pubKey=new kt().fromPrivKey(this.privKey),this}static fromSeed(a){return new this().fromSeed(a)}async asyncFromSeed(a){const c=await Je.asyncObjectMethod(this,"fromSeed",[a]);return this.fromFastBuffer(c.resbuf)}static asyncFromSeed(a){return new this().asyncFromSeed(a)}fromBuffer(a){if(a.length!==78)throw new Error("incorrect bip32 data length");this.versionBytesNum=a.slice(0,4).readUInt32BE(0),this.depth=a.slice(4,5).readUInt8(0),this.parentFingerPrint=a.slice(5,9),this.childIndex=a.slice(9,13).readUInt32BE(0),this.chainCode=a.slice(13,45);const c=a.slice(45,78),o=this.versionBytesNum===this.Constants.privKey,x=this.versionBytesNum===this.Constants.pubKey;if(o&&c[0]===0)this.privKey=new this.PrivKey().fromBn(Ee().fromBuffer(c.slice(1,33))),this.pubKey=new kt().fromPrivKey(this.privKey);else if(x&&(c[0]===2||c[0]===3))this.pubKey=new kt().fromDer(c);else throw new Error("Invalid key");return this}fromFastBuffer(a){if(a.length===0)return this;if(a.length!==78&&a.length!==111)throw new Error("incorrect bip32 fastBuffer data length: "+a.length);this.versionBytesNum=a.slice(0,4).readUInt32BE(0),this.depth=a.slice(4,5).readUInt8(0),this.parentFingerPrint=a.slice(5,9),this.childIndex=a.slice(9,13).readUInt32BE(0),this.chainCode=a.slice(13,45);const c=a.slice(45,a.length),o=this.versionBytesNum===this.Constants.privKey,x=this.versionBytesNum===this.Constants.pubKey;if(o&&c[0]===0&&a.length===78)this.privKey=new this.PrivKey().fromBn(Ee().fromBuffer(c.slice(1,33))),this.pubKey=new kt().fromPrivKey(this.privKey);else if(x&&a.length===111)this.pubKey=new kt().fromFastBuffer(c),this.pubKey.compressed=!0;else throw new Error("Invalid key");return this}derive(a){const c=a.split("/");if(a==="m")return this;let o=this;for(const x in c){const n=c[x];if(x==="0"){if(n!=="m")throw new Error("invalid path");continue}if(parseInt(n.replace("'",""),10).toString()!==n.replace("'",""))throw new Error("invalid path");const g=n.length>1&&n[n.length-1]==="'";let y=parseInt(g?n.slice(0,n.length-1):n,10)&2147483647;g&&(y+=2147483648),o=o.deriveChild(y)}return o}async asyncDerive(a){const c=await Je.asyncObjectMethod(this,"derive",[a]);return new this.constructor().fromFastBuffer(c.resbuf)}deriveChild(a){if(typeof a!="number")throw new Error("i must be a number");let c=[];c.push(a>>24&255),c.push(a>>16&255),c.push(a>>8&255),c.push(a&255),c=he.from(c);const o=(a&2147483648)!==0,x=this.versionBytesNum===this.Constants.privKey;if(o&&(!this.privKey||!x))throw new Error("Cannot do private key derivation without private key");let n=null;if(this.privKey){let y=null;o?y=he.concat([he.from([0]),this.privKey.bn.toBuffer({size:32}),c]):y=he.concat([this.pubKey.toBuffer({size:32}),c]);const b=Fe.sha512Hmac(y,this.chainCode),v=Ee().fromBuffer(b.slice(0,32),{size:32}),d=b.slice(32,64),w=v.add(this.privKey.bn).mod(st.getN());n=new this.constructor,n.chainCode=d,n.privKey=new this.PrivKey().fromBn(w),n.pubKey=new kt().fromPrivKey(n.privKey)}else{const y=he.concat([this.pubKey.toBuffer(),c]),b=Fe.sha512Hmac(y,this.chainCode),v=Ee().fromBuffer(b.slice(0,32)),d=b.slice(32,64),w=st.getG().mul(v),_=this.pubKey.point,E=w.add(_),B=new kt;B.point=E,n=new this.constructor,n.chainCode=d,n.pubKey=B}n.childIndex=a;const g=Fe.sha256Ripemd160(this.pubKey.toBuffer());return n.parentFingerPrint=g.slice(0,4),n.versionBytesNum=this.versionBytesNum,n.depth=this.depth+1,n}toPublic(){const a=new this.constructor().fromObject(this);return a.versionBytesNum=this.Constants.pubKey,a.privKey=void 0,a}toBuffer(){const a=this.versionBytesNum===this.Constants.privKey,c=this.versionBytesNum===this.Constants.pubKey;if(a)return new ot().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).writeUInt8(0).write(this.privKey.bn.toBuffer({size:32})).toBuffer();if(c){if(this.pubKey.compressed===!1)throw new Error("cannot convert bip32 to buffer if pubKey is not compressed");return new ot().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).write(this.pubKey.toBuffer()).toBuffer()}else throw new Error("bip32: invalid versionBytesNum byte")}toFastBuffer(){if(!this.versionBytesNum)return he.alloc(0);const a=this.versionBytesNum===this.Constants.privKey,c=this.versionBytesNum===this.Constants.pubKey;if(a)return new ot().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).writeUInt8(0).write(this.privKey.bn.toBuffer({size:32})).toBuffer();if(c)return new ot().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).write(this.pubKey.toFastBuffer()).toBuffer();throw new Error("bip32: invalid versionBytesNum byte")}toString(){return sr.encode(this.toBuffer())}async asyncToString(){const a=await Je.asyncObjectMethod(this,"toString",[]);return JSON.parse(a.resbuf.toString())}toJSON(){return this.toFastHex()}fromJSON(a){return this.fromFastHex(a)}isPrivate(){return this.versionBytesNum===this.Constants.privKey}}ti.Mainnet=class extends ti{constructor(M,a,c,o,x,n,g){super(M,a,c,o,x,n,g,ft.Mainnet.Bip32,Wt.Mainnet)}},ti.Testnet=class extends ti{constructor(M,a,c,o,x,n,g){super(M,a,c,o,x,n,g,ft.Testnet.Bip32,Wt.Testnet)}};const Ni=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];Ni.space=" ";const Ci=["あいこくしん","あいさつ","あいだ","あおぞら","あかちゃん","あきる","あけがた","あける","あこがれる","あさい","あさひ","あしあと","あじわう","あずかる","あずき","あそぶ","あたえる","あたためる","あたりまえ","あたる","あつい","あつかう","あっしゅく","あつまり","あつめる","あてな","あてはまる","あひる","あぶら","あぶる","あふれる","あまい","あまど","あまやかす","あまり","あみもの","あめりか","あやまる","あゆむ","あらいぐま","あらし","あらすじ","あらためる","あらゆる","あらわす","ありがとう","あわせる","あわてる","あんい","あんがい","あんこ","あんぜん","あんてい","あんない","あんまり","いいだす","いおん","いがい","いがく","いきおい","いきなり","いきもの","いきる","いくじ","いくぶん","いけばな","いけん","いこう","いこく","いこつ","いさましい","いさん","いしき","いじゅう","いじょう","いじわる","いずみ","いずれ","いせい","いせえび","いせかい","いせき","いぜん","いそうろう","いそがしい","いだい","いだく","いたずら","いたみ","いたりあ","いちおう","いちじ","いちど","いちば","いちぶ","いちりゅう","いつか","いっしゅん","いっせい","いっそう","いったん","いっち","いってい","いっぽう","いてざ","いてん","いどう","いとこ","いない","いなか","いねむり","いのち","いのる","いはつ","いばる","いはん","いびき","いひん","いふく","いへん","いほう","いみん","いもうと","いもたれ","いもり","いやがる","いやす","いよかん","いよく","いらい","いらすと","いりぐち","いりょう","いれい","いれもの","いれる","いろえんぴつ","いわい","いわう","いわかん","いわば","いわゆる","いんげんまめ","いんさつ","いんしょう","いんよう","うえき","うえる","うおざ","うがい","うかぶ","うかべる","うきわ","うくらいな","うくれれ","うけたまわる","うけつけ","うけとる","うけもつ","うける","うごかす","うごく","うこん","うさぎ","うしなう","うしろがみ","うすい","うすぎ","うすぐらい","うすめる","うせつ","うちあわせ","うちがわ","うちき","うちゅう","うっかり","うつくしい","うったえる","うつる","うどん","うなぎ","うなじ","うなずく","うなる","うねる","うのう","うぶげ","うぶごえ","うまれる","うめる","うもう","うやまう","うよく","うらがえす","うらぐち","うらない","うりあげ","うりきれ","うるさい","うれしい","うれゆき","うれる","うろこ","うわき","うわさ","うんこう","うんちん","うんてん","うんどう","えいえん","えいが","えいきょう","えいご","えいせい","えいぶん","えいよう","えいわ","えおり","えがお","えがく","えきたい","えくせる","えしゃく","えすて","えつらん","えのぐ","えほうまき","えほん","えまき","えもじ","えもの","えらい","えらぶ","えりあ","えんえん","えんかい","えんぎ","えんげき","えんしゅう","えんぜつ","えんそく","えんちょう","えんとつ","おいかける","おいこす","おいしい","おいつく","おうえん","おうさま","おうじ","おうせつ","おうたい","おうふく","おうべい","おうよう","おえる","おおい","おおう","おおどおり","おおや","おおよそ","おかえり","おかず","おがむ","おかわり","おぎなう","おきる","おくさま","おくじょう","おくりがな","おくる","おくれる","おこす","おこなう","おこる","おさえる","おさない","おさめる","おしいれ","おしえる","おじぎ","おじさん","おしゃれ","おそらく","おそわる","おたがい","おたく","おだやか","おちつく","おっと","おつり","おでかけ","おとしもの","おとなしい","おどり","おどろかす","おばさん","おまいり","おめでとう","おもいで","おもう","おもたい","おもちゃ","おやつ","おやゆび","およぼす","おらんだ","おろす","おんがく","おんけい","おんしゃ","おんせん","おんだん","おんちゅう","おんどけい","かあつ","かいが","がいき","がいけん","がいこう","かいさつ","かいしゃ","かいすいよく","かいぜん","かいぞうど","かいつう","かいてん","かいとう","かいふく","がいへき","かいほう","かいよう","がいらい","かいわ","かえる","かおり","かかえる","かがく","かがし","かがみ","かくご","かくとく","かざる","がぞう","かたい","かたち","がちょう","がっきゅう","がっこう","がっさん","がっしょう","かなざわし","かのう","がはく","かぶか","かほう","かほご","かまう","かまぼこ","かめれおん","かゆい","かようび","からい","かるい","かろう","かわく","かわら","がんか","かんけい","かんこう","かんしゃ","かんそう","かんたん","かんち","がんばる","きあい","きあつ","きいろ","ぎいん","きうい","きうん","きえる","きおう","きおく","きおち","きおん","きかい","きかく","きかんしゃ","ききて","きくばり","きくらげ","きけんせい","きこう","きこえる","きこく","きさい","きさく","きさま","きさらぎ","ぎじかがく","ぎしき","ぎじたいけん","ぎじにってい","ぎじゅつしゃ","きすう","きせい","きせき","きせつ","きそう","きぞく","きぞん","きたえる","きちょう","きつえん","ぎっちり","きつつき","きつね","きてい","きどう","きどく","きない","きなが","きなこ","きぬごし","きねん","きのう","きのした","きはく","きびしい","きひん","きふく","きぶん","きぼう","きほん","きまる","きみつ","きむずかしい","きめる","きもだめし","きもち","きもの","きゃく","きやく","ぎゅうにく","きよう","きょうりゅう","きらい","きらく","きりん","きれい","きれつ","きろく","ぎろん","きわめる","ぎんいろ","きんかくじ","きんじょ","きんようび","ぐあい","くいず","くうかん","くうき","くうぐん","くうこう","ぐうせい","くうそう","ぐうたら","くうふく","くうぼ","くかん","くきょう","くげん","ぐこう","くさい","くさき","くさばな","くさる","くしゃみ","くしょう","くすのき","くすりゆび","くせげ","くせん","ぐたいてき","くださる","くたびれる","くちこみ","くちさき","くつした","ぐっすり","くつろぐ","くとうてん","くどく","くなん","くねくね","くのう","くふう","くみあわせ","くみたてる","くめる","くやくしょ","くらす","くらべる","くるま","くれる","くろう","くわしい","ぐんかん","ぐんしょく","ぐんたい","ぐんて","けあな","けいかく","けいけん","けいこ","けいさつ","げいじゅつ","けいたい","げいのうじん","けいれき","けいろ","けおとす","けおりもの","げきか","げきげん","げきだん","げきちん","げきとつ","げきは","げきやく","げこう","げこくじょう","げざい","けさき","げざん","けしき","けしごむ","けしょう","げすと","けたば","けちゃっぷ","けちらす","けつあつ","けつい","けつえき","けっこん","けつじょ","けっせき","けってい","けつまつ","げつようび","げつれい","けつろん","げどく","けとばす","けとる","けなげ","けなす","けなみ","けぬき","げねつ","けねん","けはい","げひん","けぶかい","げぼく","けまり","けみかる","けむし","けむり","けもの","けらい","けろけろ","けわしい","けんい","けんえつ","けんお","けんか","げんき","けんげん","けんこう","けんさく","けんしゅう","けんすう","げんそう","けんちく","けんてい","けんとう","けんない","けんにん","げんぶつ","けんま","けんみん","けんめい","けんらん","けんり","こあくま","こいぬ","こいびと","ごうい","こうえん","こうおん","こうかん","ごうきゅう","ごうけい","こうこう","こうさい","こうじ","こうすい","ごうせい","こうそく","こうたい","こうちゃ","こうつう","こうてい","こうどう","こうない","こうはい","ごうほう","ごうまん","こうもく","こうりつ","こえる","こおり","ごかい","ごがつ","ごかん","こくご","こくさい","こくとう","こくない","こくはく","こぐま","こけい","こける","ここのか","こころ","こさめ","こしつ","こすう","こせい","こせき","こぜん","こそだて","こたい","こたえる","こたつ","こちょう","こっか","こつこつ","こつばん","こつぶ","こてい","こてん","ことがら","ことし","ことば","ことり","こなごな","こねこね","このまま","このみ","このよ","ごはん","こひつじ","こふう","こふん","こぼれる","ごまあぶら","こまかい","ごますり","こまつな","こまる","こむぎこ","こもじ","こもち","こもの","こもん","こやく","こやま","こゆう","こゆび","こよい","こよう","こりる","これくしょん","ころっけ","こわもて","こわれる","こんいん","こんかい","こんき","こんしゅう","こんすい","こんだて","こんとん","こんなん","こんびに","こんぽん","こんまけ","こんや","こんれい","こんわく","ざいえき","さいかい","さいきん","ざいげん","ざいこ","さいしょ","さいせい","ざいたく","ざいちゅう","さいてき","ざいりょう","さうな","さかいし","さがす","さかな","さかみち","さがる","さぎょう","さくし","さくひん","さくら","さこく","さこつ","さずかる","ざせき","さたん","さつえい","ざつおん","ざっか","ざつがく","さっきょく","ざっし","さつじん","ざっそう","さつたば","さつまいも","さてい","さといも","さとう","さとおや","さとし","さとる","さのう","さばく","さびしい","さべつ","さほう","さほど","さます","さみしい","さみだれ","さむけ","さめる","さやえんどう","さゆう","さよう","さよく","さらだ","ざるそば","さわやか","さわる","さんいん","さんか","さんきゃく","さんこう","さんさい","ざんしょ","さんすう","さんせい","さんそ","さんち","さんま","さんみ","さんらん","しあい","しあげ","しあさって","しあわせ","しいく","しいん","しうち","しえい","しおけ","しかい","しかく","じかん","しごと","しすう","じだい","したうけ","したぎ","したて","したみ","しちょう","しちりん","しっかり","しつじ","しつもん","してい","してき","してつ","じてん","じどう","しなぎれ","しなもの","しなん","しねま","しねん","しのぐ","しのぶ","しはい","しばかり","しはつ","しはらい","しはん","しひょう","しふく","じぶん","しへい","しほう","しほん","しまう","しまる","しみん","しむける","じむしょ","しめい","しめる","しもん","しゃいん","しゃうん","しゃおん","じゃがいも","しやくしょ","しゃくほう","しゃけん","しゃこ","しゃざい","しゃしん","しゃせん","しゃそう","しゃたい","しゃちょう","しゃっきん","じゃま","しゃりん","しゃれい","じゆう","じゅうしょ","しゅくはく","じゅしん","しゅっせき","しゅみ","しゅらば","じゅんばん","しょうかい","しょくたく","しょっけん","しょどう","しょもつ","しらせる","しらべる","しんか","しんこう","じんじゃ","しんせいじ","しんちく","しんりん","すあげ","すあし","すあな","ずあん","すいえい","すいか","すいとう","ずいぶん","すいようび","すうがく","すうじつ","すうせん","すおどり","すきま","すくう","すくない","すける","すごい","すこし","ずさん","すずしい","すすむ","すすめる","すっかり","ずっしり","ずっと","すてき","すてる","すねる","すのこ","すはだ","すばらしい","ずひょう","ずぶぬれ","すぶり","すふれ","すべて","すべる","ずほう","すぼん","すまい","すめし","すもう","すやき","すらすら","するめ","すれちがう","すろっと","すわる","すんぜん","すんぽう","せあぶら","せいかつ","せいげん","せいじ","せいよう","せおう","せかいかん","せきにん","せきむ","せきゆ","せきらんうん","せけん","せこう","せすじ","せたい","せたけ","せっかく","せっきゃく","ぜっく","せっけん","せっこつ","せっさたくま","せつぞく","せつだん","せつでん","せっぱん","せつび","せつぶん","せつめい","せつりつ","せなか","せのび","せはば","せびろ","せぼね","せまい","せまる","せめる","せもたれ","せりふ","ぜんあく","せんい","せんえい","せんか","せんきょ","せんく","せんげん","ぜんご","せんさい","せんしゅ","せんすい","せんせい","せんぞ","せんたく","せんちょう","せんてい","せんとう","せんぬき","せんねん","せんぱい","ぜんぶ","ぜんぽう","せんむ","せんめんじょ","せんもん","せんやく","せんゆう","せんよう","ぜんら","ぜんりゃく","せんれい","せんろ","そあく","そいとげる","そいね","そうがんきょう","そうき","そうご","そうしん","そうだん","そうなん","そうび","そうめん","そうり","そえもの","そえん","そがい","そげき","そこう","そこそこ","そざい","そしな","そせい","そせん","そそぐ","そだてる","そつう","そつえん","そっかん","そつぎょう","そっけつ","そっこう","そっせん","そっと","そとがわ","そとづら","そなえる","そなた","そふぼ","そぼく","そぼろ","そまつ","そまる","そむく","そむりえ","そめる","そもそも","そよかぜ","そらまめ","そろう","そんかい","そんけい","そんざい","そんしつ","そんぞく","そんちょう","ぞんび","ぞんぶん","そんみん","たあい","たいいん","たいうん","たいえき","たいおう","だいがく","たいき","たいぐう","たいけん","たいこ","たいざい","だいじょうぶ","だいすき","たいせつ","たいそう","だいたい","たいちょう","たいてい","だいどころ","たいない","たいねつ","たいのう","たいはん","だいひょう","たいふう","たいへん","たいほ","たいまつばな","たいみんぐ","たいむ","たいめん","たいやき","たいよう","たいら","たいりょく","たいる","たいわん","たうえ","たえる","たおす","たおる","たおれる","たかい","たかね","たきび","たくさん","たこく","たこやき","たさい","たしざん","だじゃれ","たすける","たずさわる","たそがれ","たたかう","たたく","ただしい","たたみ","たちばな","だっかい","だっきゃく","だっこ","だっしゅつ","だったい","たてる","たとえる","たなばた","たにん","たぬき","たのしみ","たはつ","たぶん","たべる","たぼう","たまご","たまる","だむる","ためいき","ためす","ためる","たもつ","たやすい","たよる","たらす","たりきほんがん","たりょう","たりる","たると","たれる","たれんと","たろっと","たわむれる","だんあつ","たんい","たんおん","たんか","たんき","たんけん","たんご","たんさん","たんじょうび","だんせい","たんそく","たんたい","だんち","たんてい","たんとう","だんな","たんにん","だんねつ","たんのう","たんぴん","だんぼう","たんまつ","たんめい","だんれつ","だんろ","だんわ","ちあい","ちあん","ちいき","ちいさい","ちえん","ちかい","ちから","ちきゅう","ちきん","ちけいず","ちけん","ちこく","ちさい","ちしき","ちしりょう","ちせい","ちそう","ちたい","ちたん","ちちおや","ちつじょ","ちてき","ちてん","ちぬき","ちぬり","ちのう","ちひょう","ちへいせん","ちほう","ちまた","ちみつ","ちみどろ","ちめいど","ちゃんこなべ","ちゅうい","ちゆりょく","ちょうし","ちょさくけん","ちらし","ちらみ","ちりがみ","ちりょう","ちるど","ちわわ","ちんたい","ちんもく","ついか","ついたち","つうか","つうじょう","つうはん","つうわ","つかう","つかれる","つくね","つくる","つけね","つける","つごう","つたえる","つづく","つつじ","つつむ","つとめる","つながる","つなみ","つねづね","つのる","つぶす","つまらない","つまる","つみき","つめたい","つもり","つもる","つよい","つるぼ","つるみく","つわもの","つわり","てあし","てあて","てあみ","ていおん","ていか","ていき","ていけい","ていこく","ていさつ","ていし","ていせい","ていたい","ていど","ていねい","ていひょう","ていへん","ていぼう","てうち","ておくれ","てきとう","てくび","でこぼこ","てさぎょう","てさげ","てすり","てそう","てちがい","てちょう","てつがく","てつづき","でっぱ","てつぼう","てつや","でぬかえ","てぬき","てぬぐい","てのひら","てはい","てぶくろ","てふだ","てほどき","てほん","てまえ","てまきずし","てみじか","てみやげ","てらす","てれび","てわけ","てわたし","でんあつ","てんいん","てんかい","てんき","てんぐ","てんけん","てんごく","てんさい","てんし","てんすう","でんち","てんてき","てんとう","てんない","てんぷら","てんぼうだい","てんめつ","てんらんかい","でんりょく","でんわ","どあい","といれ","どうかん","とうきゅう","どうぐ","とうし","とうむぎ","とおい","とおか","とおく","とおす","とおる","とかい","とかす","ときおり","ときどき","とくい","とくしゅう","とくてん","とくに","とくべつ","とけい","とける","とこや","とさか","としょかん","とそう","とたん","とちゅう","とっきゅう","とっくん","とつぜん","とつにゅう","とどける","ととのえる","とない","となえる","となり","とのさま","とばす","どぶがわ","とほう","とまる","とめる","ともだち","ともる","どようび","とらえる","とんかつ","どんぶり","ないかく","ないこう","ないしょ","ないす","ないせん","ないそう","なおす","ながい","なくす","なげる","なこうど","なさけ","なたでここ","なっとう","なつやすみ","ななおし","なにごと","なにもの","なにわ","なのか","なふだ","なまいき","なまえ","なまみ","なみだ","なめらか","なめる","なやむ","ならう","ならび","ならぶ","なれる","なわとび","なわばり","にあう","にいがた","にうけ","におい","にかい","にがて","にきび","にくしみ","にくまん","にげる","にさんかたんそ","にしき","にせもの","にちじょう","にちようび","にっか","にっき","にっけい","にっこう","にっさん","にっしょく","にっすう","にっせき","にってい","になう","にほん","にまめ","にもつ","にやり","にゅういん","にりんしゃ","にわとり","にんい","にんか","にんき","にんげん","にんしき","にんずう","にんそう","にんたい","にんち","にんてい","にんにく","にんぷ","にんまり","にんむ","にんめい","にんよう","ぬいくぎ","ぬかす","ぬぐいとる","ぬぐう","ぬくもり","ぬすむ","ぬまえび","ぬめり","ぬらす","ぬんちゃく","ねあげ","ねいき","ねいる","ねいろ","ねぐせ","ねくたい","ねくら","ねこぜ","ねこむ","ねさげ","ねすごす","ねそべる","ねだん","ねつい","ねっしん","ねつぞう","ねったいぎょ","ねぶそく","ねふだ","ねぼう","ねほりはほり","ねまき","ねまわし","ねみみ","ねむい","ねむたい","ねもと","ねらう","ねわざ","ねんいり","ねんおし","ねんかん","ねんきん","ねんぐ","ねんざ","ねんし","ねんちゃく","ねんど","ねんぴ","ねんぶつ","ねんまつ","ねんりょう","ねんれい","のいず","のおづま","のがす","のきなみ","のこぎり","のこす","のこる","のせる","のぞく","のぞむ","のたまう","のちほど","のっく","のばす","のはら","のべる","のぼる","のみもの","のやま","のらいぬ","のらねこ","のりもの","のりゆき","のれん","のんき","ばあい","はあく","ばあさん","ばいか","ばいく","はいけん","はいご","はいしん","はいすい","はいせん","はいそう","はいち","ばいばい","はいれつ","はえる","はおる","はかい","ばかり","はかる","はくしゅ","はけん","はこぶ","はさみ","はさん","はしご","ばしょ","はしる","はせる","ぱそこん","はそん","はたん","はちみつ","はつおん","はっかく","はづき","はっきり","はっくつ","はっけん","はっこう","はっさん","はっしん","はったつ","はっちゅう","はってん","はっぴょう","はっぽう","はなす","はなび","はにかむ","はぶらし","はみがき","はむかう","はめつ","はやい","はやし","はらう","はろうぃん","はわい","はんい","はんえい","はんおん","はんかく","はんきょう","ばんぐみ","はんこ","はんしゃ","はんすう","はんだん","ぱんち","ぱんつ","はんてい","はんとし","はんのう","はんぱ","はんぶん","はんぺん","はんぼうき","はんめい","はんらん","はんろん","ひいき","ひうん","ひえる","ひかく","ひかり","ひかる","ひかん","ひくい","ひけつ","ひこうき","ひこく","ひさい","ひさしぶり","ひさん","びじゅつかん","ひしょ","ひそか","ひそむ","ひたむき","ひだり","ひたる","ひつぎ","ひっこし","ひっし","ひつじゅひん","ひっす","ひつぜん","ぴったり","ぴっちり","ひつよう","ひてい","ひとごみ","ひなまつり","ひなん","ひねる","ひはん","ひびく","ひひょう","ひほう","ひまわり","ひまん","ひみつ","ひめい","ひめじし","ひやけ","ひやす","ひよう","びょうき","ひらがな","ひらく","ひりつ","ひりょう","ひるま","ひるやすみ","ひれい","ひろい","ひろう","ひろき","ひろゆき","ひんかく","ひんけつ","ひんこん","ひんしゅ","ひんそう","ぴんち","ひんぱん","びんぼう","ふあん","ふいうち","ふうけい","ふうせん","ぷうたろう","ふうとう","ふうふ","ふえる","ふおん","ふかい","ふきん","ふくざつ","ふくぶくろ","ふこう","ふさい","ふしぎ","ふじみ","ふすま","ふせい","ふせぐ","ふそく","ぶたにく","ふたん","ふちょう","ふつう","ふつか","ふっかつ","ふっき","ふっこく","ぶどう","ふとる","ふとん","ふのう","ふはい","ふひょう","ふへん","ふまん","ふみん","ふめつ","ふめん","ふよう","ふりこ","ふりる","ふるい","ふんいき","ぶんがく","ぶんぐ","ふんしつ","ぶんせき","ふんそう","ぶんぽう","へいあん","へいおん","へいがい","へいき","へいげん","へいこう","へいさ","へいしゃ","へいせつ","へいそ","へいたく","へいてん","へいねつ","へいわ","へきが","へこむ","べにいろ","べにしょうが","へらす","へんかん","べんきょう","べんごし","へんさい","へんたい","べんり","ほあん","ほいく","ぼうぎょ","ほうこく","ほうそう","ほうほう","ほうもん","ほうりつ","ほえる","ほおん","ほかん","ほきょう","ぼきん","ほくろ","ほけつ","ほけん","ほこう","ほこる","ほしい","ほしつ","ほしゅ","ほしょう","ほせい","ほそい","ほそく","ほたて","ほたる","ぽちぶくろ","ほっきょく","ほっさ","ほったん","ほとんど","ほめる","ほんい","ほんき","ほんけ","ほんしつ","ほんやく","まいにち","まかい","まかせる","まがる","まける","まこと","まさつ","まじめ","ますく","まぜる","まつり","まとめ","まなぶ","まぬけ","まねく","まほう","まもる","まゆげ","まよう","まろやか","まわす","まわり","まわる","まんが","まんきつ","まんぞく","まんなか","みいら","みうち","みえる","みがく","みかた","みかん","みけん","みこん","みじかい","みすい","みすえる","みせる","みっか","みつかる","みつける","みてい","みとめる","みなと","みなみかさい","みねらる","みのう","みのがす","みほん","みもと","みやげ","みらい","みりょく","みわく","みんか","みんぞく","むいか","むえき","むえん","むかい","むかう","むかえ","むかし","むぎちゃ","むける","むげん","むさぼる","むしあつい","むしば","むじゅん","むしろ","むすう","むすこ","むすぶ","むすめ","むせる","むせん","むちゅう","むなしい","むのう","むやみ","むよう","むらさき","むりょう","むろん","めいあん","めいうん","めいえん","めいかく","めいきょく","めいさい","めいし","めいそう","めいぶつ","めいれい","めいわく","めぐまれる","めざす","めした","めずらしい","めだつ","めまい","めやす","めんきょ","めんせき","めんどう","もうしあげる","もうどうけん","もえる","もくし","もくてき","もくようび","もちろん","もどる","もらう","もんく","もんだい","やおや","やける","やさい","やさしい","やすい","やすたろう","やすみ","やせる","やそう","やたい","やちん","やっと","やっぱり","やぶる","やめる","ややこしい","やよい","やわらかい","ゆうき","ゆうびんきょく","ゆうべ","ゆうめい","ゆけつ","ゆしゅつ","ゆせん","ゆそう","ゆたか","ゆちゃく","ゆでる","ゆにゅう","ゆびわ","ゆらい","ゆれる","ようい","ようか","ようきゅう","ようじ","ようす","ようちえん","よかぜ","よかん","よきん","よくせい","よくぼう","よけい","よごれる","よさん","よしゅう","よそう","よそく","よっか","よてい","よどがわく","よねつ","よやく","よゆう","よろこぶ","よろしい","らいう","らくがき","らくご","らくさつ","らくだ","らしんばん","らせん","らぞく","らたい","らっか","られつ","りえき","りかい","りきさく","りきせつ","りくぐん","りくつ","りけん","りこう","りせい","りそう","りそく","りてん","りねん","りゆう","りゅうがく","りよう","りょうり","りょかん","りょくちゃ","りょこう","りりく","りれき","りろん","りんご","るいけい","るいさい","るいじ","るいせき","るすばん","るりがわら","れいかん","れいぎ","れいせい","れいぞうこ","れいとう","れいぼう","れきし","れきだい","れんあい","れんけい","れんこん","れんさい","れんしゅう","れんぞく","れんらく","ろうか","ろうご","ろうじん","ろうそく","ろくが","ろこつ","ろじうら","ろしゅつ","ろせん","ろてん","ろめん","ろれつ","ろんぎ","ろんぱ","ろんぶん","ろんり","わかす","わかめ","わかやま","わかれる","わしつ","わじまし","わすれもの","わらう","われる"];Ci.space=" ";const qi=["ábaco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","acción","aceite","acelga","acento","aceptar","ácido","aclarar","acné","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","aéreo","afectar","afición","afinar","afirmar","ágil","agitar","agonía","agosto","agotar","agregar","agrio","agua","agudo","águila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacrán","alambre","alarma","alba","álbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodón","aliado","aliento","alivio","alma","almeja","almíbar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","ámbar","ámbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","andén","anemia","ángulo","anillo","ánimo","anís","anotar","antena","antiguo","antojo","anual","anular","anuncio","añadir","añejo","año","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","araña","arar","árbitro","árbol","arbusto","archivo","arco","arder","ardilla","arduo","área","árido","aries","armonía","arnés","aroma","arpa","arpón","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","áspero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","ático","atleta","átomo","atraer","atroz","atún","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avión","aviso","ayer","ayuda","ayuno","azafrán","azar","azote","azúcar","azufre","azul","baba","babor","bache","bahía","baile","bajar","balanza","balcón","balde","bambú","banco","banda","baño","barba","barco","barniz","barro","báscula","bastón","basura","batalla","batería","batir","batuta","baúl","bazar","bebé","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsái","borde","borrar","bosque","bote","botín","bóveda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufón","búho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzón","caballo","cabeza","cabina","cabra","cacao","cadáver","cadena","caer","café","caída","caimán","caja","cajón","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","cáncer","candil","canela","canguro","canica","canto","caña","cañón","caoba","caos","capaz","capitán","capote","captar","capucha","cara","carbón","cárcel","careta","carga","cariño","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","célebre","celoso","célula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","césped","cetro","chacal","chaleco","champú","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclón","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","ciprés","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","clínica","cobre","cocción","cochino","cocina","coco","código","codo","cofre","coger","cohete","cojín","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","cómodo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazón","corbata","corcho","cordón","corona","correr","coser","cosmos","costa","cráneo","cráter","crear","crecer","creído","crema","cría","crimen","cripta","crisis","cromo","crónica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupón","cúpula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","dátil","deber","débil","década","decir","dedo","defensa","definir","dejar","delfín","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvío","detalle","detener","deuda","día","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difícil","digno","dilema","diluir","dinero","directo","dirigir","disco","diseño","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","dragón","droga","ducha","duda","duelo","dueño","dulce","dúo","duque","durar","dureza","duro","ébano","ebrio","echar","eco","ecuador","edad","edición","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","élite","elixir","elogio","eludir","embudo","emitir","emoción","empate","empeño","empleo","empresa","enano","encargo","enchufe","encía","enemigo","enero","enfado","enfermo","engaño","enigma","enlace","enorme","enredo","ensayo","enseñar","entero","entrar","envase","envío","época","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espía","esposa","espuma","esquí","estar","este","estilo","estufa","etapa","eterno","ética","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","éxito","experto","explicar","exponer","extremo","fábrica","fábula","fachada","fácil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","faraón","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fértil","fervor","festín","fiable","fianza","fiar","fibra","ficción","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flúor","fobia","foca","fogata","fogón","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","frágil","franja","frase","fraude","freír","freno","fresa","frío","frito","fruta","fuego","fuente","fuerza","fuga","fumar","función","funda","furgón","furia","fusil","fútbol","futuro","gacela","gafas","gaita","gajo","gala","galería","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavilán","gemelo","gemir","gen","género","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gráfico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","grúa","grueso","grumo","grupo","guante","guapo","guardia","guerra","guía","guiño","guion","guiso","guitarra","gusano","gustar","haber","hábil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazaña","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","héroe","hervir","hielo","hierro","hígado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","húmedo","humilde","humo","hundir","huracán","hurto","icono","ideal","idioma","ídolo","iglesia","iglú","igual","ilegal","ilusión","imagen","imán","imitar","impar","imperio","imponer","impulso","incapaz","índice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","interés","íntimo","intuir","inútil","invierno","ira","iris","ironía","isla","islote","jabalí","jabón","jamón","jarabe","jardín","jarra","jaula","jazmín","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","júpiter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladrón","lagarto","lágrima","laguna","laico","lamer","lámina","lámpara","lana","lancha","langosta","lanza","lápiz","largo","larva","lástima","lata","látex","latir","laurel","lavar","lazo","leal","lección","leche","lector","leer","legión","legumbre","lejano","lengua","lento","leña","león","leopardo","lesión","letal","letra","leve","leyenda","libertad","libro","licor","líder","lidiar","lienzo","liga","ligero","lima","límite","limón","limpio","lince","lindo","línea","lingote","lino","linterna","líquido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","loción","loco","locura","lógica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","maíz","maldad","maleta","malla","malo","mamá","mambo","mamut","manco","mando","manejar","manga","maniquí","manjar","mano","manso","manta","mañana","mapa","máquina","mar","marco","marea","marfil","margen","marido","mármol","marrón","martes","marzo","masa","máscara","masivo","matar","materia","matiz","matriz","máximo","mayor","mazorca","mecha","medalla","medio","médula","mejilla","mejor","melena","melón","memoria","menor","mensaje","mente","menú","mercado","merengue","mérito","mes","mesón","meta","meter","método","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millón","mimo","mina","minero","mínimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","moción","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","moño","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","móvil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","muñeca","mural","muro","músculo","museo","musgo","música","muslo","nácar","nación","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","náusea","naval","nave","navidad","necio","néctar","negar","negocio","negro","neón","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","niñez","niño","nítido","nivel","nobleza","noche","nómina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","núcleo","nudillo","nudo","nuera","nueve","nuez","nulo","número","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","océano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oído","oír","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opción","ópera","opinar","oponer","optar","óptica","opuesto","oración","orador","oral","órbita","orca","orden","oreja","órgano","orgía","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadía","oscuro","osezno","oso","ostra","otoño","otro","oveja","óvulo","óxido","oxígeno","oyente","ozono","pacto","padre","paella","página","pago","país","pájaro","palabra","palco","paleta","pálido","palma","paloma","palpar","pan","panal","pánico","pantera","pañuelo","papá","papel","papilla","paquete","parar","parcela","pared","parir","paro","párpado","parque","párrafo","parte","pasar","paseo","pasión","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peatón","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldaño","pelea","peligro","pellejo","pelo","peluca","pena","pensar","peñón","peón","peor","pepino","pequeño","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pésimo","pestaña","pétalo","petróleo","pez","pezuña","picar","pichón","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","piña","piojo","pipa","pirata","pisar","piscina","piso","pista","pitón","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesía","poeta","polen","policía","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porción","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","príncipe","prisión","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","próximo","prueba","público","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmón","pulpo","pulso","puma","punto","puñal","puño","pupa","pupila","puré","quedar","queja","quemar","querer","queso","quieto","química","quince","quitar","rábano","rabia","rabo","ración","radical","raíz","rama","rampa","rancho","rango","rapaz","rápido","rapto","rasgo","raspa","rato","rayo","raza","razón","reacción","realidad","rebaño","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refrán","refugio","regalo","regir","regla","regreso","rehén","reino","reír","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","revés","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","rígido","rigor","rincón","riñón","río","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubí","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sábado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmón","salón","salsa","salto","salud","salvar","samba","sanción","sandía","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sartén","sastre","satán","sauna","saxofón","sección","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","señal","señor","separar","sepia","sequía","ser","serie","sermón","servir","sesenta","sesión","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","sílaba","silbar","silencio","silla","símbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","sólido","soltar","solución","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","sostén","sótano","suave","subir","suceso","sudor","suegra","suelo","sueño","suerte","sufrir","sujeto","sultán","sumar","superar","suplir","suponer","supremo","sur","surco","sureño","surgir","susto","sutil","tabaco","tabique","tabla","tabú","taco","tacto","tajo","talar","talco","talento","talla","talón","tamaño","tambor","tango","tanque","tapa","tapete","tapia","tapón","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazón","teatro","techo","tecla","técnica","tejado","tejer","tejido","tela","teléfono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teoría","terapia","terco","término","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburón","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","tímido","timo","tinta","tío","típico","tipo","tira","tirón","titán","títere","título","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","tórax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","tóxico","trabajo","tractor","traer","tráfico","trago","traje","tramo","trance","trato","trauma","trazar","trébol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tubería","tubo","tuerto","tumba","tumor","túnel","túnica","turbina","turismo","turno","tutor","ubicar","úlcera","umbral","unidad","unir","universo","uno","untar","uña","urbano","urbe","urgente","urna","usar","usuario","útil","utopía","uva","vaca","vacío","vacuna","vagar","vago","vaina","vajilla","vale","válido","valle","valor","válvula","vampiro","vara","variar","varón","vaso","vecino","vector","vehículo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vía","viaje","vibrar","vicio","víctima","vida","vídeo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","viñedo","violín","viral","virgo","virtud","visor","víspera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volcán","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"];qi.space=" ";class Li extends ct{constructor(a,c,o){super({mnemonic:a,seed:c,wordlist:o}),this.Wordlist=Ni,this.es=qi,this.jp=Ci}setLang(a){switch(a){case"es":this.Wordlist=qi;break;case"jp":this.Wordlist=Ci;break;case"en":default:this.Wordlist=Ni;break}}toBw(a){if(a||(a=new ot),this.mnemonic){const c=he.from(this.mnemonic);a.writeVarIntNum(c.length),a.write(c)}else a.writeVarIntNum(0);return this.seed?(a.writeVarIntNum(this.seed.length),a.write(this.seed)):a.writeVarIntNum(0),a}fromBr(a){const c=a.readVarIntNum();c>0&&(this.mnemonic=a.read(c).toString());const o=a.readVarIntNum();return o>0&&(this.seed=a.read(o)),this}fromRandom(a){if(a||(a=128),a%32!==0)throw new Error("bits must be multiple of 32");if(a<128)throw new Error("bits must be at least 128");const c=or.getRandomBuffer(a/8);return this.entropy2Mnemonic(c),this.mnemonic2Seed(),this}static fromRandom(a){return new this().fromRandom(a)}async asyncFromRandom(a){a||(a=128);const c=or.getRandomBuffer(a/8);let o=await Je.asyncObjectMethod(this,"entropy2Mnemonic",[c]);const x=new Li().fromFastBuffer(o.resbuf);return o=await Je.asyncObjectMethod(x,"mnemonic2Seed",[]),this.fromFastBuffer(o.resbuf)}static asyncFromRandom(a){return new this().asyncFromRandom(a)}fromEntropy(a){return this.entropy2Mnemonic(a),this}static fromEntropy(a){return new this().fromEntropy(a)}async asyncFromEntropy(a){const c=await Je.asyncObjectMethod(this,"fromEntropy",[a]);return this.fromFastBuffer(c.resbuf)}static asyncFromEntropy(a){return new this().asyncFromEntropy(a)}fromString(a){return this.mnemonic=a.trim(),this}toString(){return this.mnemonic}toSeed(a){return this.mnemonic2Seed(a),this.seed}async asyncToSeed(a){a===void 0&&(a="");const c=[a];return(await Je.asyncObjectMethod(this,"toSeed",c)).resbuf}entropy2Mnemonic(a){if(!he.isBuffer(a)||a.length<128/8)throw new Error("Entropy is less than 128 bits. It must be 128 bits or more.");const c=Fe.sha256(a);let o="";const x=a.length*8;for(let y=0;y<a.length;y++)o=o+("00000000"+a[y].toString(2)).slice(-8);let n=c[0].toString(2);if(n=("00000000"+n).slice(-8).slice(0,x/32),o=o+n,o.length%11!==0)throw new Error("internal error - entropy not an even multiple of 11 bits - "+o.length);let g="";for(let y=0;y<o.length/11;y++){g!==""&&(g=g+this.Wordlist.space);const b=parseInt(o.slice(y*11,(y+1)*11),2);g=g+this.Wordlist[b]}return this.mnemonic=g,this}check(){const c=this.mnemonic.split(this.Wordlist.space);let o="";for(let d=0;d<c.length;d++){const w=this.Wordlist.indexOf(c[d]);if(w<0)return!1;o=o+("00000000000"+w.toString(2)).slice(-11)}if(o.length%11!==0)throw new Error("internal error - entropy not an even multiple of 11 bits - "+o.length);const x=o.length/33,n=o.slice(-x),g=o.slice(0,o.length-x),y=he.alloc(g.length/8);for(let d=0;d<g.length/8;d++)y.writeUInt8(parseInt(o.slice(d*8,(d+1)*8),2),d);let v=Fe.sha256(y)[0].toString(2);return v=("00000000"+v).slice(-8).slice(0,x),v===n}mnemonic2Seed(a=""){let c=this.mnemonic;if(!this.check())throw new Error("Mnemonic does not pass the check - was the mnemonic typed incorrectly? Are there extra spaces?");if(typeof a!="string")throw new Error("passphrase must be a string or undefined");c=c.normalize("NFKD"),a=a.normalize("NFKD");const o=he.from(c),x=he.concat([he.from("mnemonic"),he.from(a)]);return this.seed=Vl.pbkdf2Sync(o,x,2048,64,"sha512"),this}isValid(a=""){let c;try{c=!!this.mnemonic2Seed(a)}catch{c=!1}return c}static isValid(a,c=""){return new Li(a).isValid(c)}}class Ft extends ct{constructor(a,c,o=Wt){super({privKey:a,pubKey:c}),this.PrivKey=o}fromJSON(a){return a.privKey&&(this.privKey=this.PrivKey.fromJSON(a.privKey)),a.pubKey&&(this.pubKey=kt.fromJSON(a.pubKey)),this}fromBr(a){const c=a.readUInt8();c>0&&(this.privKey=new this.PrivKey().fromFastBuffer(a.read(c)));const o=a.readUInt8();return o>0&&(this.pubKey=new kt().fromFastBuffer(a.read(o))),this}toBw(a){if(a||(a=new ot),this.privKey){const c=this.privKey.toFastBuffer();a.writeUInt8(c.length),a.write(c)}else a.writeUInt8(0);if(this.pubKey){const c=this.pubKey.toFastBuffer();a.writeUInt8(c.length),a.write(c)}else a.writeUInt8(0);return a}fromString(a){return this.fromJSON(JSON.parse(a))}toString(){return JSON.stringify(this.toJSON())}toPublic(){const a=new Ft().fromObject(this);return a.privKey=void 0,a}fromPrivKey(a){return this.privKey=a,this.pubKey=new kt().fromPrivKey(a),this}static fromPrivKey(a){return new this().fromPrivKey(a)}async asyncFromPrivKey(a){return this.privKey=a,this.pubKey=await new kt().asyncFromPrivKey(a),this}static asyncFromPrivKey(a){return new this().asyncFromPrivKey(a)}fromRandom(){return this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new kt().fromPrivKey(this.privKey),this}static fromRandom(){return new this().fromRandom()}async asyncFromRandom(){return this.privKey=new this.PrivKey().fromRandom(),this.asyncFromPrivKey(this.privKey)}static asyncFromRandom(){return new this().asyncFromRandom()}}Ft.Mainnet=class extends Ft{constructor(M,a){super(M,a,Wt.Mainnet)}},Ft.Testnet=class extends Ft{constructor(M,a){super(M,a,Wt.Testnet)}};class Dt extends ct{constructor(a,c,o,x,n,g){super({sig:a,keyPair:c,hashBuf:o,k:x,endian:n,verified:g})}toJSON(){return{sig:this.sig?this.sig.toString():void 0,keyPair:this.keyPair?this.keyPair.toBuffer().toString("hex"):void 0,hashBuf:this.hashBuf?this.hashBuf.toString("hex"):void 0,k:this.k?this.k.toString():void 0,endian:this.endian,verified:this.verified}}fromJSON(a){return this.sig=a.sig?new $e().fromString(a.sig):void 0,this.keyPair=a.keyPair?new Ft().fromBuffer(he.from(a.keyPair,"hex")):void 0,this.hashBuf=a.hashBuf?he.from(a.hashBuf,"hex"):void 0,this.k=a.k?new Ee().fromString(a.k):void 0,this.endian=a.endian,this.verified=a.verified,this}toBuffer(){const a=JSON.stringify(this.toJSON());return he.from(a)}fromBuffer(a){const c=JSON.parse(a.toString());return this.fromJSON(c)}calcrecovery(){for(let a=0;a<4;a++){let c;this.sig.recovery=a;try{c=this.sig2PubKey()}catch{continue}if(c.point.eq(this.keyPair.pubKey.point)){const o=this.keyPair.pubKey.compressed;return this.sig.compressed=this.keyPair.pubKey.compressed===void 0?!0:o,this}}throw this.sig.recovery=void 0,new Error("Unable to find valid recovery factor")}async asyncCalcrecovery(){const a=await Je.asyncObjectMethod(this,"calcrecovery",[]);return this.fromFastBuffer(a.resbuf)}static calcrecovery(a,c,o){return new Dt().fromObject({sig:a,keyPair:new Ft().fromObject({pubKey:c}),hashBuf:o}).calcrecovery().sig}static async asyncCalcrecovery(a,c,o){const x=await Je.asyncClassMethod(Dt,"calcrecovery",[a,c,o]);return new $e().fromFastBuffer(x.resbuf)}fromString(a){const c=JSON.parse(a);return c.hashBuf&&(this.hashBuf=he.from(c.hashBuf,"hex")),c.keyPair&&(this.keyPair=new Ft().fromString(c.keyPair)),c.sig&&(this.sig=new $e().fromString(c.sig)),c.k&&(this.k=new Ee(c.k,10)),this}randomK(){const a=st.getN();let c;do c=new Ee().fromBuffer(or.getRandomBuffer(32));while(!(c.lt(a)&&c.gt(0)));return this.k=c,this}deterministicK(a){let c=he.alloc(32);c.fill(1);let o=he.alloc(32);o.fill(0);const x=this.keyPair.privKey.bn.toBuffer({size:32});o=Fe.sha256Hmac(he.concat([c,he.from([0]),x,this.hashBuf]),o),c=Fe.sha256Hmac(c,o),o=Fe.sha256Hmac(he.concat([c,he.from([1]),x,this.hashBuf]),o),c=Fe.sha256Hmac(c,o),c=Fe.sha256Hmac(c,o);let n=new Ee().fromBuffer(c);const g=st.getN();a===void 0&&(a=0);for(let y=0;y<a||!(n.lt(g)&&n.gt(0));y++)o=Fe.sha256Hmac(he.concat([c,he.from([0])]),o),c=Fe.sha256Hmac(c,o),c=Fe.sha256Hmac(c,o),n=new Ee().fromBuffer(c);return this.k=n,this}sig2PubKey(){const a=this.sig.recovery;if(!(a===0||a===1||a===2||a===3))throw new Error("i must be equal to 0, 1, 2, or 3");const c=new Ee().fromBuffer(this.hashBuf),o=this.sig.r,x=this.sig.s,n=a&1,g=a>>1,y=st.getN(),b=st.getG(),v=g?o.add(y):o,d=st.fromX(n,v);let w="";try{d.mul(y)}catch(P){w=P.message}if(w!=="point mul out of range")throw new Error("nR is not a valid curve point");const _=c.neg().umod(y),E=o.invm(y),B=d.mul(x).add(b.mul(_)).mul(E),A=new kt(B);return A.compressed=this.sig.compressed,A.validate(),A}async asyncSig2PubKey(){const a=await Je.asyncObjectMethod(this,"sig2PubKey",[]);return kt.fromFastBuffer(a.resbuf)}static sig2PubKey(a,c){return new Dt().fromObject({sig:a,hashBuf:c}).sig2PubKey()}static async asyncSig2PubKey(a,c){return await new Dt().fromObject({sig:a,hashBuf:c}).asyncSig2PubKey()}verifyStr(a=!0){if(!he.isBuffer(this.hashBuf)||this.hashBuf.length!==32)return"hashBuf must be a 32 byte buffer";try{this.keyPair.pubKey.validate()}catch(d){return"Invalid pubKey: "+d}const c=this.sig.r,o=this.sig.s;if(!(c.gt(0)&&c.lt(st.getN()))||!(o.gt(0)&&o.lt(st.getN())))return"r and s not in range";if(a&&!this.sig.hasLowS())return"s is too high and does not satisfy low s contraint - see bip 62";const x=new Ee().fromBuffer(this.hashBuf,this.endian?{endian:this.endian}:void 0),n=st.getN(),g=o.invm(n),y=g.mul(x).mod(n),b=g.mul(c).mod(n),v=st.getG().mulAdd(y,this.keyPair.pubKey.point,b);return v.isInfinity()?"p is infinity":v.getX().mod(n).cmp(c)!==0?"Invalid signature":!1}sign(){const a=this.endian==="little"?new Lt(this.hashBuf).readReverse():this.hashBuf,c=this.keyPair.privKey,o=c.bn;if(!a||!c||!o)throw new Error("invalid parameters");if(!he.isBuffer(a)||a.length!==32)throw new Error("hashBuf must be a 32 byte buffer");const x=st.getN(),n=st.getG(),g=new Ee().fromBuffer(a);let y=0,b,v,d,w;do(!this.k||y>0)&&this.deterministicK(y),y++,b=this.k,v=n.mul(b),d=v.getX().mod(x),w=b.invm(x).mul(g.add(o.mul(d))).mod(x);while(d.cmp(0)<=0||w.cmp(0)<=0);return w.gt(new Ee().fromBuffer(he.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(w=st.getN().sub(w)),this.sig=$e.fromObject({r:d,s:w,compressed:this.keyPair.pubKey.compressed}),this}async asyncSign(){const a=await Je.asyncObjectMethod(this,"sign",[]);return this.fromFastBuffer(a.resbuf)}signRandomK(){return this.randomK(),this.sign()}toString(){const a={};return this.hashBuf&&(a.hashBuf=this.hashBuf.toString("hex")),this.keyPair&&(a.keyPair=this.keyPair.toString()),this.sig&&(a.sig=this.sig.toString()),this.k&&(a.k=this.k.toString()),JSON.stringify(a)}verify(a=!0){return this.verifyStr(a)?this.verified=!1:this.verified=!0,this}async asyncVerify(a=!0){const c=await Je.asyncObjectMethod(this,"verify",[a]);return this.fromFastBuffer(c.resbuf)}static sign(a,c,o){return new Dt().fromObject({hashBuf:a,endian:o,keyPair:c}).sign().sig}static async asyncSign(a,c,o){const x=new Dt().fromObject({hashBuf:a,endian:o,keyPair:c});return await x.asyncSign(),x.sig}static verify(a,c,o,x,n=!0){return new Dt().fromObject({hashBuf:a,endian:x,sig:c,keyPair:new Ft().fromObject({pubKey:o})}).verify(n).verified}static async asyncVerify(a,c,o,x,n=!0){const g=new Dt().fromObject({hashBuf:a,endian:x,sig:c,keyPair:new Ft().fromObject({pubKey:o})});return await g.asyncVerify(n),g.verified}}class Yt extends ct{constructor(a,c,o,x,n){super({messageBuf:a,keyPair:c,sig:o,address:x,verified:n})}static magicHash(a){if(!he.isBuffer(a))throw new Error("messageBuf must be a buffer");const c=new ot;c.writeVarIntNum(Yt.magicBytes.length),c.write(Yt.magicBytes),c.writeVarIntNum(a.length),c.write(a);const o=c.toBuffer();return Fe.sha256Sha256(o)}static async asyncMagicHash(a){const c=[a];return(await Je.asyncClassMethod(Yt,"magicHash",c)).resbuf}static sign(a,c){const o=new Yt(a,c);return o.sign(),o.sig.toCompact().toString("base64")}static async asyncSign(a,c){const o=[a,c],x=await Je.asyncClassMethod(Yt,"sign",o);return JSON.parse(x.resbuf.toString())}static verify(a,c,o){const x=he.from(c,"base64"),n=new Yt;return n.messageBuf=a,n.sig=new $e().fromCompact(x),n.address=o,n.verify().verified}static async asyncVerify(a,c,o){const x=[a,c,o],n=await Je.asyncClassMethod(Yt,"verify",x);return JSON.parse(n.resbuf.toString())}sign(){const a=Yt.magicHash(this.messageBuf),c=new Dt().fromObject({hashBuf:a,keyPair:this.keyPair});return c.sign(),c.calcrecovery(),this.sig=c.sig,this}verify(){const a=Yt.magicHash(this.messageBuf),c=new Dt;if(c.hashBuf=a,c.sig=this.sig,c.keyPair=new Ft,c.keyPair.pubKey=c.sig2PubKey(),!c.verify())return this.verified=!1,this;const o=new Qt().fromPubKey(c.keyPair.pubKey,void 0,this.sig.compressed);return vr(o.hashBuf,this.address.hashBuf)?this.verified=!0:this.verified=!1,this}}Yt.magicBytes=he.from(`Bitcoin Signed Message:
28
- `);class Fi extends ct{constructor(a,c,o,x,n,g){super({versionBytesNum:a,prevBlockHashBuf:c,merkleRootBuf:o,time:x,bits:n,nonce:g})}fromJSON(a){return this.fromObject({versionBytesNum:a.versionBytesNum,prevBlockHashBuf:he.from(a.prevBlockHashBuf,"hex"),merkleRootBuf:he.from(a.merkleRootBuf,"hex"),time:a.time,bits:a.bits,nonce:a.nonce}),this}toJSON(){return{versionBytesNum:this.versionBytesNum,prevBlockHashBuf:this.prevBlockHashBuf.toString("hex"),merkleRootBuf:this.merkleRootBuf.toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}}fromBr(a){return this.versionBytesNum=a.readUInt32LE(),this.prevBlockHashBuf=a.read(32),this.merkleRootBuf=a.read(32),this.time=a.readUInt32LE(),this.bits=a.readUInt32LE(),this.nonce=a.readUInt32LE(),this}toBw(a){return a||(a=new ot),a.writeUInt32LE(this.versionBytesNum),a.write(this.prevBlockHashBuf),a.write(this.merkleRootBuf),a.writeUInt32LE(this.time),a.writeUInt32LE(this.bits),a.writeUInt32LE(this.nonce),a}}class Fr extends ct{constructor(a,c,o,x){super({hashBuf:a,buf:c,merkle1:o,merkle2:x})}hash(){if(this.hashBuf)return this.hashBuf;if(this.buf)return Fe.sha256Sha256(this.buf);const a=this.merkle1.hash(),c=this.merkle2.hash();return this.buf=he.concat([a,c]),Fe.sha256Sha256(this.buf)}fromBuffers(a){if(a.length<1)throw new Error("buffers must have a length");a=a.slice();const c=Math.log2(a.length);if(!Number.isInteger(c)){const n=a[a.length-1],g=Math.pow(2,Math.ceil(c));for(let y=a.length;y<g;y++)a.push(n)}const o=a.slice(0,a.length/2),x=a.slice(a.length/2);return this.fromBufferArrays(o,x),this}static fromBuffers(a){return new this().fromBuffers(a)}fromBufferArrays(a,c){if(a.length===1)return this.merkle1=new Fr(void 0,a[0]),this.merkle2=new Fr(void 0,c[0]),this;const o=a.slice(0,a.length/2),x=a.slice(a.length/2);this.merkle1=new Fr().fromBufferArrays(o,x);const n=c.slice(0,c.length/2),g=c.slice(c.length/2);return this.merkle2=new Fr().fromBufferArrays(n,g),this}static fromBufferArrays(a,c){return new this().fromBufferArrays(a,c)}leavesNum(){if(this.merkle1)return this.merkle1.leavesNum()+this.merkle2.leavesNum();if(this.buf)return 1;throw new Error("invalid number of leaves")}}class Di extends ct{constructor(a,c,o){super(),this.fromObject({prevoutsHashBuf:a,sequenceHashBuf:c,outputsHashBuf:o})}fromBuffer(a){return this.fromJSON(JSON.parse(a.toString()))}toBuffer(){return he.from(JSON.stringify(this.toJSON()))}fromJSON(a){return this.prevoutsHashBuf=a.prevoutsHashBuf?he.from(a.prevoutsHashBuf,"hex"):void 0,this.sequenceHashBuf=a.sequenceHashBuf?he.from(a.sequenceHashBuf,"hex"):void 0,this.outputsHashBuf=a.outputsHashBuf?he.from(a.outputsHashBuf,"hex"):void 0,this}toJSON(){return{prevoutsHashBuf:this.prevoutsHashBuf?this.prevoutsHashBuf.toString("hex"):void 0,sequenceHashBuf:this.sequenceHashBuf?this.sequenceHashBuf.toString("hex"):void 0,outputsHashBuf:this.outputsHashBuf?this.outputsHashBuf.toString("hex"):void 0}}}class Pt extends ct{constructor(a){super({buf:a})}fromJSON(a){return this.fromObject({buf:he.from(a,"hex")}),this}toJSON(){return this.buf.toString("hex")}fromBuffer(a){return this.buf=a,this}fromBr(a){return this.buf=a.readVarIntBuf(),this}fromBn(a){return this.buf=new ot().writeVarIntBn(a).toBuffer(),this}static fromBn(a){return new this().fromBn(a)}fromNumber(a){return this.buf=new ot().writeVarIntNum(a).toBuffer(),this}static fromNumber(a){return new this().fromNumber(a)}toBuffer(){return this.buf}toBn(){return new Lt(this.buf).readVarIntBn()}toNumber(){return new Lt(this.buf).readVarIntNum()}}class It extends ct{constructor(a,c,o,x,n=4294967295){super({txHashBuf:a,txOutNum:c,scriptVi:o,script:x,nSequence:n})}setScript(a){return this.scriptVi=Pt.fromNumber(a.toBuffer().length),this.script=a,this}fromProperties(a,c,o,x){return this.fromObject({txHashBuf:a,txOutNum:c,nSequence:x}),this.setScript(o),this}static fromProperties(a,c,o,x){return new this().fromProperties(a,c,o,x)}fromJSON(a){return this.fromObject({txHashBuf:typeof a.txHashBuf<"u"?he.from(a.txHashBuf,"hex"):void 0,txOutNum:a.txOutNum,scriptVi:typeof a.scriptVi<"u"?Pt.fromJSON(a.scriptVi):void 0,script:typeof a.script<"u"?at.fromJSON(a.script):void 0,nSequence:a.nSequence}),this}toJSON(){return{txHashBuf:typeof this.txHashBuf<"u"?this.txHashBuf.toString("hex"):void 0,txOutNum:this.txOutNum,scriptVi:typeof this.scriptVi<"u"?this.scriptVi.toJSON():void 0,script:typeof this.script<"u"?this.script.toJSON():void 0,nSequence:this.nSequence}}fromBr(a){return this.txHashBuf=a.read(32),this.txOutNum=a.readUInt32LE(),this.scriptVi=Pt.fromBuffer(a.readVarIntBuf()),this.script=at.fromBuffer(a.read(this.scriptVi.toNumber())),this.nSequence=a.readUInt32LE(),this}toBw(a){return a||(a=new ot),a.write(this.txHashBuf),a.writeUInt32LE(this.txOutNum),a.write(this.scriptVi.buf),a.write(this.script.toBuffer()),a.writeUInt32LE(this.nSequence),a}fromPubKeyHashTxOut(a,c,o,x){const n=new at;if(o.script.isPubKeyHashOut())n.writeOpCode(oe.OP_0),x?n.writeBuffer(x.toBuffer()):n.writeOpCode(oe.OP_0);else throw new Error("txOut must be of type pubKeyHash");return this.txHashBuf=a,this.txOutNum=c,this.setScript(n),this}hasNullInput(){return this.txHashBuf.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.txOutNum===4294967295}setNullInput(){this.txHashBuf=he.alloc(32),this.txHashBuf.fill(0),this.txOutNum=4294967295}}It.LOCKTIME_VERIFY_SEQUENCE=1,It.SEQUENCE_FINAL=4294967295,It.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31,It.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22,It.SEQUENCE_LOCKTIME_MASK=65535,It.SEQUENCE_LOCKTIME_GRANULARITY=9;class Jt extends ct{constructor(a,c,o){super({valueBn:a,scriptVi:c,script:o})}setScript(a){return this.scriptVi=Pt.fromNumber(a.toBuffer().length),this.script=a,this}fromProperties(a,c){return this.fromObject({valueBn:a}),this.setScript(c),this}static fromProperties(a,c){return new this().fromProperties(a,c)}fromJSON(a){return this.fromObject({valueBn:new Ee().fromJSON(a.valueBn),scriptVi:new Pt().fromJSON(a.scriptVi),script:new at().fromJSON(a.script)}),this}toJSON(){return{valueBn:this.valueBn.toJSON(),scriptVi:this.scriptVi.toJSON(),script:this.script.toJSON()}}fromBr(a){return this.valueBn=a.readUInt64LEBn(),this.scriptVi=Pt.fromNumber(a.readVarIntNum()),this.script=new at().fromBuffer(a.read(this.scriptVi.toNumber())),this}toBw(a){return a||(a=new ot),a.writeUInt64LEBn(this.valueBn),a.write(this.scriptVi.buf),a.write(this.script.toBuffer()),a}}class ht extends ct{constructor(a=1,c=Pt.fromNumber(0),o=[],x=Pt.fromNumber(0),n=[],g=0){super({versionBytesNum:a,txInsVi:c,txIns:o,txOutsVi:x,txOuts:n,nLockTime:g})}fromJSON(a){const c=[];a.txIns.forEach(function(x){c.push(new It().fromJSON(x))});const o=[];return a.txOuts.forEach(function(x){o.push(new Jt().fromJSON(x))}),this.fromObject({versionBytesNum:a.versionBytesNum,txInsVi:new Pt().fromJSON(a.txInsVi),txIns:c,txOutsVi:new Pt().fromJSON(a.txOutsVi),txOuts:o,nLockTime:a.nLockTime}),this}toJSON(){const a=[];this.txIns.forEach(function(o){a.push(o.toJSON())});const c=[];return this.txOuts.forEach(function(o){c.push(o.toJSON())}),{versionBytesNum:this.versionBytesNum,txInsVi:this.txInsVi.toJSON(),txIns:a,txOutsVi:this.txOutsVi.toJSON(),txOuts:c,nLockTime:this.nLockTime}}fromBr(a){this.versionBytesNum=a.readUInt32LE(),this.txInsVi=new Pt(a.readVarIntBuf());const c=this.txInsVi.toNumber();this.txIns=[];for(let x=0;x<c;x++)this.txIns.push(new It().fromBr(a));this.txOutsVi=new Pt(a.readVarIntBuf());const o=this.txOutsVi.toNumber();this.txOuts=[];for(let x=0;x<o;x++)this.txOuts.push(new Jt().fromBr(a));return this.nLockTime=a.readUInt32LE(),this}toBw(a){a||(a=new ot),a.writeUInt32LE(this.versionBytesNum),a.write(this.txInsVi.buf);for(let c=0;c<this.txIns.length;c++)this.txIns[c].toBw(a);a.write(this.txOutsVi.buf);for(let c=0;c<this.txOuts.length;c++)this.txOuts[c].toBw(a);return a.writeUInt32LE(this.nLockTime),a}hashPrevouts(){const a=new ot;for(const c in this.txIns){const o=this.txIns[c];a.write(o.txHashBuf),a.writeUInt32LE(o.txOutNum)}return Fe.sha256Sha256(a.toBuffer())}hashSequence(){const a=new ot;for(const c in this.txIns){const o=this.txIns[c];a.writeUInt32LE(o.nSequence)}return Fe.sha256Sha256(a.toBuffer())}hashOutputs(){const a=new ot;for(const c in this.txOuts){const o=this.txOuts[c];a.write(o.toBuffer())}return Fe.sha256Sha256(a.toBuffer())}sighash(a,c,o,x,n=ht.SCRIPT_ENABLE_SIGHASH_FORKID,g=new Di){const y=this.sighashPreimage(a,c,o,x,n,g);return y.compare(he.from("0000000000000000000000000000000000000000000000000000000000000001","hex"))===0?y:new Lt(Fe.sha256Sha256(y)).readReverse()}async asyncSighash(a,c,o,x,n=0,g={}){return(await Je.asyncObjectMethod(this,"sighash",[a,c,o,x,n,g])).resbuf}sighashPreimage(a,c,o,x,n=ht.SCRIPT_ENABLE_SIGHASH_FORKID,g=new Di){if(a&$e.SIGHASH_FORKID&&n&ht.SCRIPT_ENABLE_SIGHASH_FORKID){let v=he.alloc(32,0),d=he.alloc(32,0),w=he.alloc(32,0);a&$e.SIGHASH_ANYONECANPAY||(v=g.prevoutsHashBuf?g.prevoutsHashBuf:g.prevoutsHashBuf=this.hashPrevouts()),!(a&$e.SIGHASH_ANYONECANPAY)&&(a&31)!==$e.SIGHASH_SINGLE&&(a&31)!==$e.SIGHASH_NONE&&(d=g.sequenceHashBuf?g.sequenceHashBuf:g.sequenceHashBuf=this.hashSequence()),(a&31)!==$e.SIGHASH_SINGLE&&(a&31)!==$e.SIGHASH_NONE?w=g.outputsHashBuf?g.outputsHashBuf:g.outputsHashBuf=this.hashOutputs():(a&31)===$e.SIGHASH_SINGLE&&c<this.txOuts.length&&(w=Fe.sha256Sha256(this.txOuts[c].toBuffer()));const _=new ot;return _.writeUInt32LE(this.versionBytesNum),_.write(v),_.write(d),_.write(this.txIns[c].txHashBuf),_.writeUInt32LE(this.txIns[c].txOutNum),_.writeVarIntNum(o.toBuffer().length),_.write(o.toBuffer()),_.writeUInt64LEBn(x),_.writeUInt32LE(this.txIns[c].nSequence),_.write(w),_.writeUInt32LE(this.nLockTime),_.writeUInt32LE(a>>>0),_.toBuffer()}const y=this.cloneByBuffer();o=new at().fromBuffer(o.toBuffer()),o.removeCodeseparators();for(let v=0;v<y.txIns.length;v++)y.txIns[v]=It.fromBuffer(y.txIns[v].toBuffer()).setScript(new at);if(y.txIns[c]=It.fromBuffer(y.txIns[c].toBuffer()).setScript(o),(a&31)===$e.SIGHASH_NONE){y.txOuts.length=0,y.txOutsVi=Pt.fromNumber(0);for(let v=0;v<y.txIns.length;v++)v!==c&&(y.txIns[v].nSequence=0)}else if((a&31)===$e.SIGHASH_SINGLE){if(c>y.txOuts.length-1)return he.from("0000000000000000000000000000000000000000000000000000000000000001","hex");y.txOuts.length=c+1,y.txOutsVi=Pt.fromNumber(c+1);for(let v=0;v<y.txOuts.length;v++)v<c&&(y.txOuts[v]=Jt.fromProperties(new Ee().fromBuffer(he.from("ffffffffffffffff","hex")),new at));for(let v=0;v<y.txIns.length;v++)v!==c&&(y.txIns[v].nSequence=0)}return a&$e.SIGHASH_ANYONECANPAY&&(y.txIns[0]=y.txIns[c],y.txIns.length=1,y.txInsVi=Pt.fromNumber(1)),new ot().write(y.toBuffer()).writeInt32LE(a).toBuffer()}async asyncSighashPreimage(a,c,o,x,n=0,g={}){return(await Je.asyncObjectMethod(this,"sighashPreimage",[a,c,o,x,n,g])).resbuf}sign(a,c=$e.SIGHASH_ALL|$e.SIGHASH_FORKID,o,x,n,g=ht.SCRIPT_ENABLE_SIGHASH_FORKID,y={}){const b=this.sighash(c,o,x,n,g,y);return this.preImageBuf=b,Dt.sign(b,a,"little").fromObject({nHashType:c})}async asyncSign(a,c=$e.SIGHASH_ALL|$e.SIGHASH_FORKID,o,x,n,g=ht.SCRIPT_ENABLE_SIGHASH_FORKID,y={}){const b=await Je.asyncObjectMethod(this,"sign",[a,c,o,x,n,g,y]);return new $e().fromFastBuffer(b.resbuf)}verify(a,c,o,x,n=!1,g,y=ht.SCRIPT_ENABLE_SIGHASH_FORKID,b={}){const v=this.sighash(a.nHashType,o,x,g,y,b);return Dt.verify(v,a,c,"little",n)}async asyncVerify(a,c,o,x,n=!1,g,y=ht.SCRIPT_ENABLE_SIGHASH_FORKID,b={}){const v=await Je.asyncObjectMethod(this,"verify",[a,c,o,x,n,g,y,b]);return JSON.parse(v.resbuf.toString())}hash(){return Fe.sha256Sha256(this.toBuffer())}async asyncHash(){return(await Je.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new Lt(this.hash()).readReverse().toString("hex")}async asyncId(){const a=await Je.asyncObjectMethod(this,"id",[]);return JSON.parse(a.resbuf.toString())}addTxIn(a,c,o,x){let n;return a instanceof It?n=a:n=new It().fromObject({txHashBuf:a,txOutNum:c,nSequence:x}).setScript(o),this.txIns.push(n),this.txInsVi=Pt.fromNumber(this.txInsVi.toNumber()+1),this}addTxOut(a,c){let o;return a instanceof Jt?o=a:o=new Jt().fromObject({valueBn:a}).setScript(c),this.txOuts.push(o),this.txOutsVi=Pt.fromNumber(this.txOutsVi.toNumber()+1),this}isCoinbase(){return this.txIns.length===1&&this.txIns[0].hasNullInput()}sort(){return this.txIns.sort((a,c)=>new Lt(a.txHashBuf).readReverse().compare(new Lt(c.txHashBuf).readReverse())||a.txOutNum-c.txOutNum),this.txOuts.sort((a,c)=>a.valueBn.sub(c.valueBn).toNumber()||a.script.toBuffer().compare(c.script.toBuffer())),this}}ht.MAX_MONEY=21e6*1e8,ht.SCRIPT_ENABLE_SIGHASH_FORKID=65536;class io extends ct{constructor(a,c,o){super({blockHeader:a,txsVi:c,txs:o})}fromJSON(a){const c=[];return a.txs.forEach(function(o){c.push(new ht().fromJSON(o))}),this.fromObject({blockHeader:new Fi().fromJSON(a.blockHeader),txsVi:new Pt().fromJSON(a.txsVi),txs:c}),this}toJSON(){const a=[];return this.txs.forEach(function(c){a.push(c.toJSON())}),{blockHeader:this.blockHeader.toJSON(),txsVi:this.txsVi.toJSON(),txs:a}}fromBr(a){this.blockHeader=new Fi().fromBr(a),this.txsVi=new Pt(a.readVarIntBuf());const c=this.txsVi.toNumber();this.txs=[];for(let o=0;o<c;o++)this.txs.push(new ht().fromBr(a));return this}toBw(a){a||(a=new ot),a.write(this.blockHeader.toBuffer()),a.write(this.txsVi.buf);const c=this.txsVi.toNumber();for(let o=0;o<c;o++)this.txs[o].toBw(a);return a}hash(){return Fe.sha256Sha256(this.blockHeader.toBuffer())}async asyncHash(){return(await Je.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new Lt(this.hash()).readReverse().toString("hex")}async asyncId(){const a=await Je.asyncObjectMethod(this,"id",[]);return JSON.parse(a.resbuf.toString())}verifyMerkleRoot(){const a=this.txs.map(o=>o.toBuffer()),c=Fr.fromBuffers(a).hash();return he.compare(c,this.blockHeader.merkleRootBuf)}static iterateTxs(a){const c=new Lt(a),o=new Fi().fromBr(c),x=new Pt(c.readVarIntBuf()),n=x.toNumber();return{blockHeader:o,txsVi:x,txsNum:n,*[Symbol.iterator](){for(let g=0;g<n;g++)yield new ht().fromBr(c)}}}}io.MAX_BLOCK_SIZE=1e6;const $l=M=>{if(M.length===0)return M;const a=M[M.length-1];if((a&127)!==0)return M;if(M.length===1)return[];if((M[M.length-2]&128)!==0)return M;for(let c=M.length-1;c>0;c--)if(M[c-1]!==0)return(M[c-1]&128)!==0?(M[c]=a,M.slice(0,c+1)):(M[c-1]|=a,M.slice(0,c));return[]};class qe extends ct{constructor(a,c,o,x=[],n=[],g=0,y=0,b=0,v=[],d="",w=qe.defaultFlags,_=new Ee(0)){super({script:a,tx:c,nIn:o,stack:x,altStack:n,pc:g,pBeginCodeHash:y,nOpCount:b,ifStack:v,errStr:d,flags:w,valueBn:_})}initialize(){return this.script=new at,this.stack=[],this.altStack=[],this.pc=0,this.pBeginCodeHash=0,this.nOpCount=0,this.ifStack=[],this.errStr="",this.flags=qe.defaultFlags,this.scriptLimit=1e7,this.stackLimit=1e7,this}fromJSON(a){return this.fromJSONNoTx(a),this.tx=a.tx?new ht().fromJSON(a.tx):void 0,this}fromJSONNoTx(a){return this.fromObject({script:a.script!==void 0?new at().fromJSON(a.script):void 0,nIn:a.nIn}),this.stack=[],a.stack.forEach((function(c){this.stack.push(he.from(c,"hex"))}).bind(this)),this.altStack=[],a.altStack.forEach((function(c){this.altStack.push(he.from(c,"hex"))}).bind(this)),this.fromObject({pc:a.pc,pBeginCodeHash:a.pBeginCodeHash,nOpCount:a.nOpCount,ifStack:a.ifStack,errStr:a.errStr,flags:a.flags}),this}fromBr(a){let c=a.readVarIntNum(),o=a.read(c);this.fromJSONNoTx(JSON.parse(o.toString()));let x=a.readVarIntNum();if(x>0){let n=a.read(x);this.tx=new ht().fromFastBuffer(n)}return this}toJSON(){let a=this.toJSONNoTx();return a.tx=this.tx?this.tx.toJSON():void 0,a}toJSONNoTx(){let a=[];this.stack.forEach(function(o){a.push(o.toString("hex"))});let c=[];return this.altStack.forEach(function(o){c.push(o.toString("hex"))}),{script:this.script?this.script.toJSON():void 0,nIn:this.nIn,stack:a,altStack:c,pc:this.pc,pBeginCodeHash:this.pBeginCodeHash,nOpCount:this.nOpCount,ifStack:this.ifStack,errStr:this.errStr,flags:this.flags,preImage:this!=null&&this.preImage?this.preImage.toString("hex"):"",hashBuf:this!=null&&this.hashBuf?this.hashBuf.toString("hex"):""}}toBw(a){a||(a=new ot);let c=he.from(JSON.stringify(this.toJSONNoTx()));if(a.writeVarIntNum(c.length),a.write(c),this.tx){let o=this.tx.toFastBuffer();a.writeVarIntNum(o.length),a.write(o)}else a.writeVarIntNum(0);return a}static getFlags(a){let c=0;return a.indexOf("NONE")!==-1&&(c=c|qe.SCRIPT_VERIFY_NONE),a.indexOf("P2SH")!==-1&&(c=c|qe.SCRIPT_VERIFY_P2SH),a.indexOf("STRICTENC")!==-1&&(c=c|qe.SCRIPT_VERIFY_STRICTENC),a.indexOf("DERSIG")!==-1&&(c=c|qe.SCRIPT_VERIFY_DERSIG),a.indexOf("LOW_S")!==-1&&(c=c|qe.SCRIPT_VERIFY_LOW_S),a.indexOf("NULLDUMMY")!==-1&&(c=c|qe.SCRIPT_VERIFY_NULLDUMMY),a.indexOf("SIGPUSHONLY")!==-1&&(c=c|qe.SCRIPT_VERIFY_SIGPUSHONLY),a.indexOf("MINIMALDATA")!==-1&&(c=c|qe.SCRIPT_VERIFY_MINIMALDATA),a.indexOf("DISCOURAGE_UPGRADABLE_NOPS")!==-1&&(c=c|qe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS),a.indexOf("CLEANSTACK")!==-1&&(c=c|qe.SCRIPT_VERIFY_CLEANSTACK),a.indexOf("CHECKLOCKTIMEVERIFY")!==-1&&(c=c|qe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY),a.indexOf("CHECKSEQUENCEVERIFY")!==-1&&(c=c|qe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY),a.indexOf("SIGHASH_FORKID")!==-1&&(c=c|qe.SCRIPT_ENABLE_SIGHASH_FORKID),c}static castToBool(a){for(let c=0;c<a.length;c++)if(a[c]!==0)return!(c===a.length-1&&a[c]===128);return!1}checkSigEncoding(a){if(a.length===0)return!0;if((this.flags&(qe.SCRIPT_VERIFY_DERSIG|qe.SCRIPT_VERIFY_LOW_S|qe.SCRIPT_VERIFY_STRICTENC))!==0&&!$e.IsTxDer(a))return this.errStr="SCRIPT_ERR_SIG_DER",!1;if((this.flags&qe.SCRIPT_VERIFY_LOW_S)!==0){if(!new $e().fromTxFormat(a).hasLowS())return this.errStr="SCRIPT_ERR_SIG_DER",!1}else if((this.flags&qe.SCRIPT_VERIFY_STRICTENC)!==0&&!new $e().fromTxFormat(a).hasDefinedHashType())return this.errStr="SCRIPT_ERR_SIG_HASHTYPE",!1;return!0}checkPubKeyEncoding(a){return(this.flags&qe.SCRIPT_VERIFY_STRICTENC)!==0&&!kt.isCompressedOrUncompressed(a)?(this.errStr="SCRIPT_ERR_PUBKEYTYPE",!1):!0}checkLockTime(a){return!(!(this.tx.nLockTime<qe.LOCKTIME_THRESHOLD&&a<qe.LOCKTIME_THRESHOLD||this.tx.nLockTime>=qe.LOCKTIME_THRESHOLD&&a>=qe.LOCKTIME_THRESHOLD)||a>this.tx.nLockTime||It.SEQUENCE_FINAL===this.tx.txIns[this.nIn].nSequence)}checkSequence(a){let c=this.tx.txIns[this.nIn].nSequence;if(this.tx.versionBytesNum<2||c&It.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;let o=It.SEQUENCE_LOCKTIME_TYPE_FLAG|It.SEQUENCE_LOCKTIME_MASK,x=c&o,n=a&o;return!(!(x<It.SEQUENCE_LOCKTIME_TYPE_FLAG&&n<It.SEQUENCE_LOCKTIME_TYPE_FLAG||x>=It.SEQUENCE_LOCKTIME_TYPE_FLAG&&n>=It.SEQUENCE_LOCKTIME_TYPE_FLAG)||n>x)}*eval(){this.script.toBuffer().length>this.scriptLimit&&(this.errStr="SCRIPT_ERR_SCRIPT_SIZE",yield!1);try{for(;this.pc<this.script.chunks.length;){let a=this.step();a?yield a:yield!1}this.stack.length+this.altStack.length>this.stackLimit&&(this.errStr="SCRIPT_ERR_STACK_SIZE",yield!1)}catch(a){this.errStr="SCRIPT_ERR_UNKNOWN_ERROR: "+a,yield!1}this.ifStack.length>0&&(this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",yield!1),yield!0}step(){let a=(this.flags&qe.SCRIPT_VERIFY_MINIMALDATA)!==0,c=!(this.ifStack.indexOf(!1)+1),o=this.script.chunks[this.pc];this.pc++;let x=o.opCodeNum;if(x===void 0)return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;if(o.buf&&o.buf.length>qe.MAX_SCRIPT_ELEMENT_SIZE)return this.errStr="SCRIPT_ERR_PUSH_SIZE",!1;if(x>oe.OP_16&&++this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;if(x===oe.OP_2MUL||x===oe.OP_2DIV)return this.errStr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(c&&x>=0&&x<=oe.OP_PUSHDATA4){if(a&&!this.script.checkMinimalPush(this.pc-1))return this.errStr="SCRIPT_ERR_MINIMALDATA",!1;if(!o.buf)this.stack.push(qe.false);else{if(o.len!==o.buf.length)throw new Error("LEngth of push value not equal to length of data");this.stack.push(o.buf)}}else if(c||oe.OP_IF<=x&&x<=oe.OP_ENDIF)switch(x){case oe.OP_1NEGATE:case oe.OP_1:case oe.OP_2:case oe.OP_3:case oe.OP_4:case oe.OP_5:case oe.OP_6:case oe.OP_7:case oe.OP_8:case oe.OP_9:case oe.OP_10:case oe.OP_11:case oe.OP_12:case oe.OP_13:case oe.OP_14:case oe.OP_15:case oe.OP_16:{let L=x-(oe.OP_1-1),V=new Ee(L).toScriptNumBuffer();this.stack.push(V)}break;case oe.OP_NOP:break;case oe.OP_CHECKLOCKTIMEVERIFY:{if(!(this.flags&qe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&qe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-1],ee=new Ee().fromScriptNumBuffer(L,a,5).toNumber();if(ee<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(ee))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case oe.OP_CHECKSEQUENCEVERIFY:{if(!(this.flags&qe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&qe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-1],ee=new Ee().fromScriptNumBuffer(L,a,5).toNumber();if(ee<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((ee&It.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(ee))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case oe.OP_NOP1:case oe.OP_NOP3:case oe.OP_NOP4:case oe.OP_NOP5:case oe.OP_NOP6:case oe.OP_NOP7:case oe.OP_NOP8:case oe.OP_NOP9:case oe.OP_NOP10:if(this.flags&qe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case oe.OP_IF:case oe.OP_NOTIF:{let L=!1;if(c){if(this.stack.length<1)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;let V=this.stack.pop();L=qe.castToBool(V),x===oe.OP_NOTIF&&(L=!L)}this.ifStack.push(L)}break;case oe.OP_ELSE:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.ifStack[this.ifStack.length-1]=!this.ifStack[this.ifStack.length-1];break;case oe.OP_ENDIF:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.ifStack.pop();break;case oe.OP_VERIFY:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-1];if(qe.castToBool(L))this.stack.pop();else return this.errStr="SCRIPT_ERR_VERIFY",!1}break;case oe.OP_RETURN:return this.errStr="SCRIPT_ERR_OP_RETURN",!1;case oe.OP_TOALTSTACK:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altStack.push(this.stack.pop());break;case oe.OP_FROMALTSTACK:if(this.altStack.length<1)return this.errStr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altStack.pop());break;case oe.OP_2DROP:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case oe.OP_2DUP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-2],V=this.stack[this.stack.length-1];this.stack.push(L),this.stack.push(V)}break;case oe.OP_3DUP:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-3],V=this.stack[this.stack.length-2],ee=this.stack[this.stack.length-1];this.stack.push(L),this.stack.push(V),this.stack.push(ee)}break;case oe.OP_2OVER:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-4],V=this.stack[this.stack.length-3];this.stack.push(L),this.stack.push(V)}break;case oe.OP_2ROT:{if(this.stack.length<6)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack.splice(this.stack.length-6,2);this.stack.push(L[0]),this.stack.push(L[1])}break;case oe.OP_2SWAP:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack.splice(this.stack.length-4,2);this.stack.push(L[0]),this.stack.push(L[1])}break;case oe.OP_IFDUP:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-1];qe.castToBool(L)&&this.stack.push(L)}break;case oe.OP_DEPTH:{let L=new Ee(this.stack.length).toScriptNumBuffer();this.stack.push(L)}break;case oe.OP_DROP:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case oe.OP_DUP:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1]);break;case oe.OP_NIP:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case oe.OP_OVER:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2]);break;case oe.OP_PICK:case oe.OP_ROLL:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-1],ee=new Ee().fromScriptNumBuffer(L,a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS).toNumber();if(this.stack.pop(),ee<0||ee>=this.stack.length)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;L=this.stack[this.stack.length-ee-1],x===oe.OP_ROLL&&this.stack.splice(this.stack.length-ee-1,1),this.stack.push(L)}break;case oe.OP_ROT:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-3],V=this.stack[this.stack.length-2],ee=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=V,this.stack[this.stack.length-2]=ee,this.stack[this.stack.length-1]=L}break;case oe.OP_SWAP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-2],V=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=V,this.stack[this.stack.length-1]=L}break;case oe.OP_TUCK:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case oe.OP_SIZE:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=new Ee(this.stack[this.stack.length-1].length);this.stack.push(L.toScriptNumBuffer())}break;case oe.OP_OR:case oe.OP_AND:case oe.OP_XOR:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var n=this.stack[this.stack.length-2],g=this.stack[this.stack.length-1];if(n.length!=g.length)return this.errStr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(x){case oe.OP_AND:for(let L=0;L<n.length;L++)n[L]&=g[L];break;case oe.OP_OR:for(let L=0;L<n.length;L++)n[L]|=g[L];break;case oe.OP_XOR:for(let L=0;L<n.length;L++)n[L]^=g[L];break}this.stack.pop();break;case oe.OP_INVERT:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var y=this.stack[this.stack.length-1];for(let L=0;L<y.length;L++)y[L]=~y[L];break;case oe.OP_LSHIFT:case oe.OP_RSHIFT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-2],V=new Ee(L),ee=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-1],a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS).toNumber();if(ee<0)return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;switch(this.stack.pop(),this.stack.pop(),x){case oe.OP_LSHIFT:V=V.ushln(ee);break;case oe.OP_RSHIFT:V=V.ushrn(ee);break}let ne=V.toBuffer().slice(-L.length);ne.length<L.length&&(ne=he.concat([he.alloc(L.length-ne.length),ne])),this.stack.push(ne);break}case oe.OP_EQUAL:case oe.OP_EQUALVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-2],V=this.stack[this.stack.length-1],ee=vr(L,V);if(this.stack.pop(),this.stack.pop(),this.stack.push(ee?qe.true:qe.false),x===oe.OP_EQUALVERIFY)if(ee)this.stack.pop();else return this.errStr="SCRIPT_ERR_EQUALVERIFY",!1}break;case oe.OP_1ADD:case oe.OP_1SUB:case oe.OP_NEGATE:case oe.OP_ABS:case oe.OP_NOT:case oe.OP_0NOTEQUAL:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-1],V=new Ee().fromScriptNumBuffer(L,a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS);switch(x){case oe.OP_1ADD:V=V.add(1);break;case oe.OP_1SUB:V=V.sub(1);break;case oe.OP_NEGATE:V=V.neg();break;case oe.OP_ABS:V.lt(0)&&(V=V.neg());break;case oe.OP_NOT:V=new Ee(V.eq(0)+0);break;case oe.OP_0NOTEQUAL:V=new Ee(V.neq(0)+0);break}this.stack.pop(),this.stack.push(V.toScriptNumBuffer())}break;case oe.OP_ADD:case oe.OP_SUB:case oe.OP_MUL:case oe.OP_DIV:case oe.OP_MOD:case oe.OP_BOOLAND:case oe.OP_BOOLOR:case oe.OP_NUMEQUAL:case oe.OP_NUMEQUALVERIFY:case oe.OP_NUMNOTEQUAL:case oe.OP_LESSTHAN:case oe.OP_GREATERTHAN:case oe.OP_LESSTHANOREQUAL:case oe.OP_GREATERTHANOREQUAL:case oe.OP_MIN:case oe.OP_MAX:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-2],a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),V=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-1],a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),ee=new Ee(0);switch(x){case oe.OP_ADD:ee=L.add(V);break;case oe.OP_SUB:ee=L.sub(V);break;case oe.OP_MUL:ee=L.mul(V);break;case oe.OP_DIV:if(V==0)return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;ee=L.div(V);break;case oe.OP_MOD:if(V==0)return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;ee=L.mod(V);break;case oe.OP_BOOLAND:ee=new Ee((L.neq(0)&&V.neq(0))+0);break;case oe.OP_BOOLOR:ee=new Ee((L.neq(0)||V.neq(0))+0);break;case oe.OP_NUMEQUAL:ee=new Ee(L.eq(V)+0);break;case oe.OP_NUMEQUALVERIFY:ee=new Ee(L.eq(V)+0);break;case oe.OP_NUMNOTEQUAL:ee=new Ee(L.neq(V)+0);break;case oe.OP_LESSTHAN:ee=new Ee(L.lt(V)+0);break;case oe.OP_GREATERTHAN:ee=new Ee(L.gt(V)+0);break;case oe.OP_LESSTHANOREQUAL:ee=new Ee(L.leq(V)+0);break;case oe.OP_GREATERTHANOREQUAL:ee=new Ee(L.geq(V)+0);break;case oe.OP_MIN:ee=L.lt(V)?L:V;break;case oe.OP_MAX:ee=L.gt(V)?L:V;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(ee.toScriptNumBuffer()),x===oe.OP_NUMEQUALVERIFY)if(qe.castToBool(this.stack[this.stack.length-1]))this.stack.pop();else return this.errStr="SCRIPT_ERR_NUMEQUALVERIFY",!1}break;case oe.OP_WITHIN:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-3],a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),V=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-2],a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),ee=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-1],a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),ne=V.leq(L)&&L.lt(ee);this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(ne?qe.true:qe.false)}break;case oe.OP_RIPEMD160:case oe.OP_SHA1:case oe.OP_SHA256:case oe.OP_HASH160:case oe.OP_HASH256:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-1],V;x===oe.OP_RIPEMD160?V=Fe.ripemd160(L):x===oe.OP_SHA1?V=Fe.sha1(L):x===oe.OP_SHA256?V=Fe.sha256(L):x===oe.OP_HASH160?V=Fe.sha256Ripemd160(L):x===oe.OP_HASH256&&(V=Fe.sha256Sha256(L)),this.stack.pop(),this.stack.push(V)}break;case oe.OP_CODESEPARATOR:this.pBeginCodeHash=this.pc;break;case oe.OP_CHECKSIG:case oe.OP_CHECKSIGVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let L=this.stack[this.stack.length-2],V=this.stack[this.stack.length-1];if(!this.checkSigEncoding(L)||!this.checkPubKeyEncoding(V))return!1;let ee=new at().fromObject({chunks:this.script.chunks.slice(this.pBeginCodeHash)});if((L.length>0?L.readUInt8(L.length-1):0)&$e.SIGHASH_FORKID){if(!(this.flags&qe.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else ee.findAndDelete(new at().writeBuffer(L));let J;try{let ue=new $e().fromTxFormat(L),m=new kt().fromBuffer(V,!1);this.nHashType=ue.nHashType,typeof this.nIn>"u"&&console.log("Missing tx input nIn"),typeof this.tx>"u"&&(this.tx=new ht);try{this.preImage=this.tx.sighashPreimage(ue.nHashType,this.nIn,ee,this.valueBn,ht.SCRIPT_ENABLE_SIGHASH_FORKID),this.preImage.compare(he.from("0000000000000000000000000000000000000000000000000000000000000001","hex"))===0?this.hashBuf=this.preImage:this.hashBuf=new Lt(Fe.sha256Sha256(this.preImage)).readReverse(),this.verify=Dt.verify(this.hashBuf,ue,m,"little",!0)}catch(e){console.log("ERROR: ",e.message)}J=this.tx.verify(ue,m,this.nIn,ee,!!(this.flags&qe.SCRIPT_VERIFY_LOW_S),this.valueBn,ht.SCRIPT_ENABLE_SIGHASH_FORKID)}catch{J=!1}if(this.stack.pop(),this.stack.pop(),this.stack.push(J?qe.true:qe.false),x===oe.OP_CHECKSIGVERIFY)if(J)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKSIGVERIFY",!1}break;case oe.OP_CHECKMULTISIG:case oe.OP_CHECKMULTISIGVERIFY:{let L=1;if(this.stack.length<L)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let V=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-L],a).toNumber();if(V<0||V>20)return this.errStr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=V,this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;let ee=++L;if(L+=V,this.stack.length<L)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let ne=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-L],a).toNumber();if(ne<0||ne>V)return this.errStr="SCRIPT_ERR_SIG_COUNT",!1;let J=++L;if(L+=ne,this.stack.length<L)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let ue=new at().fromObject({chunks:this.script.chunks.slice(this.pBeginCodeHash)});for(let e=0;e<ne;e++){let r=this.stack[this.stack.length-J-e];if((r.length>0?r.readUInt8(r.length-1):0)&$e.SIGHASH_FORKID){if(!(this.flags&qe.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else ue.findAndDelete(new at().writeBuffer(r))}let m=!0;for(;m&&ne>0;){let e=this.stack[this.stack.length-J],r=this.stack[this.stack.length-ee];if(!this.checkSigEncoding(e)||!this.checkPubKeyEncoding(r))return!1;let i;try{let f=new $e().fromTxFormat(e),h=new kt().fromBuffer(r,!1);i=this.tx.verify(f,h,this.nIn,ue,!!(this.flags&qe.SCRIPT_VERIFY_LOW_S),this.valueBn,this.flags)}catch{i=!1}i&&(J++,ne--),ee++,V--,ne>V&&(m=!1)}for(;L-- >1;)this.stack.pop();if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&qe.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errStr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(m?qe.true:qe.false),x===oe.OP_CHECKMULTISIGVERIFY)if(m)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1}break;case oe.OP_CAT:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let E=this.stack[this.stack.length-2],B=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=he.concat([E,B]),this.stack.pop();break;case oe.OP_SPLIT:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let A=this.stack[this.stack.length-2],P=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-1],a);if(P.lt(0)||P.gt(A.length))return this.errStr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;let I=A.slice(0,P),k=A.slice(P);this.stack.pop(),this.stack.pop(),this.stack.push(I),this.stack.push(k);break;case oe.OP_NUM2BIN:this.stack.length<2&&(this.errStr="OP_NUM2BIN requires at least two items to be on the stack.");let F=new Ee().fromScriptNumBuffer(this.stack[this.stack.length-1],a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS).toNumber();F>qe.MAX_SCRIPT_ELEMENT_SIZE&&(this.errStr=`It's not currently possible to push data larger than ${qe.MAX_SCRIPT_ELEMENT_SIZE} bytes.`),this.stack.pop();let q=this.stack[this.stack.length-1];if(q=$l(q),q.length>F&&(this.errStr="OP_NUM2BIN requires that the size expressed in the top stack item is large enough to hold the value expressed in the second-from-top stack item."),q.length===F){this.stack[this.stack.length-1]=q;break}var b=0;q.length>0&&(b=q[q.length-1]&128,q[q.length-1]&=127);var v=new Array(F);v.fill(0);for(var d=0;d<F;d++)v[d]=q[d];for(d=q.length-1;d++<F-2;)v[d]=0;v[d]=b,this.stack[this.stack.length-1]=he.from(new Uint8Array(v).buffer,"binary");break;case oe.OP_BIN2NUM:this.stack.length<1&&(this.errStr="OP_BIN2NUM requires at least one item to be on the stack.");var w=this.stack[this.stack.length-1],_=$l(w);this.stack[this.stack.length-1]=new Ee().fromScriptNumBuffer(_,a,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS);break;default:return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}verify(a,c,o,x,n,g){let y=this.results(a,c,o,x,n,g);for(let b of y)if(!b)return!1;return!0}*results(a,c,o,x,n,g){let y;this.fromObject({script:a,tx:o,nIn:x,flags:n,valueBn:g}),(n&qe.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!a.isPushOnly()&&(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1),yield*this.eval(),n&qe.SCRIPT_VERIFY_P2SH&&(y=this.stack.slice());let b=this.stack;this.initialize(),this.fromObject({script:c,stack:b,tx:o,nIn:x,flags:n,valueBn:g}),yield*this.eval(),this.stack.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1);let v=this.stack[this.stack.length-1];if(qe.castToBool(v)||(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),n&qe.SCRIPT_VERIFY_P2SH&&c.isScriptHashOut()){a.isPushOnly()||(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1);let d=b;if(b=y,y=d,b.length===0)throw new Error("internal error - stack copy empty");let w=b[b.length-1],_=new at().fromBuffer(w);b.pop(),this.initialize(),this.fromObject({script:_,stack:b,tx:o,nIn:x,flags:n,valueBn:g}),yield*this.eval(),b.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),qe.castToBool(b[b.length-1])?yield!0:(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1)}if((n&qe.SCRIPT_VERIFY_CLEANSTACK)!==0){if(!(n&qe.SCRIPT_VERIFY_P2SH))throw new Error("cannot use CLEANSTACK without P2SH");b.length!==1&&(this.errStr=this.errStr||"SCRIPT_ERR_CLEANSTACK",yield!1)}yield!0}getDebugObject(){let a=this.pc-1;return{errStr:this.errStr,scriptStr:this.script?this.script.toString():"no script found",pc:a,stack:this.stack.map(c=>c.toString("hex")),altStack:this.altStack.map(c=>c.toString("hex")),opCodeStr:this.script?oe.fromNumber(this.script.chunks[a].opCodeNum).toString():"no script found"}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}qe.true=he.from([1]),qe.false=he.from([]),qe.MAX_SCRIPT_ELEMENT_SIZE=500*1e3,qe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS=10*1e3,qe.LOCKTIME_THRESHOLD=5e8,qe.SCRIPT_VERIFY_NONE=0,qe.SCRIPT_VERIFY_P2SH=1,qe.SCRIPT_VERIFY_STRICTENC=2,qe.SCRIPT_VERIFY_DERSIG=4,qe.SCRIPT_VERIFY_LOW_S=8,qe.SCRIPT_VERIFY_NULLDUMMY=16,qe.SCRIPT_VERIFY_SIGPUSHONLY=32,qe.SCRIPT_VERIFY_MINIMALDATA=64,qe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,qe.SCRIPT_VERIFY_CLEANSTACK=256,qe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,qe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024,qe.SCRIPT_ENABLE_SIGHASH_FORKID=65536,qe.defaultFlags=qe.SCRIPT_VERIFY_P2SH|qe.SCRIPT_VERIFY_STRICTENC|qe.SCRIPT_ENABLE_SIGHASH_FORKID|qe.SCRIPT_VERIFY_LOW_S|qe.SCRIPT_VERIFY_NULLDUMMY|qe.SCRIPT_VERIFY_DERSIG|qe.SCRIPT_VERIFY_MINIMALDATA|qe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS|qe.SCRIPT_VERIFY_CLEANSTACK|qe.SCRIPT_VERIFY_SIGPUSHONLY|qe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|qe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;class no extends ct{constructor(a=new Map){super({map:a})}toJSON(){const a={};return this.map.forEach((c,o)=>{a[o]=c.map(x=>({nScriptChunk:x.nScriptChunk,type:x.type,addressStr:x.addressStr,nHashType:x.nHashType,log:x.log}))}),a}fromJSON(a){return Object.keys(a).forEach(c=>{this.map.set(c,a[c].map(o=>({nScriptChunk:o.nScriptChunk,type:o.type,addressStr:o.addressStr,nHashType:o.nHashType,log:o.log})))}),this}setOne(a,c,o,x="sig",n,g=$e.SIGHASH_ALL|$e.SIGHASH_FORKID){const y=a.toString("hex")+":"+c,b={nScriptChunk:o,type:x,addressStr:n,nHashType:g};return this.map.set(y,[b]),this}setMany(a,c,o){const x=a.toString("hex")+":"+c;return o=o.map(n=>({type:n.type||"sig",nHashType:n.nHashType||$e.SIGHASH_ALL|$e.SIGHASH_FORKID,...n})),this.map.set(x,o),this}addOne(a,c,o,x="sig",n,g=$e.SIGHASH_ALL|$e.SIGHASH_FORKID){const y=this.get(a,c)||[];return y.push({nScriptChunk:o,type:x,addressStr:n,nHashType:g}),this.setMany(a,c,y),this}get(a,c){const o=a.toString("hex")+":"+c;return this.map.get(o)||[]}}class ao extends ct{constructor(a=new Map){super({map:a})}toJSON(){const a={};return this.map.forEach((c,o)=>{a[o]=c.toHex()}),a}fromJSON(a){return Object.keys(a).forEach(c=>{this.map.set(c,Jt.fromHex(a[c]))}),this}set(a,c,o){const x=a.toString("hex")+":"+c;return this.map.set(x,o),this}get(a,c){const o=a.toString("hex")+":"+c;return this.map.get(o)}setTx(a){const c=a.hash().toString("hex");return a.txOuts.forEach((o,x)=>{const n=c+":"+x;this.map.set(n,o)}),this}}const fo=ft.Default.TxBuilder;class z1 extends ct{constructor(a=new ht,c=[],o=[],x=new ao,n=new no,g,y,b,v=fo.feePerKbNum,d=0,w=1,_=1,E=fo.dust,B=!1,A=new Di){super({tx:a,txIns:c,txOuts:o,uTxOutMap:x,sigOperations:n,changeScript:g,changeAmountBn:y,feeAmountBn:b,feePerKbNum:v,nLockTime:d,versionBytesNum:w,sigsPerInput:_,dust:E,dustChangeToFees:B,hashCache:A})}toJSON(){const a={};return a.tx=this.tx.toHex(),a.txIns=this.txIns.map(c=>c.toHex()),a.txOuts=this.txOuts.map(c=>c.toHex()),a.uTxOutMap=this.uTxOutMap.toJSON(),a.sigOperations=this.sigOperations.toJSON(),a.changeScript=this.changeScript?this.changeScript.toHex():void 0,a.changeAmountBn=this.changeAmountBn?this.changeAmountBn.toNumber():void 0,a.feeAmountBn=this.feeAmountBn?this.feeAmountBn.toNumber():void 0,a.feePerKbNum=this.feePerKbNum,a.sigsPerInput=this.sigsPerInput,a.dust=this.dust,a.dustChangeToFees=this.dustChangeToFees,a.hashCache=this.hashCache.toJSON(),a}fromJSON(a){return this.tx=new ht().fromHex(a.tx),this.txIns=a.txIns.map(c=>It.fromHex(c)),this.txOuts=a.txOuts.map(c=>Jt.fromHex(c)),this.uTxOutMap=new ao().fromJSON(a.uTxOutMap),this.sigOperations=new no().fromJSON(a.sigOperations),this.changeScript=a.changeScript?new at().fromHex(a.changeScript):void 0,this.changeAmountBn=a.changeAmountBn?new Ee(a.changeAmountBn):void 0,this.feeAmountBn=a.feeAmountBn?new Ee(a.feeAmountBn):void 0,this.feePerKbNum=a.feePerKbNum||this.feePerKbNum,this.sigsPerInput=a.sigsPerInput||this.sigsPerInput,this.dust=a.dust||this.dust,this.dustChangeToFees=a.dustChangeToFees||this.dustChangeToFees,this.hashCache=Di.fromJSON(a.hashCache),this}setFeePerKbNum(a){if(typeof a!="number"||a<0)throw new Error("cannot set a fee of zero or less");return this.feePerKbNum=a,this}setChangeAddress(a){return this.changeScript=a.toTxOutScript(),this}setChangeScript(a){return this.changeScript=a,this}setNLocktime(a){return this.nLockTime=a,this}setVersion(a){return this.versionBytesNum=a,this}setDust(a=fo.dust){return this.dust=a,this}sendDustChangeToFees(a=!1){return this.dustChangeToFees=a,this}importPartiallySignedTx(a,c=this.uTxOutMap,o=this.sigOperations){return this.tx=a,this.uTxOutMap=c,this.sigOperations=o,this}inputFromScript(a,c,o,x,n){if(!he.isBuffer(a)||typeof c!="number"||!(o instanceof Jt)||!(x instanceof at))throw new Error("invalid one of: txHashBuf, txOutNum, txOut, script");return this.txIns.push(It.fromProperties(a,c,x,n)),this.uTxOutMap.set(a,c,o),this}addSigOperation(a,c,o,x,n,g){return this.sigOperations.addOne(a,c,o,x,n,g),this}inputFromPubKeyHash(a,c,o,x,n,g){if(!he.isBuffer(a)||typeof c!="number"||!(o instanceof Jt))throw new Error("invalid one of: txHashBuf, txOutNum, txOut");this.txIns.push(new It().fromObject({nSequence:n}).fromPubKeyHashTxOut(a,c,o,x)),this.uTxOutMap.set(a,c,o);const y=Qt.fromTxOutScript(o.script).toString();return this.addSigOperation(a,c,0,"sig",y,g),this.addSigOperation(a,c,1,"pubKey",y),this}outputToAddress(a,c){if(!(c instanceof Qt)||!(a instanceof Ee))throw new Error("addr must be an Address, and valueBn must be a Bn");const o=new at().fromPubKeyHash(c.hashBuf);return this.outputToScript(a,o),this}outputToScript(a,c){if(!(c instanceof at)||!(a instanceof Ee))throw new Error("script must be a Script, and valueBn must be a Bn");const o=Jt.fromProperties(a,c);return this.txOuts.push(o),this}buildOutputs(){let a=new Ee(0);return this.txOuts.forEach(c=>{if(c.valueBn.lt(this.dust)&&!c.script.isNonSpendable())throw new Error("cannot create output lesser than dust");a=a.add(c.valueBn),this.tx.addTxOut(c)}),a}buildInputs(a,c=0){let o=new Ee(0);for(const x of this.txIns){const n=this.uTxOutMap.get(x.txHashBuf,x.txOutNum);if(o=o.add(n.valueBn),this.tx.addTxIn(x),o.geq(a)){if(c<=0)break;c--}}if(o.lt(a))throw new Error("not enough funds for outputs: inAmountBn "+o.toNumber()+" outAmountBn "+a.toNumber());return o}estimateSize(){let o=this.tx.toBuffer().length;return this.tx.txIns.forEach(x=>{const{txHashBuf:n,txOutNum:g}=x;this.sigOperations.get(n,g).forEach(b=>{const{nScriptChunk:v,type:d}=b,_=new at([x.script.chunks[v]]).toBuffer().length;if(o-=_,d==="sig")o+=72;else if(b.type==="pubKey")o+=35;else throw new Error("unsupported sig operations type")})}),o=o+1,Math.round(o)}estimateFee(a=new Ee(0)){const c=Math.ceil(this.estimateSize()/1e3*this.feePerKbNum);return new Ee(c).add(a)}build(a={useAllInputs:!1}){let c;if(this.txIns.length<=0)throw Error("tx-builder number of inputs must be greater than 0");if(!this.changeScript)throw new Error("must specify change script to use build method");for(let o=a.useAllInputs?this.txIns.length-1:0;o<this.txIns.length;o++){this.tx=new ht;const x=this.buildOutputs(),n=Jt.fromProperties(new Ee(0),this.changeScript);this.tx.addTxOut(n);let g;try{g=this.buildInputs(x,o)}catch(y){throw y.message.includes("not enough funds for outputs")?new Error("unable to gather enough inputs for outputs and fee"):y}if(this.changeAmountBn=g.sub(x),n.valueBn=this.changeAmountBn,c=this.estimateFee(),this.changeAmountBn.geq(c)&&this.changeAmountBn.sub(c).gt(this.dust))break}if(this.changeAmountBn.geq(c)){if(this.feeAmountBn=c,this.changeAmountBn=this.changeAmountBn.sub(this.feeAmountBn),this.tx.txOuts[this.tx.txOuts.length-1].valueBn=this.changeAmountBn,this.changeAmountBn.lt(this.dust))if(this.dustChangeToFees)this.tx.txOuts.pop(),this.tx.txOutsVi=Pt.fromNumber(this.tx.txOutsVi.toNumber()-1),this.feeAmountBn=this.feeAmountBn.add(this.changeAmountBn),this.changeAmountBn=new Ee(0);else throw new Error("unable to create change amount greater than dust");if(this.tx.nLockTime=this.nLockTime,this.tx.versionBytesNum=this.versionBytesNum,this.tx.txOuts.length===0)throw new Error("outputs length is zero - unable to create any outputs greater than dust");return this}else throw new Error("unable to gather enough inputs for outputs and fee")}sort(){return this.tx.sort(),this}static allSigsPresent(a,c){let o=0;for(let x=1;x<c.chunks.length-1;x++)c.chunks[x].buf&&o++;return o===a}static removeBlankSigs(a){a=new at(a.chunks.slice());for(let c=1;c<a.chunks.length-1;c++)a.chunks[c].buf||a.chunks.splice(c,1);return a}fillSig(a,c,o){const x=this.tx.txIns[a];return x.script.chunks[c]=new at().writeBuffer(o.toTxFormat()).chunks[0],x.scriptVi=Pt.fromNumber(x.script.toBuffer().length),this}getSig(a,c=$e.SIGHASH_ALL|$e.SIGHASH_FORKID,o,x,n=ht.SCRIPT_ENABLE_SIGHASH_FORKID){let g;if(c&$e.SIGHASH_FORKID&&n&ht.SCRIPT_ENABLE_SIGHASH_FORKID){const y=this.tx.txIns[o].txHashBuf,b=this.tx.txIns[o].txOutNum,v=this.uTxOutMap.get(y,b);if(!v)throw new Error("for SIGHASH_FORKID must provide UTXOs");g=v.valueBn}return this.tx.sign(a,c,o,x,g,n,this.hashCache)}asyncGetSig(a,c=$e.SIGHASH_ALL|$e.SIGHASH_FORKID,o,x,n=ht.SCRIPT_ENABLE_SIGHASH_FORKID){let g;if(c&$e.SIGHASH_FORKID&&n&ht.SCRIPT_ENABLE_SIGHASH_FORKID){const y=this.tx.txIns[o].txHashBuf,b=this.tx.txIns[o].txOutNum,v=this.uTxOutMap.get(y,b);if(!v)throw new Error("for SIGHASH_FORKID must provide UTXOs");g=v.valueBn}return this.tx.asyncSign(a,c,o,x,g,n,this.hashCache)}signTxIn(a,c,o,x,n=$e.SIGHASH_ALL|$e.SIGHASH_FORKID,g=ht.SCRIPT_ENABLE_SIGHASH_FORKID){const y=this.tx.txIns[a],b=y.script;if(x===void 0&&b.isPubKeyHashIn()&&(x=0),x===void 0)throw new Error("cannot sign unknown script type for input "+a);const v=y.txHashBuf,d=y.txOutNum;o||(o=this.uTxOutMap.get(v,d));const _=o.script,E=this.getSig(c,n,a,_,g,this.hashCache);return this.fillSig(a,x,E),this}async asyncSignTxIn(a,c,o,x,n=$e.SIGHASH_ALL|$e.SIGHASH_FORKID,g=ht.SCRIPT_ENABLE_SIGHASH_FORKID){const y=this.tx.txIns[a],b=y.script;if(x===void 0&&b.isPubKeyHashIn()&&(x=0),x===void 0)throw new Error("cannot sign unknown script type for input "+a);const v=y.txHashBuf,d=y.txOutNum;o||(o=this.uTxOutMap.get(v,d));const _=o.script,E=await this.asyncGetSig(c,n,a,_,g,this.hashCache);return this.fillSig(a,x,E),this}signWithKeyPairs(a){const c={};for(const o of a){const x=Qt.fromPubKey(o.pubKey).toString();c[x]=o}for(const o in this.tx.txIns){const x=this.tx.txIns[o],n=this.sigOperations.get(x.txHashBuf,x.txOutNum);for(const g of n){const{nScriptChunk:y,type:b,addressStr:v,nHashType:d}=g,w=c[v];if(!w){g.log=`cannot find keyPair for addressStr ${v}`;continue}const _=this.uTxOutMap.get(x.txHashBuf,x.txOutNum);if(b==="sig")this.signTxIn(o,w,_,y,d),g.log="successfully inserted signature";else if(b==="pubKey")x.script.chunks[y]=new at().writeBuffer(w.pubKey.toBuffer()).chunks[0],x.setScript(x.script),g.log="successfully inserted public key";else{g.log=`cannot perform operation of type ${b}`;continue}}}return this}}class Ui extends ct{constructor(a,c,o,x){super({tx:a,txOutMap:c,errStr:o,interp:x})}verify(a=qe.SCRIPT_ENABLE_SIGHASH_FORKID){return!this.checkStr()&&!this.verifyStr(a)}async asyncVerify(a){const c=await this.asyncVerifyStr(a);return!this.checkStr()&&!c}static verify(a,c,o){return new Ui(a,c).verify(o)}static asyncVerify(a,c,o){return new Ui(a,c).asyncVerify(o)}checkStr(){if(this.tx.txIns.length===0||this.tx.txInsVi.toNumber()===0)return this.errStr="transaction txIns empty",this.errStr;if(this.tx.txOuts.length===0||this.tx.txOutsVi.toNumber()===0)return this.errStr="transaction txOuts empty",this.errStr;if(this.tx.toBuffer().length>io.MAX_BLOCK_SIZE)return this.errStr="transaction over the maximum block size",this.errStr;let a=new Ee(0);for(let o=0;o<this.tx.txOuts.length;o++){const x=this.tx.txOuts[o];if(x.valueBn.lt(0))return this.errStr="transaction txOut "+o+" negative",this.errStr;if(x.valueBn.gt(ht.MAX_MONEY))return this.errStr="transaction txOut "+o+" greater than MAX_MONEY",this.errStr;if(a=a.add(x.valueBn),a.gt(ht.MAX_MONEY))return this.errStr="transaction txOut "+o+" total output greater than MAX_MONEY",this.errStr}const c={};for(let o=0;o<this.tx.txIns.length;o++){const x=this.tx.txIns[o],n=x.txHashBuf.toString("hex")+":"+x.txOutNum;if(c[n]!==void 0)return this.errStr="transaction input "+o+" duplicate input",this.errStr;c[n]=!0}if(this.tx.isCoinbase()){const o=this.tx.txIns[0].script.toBuffer();if(o.length<2||o.length>100)return this.errStr="coinbase trasaction script size invalid",this.errStr}else for(let o=0;o<this.tx.txIns.length;o++)if(this.tx.txIns[o].hasNullInput())return this.errStr="transaction input "+o+" has null input",this.errStr;return!1}verifyStr(a){for(let c=0;c<this.tx.txIns.length;c++)if(!this.verifyNIn(c,a))return this.errStr="input "+c+" failed script verify",this.errStr;return!1}async asyncVerifyStr(a){for(let c=0;c<this.tx.txIns.length;c++)if(!await this.asyncVerifyNIn(c,a))return this.errStr="input "+c+" failed script verify",this.errStr;return!1}verifyNIn(a,c){const o=this.tx.txIns[a],x=o.script,n=this.txOutMap.get(o.txHashBuf,o.txOutNum);if(!n)return console.log("output "+o.txOutNum+" not found"),!1;const g=n.script,y=n.valueBn;return this.interp=new qe,this.interp.verify(x,g,this.tx,a,c,y)}async asyncVerifyNIn(a,c){const o=this.tx.txIns[a],x=o.script,n=this.txOutMap.get(o.txHashBuf,o.txOutNum);if(!n)return console.log("output "+o.txOutNum+" not found"),!1;const g=n.script,y=n.valueBn;this.interp=new qe;const b=await Je.asyncObjectMethod(this.interp,"verify",[x,g,this.tx,a,c,y]);return JSON.parse(b.resbuf.toString())}getDebugObject(){return{errStr:this.errStr,interpFailure:this.interp?this.interp.getDebugObject():void 0}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}class Ut{}Ut.encrypt=function(M,a){const c=Ut.buf2Words(a),o=Ut.buf2Words(M),n=new Ki(c).encrypt(o);return Ut.words2Buf(n)},Ut.decrypt=function(M,a){const c=Ut.buf2Words(M),o=Ut.buf2Words(a),n=new Ki(o).decrypt(c);return Ut.words2Buf(n)},Ut.buf2Words=function(M){if(M.length%4)throw new Error("buf length must be a multiple of 4");const a=[];for(let c=0;c<M.length/4;c++)a.push(M.readUInt32BE(c*4));return a},Ut.words2Buf=function(M){const a=he.alloc(M.length*4);for(let c=0;c<M.length;c++)a.writeUInt32BE(M[c],c*4);return a};class Ot{}Ot.buf2BlocksBuf=function(M,a){const c=a/8,o=[];for(let x=0;x<=M.length/c;x++){let n=M.slice(x*c,x*c+c);n.length<a&&(n=Ot.pkcs7Pad(n,a)),o.push(n)}return o},Ot.blockBufs2Buf=function(M){let a=M[M.length-1];return a=Ot.pkcs7Unpad(a),M[M.length-1]=a,he.concat(M)},Ot.encrypt=function(M,a,c,o){const x=a.length*8,n=Ot.buf2BlocksBuf(M,x),g=Ot.encryptBlocks(n,a,c,o);return he.concat(g)},Ot.decrypt=function(M,a,c,o){const x=a.length,n=[];for(let b=0;b<M.length/x;b++)n.push(M.slice(b*x,b*x+x));const g=Ot.decryptBlocks(n,a,c,o);return Ot.blockBufs2Buf(g)},Ot.encryptBlock=function(M,a,c,o){const x=Ot.xorBufs(M,a);return c.encrypt(x,o)},Ot.decryptBlock=function(M,a,c,o){const x=c.decrypt(M,o);return Ot.xorBufs(x,a)},Ot.encryptBlocks=function(M,a,c,o){const x=[];for(let n=0;n<M.length;n++){const g=M[n],y=Ot.encryptBlock(g,a,c,o);x.push(y),a=y}return x},Ot.decryptBlocks=function(M,a,c,o){const x=[];for(let n=0;n<M.length;n++){const g=M[n],y=Ot.decryptBlock(g,a,c,o);x.push(y),a=g}return x},Ot.pkcs7Pad=function(M,a){const o=a/8-M.length,x=he.alloc(o);return x.fill(o),he.concat([M,x])},Ot.pkcs7Unpad=function(M){const a=M[M.length-1],c=M.slice(M.length-a,M.length),o=he.alloc(a);if(o.fill(a),!vr(c,o))throw new Error("invalid padding");return M.slice(0,M.length-a)},Ot.xorBufs=function(M,a){if(M.length!==a.length)throw new Error("bufs must have the same length");const c=he.alloc(M.length);for(let o=0;o<M.length;o++)c[o]=M[o]^a[o];return c};class lr{}lr.encrypt=function(M,a,c,o=!0){c=c||or.getRandomBuffer(128/8);const x=Ot.encrypt(M,c,Ut,a);return o?he.concat([c,x]):x},lr.decrypt=function(M,a,c=!1){if(c){const o=M;return Ot.decrypt(o,c,Ut,a)}else{const o=M.slice(0,16),x=M.slice(128/8);return Ot.decrypt(x,o,Ut,a)}};class Br{}Br.encrypt=function(M,a,c){const o=lr.encrypt(M,a,c),x=Fe.sha256Hmac(o,a);return he.concat([x,o])},Br.asyncEncrypt=async function(M,a,c){c||(c=or.getRandomBuffer(128/8));const o=[M,a,c];return(await Je.asyncClassMethod(Br,"encrypt",o)).resbuf},Br.decrypt=function(M,a){if(M.length<512/8)throw new Error("The encrypted data must be at least 256+128+128 bits, which is the length of the Hmac plus the iv plus the smallest encrypted data size");const c=M.slice(0,256/8);M=M.slice(256/8,M.length);const o=Fe.sha256Hmac(M,a);if(!vr(c,o))throw new Error("Message authentication failed - Hmacs are not equivalent");return lr.decrypt(M,a)},Br.asyncDecrypt=async function(M,a){const c=[M,a];return(await Je.asyncClassMethod(Br,"decrypt",c)).resbuf};class Zt{}Zt.ivkEkM=function(M,a){const c=M.bn,x=a.point.mul(c),g=new kt(x).toBuffer(),y=Fe.sha512(g);return{iv:y.slice(0,16),kE:y.slice(16,32),kM:y.slice(32,64)}},Zt.electrumEncrypt=function(M,a,c,o=!1){if(!he.isBuffer(M))throw new Error("messageBuf must be a buffer");let x;c===null&&(c=Ft.fromRandom()),o||(x=c.pubKey.toDer(!0));const{iv:n,kE:g,kM:y}=Zt.ivkEkM(c.privKey,a),b=lr.encrypt(M,g,n,!1),v=he.from("BIE1");let d;x?d=he.concat([v,x,b]):d=he.concat([v,b]);const w=Fe.sha256Hmac(d,y);return he.concat([d,w])},Zt.electrumDecrypt=function(M,a,c=null){if(!he.isBuffer(M))throw new Error("encBuf must be a buffer");const o=32;if(!M.slice(0,4).equals(he.from("BIE1")))throw new Error("Invalid Magic");let n=4;if(c===null){const _=M.slice(4,37);c=kt.fromDer(_),n=37}const{iv:g,kE:y,kM:b}=Zt.ivkEkM(a,c),v=M.slice(n,M.length-o),d=M.slice(M.length-o,M.length),w=Fe.sha256Hmac(M.slice(0,M.length-o),b);if(!d.equals(w))throw new Error("Invalid checksum");return lr.decrypt(v,y,g)},Zt.bitcoreEncrypt=function(M,a,c,o){c||(c=Ft.fromRandom());const x=c.privKey.bn,g=c.pubKey.toDer(!0),d=a.point.mul(x).getX().toBuffer({size:32}),w=Fe.sha512(d),_=w.slice(0,32),E=w.slice(32,64),B=lr.encrypt(M,_,o),A=Fe.sha256Hmac(B,E);return he.concat([g,B,A])},Zt.asyncBitcoreEncrypt=async function(M,a,c,o){c||(c=await Ft.asyncFromRandom()),o||(o=or.getRandomBuffer(128/8));const x=[M,a,c,o];return(await Je.asyncClassMethod(Zt,"bitcoreEncrypt",x)).resbuf},Zt.bitcoreDecrypt=function(M,a){const c=a.bn,n=kt.fromDer(M.slice(0,33)).point.mul(c);if(n.eq(new st))throw new Error("P equals 0");const y=n.getX().toBuffer({size:32}),b=Fe.sha512(y),v=b.slice(0,32),d=b.slice(32,64),w=M.slice(33,M.length-32),_=M.slice(M.length-32,M.length),E=Fe.sha256Hmac(w,d);if(!vr(_,E))throw new Error("Invalid checksum");return lr.decrypt(w,v)},Zt.asyncBitcoreDecrypt=async function(M,a){const c=[M,a];return(await Je.asyncClassMethod(Zt,"bitcoreDecrypt",c)).resbuf};const j1={aes:Ki,bnjs:qt,bs58:ji,elliptic:jl,hashjs:Jr,pbkdf2:Vl,Buffer:mp},V1=q1.version;We.Ach=Br,We.Address=Qt,We.Aes=Ut,We.Aescbc=lr,We.Base58=Lr,We.Base58Check=sr,We.Bip32=ti,We.Bip39=Li,We.Block=io,We.BlockHeader=Fi,We.Bn=Ee,We.Br=Lt,We.Bsm=Yt,We.Bw=ot,We.Cbc=Ot,We.Constants=ft,We.Ecdsa=Dt,We.Ecies=Zt,We.Hash=Fe,We.Interp=qe,We.KeyPair=Ft,We.OpCode=oe,We.Point=st,We.PrivKey=Wt,We.PubKey=kt,We.Random=or,We.Script=at,We.Sig=$e,We.SigOperations=no,We.Struct=ct,We.Tx=ht,We.TxBuilder=z1,We.TxIn=It,We.TxOut=Jt,We.TxOutMap=ao,We.TxVerifier=Ui,We.VarInt=Pt,We.Workers=Je,We.WorkersResult=ro,We.cmp=vr,We.deps=j1,We.en=Ni,We.es=qi,We.getConstants=U1,We.jp=Ci,We.version=V1,Object.defineProperty(We,Symbol.toStringTag,{value:"Module"})});
11
+ */(function(n){const e=Ir,t=zn,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=o,n.SlowBuffer=I,n.INSPECT_MAX_BYTES=50;const a=2147483647;n.kMaxLength=a;const{Uint8Array:i,ArrayBuffer:u,SharedArrayBuffer:c}=globalThis;o.TYPED_ARRAY_SUPPORT=h(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function h(){try{const O=new i(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,i.prototype),Object.setPrototypeOf(O,l),O.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function f(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');const l=new i(O);return Object.setPrototypeOf(l,o.prototype),l}function o(O,l,b){if(typeof O=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(O)}return v(O,l,b)}o.poolSize=8192;function v(O,l,b){if(typeof O=="string")return x(O,l);if(u.isView(O))return P(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(Ye(O,u)||O&&Ye(O.buffer,u)||typeof c<"u"&&(Ye(O,c)||O&&Ye(O.buffer,c)))return k(O,l,b);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=O.valueOf&&O.valueOf();if(H!=null&&H!==O)return o.from(H,l,b);const $=L(O);if($)return $;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return o.from(O[Symbol.toPrimitive]("string"),l,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}o.from=function(O,l,b){return v(O,l,b)},Object.setPrototypeOf(o.prototype,i.prototype),Object.setPrototypeOf(o,i);function w(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function A(O,l,b){return w(O),O<=0?f(O):l!==void 0?typeof b=="string"?f(O).fill(l,b):f(O).fill(l):f(O)}o.alloc=function(O,l,b){return A(O,l,b)};function B(O){return w(O),f(O<0?0:T(O)|0)}o.allocUnsafe=function(O){return B(O)},o.allocUnsafeSlow=function(O){return B(O)};function x(O,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const b=F(O,l)|0;let H=f(b);const $=H.write(O,l);return $!==b&&(H=H.slice(0,$)),H}function U(O){const l=O.length<0?0:T(O.length)|0,b=f(l);for(let H=0;H<l;H+=1)b[H]=O[H]&255;return b}function P(O){if(Ye(O,i)){const l=new i(O);return k(l.buffer,l.byteOffset,l.byteLength)}return U(O)}function k(O,l,b){if(l<0||O.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<l+(b||0))throw new RangeError('"length" is outside of buffer bounds');let H;return l===void 0&&b===void 0?H=new i(O):b===void 0?H=new i(O,l):H=new i(O,l,b),Object.setPrototypeOf(H,o.prototype),H}function L(O){if(o.isBuffer(O)){const l=T(O.length)|0,b=f(l);return b.length===0||O.copy(b,0,0,l),b}if(O.length!==void 0)return typeof O.length!="number"||Ke(O.length)?f(0):U(O);if(O.type==="Buffer"&&Array.isArray(O.data))return U(O.data)}function T(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function I(O){return+O!=O&&(O=0),o.alloc(+O)}o.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==o.prototype},o.compare=function(l,b){if(Ye(l,i)&&(l=o.from(l,l.offset,l.byteLength)),Ye(b,i)&&(b=o.from(b,b.offset,b.byteLength)),!o.isBuffer(l)||!o.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===b)return 0;let H=l.length,$=b.length;for(let X=0,re=Math.min(H,$);X<re;++X)if(l[X]!==b[X]){H=l[X],$=b[X];break}return H<$?-1:$<H?1:0},o.isEncoding=function(l){switch(String(l).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}},o.concat=function(l,b){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return o.alloc(0);let H;if(b===void 0)for(b=0,H=0;H<l.length;++H)b+=l[H].length;const $=o.allocUnsafe(b);let X=0;for(H=0;H<l.length;++H){let re=l[H];if(Ye(re,i))X+re.length>$.length?(o.isBuffer(re)||(re=o.from(re)),re.copy($,X)):i.prototype.set.call($,re,X);else if(o.isBuffer(re))re.copy($,X);else throw new TypeError('"list" argument must be an Array of Buffers');X+=re.length}return $};function F(O,l){if(o.isBuffer(O))return O.length;if(u.isView(O)||Ye(O,u))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);const b=O.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&b===0)return 0;let $=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return ke(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return ye(O).length;default:if($)return H?-1:ke(O).length;l=(""+l).toLowerCase(),$=!0}}o.byteLength=F;function j(O,l,b){let H=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,l>>>=0,b<=l))return"";for(O||(O="utf8");;)switch(O){case"hex":return p(this,l,b);case"utf8":case"utf-8":return g(this,l,b);case"ascii":return G(this,l,b);case"latin1":case"binary":return C(this,l,b);case"base64":return S(this,l,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,l,b);default:if(H)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),H=!0}}o.prototype._isBuffer=!0;function W(O,l,b){const H=O[l];O[l]=O[b],O[b]=H}o.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<l;b+=2)W(this,b,b+1);return this},o.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<l;b+=4)W(this,b,b+3),W(this,b+1,b+2);return this},o.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<l;b+=8)W(this,b,b+7),W(this,b+1,b+6),W(this,b+2,b+5),W(this,b+3,b+4);return this},o.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?g(this,0,l):j.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(l){if(!o.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:o.compare(this,l)===0},o.prototype.inspect=function(){let l="";const b=n.INSPECT_MAX_BYTES;return l=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(l+=" ... "),"<Buffer "+l+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(l,b,H,$,X){if(Ye(l,i)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(b===void 0&&(b=0),H===void 0&&(H=l?l.length:0),$===void 0&&($=0),X===void 0&&(X=this.length),b<0||H>l.length||$<0||X>this.length)throw new RangeError("out of range index");if($>=X&&b>=H)return 0;if($>=X)return-1;if(b>=H)return 1;if(b>>>=0,H>>>=0,$>>>=0,X>>>=0,this===l)return 0;let re=X-$,Ne=H-b;const Ee=Math.min(re,Ne),Be=this.slice($,X),$e=l.slice(b,H);for(let ve=0;ve<Ee;++ve)if(Be[ve]!==$e[ve]){re=Be[ve],Ne=$e[ve];break}return re<Ne?-1:Ne<re?1:0};function Z(O,l,b,H,$){if(O.length===0)return-1;if(typeof b=="string"?(H=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,Ke(b)&&(b=$?0:O.length-1),b<0&&(b=O.length+b),b>=O.length){if($)return-1;b=O.length-1}else if(b<0)if($)b=0;else return-1;if(typeof l=="string"&&(l=o.from(l,H)),o.isBuffer(l))return l.length===0?-1:ne(O,l,b,H,$);if(typeof l=="number")return l=l&255,typeof i.prototype.indexOf=="function"?$?i.prototype.indexOf.call(O,l,b):i.prototype.lastIndexOf.call(O,l,b):ne(O,[l],b,H,$);throw new TypeError("val must be string, number or Buffer")}function ne(O,l,b,H,$){let X=1,re=O.length,Ne=l.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(O.length<2||l.length<2)return-1;X=2,re/=2,Ne/=2,b/=2}function Ee($e,ve){return X===1?$e[ve]:$e.readUInt16BE(ve*X)}let Be;if($){let $e=-1;for(Be=b;Be<re;Be++)if(Ee(O,Be)===Ee(l,$e===-1?0:Be-$e)){if($e===-1&&($e=Be),Be-$e+1===Ne)return $e*X}else $e!==-1&&(Be-=Be-$e),$e=-1}else for(b+Ne>re&&(b=re-Ne),Be=b;Be>=0;Be--){let $e=!0;for(let ve=0;ve<Ne;ve++)if(Ee(O,Be+ve)!==Ee(l,ve)){$e=!1;break}if($e)return Be}return-1}o.prototype.includes=function(l,b,H){return this.indexOf(l,b,H)!==-1},o.prototype.indexOf=function(l,b,H){return Z(this,l,b,H,!0)},o.prototype.lastIndexOf=function(l,b,H){return Z(this,l,b,H,!1)};function ae(O,l,b,H){b=Number(b)||0;const $=O.length-b;H?(H=Number(H),H>$&&(H=$)):H=$;const X=l.length;H>X/2&&(H=X/2);let re;for(re=0;re<H;++re){const Ne=parseInt(l.substr(re*2,2),16);if(Ke(Ne))return re;O[b+re]=Ne}return re}function N(O,l,b,H){return Se(ke(l,O.length-b),O,b,H)}function E(O,l,b,H){return Se(me(l),O,b,H)}function s(O,l,b,H){return Se(ye(l),O,b,H)}function y(O,l,b,H){return Se(Oe(l,O.length-b),O,b,H)}o.prototype.write=function(l,b,H,$){if(b===void 0)$="utf8",H=this.length,b=0;else if(H===void 0&&typeof b=="string")$=b,H=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(H)?(H=H>>>0,$===void 0&&($="utf8")):($=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const X=this.length-b;if((H===void 0||H>X)&&(H=X),l.length>0&&(H<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");let re=!1;for(;;)switch($){case"hex":return ae(this,l,b,H);case"utf8":case"utf-8":return N(this,l,b,H);case"ascii":case"latin1":case"binary":return E(this,l,b,H);case"base64":return s(this,l,b,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,l,b,H);default:if(re)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),re=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(O,l,b){return l===0&&b===O.length?e.fromByteArray(O):e.fromByteArray(O.slice(l,b))}function g(O,l,b){b=Math.min(O.length,b);const H=[];let $=l;for(;$<b;){const X=O[$];let re=null,Ne=X>239?4:X>223?3:X>191?2:1;if($+Ne<=b){let Ee,Be,$e,ve;switch(Ne){case 1:X<128&&(re=X);break;case 2:Ee=O[$+1],(Ee&192)===128&&(ve=(X&31)<<6|Ee&63,ve>127&&(re=ve));break;case 3:Ee=O[$+1],Be=O[$+2],(Ee&192)===128&&(Be&192)===128&&(ve=(X&15)<<12|(Ee&63)<<6|Be&63,ve>2047&&(ve<55296||ve>57343)&&(re=ve));break;case 4:Ee=O[$+1],Be=O[$+2],$e=O[$+3],(Ee&192)===128&&(Be&192)===128&&($e&192)===128&&(ve=(X&15)<<18|(Ee&63)<<12|(Be&63)<<6|$e&63,ve>65535&&ve<1114112&&(re=ve))}}re===null?(re=65533,Ne=1):re>65535&&(re-=65536,H.push(re>>>10&1023|55296),re=56320|re&1023),H.push(re),$+=Ne}return M(H)}const _=4096;function M(O){const l=O.length;if(l<=_)return String.fromCharCode.apply(String,O);let b="",H=0;for(;H<l;)b+=String.fromCharCode.apply(String,O.slice(H,H+=_));return b}function G(O,l,b){let H="";b=Math.min(O.length,b);for(let $=l;$<b;++$)H+=String.fromCharCode(O[$]&127);return H}function C(O,l,b){let H="";b=Math.min(O.length,b);for(let $=l;$<b;++$)H+=String.fromCharCode(O[$]);return H}function p(O,l,b){const H=O.length;(!l||l<0)&&(l=0),(!b||b<0||b>H)&&(b=H);let $="";for(let X=l;X<b;++X)$+=Ge[O[X]];return $}function q(O,l,b){const H=O.slice(l,b);let $="";for(let X=0;X<H.length-1;X+=2)$+=String.fromCharCode(H[X]+H[X+1]*256);return $}o.prototype.slice=function(l,b){const H=this.length;l=~~l,b=b===void 0?H:~~b,l<0?(l+=H,l<0&&(l=0)):l>H&&(l=H),b<0?(b+=H,b<0&&(b=0)):b>H&&(b=H),b<l&&(b=l);const $=this.subarray(l,b);return Object.setPrototypeOf($,o.prototype),$};function ue(O,l,b){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+l>b)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(l,b,H){l=l>>>0,b=b>>>0,H||ue(l,b,this.length);let $=this[l],X=1,re=0;for(;++re<b&&(X*=256);)$+=this[l+re]*X;return $},o.prototype.readUintBE=o.prototype.readUIntBE=function(l,b,H){l=l>>>0,b=b>>>0,H||ue(l,b,this.length);let $=this[l+--b],X=1;for(;b>0&&(X*=256);)$+=this[l+--b]*X;return $},o.prototype.readUint8=o.prototype.readUInt8=function(l,b){return l=l>>>0,b||ue(l,1,this.length),this[l]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(l,b){return l=l>>>0,b||ue(l,2,this.length),this[l]|this[l+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(l,b){return l=l>>>0,b||ue(l,2,this.length),this[l]<<8|this[l+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(l,b){return l=l>>>0,b||ue(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(l,b){return l=l>>>0,b||ue(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},o.prototype.readBigUInt64LE=gt(function(l){l=l>>>0,Me(l,"offset");const b=this[l],H=this[l+7];(b===void 0||H===void 0)&&Re(l,this.length-8);const $=b+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,X=this[++l]+this[++l]*2**8+this[++l]*2**16+H*2**24;return BigInt($)+(BigInt(X)<<BigInt(32))}),o.prototype.readBigUInt64BE=gt(function(l){l=l>>>0,Me(l,"offset");const b=this[l],H=this[l+7];(b===void 0||H===void 0)&&Re(l,this.length-8);const $=b*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],X=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+H;return(BigInt($)<<BigInt(32))+BigInt(X)}),o.prototype.readIntLE=function(l,b,H){l=l>>>0,b=b>>>0,H||ue(l,b,this.length);let $=this[l],X=1,re=0;for(;++re<b&&(X*=256);)$+=this[l+re]*X;return X*=128,$>=X&&($-=Math.pow(2,8*b)),$},o.prototype.readIntBE=function(l,b,H){l=l>>>0,b=b>>>0,H||ue(l,b,this.length);let $=b,X=1,re=this[l+--$];for(;$>0&&(X*=256);)re+=this[l+--$]*X;return X*=128,re>=X&&(re-=Math.pow(2,8*b)),re},o.prototype.readInt8=function(l,b){return l=l>>>0,b||ue(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},o.prototype.readInt16LE=function(l,b){l=l>>>0,b||ue(l,2,this.length);const H=this[l]|this[l+1]<<8;return H&32768?H|4294901760:H},o.prototype.readInt16BE=function(l,b){l=l>>>0,b||ue(l,2,this.length);const H=this[l+1]|this[l]<<8;return H&32768?H|4294901760:H},o.prototype.readInt32LE=function(l,b){return l=l>>>0,b||ue(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},o.prototype.readInt32BE=function(l,b){return l=l>>>0,b||ue(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},o.prototype.readBigInt64LE=gt(function(l){l=l>>>0,Me(l,"offset");const b=this[l],H=this[l+7];(b===void 0||H===void 0)&&Re(l,this.length-8);const $=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(H<<24);return(BigInt($)<<BigInt(32))+BigInt(b+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),o.prototype.readBigInt64BE=gt(function(l){l=l>>>0,Me(l,"offset");const b=this[l],H=this[l+7];(b===void 0||H===void 0)&&Re(l,this.length-8);const $=(b<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt($)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+H)}),o.prototype.readFloatLE=function(l,b){return l=l>>>0,b||ue(l,4,this.length),t.read(this,l,!0,23,4)},o.prototype.readFloatBE=function(l,b){return l=l>>>0,b||ue(l,4,this.length),t.read(this,l,!1,23,4)},o.prototype.readDoubleLE=function(l,b){return l=l>>>0,b||ue(l,8,this.length),t.read(this,l,!0,52,8)},o.prototype.readDoubleBE=function(l,b){return l=l>>>0,b||ue(l,8,this.length),t.read(this,l,!1,52,8)};function he(O,l,b,H,$,X){if(!o.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>$||l<X)throw new RangeError('"value" argument is out of bounds');if(b+H>O.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(l,b,H,$){if(l=+l,b=b>>>0,H=H>>>0,!$){const Ne=Math.pow(2,8*H)-1;he(this,l,b,H,Ne,0)}let X=1,re=0;for(this[b]=l&255;++re<H&&(X*=256);)this[b+re]=l/X&255;return b+H},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(l,b,H,$){if(l=+l,b=b>>>0,H=H>>>0,!$){const Ne=Math.pow(2,8*H)-1;he(this,l,b,H,Ne,0)}let X=H-1,re=1;for(this[b+X]=l&255;--X>=0&&(re*=256);)this[b+X]=l/re&255;return b+H},o.prototype.writeUint8=o.prototype.writeUInt8=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,1,255,0),this[b]=l&255,b+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,2,65535,0),this[b]=l&255,this[b+1]=l>>>8,b+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,2,65535,0),this[b]=l>>>8,this[b+1]=l&255,b+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,4,4294967295,0),this[b+3]=l>>>24,this[b+2]=l>>>16,this[b+1]=l>>>8,this[b]=l&255,b+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,4,4294967295,0),this[b]=l>>>24,this[b+1]=l>>>16,this[b+2]=l>>>8,this[b+3]=l&255,b+4};function de(O,l,b,H,$){Ie(l,H,$,O,b,7);let X=Number(l&BigInt(4294967295));O[b++]=X,X=X>>8,O[b++]=X,X=X>>8,O[b++]=X,X=X>>8,O[b++]=X;let re=Number(l>>BigInt(32)&BigInt(4294967295));return O[b++]=re,re=re>>8,O[b++]=re,re=re>>8,O[b++]=re,re=re>>8,O[b++]=re,b}function V(O,l,b,H,$){Ie(l,H,$,O,b,7);let X=Number(l&BigInt(4294967295));O[b+7]=X,X=X>>8,O[b+6]=X,X=X>>8,O[b+5]=X,X=X>>8,O[b+4]=X;let re=Number(l>>BigInt(32)&BigInt(4294967295));return O[b+3]=re,re=re>>8,O[b+2]=re,re=re>>8,O[b+1]=re,re=re>>8,O[b]=re,b+8}o.prototype.writeBigUInt64LE=gt(function(l,b=0){return de(this,l,b,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=gt(function(l,b=0){return V(this,l,b,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(l,b,H,$){if(l=+l,b=b>>>0,!$){const Ee=Math.pow(2,8*H-1);he(this,l,b,H,Ee-1,-Ee)}let X=0,re=1,Ne=0;for(this[b]=l&255;++X<H&&(re*=256);)l<0&&Ne===0&&this[b+X-1]!==0&&(Ne=1),this[b+X]=(l/re>>0)-Ne&255;return b+H},o.prototype.writeIntBE=function(l,b,H,$){if(l=+l,b=b>>>0,!$){const Ee=Math.pow(2,8*H-1);he(this,l,b,H,Ee-1,-Ee)}let X=H-1,re=1,Ne=0;for(this[b+X]=l&255;--X>=0&&(re*=256);)l<0&&Ne===0&&this[b+X+1]!==0&&(Ne=1),this[b+X]=(l/re>>0)-Ne&255;return b+H},o.prototype.writeInt8=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,1,127,-128),l<0&&(l=255+l+1),this[b]=l&255,b+1},o.prototype.writeInt16LE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,2,32767,-32768),this[b]=l&255,this[b+1]=l>>>8,b+2},o.prototype.writeInt16BE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,2,32767,-32768),this[b]=l>>>8,this[b+1]=l&255,b+2},o.prototype.writeInt32LE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,4,2147483647,-2147483648),this[b]=l&255,this[b+1]=l>>>8,this[b+2]=l>>>16,this[b+3]=l>>>24,b+4},o.prototype.writeInt32BE=function(l,b,H){return l=+l,b=b>>>0,H||he(this,l,b,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[b]=l>>>24,this[b+1]=l>>>16,this[b+2]=l>>>8,this[b+3]=l&255,b+4},o.prototype.writeBigInt64LE=gt(function(l,b=0){return de(this,l,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=gt(function(l,b=0){return V(this,l,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function K(O,l,b,H,$,X){if(b+H>O.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function te(O,l,b,H,$){return l=+l,b=b>>>0,$||K(O,l,b,4),t.write(O,l,b,H,23,4),b+4}o.prototype.writeFloatLE=function(l,b,H){return te(this,l,b,!0,H)},o.prototype.writeFloatBE=function(l,b,H){return te(this,l,b,!1,H)};function se(O,l,b,H,$){return l=+l,b=b>>>0,$||K(O,l,b,8),t.write(O,l,b,H,52,8),b+8}o.prototype.writeDoubleLE=function(l,b,H){return se(this,l,b,!0,H)},o.prototype.writeDoubleBE=function(l,b,H){return se(this,l,b,!1,H)},o.prototype.copy=function(l,b,H,$){if(!o.isBuffer(l))throw new TypeError("argument should be a Buffer");if(H||(H=0),!$&&$!==0&&($=this.length),b>=l.length&&(b=l.length),b||(b=0),$>0&&$<H&&($=H),$===H||l.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),l.length-b<$-H&&($=l.length-b+H);const X=$-H;return this===l&&typeof i.prototype.copyWithin=="function"?this.copyWithin(b,H,$):i.prototype.set.call(l,this.subarray(H,$),b),X},o.prototype.fill=function(l,b,H,$){if(typeof l=="string"){if(typeof b=="string"?($=b,b=0,H=this.length):typeof H=="string"&&($=H,H=this.length),$!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!o.isEncoding($))throw new TypeError("Unknown encoding: "+$);if(l.length===1){const re=l.charCodeAt(0);($==="utf8"&&re<128||$==="latin1")&&(l=re)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(b<0||this.length<b||this.length<H)throw new RangeError("Out of range index");if(H<=b)return this;b=b>>>0,H=H===void 0?this.length:H>>>0,l||(l=0);let X;if(typeof l=="number")for(X=b;X<H;++X)this[X]=l;else{const re=o.isBuffer(l)?l:o.from(l,$),Ne=re.length;if(Ne===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(X=0;X<H-b;++X)this[X+b]=re[X%Ne]}return this};const le={};function fe(O,l,b){le[O]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code($){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:$,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}fe("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),fe("ERR_INVALID_ARG_TYPE",function(O,l){return`The "${O}" argument must be of type number. Received type ${typeof l}`},TypeError),fe("ERR_OUT_OF_RANGE",function(O,l,b){let H=`The value of "${O}" is out of range.`,$=b;return Number.isInteger(b)&&Math.abs(b)>2**32?$=pe(String(b)):typeof b=="bigint"&&($=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&($=pe($)),$+="n"),H+=` It must be ${l}. Received ${$}`,H},RangeError);function pe(O){let l="",b=O.length;const H=O[0]==="-"?1:0;for(;b>=H+4;b-=3)l=`_${O.slice(b-3,b)}${l}`;return`${O.slice(0,b)}${l}`}function xe(O,l,b){Me(l,"offset"),(O[l]===void 0||O[l+b]===void 0)&&Re(l,O.length-(b+1))}function Ie(O,l,b,H,$,X){if(O>b||O<l){const re=typeof l=="bigint"?"n":"";let Ne;throw l===0||l===BigInt(0)?Ne=`>= 0${re} and < 2${re} ** ${(X+1)*8}${re}`:Ne=`>= -(2${re} ** ${(X+1)*8-1}${re}) and < 2 ** ${(X+1)*8-1}${re}`,new le.ERR_OUT_OF_RANGE("value",Ne,O)}xe(H,$,X)}function Me(O,l){if(typeof O!="number")throw new le.ERR_INVALID_ARG_TYPE(l,"number",O)}function Re(O,l,b){throw Math.floor(O)!==O?(Me(O,b),new le.ERR_OUT_OF_RANGE("offset","an integer",O)):l<0?new le.ERR_BUFFER_OUT_OF_BOUNDS:new le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,O)}const Ce=/[^+/0-9A-Za-z-_]/g;function ft(O){if(O=O.split("=")[0],O=O.trim().replace(Ce,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function ke(O,l){l=l||1/0;let b;const H=O.length;let $=null;const X=[];for(let re=0;re<H;++re){if(b=O.charCodeAt(re),b>55295&&b<57344){if(!$){if(b>56319){(l-=3)>-1&&X.push(239,191,189);continue}else if(re+1===H){(l-=3)>-1&&X.push(239,191,189);continue}$=b;continue}if(b<56320){(l-=3)>-1&&X.push(239,191,189),$=b;continue}b=($-55296<<10|b-56320)+65536}else $&&(l-=3)>-1&&X.push(239,191,189);if($=null,b<128){if((l-=1)<0)break;X.push(b)}else if(b<2048){if((l-=2)<0)break;X.push(b>>6|192,b&63|128)}else if(b<65536){if((l-=3)<0)break;X.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((l-=4)<0)break;X.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return X}function me(O){const l=[];for(let b=0;b<O.length;++b)l.push(O.charCodeAt(b)&255);return l}function Oe(O,l){let b,H,$;const X=[];for(let re=0;re<O.length&&!((l-=2)<0);++re)b=O.charCodeAt(re),H=b>>8,$=b%256,X.push($),X.push(H);return X}function ye(O){return e.toByteArray(ft(O))}function Se(O,l,b,H){let $;for($=0;$<H&&!($+b>=l.length||$>=O.length);++$)l[$+b]=O[$];return $}function Ye(O,l){return O instanceof l||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===l.name}function Ke(O){return O!==O}const Ge=function(){const O="0123456789abcdef",l=new Array(256);for(let b=0;b<16;++b){const H=b*16;for(let $=0;$<16;++$)l[H+$]=O[b]+O[$]}return l}();function gt(O){return typeof BigInt>"u"?Ve:O}function Ve(){throw new Error("BigInt not supported")}})(Vn);const Y=Vn.Buffer,Yu=Vn.Buffer,$u={version:"2.1.4"};function ee(n,e,...t){if(!(this instanceof ee))return new ee(n,e,...t);lt.call(this,n,e,...t)}Object.keys(lt).forEach(function(n){ee[n]=lt[n]}),ee.prototype=Object.create(lt.prototype),ee.prototype.constructor=ee;function Ar(n){const e=Y.alloc(n.length);for(let t=0;t<n.length;t++)e[t]=n[n.length-1-t];return e}ee.prototype.fromHex=function(n,e){return this.fromBuffer(Y.from(n,"hex"),e)},ee.prototype.toHex=function(n){return this.toBuffer(n).toString("hex")},ee.prototype.toJSON=function(){return this.toString()},ee.prototype.fromJSON=function(n){return ee(n).copy(this),this},ee.prototype.fromNumber=function(n){return ee(n).copy(this),this},ee.prototype.toNumber=function(){return parseInt(this.toString(10),10)},ee.prototype.fromString=function(n,e){return ee(n,e).copy(this),this},ee.fromBuffer=function(n,e={endian:"big"}){e.endian==="little"&&(n=Ar(n));const t=n.toString("hex");return new ee(t,16)},ee.prototype.fromBuffer=function(n,e){return ee.fromBuffer(n,e).copy(this),this},ee.prototype.toBuffer=function(n={size:void 0,endian:"big"}){let e;if(n.size){const r=this.toString(16,2),a=r.length/2;if(e=Y.from(r,"hex"),a!==n.size){if(a>n.size)e=e.slice(a-e.length,e.length);else if(a<n.size){const i=Y.alloc(n.size);for(let u=0;u<e.length;u++)i[i.length-1-u]=e[e.length-1-u];for(let u=0;u<n.size-a;u++)i[u]=0;e=i}}}else{const r=this.toString(16,2);e=Y.from(r,"hex")}n.endian==="little"&&(e=Ar(e));const t=Y.from([0]);return Y.compare(e,t)===0?Y.from([]):e},ee.prototype.toFastBuffer=ee.prototype.toBuffer,ee.fromFastBuffer=ee.fromBuffer,ee.prototype.fromFastBuffer=ee.prototype.fromBuffer,ee.prototype.fromSm=function(n,e={endian:"big"}){return n.length===0&&this.fromBuffer(Y.from([0])),e.endian==="little"&&(n=Ar(n)),n[0]&128?(n[0]=n[0]&127,this.fromBuffer(n),this.neg().copy(this)):this.fromBuffer(n),this},ee.prototype.toSm=function(n={endian:"big"}){const e=n.endian;let t;return this.cmp(0)===-1?(t=this.neg().toBuffer(),t[0]&128?t=Y.concat([Y.from([128]),t]):t[0]=t[0]|128):(t=this.toBuffer(),t[0]&128&&(t=Y.concat([Y.from([0]),t]))),t.length===1&t[0]===0&&(t=Y.from([])),e==="little"&&(t=Ar(t)),t},ee.prototype.fromBits=function(n,e={strict:!1}){let t=Y.alloc(4);if(t.writeUInt32BE(n,0),n=t.readInt32BE(0),e.strict&&n&8388608)throw new Error("negative bit set");const r=n>>24,a=n&8388607;if(t=Y.alloc(4),t.writeInt32BE(a),r<=3)t=t.slice(1,r+1);else{const i=Y.alloc(r-3);i.fill(0),t=Y.concat([t,i])}return this.fromBuffer(t),n&8388608&&ee(0).sub(this).copy(this),this},ee.prototype.toBits=function(){let n;this.lt(0)?n=this.neg().toBuffer():n=this.toBuffer();let e=n.length,t;if(e>3)t=Y.concat([Y.from([0]),n.slice(0,3)]).readUInt32BE(0);else if(e<=3){const a=Y.alloc(3-e+1);a.fill(0),t=Y.concat([a,n.slice(0,e)]).readUInt32BE(0)}t&8388608&&(t>>=8,e++),this.lt(0)&&(t|=8388608);const r=e<<24|t;return n=Y.alloc(4),n.writeInt32BE(r,0),n.readUInt32BE(0)},ee.prototype.fromScriptNumBuffer=function(n,e,t,r=!1){if(t===void 0&&(t=4),n.length>t)throw new Error(`script number overflow nMaxNumSize: ${t}`);if(e&&n.length>0&&(n[n.length-1]&127)===0&&(n.length<=1||(n[n.length-2]&128)===0))throw new Error("non-minimally encoded script number");return n.byteLength===0||n.byteLength<=t,this.fromSm(n,{endian:"little"})},ee.prototype.toScriptNumBuffer=function(n){return this.toSm({endian:"little"})},ee.prototype.neg=function(){const n=lt.prototype.neg.call(this),e=Object.create(ee.prototype);return n.copy(e),e},ee.prototype.add=function(n){const e=lt.prototype.add.call(this,n);return n=Object.create(ee.prototype),e.copy(n),n},ee.prototype.sub=function(n){const e=lt.prototype.sub.call(this,n);return n=Object.create(ee.prototype),e.copy(n),n},ee.prototype.mul=function(n){const e=lt.prototype.mul.call(this,n);return n=Object.create(ee.prototype),e.copy(n),n},ee.prototype.mod=function(n){const e=lt.prototype.mod.call(this,n);return n=Object.create(ee.prototype),e.copy(n),n},ee.prototype.umod=function(n){const e=lt.prototype.umod.call(this,n);return n=Object.create(ee.prototype),e.copy(n),n},ee.prototype.invm=function(n){const e=lt.prototype.invm.call(this,n);return n=Object.create(ee.prototype),e.copy(n),n},ee.prototype.div=function(n){const e=lt.prototype.div.call(this,n);return n=Object.create(ee.prototype),e.copy(n),n},ee.prototype.ushln=function(n){const e=lt.prototype.ushln.call(this,n),t=Object.create(ee.prototype);return e.copy(t),t},ee.prototype.ushrn=function(n){const e=lt.prototype.ushrn.call(this,n),t=Object.create(ee.prototype);return e.copy(t),t},ee.prototype.cmp=function(n){return lt.prototype.cmp.call(this,n)};function Bt(n){ee.prototype["_"+n]=ee.prototype[n];const e=function(t){return typeof t=="string"?t=new ee(t):typeof t=="number"&&(t=new ee(t.toString())),this["_"+n](t)};ee.prototype[n]=e}ee.prototype.eq=function(n){return this.cmp(n)===0},ee.prototype.neq=function(n){return this.cmp(n)!==0},ee.prototype.gt=function(n){return this.cmp(n)>0},ee.prototype.geq=function(n){return this.cmp(n)>=0},ee.prototype.lt=function(n){return this.cmp(n)<0},ee.prototype.leq=function(n){return this.cmp(n)<=0},Bt("add"),Bt("sub"),Bt("mul"),Bt("mod"),Bt("invm"),Bt("div"),Bt("cmp"),Bt("gt"),Bt("geq"),Bt("lt"),Bt("leq");class ht{constructor(e){this.fromObject({buf:e})}fromObject(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this}eof(){return this.pos>=this.buf.length}read(e=this.buf.length){const t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t}readReverse(e=this.buf.length){const t=this.buf.slice(this.pos,this.pos+e);this.pos=this.pos+e;const r=Y.alloc(t.length);for(let a=0;a<r.length;a++)r[a]=t[t.length-1-a];return r}readUInt8(){const e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e}readInt8(){const e=this.buf.readInt8(this.pos);return this.pos=this.pos+1,e}readUInt16BE(){const e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e}readInt16BE(){const e=this.buf.readInt16BE(this.pos);return this.pos=this.pos+2,e}readUInt16LE(){const e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e}readInt16LE(){const e=this.buf.readInt16LE(this.pos);return this.pos=this.pos+2,e}readUInt32BE(){const e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e}readInt32BE(){const e=this.buf.readInt32BE(this.pos);return this.pos=this.pos+4,e}readUInt32LE(){const e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e}readInt32LE(){const e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e}readUInt64BEBn(){const e=this.buf.slice(this.pos,this.pos+8),t=new ee().fromBuffer(e);return this.pos=this.pos+8,t}readUInt64LEBn(){const e=this.readReverse(8);return new ee().fromBuffer(e)}readVarIntNum(){const e=this.readUInt8();let t,r;switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(t=this.readUInt64LEBn(),r=t.toNumber(),r<=Math.pow(2,53))return r;throw new Error("number too large to retain precision - use readVarIntBn");default:return e}}readVarIntBuf(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){const e=this.readUInt8();switch(e){case 253:return new ee(this.readUInt16LE());case 254:return new ee(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new ee(e)}}}class qe{constructor(e){this.fromObject({bufs:e})}fromObject(e){return this.bufs=e.bufs||this.bufs||[],this}getLength(){let e=0;for(const t in this.bufs){const r=this.bufs[t];e=e+r.length}return e}toBuffer(){return Y.concat(this.bufs)}write(e){return this.bufs.push(e),this}writeReverse(e){const t=Y.alloc(e.length);for(let r=0;r<t.length;r++)t[r]=e[e.length-1-r];return this.bufs.push(t),this}writeUInt8(e){const t=Y.alloc(1);return t.writeUInt8(e,0),this.write(t),this}writeInt8(e){const t=Y.alloc(1);return t.writeInt8(e,0),this.write(t),this}writeUInt16BE(e){const t=Y.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this}writeInt16BE(e){const t=Y.alloc(2);return t.writeInt16BE(e,0),this.write(t),this}writeUInt16LE(e){const t=Y.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this}writeInt16LE(e){const t=Y.alloc(2);return t.writeInt16LE(e,0),this.write(t),this}writeUInt32BE(e){const t=Y.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this}writeInt32BE(e){const t=Y.alloc(4);return t.writeInt32BE(e,0),this.write(t),this}writeUInt32LE(e){const t=Y.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this}writeInt32LE(e){const t=Y.alloc(4);return t.writeInt32LE(e,0),this.write(t),this}writeUInt64BEBn(e){const t=e.toBuffer({size:8});return this.write(t),this}writeUInt64LEBn(e){const t=e.toBuffer({size:8});return this.writeReverse(t),this}writeVarIntNum(e){const t=qe.varIntBufNum(e);return this.write(t),this}writeVarIntBn(e){const t=qe.varIntBufBn(e);return this.write(t),this}static varIntBufNum(e){let t;return e<253?(t=Y.alloc(1),t.writeUInt8(e,0)):e<65536?(t=Y.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=Y.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=Y.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t}static varIntBufBn(e){let t;const r=e.toNumber();if(r<253)t=Y.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=Y.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=Y.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{const a=new qe;a.writeUInt8(255),a.writeUInt64LEBn(e),t=a.toBuffer()}return t}}function Ju(n){const e=typeof n=="string"?n.charCodeAt(0):n;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}const Gn=Ju;class ze{constructor(e){this.fromObject(e)}fromObject(e){if(!e)return this;for(const t of Object.keys(e))e[t]!==void 0&&(this[t]=e[t]);return this}static fromObject(e){return new this().fromObject(e)}fromBr(e){throw e instanceof ht?new Error("not implemented"):new Error("br must be a buffer reader")}static fromBr(e){return new this().fromBr(e)}asyncFromBr(e){throw e instanceof ht?new Error("not implemented"):new Error("br must be a buffer reader")}static asyncFromBr(e){return new this().asyncFromBr(e)}toBw(e){throw new Error("not implemented")}asyncToBw(e){throw new Error("not implemented")}*genFromBuffers(){throw new Error("not implemented")}*expect(e,t){let r=t;const a=new qe;let i=0;for(t&&(a.write(t),i+=t.length);i<e;)r=yield e-i,r&&(a.write(r),i+=r.length);r=a.toBuffer();const u=i-e,c=r.slice(r.length-u,r.length);return r=r.slice(0,r.length-u),{buf:r,remainderbuf:c}}fromBuffer(e,...t){if(!Y.isBuffer(e))throw new Error("buf must be a buffer");const r=new ht(e);return this.fromBr(r,...t)}static fromBuffer(...e){return new this().fromBuffer(...e)}asyncFromBuffer(e,...t){if(!Y.isBuffer(e))throw new Error("buf must be a buffer");const r=new ht(e);return this.asyncFromBr(r,...t)}static asyncFromBuffer(e,...t){return new this().asyncFromBuffer(e,...t)}fromFastBuffer(e,...t){return e.length===0?this:this.fromBuffer(e,...t)}static fromFastBuffer(...e){return new this().fromFastBuffer(...e)}toBuffer(...e){return this.toBw(...e).toBuffer()}asyncToBuffer(...e){return this.asyncToBw(...e).then(t=>t.toBuffer())}toFastBuffer(...e){return Object.keys(this).length===0?Y.alloc(0):this.toBuffer(...e)}fromHex(e,...t){if(!Gn(e))throw new Error("invalid hex string");const r=Y.from(e,"hex");return this.fromBuffer(r,...t)}static fromHex(e,...t){return new this().fromHex(e,...t)}asyncFromHex(e,...t){if(!Gn(e))throw new Error("invalid hex string");const r=Y.from(e,"hex");return this.asyncFromBuffer(r,...t)}static asyncFromHex(e,...t){return new this().asyncFromHex(e,...t)}fromFastHex(e,...t){if(!Gn(e))throw new Error("invalid hex string");const r=Y.from(e,"hex");return this.fromFastBuffer(r,...t)}static fromFastHex(e,...t){return new this().fromFastHex(e,...t)}toHex(...e){return this.toBuffer(...e).toString("hex")}asyncToHex(...e){return this.asyncToBuffer(...e).then(t=>t.toString("hex"))}toFastHex(...e){return this.toFastBuffer(...e).toString("hex")}fromString(e,...t){if(typeof e!="string")throw new Error("str must be a string");return this.fromHex(e,...t)}static fromString(e,...t){return new this().fromString(e,...t)}asyncFromString(e,...t){if(typeof e!="string")throw new Error("str must be a string");return this.asyncFromHex(e,...t)}static asyncFromString(e,...t){return new this().asyncFromString(e,...t)}toString(...e){return this.toHex(...e)}asyncToString(...e){return this.asyncToHex(...e)}fromJSON(e){throw new Error("not implemented")}static fromJSON(e,...t){return new this().fromJSON(e,...t)}asyncFromJSON(e,...t){throw new Error("not implemented")}static asyncFromJSON(e,...t){return new this().asyncFromJSON(e,...t)}toJSON(){let e={};for(const t in this)if(Array.isArray(this[t])){const r=[];for(const a in this[t])typeof this[t][a].toJSON=="function"?r.push(this[t][a].toJSON()):r.push(JSON.stringify(this[t][a]));e[t]=r}else if(this[t]===null)e[t]=this[t];else if(typeof this[t]=="object"&&typeof this[t].toJSON=="function")e[t]=this[t].toJSON();else if(typeof this[t]=="boolean"||typeof this[t]=="number"||typeof this[t]=="string")e[t]=this[t];else if(Y.isBuffer(this[t]))e[t]=this[t].toString("hex");else if(this[t]instanceof Map)e[t]=JSON.stringify(this[t]);else if(typeof this[t]=="object")throw new Error("not implemented");return e}asyncToJSON(){throw new Error("not implemented")}clone(){return this.cloneByJSON()}cloneByBuffer(){return new this.constructor().fromBuffer(this.toBuffer())}cloneByFastBuffer(){return new this.constructor().fromFastBuffer(this.toFastBuffer())}cloneByHex(){return new this.constructor().fromHex(this.toHex())}cloneByString(){return new this.constructor().fromString(this.toString())}cloneByJSON(){return new this.constructor().fromJSON(this.toJSON())}}class er extends ze{constructor(e){super({buf:e})}fromHex(e){return this.fromBuffer(Y.from(e,"hex"))}toHex(){return this.toBuffer().toString("hex")}static encode(e){if(!Y.isBuffer(e))throw new Error("Input should be a buffer");return Hr.encode(e)}static decode(e){if(typeof e!="string")throw new Error("Input should be a string");return Y.from(Hr.decode(e))}fromBuffer(e){return this.buf=e,this}fromString(e){const t=er.decode(e);return this.buf=t,this}toBuffer(){return this.buf}toString(){return er.encode(this.buf)}}const Ut=(n,e)=>{if(!Y.isBuffer(n)||!Y.isBuffer(e))throw new Error("buf1 and buf2 must be buffers");if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++){const a=n[r],i=e[r];t|=a^i}return t===0};class Yn extends ze{constructor(e,t,r){super({resbuf:e,isError:t,id:r})}fromResult(e,t){return e.toFastBuffer?this.resbuf=e.toFastBuffer():Y.isBuffer(e)?this.resbuf=e:this.resbuf=Y.from(JSON.stringify(e)),this.isError=!1,this.id=t,this}static fromResult(e,t){return new this().fromResult(e,t)}fromError(e,t){return this.resbuf=Y.from(JSON.stringify(e.message)),this.isError=!0,this.id=t,this}toBw(e){return e||(e=new qe),e.writeVarIntNum(this.resbuf.length),e.write(this.resbuf),e.writeUInt8(Number(this.isError)),e.writeVarIntNum(this.id),e}fromBr(e){const t=e.readVarIntNum();return this.resbuf=e.read(t),this.isError=!!e.readUInt8(),this.id=e.readVarIntNum(),this}}let Ht;class we{constructor(e=[],t=0,r=[],a=new Map){this.nativeWorkers=e,this.lastid=t,this.incompconsteRes=r,this.promisemap=a}asyncObjectMethod(e,t,r,a=this.lastid+1){if(!r)throw new Error("must specify args");const i=e[t](...r);return new Yn().fromResult(i,a)}static asyncObjectMethod(e,t,r,a){return Ht||(Ht=new we),Ht.asyncObjectMethod(e,t,r,a)}asyncClassMethod(e,t,r,a=this.lastid+1){if(!r)throw new Error("must specify args");const i=e[t](...r);return new Yn().fromResult(i,a)}static asyncClassMethod(e,t,r,a){return Ht||(Ht=new we),Ht.asyncClassMethod(e,t,r,a)}static endGlobalWorkers(){Ht&&!ut.browser&&(Ht=void 0)}}class ce{}ce.sha1=function(n){if(!Y.isBuffer(n))throw new Error("sha1 hash must be of a buffer");const e=rr.sha1,t=new e().update(n).digest();return Y.from(t)},ce.sha1.blockSize=512,ce.asyncSha1=async function(n){const e=[n];return(await we.asyncClassMethod(ce,"sha1",e)).resbuf},ce.sha256=function(n){if(!Y.isBuffer(n))throw new Error("sha256 hash must be of a buffer");const e=rr.sha256,t=new e().update(n).digest();return Y.from(t)},ce.sha256.blockSize=512,ce.asyncSha256=async function(n){const e=[n];return(await we.asyncClassMethod(ce,"sha256",e)).resbuf},ce.sha256Sha256=function(n){try{return ce.sha256(ce.sha256(n))}catch(e){throw new Error("sha256Sha256 hash must be of a buffer: "+e)}},ce.asyncSha256Sha256=async function(n){const e=[n];return(await we.asyncClassMethod(ce,"sha256Sha256",e)).resbuf},ce.ripemd160=function(n){if(!Y.isBuffer(n))throw new Error("ripemd160 hash must be of a buffer");const e=rr.ripemd160,t=new e().update(n).digest();return Y.from(t)},ce.asyncRipemd160=async function(n){const e=[n];return(await we.asyncClassMethod(ce,"ripemd160",e)).resbuf},ce.sha256Ripemd160=function(n){try{return ce.ripemd160(ce.sha256(n))}catch(e){throw new Error("sha256Ripemd160 hash must be of a buffer: "+e)}},ce.asyncSha256Ripemd160=async function(n){const e=[n];return(await we.asyncClassMethod(ce,"sha256Ripemd160",e)).resbuf},ce.sha512=function(n){if(!Y.isBuffer(n))throw new Error("sha512 hash must be of a buffer");const e=rr.sha512,t=new e().update(n).digest();return Y.from(t)},ce.asyncSha512=async function(n){const e=[n];return(await we.asyncClassMethod(ce,"sha512",e)).resbuf},ce.sha512.blockSize=1024,ce.hmac=function(n,e,t){if(n!=="sha1"&&n!=="sha256"&&n!=="sha512")throw new Error("invalid choice of hash function");const r=ce[n];if(!Y.isBuffer(e)||!Y.isBuffer(t))throw new Error("data and key must be buffers");const a=r.blockSize/8;if(t.length>a&&(t=r(t)),t.length<a){const c=Y.alloc(a);c.fill(0,t.length),t.copy(c),t=c}const i=Y.alloc(a),u=Y.alloc(a);for(let c=0;c<a;c++)i[c]=92^t[c],u[c]=54^t[c];return r(Y.concat([i,r(Y.concat([u,e]))]))},ce.sha1Hmac=function(n,e){return ce.hmac("sha1",n,e)},ce.asyncSha1Hmac=async function(n,e){const t=[n,e];return(await we.asyncClassMethod(ce,"sha1Hmac",t)).resbuf},ce.sha1Hmac.bitsize=160,ce.sha256Hmac=function(n,e){return ce.hmac("sha256",n,e)},ce.asyncSha256Hmac=async function(n,e){const t=[n,e];return(await we.asyncClassMethod(ce,"sha256Hmac",t)).resbuf},ce.sha256Hmac.bitsize=256,ce.sha512Hmac=function(n,e){return ce.hmac("sha512",n,e)},ce.asyncSha512Hmac=async function(n,e){const t=[n,e];return(await we.asyncClassMethod(ce,"sha512Hmac",t)).resbuf},ce.sha512Hmac.bitsize=512;class Tt extends ze{constructor(e){super({buf:e})}fromHex(e){return this.fromBuffer(Y.from(e,"hex"))}toHex(){return this.toBuffer().toString("hex")}static decode(e){if(typeof e!="string")throw new Error("Input must be a string");const t=er.decode(e);if(t.length<4)throw new Error("Input string too short");const r=t.slice(0,-4),a=t.slice(-4),u=ce.sha256Sha256(r).slice(0,4);if(!Ut(a,u))throw new Error("Checksum mismatch");return r}static encode(e){if(!Y.isBuffer(e))throw new Error("Input must be a buffer");const t=Y.alloc(e.length+4),r=ce.sha256Sha256(e);return e.copy(t),r.copy(t,e.length),er.encode(t)}fromBuffer(e){return this.buf=e,this}fromString(e){const t=Tt.decode(e);return this.buf=t,this}toBuffer(){return this.buf}toString(){return Tt.encode(this.buf)}}class Wu{constructor(e){this.keyDefined=t=>t in e,this.getValue=t=>e[t]}get(e){if(this.keyDefined(e))return this.getValue(e);throw new Error(`Unknown configuration: ${e}`)}}class Xu{constructor(){this.variables={}}build(){return new Wu(this.variables)}addValue(e,t){if(t===void 0)throw new Error(`Failed to add "${e}" property. The value cannot be undefined`);if(e in this.variables)throw new Error(`"${e}" already has a value defined.`);return this.variables[e]=t,this}addValueWithDefault(e,t,r){if(r===void 0)throw new Error(`Failed to add "${e}" property. Default value cannot be undefined`);return this.addValue(e,t===void 0?r:t)}}const or=new Xu().addValue("NETWORK","mainnet").build(),Le={};if(Le.Mainnet={MaxSize:33554432,Port:8333,Address:{pubKeyHash:0,payToScriptHash:5},Bip32:{pubKey:76067358,privKey:76066276},Block:{maxNBits:486604799,magicNum:3823236072},Msg:{magicNum:3823236072,versionBytesNum:70015},PrivKey:{versionByteNum:128},TxBuilder:{dust:0,feePerKbNum:1},Workers:{timeout:6e4}},Le.Testnet=Object.assign({},Le.Mainnet,{Port:18333,Address:{pubKeyHash:111,payToScriptHash:196},Bip32:{pubKey:70617039,privKey:70615956},Block:{maxNBits:486604799,magicNum:4108710900},Msg:{magicNum:4108710900,versionBytesNum:70015},PrivKey:{versionByteNum:239}}),Le.Regtest=Object.assign({},Le.Mainnet,{Port:18444,Address:{pubKeyHash:111,payToScriptHash:196},Bip32:{pubKey:70617039,privKey:70615956},Block:{maxNBits:545259519,magicNum:3669344250},Msg:{magicNum:3669344250,versionBytesNum:70015},PrivKey:{versionByteNum:239}}),Le.STN=Object.assign({},Le.Mainnet,{Port:9333,Address:{pubKeyHash:111,payToScriptHash:196},Bip32:{pubKey:70617039,privKey:70615956},Block:{maxNBits:486604799,magicNum:4224632057},Msg:{magicNum:4224632057,versionBytesNum:70015},PrivKey:{versionByteNum:239}}),or.get("NETWORK")==="testnet")Le.Default=Object.assign({},Le.Testnet);else if(or.get("NETWORK")==="mainnet")Le.Default=Object.assign({},Le.Mainnet);else if(or.get("NETWORK")==="regtest")Le.Default=Object.assign({},Le.Regtest);else if(or.get("NETWORK")==="stn")Le.Default=Object.assign({},Le.STN);else throw new Error(`must set network in environment variable - mainnet, testnet, regtest or stn?, received ${or.get("NETWORK")}`);const Qu=n=>Le.Mainnet.Msg.magicNum===n?Le.Mainnet:Le.Testnet.Msg.magicNum===n?Le.Testnet:Le.Regtest.Msg.magicNum===n?Le.Regtest:Le.STN.Msg.magicNum===n?Le.STN:Le.Default,fr={FALSE:0,0:0,PUSHDATA1:76,PUSHDATA2:77,PUSHDATA4:78,"1NEGATE":79,RESERVED:80,TRUE:81,1:81,2:82,3:83,4:84,5:85,6:86,7:87,8:88,9:89,10:90,11:91,12:92,13:93,14:94,15:95,16:96,NOP:97,VER:98,IF:99,NOTIF:100,VERIF:101,VERNOTIF:102,ELSE:103,ENDIF:104,VERIFY:105,RETURN:106,TOALTSTACK:107,FROMALTSTACK:108,"2DROP":109,"2DUP":110,"3DUP":111,"2OVER":112,"2ROT":113,"2SWAP":114,IFDUP:115,DEPTH:116,DROP:117,DUP:118,NIP:119,OVER:120,PICK:121,ROLL:122,ROT:123,SWAP:124,TUCK:125,CAT:126,SUBSTR:127,SPLIT:127,LEFT:128,NUM2BIN:128,RIGHT:129,BIN2NUM:129,SIZE:130,INVERT:131,AND:132,OR:133,XOR:134,EQUAL:135,EQUALVERIFY:136,RESERVED1:137,RESERVED2:138,"1ADD":139,"1SUB":140,"2MUL":141,"2DIV":142,NEGATE:143,ABS:144,NOT:145,"0NOTEQUAL":146,ADD:147,SUB:148,MUL:149,DIV:150,MOD:151,LSHIFT:152,RSHIFT:153,BOOLAND:154,BOOLOR:155,NUMEQUAL:156,NUMEQUALVERIFY:157,NUMNOTEQUAL:158,LESSTHAN:159,GREATERTHAN:160,LESSTHANOREQUAL:161,GREATERTHANOREQUAL:162,MIN:163,MAX:164,WITHIN:165,RIPEMD160:166,SHA1:167,SHA256:168,HASH160:169,HASH256:170,CODESEPARATOR:171,CHECKSIG:172,CHECKSIGVERIFY:173,CHECKMULTISIG:174,CHECKMULTISIGVERIFY:175,NOP1:176,NOP2:177,CHECKLOCKTIMEVERIFY:177,NOP3:178,CHECKSEQUENCEVERIFY:178,NOP4:179,NOP5:180,NOP6:181,NOP7:182,NOP8:183,NOP9:184,NOP10:185,SMALLDATA:249,SMALLINTEGER:250,PUBKEYS:251,PUBKEYHASH:253,PUBKEY:254,INVALIDOPCODE:255},ur={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_SPLIT:127,OP_LEFT:128,OP_NUM2BIN:128,OP_RIGHT:129,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_SMALLDATA:249,OP_SMALLINTEGER:250,OP_PUBKEYS:251,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};class z extends ze{constructor(e){super({num:e})}fromNumber(e){return this.num=e,this}static fromNumber(e){return new this().fromNumber(e)}toNumber(){return this.num}fromString(e){const t=ur[e];if(t===void 0)throw new Error("Invalid opCodeStr");return this.num=t,this}fromNoOpString(e){const t=fr[e];if(t===void 0)throw new Error("Invalid opCodeStr");return this.num=t,this}static fromString(e){return new this().fromString(e)}static fromNoOpString(e){return new this().fromNoOpString(e)}toString(){const e=z.str[this.num];return e===void 0?this.num>0&&this.num<z.OP_PUSHDATA1?this.num.toString():"OP_"+this.num.toNumber():e}toNoOpString(){const e=z.noopstr[this.num];return e===void 0?this.num>0&&this.num<z.OP_PUSHDATA1?this.num.toString():this.num.toNumber():e}}z.str={},z.noopstr={};for(const n in ur)z[n]=ur[n],Object.prototype.hasOwnProperty.call(ur,n)&&(z.str[ur[n]]=n);for(const n in fr)z[n]=fr[n],Object.prototype.hasOwnProperty.call(fr,n)&&(z.noopstr[fr[n]]=n);const cr=es.curves.secp256k1,zt=cr.curve.point().constructor;class Ue extends zt{constructor(e,t,r){super(cr.curve,e,t,r)}static fromX(e,t){const r=cr.curve.pointFromX(t,e);return Object.create(Ue.prototype).copyFrom(r)}copyFrom(e){if(!(e instanceof zt))throw new Error("point should be an external point");return Object.keys(e).forEach((function(t){this[t]=e[t]}).bind(this)),this}add(e){return e=zt.prototype.add.call(this,e),Object.create(Ue.prototype).copyFrom(e)}mul(e){if(!e.lt(Ue.getN()))throw new Error("point mul out of range");const t=zt.prototype.mul.call(this,e);return Object.create(Ue.prototype).copyFrom(t)}mulAdd(e,t,r){const a=zt.prototype.mulAdd.call(this,e,t,r);return t=Object.create(Ue.prototype),t.copyFrom(a)}getX(){const e=zt.prototype.getX.call(this),t=Object.create(ee.prototype);return e.copy(t),t}getY(){const e=zt.prototype.getY.call(this),t=Object.create(ee.prototype);return e.copy(t),t}fromX(e,t){const r=Ue.fromX(e,t);return this.copyFrom(r)}toJSON(){return{x:this.getX().toString(),y:this.getY().toString()}}fromJSON(e){const t=new ee().fromString(e.x),r=new ee().fromString(e.y),a=new Ue(t,r);return this.copyFrom(a)}toString(){return JSON.stringify(this.toJSON())}fromString(e){const t=JSON.parse(e),r=new Ue().fromJSON(t);return this.copyFrom(r)}static getG(){const e=cr.curve.g;return Object.create(Ue.prototype).copyFrom(e)}static getN(){return new ee(cr.curve.n.toArray())}validate(){if(Ue.fromX(this.getY().isOdd(),this.getX()).getY().cmp(this.getY())!==0)throw new Error("Invalid y value of public key");if(!(this.getX().gt(-1)&&this.getX().lt(Ue.getN()))||!(this.getY().gt(-1)&&this.getY().lt(Ue.getN())))throw new Error("Point does not lie on the curve");return this}}class Ze extends ze{constructor(e,t){super({point:e,compressed:t})}fromJSON(e){return this.fromFastHex(e),this}toJSON(){return this.toFastHex()}fromPrivKey(e){return this.fromObject({point:Ue.getG().mul(e.bn),compressed:e.compressed}),this}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){const t=await we.asyncObjectMethod(this,"fromPrivKey",[e]);return this.fromFastBuffer(t.resbuf)}static asyncFromPrivKey(e){return new this().asyncFromPrivKey(e)}fromBuffer(e,t){return this.fromDer(e,t)}async asyncFromBuffer(e,t){const r=[e,t],a=await we.asyncObjectMethod(this,"fromBuffer",r);return this.fromFastBuffer(a.resbuf)}fromFastBuffer(e){if(e.length===0)return this;const t=!!e[0];return e=e.slice(1),this.fromDer(e),this.compressed=t,this}fromDer(e,t){if(t===void 0?t=!0:t=!1,e[0]===4||!t&&(e[0]===6||e[0]===7)){const r=e.slice(1,33),a=e.slice(33,65);if(r.length!==32||a.length!==32||e.length!==65)throw new Error("LEngth of x and y must be 32 bytes");const i=new ee(r),u=new ee(a);this.point=new Ue(i,u),this.compressed=!1}else if(e[0]===3){const r=e.slice(1),a=new ee(r);this.fromX(!0,a),this.compressed=!0}else if(e[0]===2){const r=e.slice(1),a=new ee(r);this.fromX(!1,a),this.compressed=!0}else throw new Error("Invalid DER format pubKey");return this}static fromDer(e,t){return new this().fromDer(e,t)}fromString(e){return this.fromDer(Y.from(e,"hex")),this}fromX(e,t){if(typeof e!="boolean")throw new Error("Must specify whether y is odd or not (true or false)");return this.point=Ue.fromX(e,t),this}static fromX(e,t){return new this().fromX(e,t)}toBuffer(){const e=this.compressed===void 0?!0:this.compressed;return this.toDer(e)}toFastBuffer(){if(!this.point)return Y.alloc(0);const e=new qe,t=this.compressed===void 0?!0:!!this.compressed;return e.writeUInt8(Number(t)),e.write(this.toDer(!1)),e.toBuffer()}toDer(e){if(e=e===void 0?this.compressed:e,typeof e!="boolean")throw new Error("Must specify whether the public key is compressed or not (true or false)");const t=this.point.getX(),r=this.point.getY(),a=t.toBuffer({size:32}),i=r.toBuffer({size:32});let u;return e?(i[i.length-1]%2?u=Y.from([3]):u=Y.from([2]),Y.concat([u,a])):(u=Y.from([4]),Y.concat([u,a,i]))}toString(){const e=this.compressed===void 0?!0:this.compressed;return this.toDer(e).toString("hex")}static isCompressedOrUncompressed(e){if(e.length<33)return!1;if(e[0]===4){if(e.length!==65)return!1}else if(e[0]===2||e[0]===3){if(e.length!==33)return!1}else return!1;return!0}validate(){if(this.point.isInfinity())throw new Error("point: Point cannot be equal to Infinity");if(this.point.eq(new Ue(new ee(0),new ee(0))))throw new Error("point: Point cannot be equal to 0, 0");return this.point.validate(),this}}var Or={exports:{}},cf;function Zu(){if(cf)return Or.exports;cf=1;var n=65536,e=4294967295;function t(){throw new Error(`Secure random number generation is not supported by this browser.
12
+ Use Chrome, Firefox or Internet Explorer 11`)}var r=bt().Buffer,a=He.crypto||He.msCrypto;a&&a.getRandomValues?Or.exports=i:Or.exports=t;function i(u,c){if(u>e)throw new RangeError("requested too many random bytes");var h=r.allocUnsafe(u);if(u>0)if(u>n)for(var f=0;f<u;f+=n)a.getRandomValues(h.slice(f,f+n));else a.getRandomValues(h);return typeof c=="function"?ut.nextTick(function(){c(null,h)}):h}return Or.exports}var ec=Zu();const tc=$t(ec);class Mt{}Mt.getRandomBuffer=function(n){return tc(n)};class xt extends ze{constructor(e,t,r=null){super({bn:e,compressed:t}),r=r||Le.Default.PrivKey,this.Constants=r}fromJSON(e){return this.fromHex(e),this}toJSON(){return this.toHex()}fromRandom(){let e,t,r;do e=Mt.getRandomBuffer(32),t=new ee().fromBuffer(e),r=t.lt(Ue.getN());while(!r);return this.fromObject({bn:t,compressed:!0}),this}static fromRandom(){return new this().fromRandom()}toBuffer(){let e=this.compressed;e===void 0&&(e=!0);const t=this.bn.toBuffer({size:32});let r;return e?r=Y.concat([Y.from([this.Constants.versionByteNum]),t,Y.from([1])]):r=Y.concat([Y.from([this.Constants.versionByteNum]),t]),r}fromBuffer(e){if(e.length===34&&e[33]===1)this.compressed=!0;else if(e.length===33)this.compressed=!1;else throw new Error("Length of privKey buffer must be 33 (uncompressed pubKey) or 34 (compressed pubKey)");if(e[0]!==this.Constants.versionByteNum)throw new Error("Invalid versionByteNum byte");return this.fromBn(new ee().fromBuffer(e.slice(1,33)))}toBn(){return this.bn}fromBn(e){return this.bn=e,this}static fromBn(e){return new this().fromBn(e)}validate(){if(!this.bn.lt(Ue.getN()))throw new Error("Number must be less than N");if(typeof this.compressed!="boolean")throw new Error("Must specify whether the corresponding public key is compressed or not (true or false)");return this}toWif(){return Tt.encode(this.toBuffer())}fromWif(e){return this.fromBuffer(Tt.decode(e))}static fromWif(e){return new this().fromWif(e)}toString(){return this.toWif()}fromString(e){return this.fromWif(e)}}xt.Mainnet=class extends xt{constructor(n,e){super(n,e,Le.Mainnet.PrivKey)}},xt.Testnet=class extends xt{constructor(n,e){super(n,e,Le.Testnet.PrivKey)}};class be extends ze{constructor(e,t,r,a,i){super({r:e,s:t,nHashType:r,recovery:a,compressed:i})}fromBuffer(e){try{return this.fromDer(e,!0)}catch{}try{return this.fromCompact(e)}catch{}return this.fromTxFormat(e)}toBuffer(){return this.nHashType!==void 0?this.toTxFormat():this.recovery!==void 0?this.toCompact():this.toDer()}fromCompact(e){let t=!0,r=e.slice(0,1)[0]-27-4;if(r<0&&(t=!1,r=r+4),!(r===0||r===1||r===2||r===3))throw new Error("i must be 0, 1, 2, or 3");this.compressed=t,this.recovery=r;const a=e.slice(1);return this.fromRS(a),this}static fromCompact(e){return new this().fromCompact(e)}fromRS(e){const t=e.slice(0,32),r=e.slice(32,64);if(t.length!==32)throw new Error("r must be 32 bytes");if(r.length!==32||e.length>64)throw new Error("s must be 32 bytes");return this.r=new ee().fromBuffer(t),this.s=new ee().fromBuffer(r),this}static fromRS(e){return new this().fromRS(e)}fromDer(e,t){const r=be.parseDer(e,t);return this.r=r.r,this.s=r.s,this}static fromDer(e,t){return new this().fromDer(e,t)}fromTxFormat(e){if(e.length===0)return this.r=new ee(1),this.s=new ee(1),this.nHashType=1,this;const t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1);return this.fromDer(r,!1),this.nHashType=t,this}static fromTxFormat(e){return new this().fromTxFormat(e)}fromString(e){return this.fromHex(e)}static parseDer(e,t){if(t===void 0&&(t=!0),!Y.isBuffer(e))throw new Error("DER formatted signature should be a buffer");const r=e[0];if(r!==48)throw new Error("Header byte should be 0x30");let a=e[1];const i=e.slice(2).length;if(t&&a!==i)throw new Error("LEngth byte should length of what follows");a=a<i?a:i;const u=e[2];if(u!==2)throw new Error("Integer byte for r should be 0x02");const c=e[3],h=e.slice(4,4+c),f=new ee().fromBuffer(h),o=e[4]===0;if(c!==h.length)throw new Error("LEngth of r incorrect");const v=e[4+c+0];if(v!==2)throw new Error("Integer byte for s should be 0x02");const w=e[4+c+1],A=e.slice(4+c+2,4+c+2+w),B=new ee().fromBuffer(A),x=e[4+c+2+2]===0;if(w!==A.length)throw new Error("LEngth of s incorrect");const U=4+c+2+w;if(a!==U-2)throw new Error("LEngth of signature incorrect");return{header:r,length:a,rheader:u,rlength:c,rneg:o,rbuf:h,r:f,sheader:v,slength:w,sneg:x,sbuf:A,s:B}}static IsTxDer(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;const t=e[3];if(5+t>=e.length)return!1;const r=e[5+t];if(t+r+7!==e.length)return!1;const a=e.slice(4);if(e[2]!==2||t===0||a[0]&128||t>1&&a[0]===0&&!(a[1]&128))return!1;const i=e.slice(6+t);return!(e[6+t-2]!==2||r===0||i[0]&128||r>1&&i[0]===0&&!(i[1]&128))}hasLowS(){return!(this.s.lt(1)||this.s.gt(ee.fromBuffer(Y.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))))}hasDefinedHashType(){return!(this.nHashType<be.SIGHASH_ALL||this.nHashType>be.SIGHASH_SINGLE)}toCompact(e,t){if(e=typeof e=="number"?e:this.recovery,t=typeof t=="boolean"?t:this.compressed,!(e===0||e===1||e===2||e===3))throw new Error("recovery must be equal to 0, 1, 2, or 3");let r=e+27+4;t===!1&&(r=r-4);const a=Y.from([r]),i=this.r.toBuffer({size:32}),u=this.s.toBuffer({size:32});return Y.concat([a,i,u])}toRS(){return Y.concat([this.r.toBuffer({size:32}),this.s.toBuffer({size:32})])}toDer(){const e=this.r.toBuffer(),t=this.s.toBuffer(),r=e[0]&128,a=t[0]&128,i=r?Y.concat([Y.from([0]),e]):e,u=a?Y.concat([Y.from([0]),t]):t,c=2+i.length+2+u.length,h=i.length,f=u.length;return Y.concat([Y.from([48,c,2,h]),i,Y.from([2,f]),u])}toTxFormat(){const e=this.toDer(),t=Y.alloc(1);return t.writeUInt8(this.nHashType,0),Y.concat([e,t])}toString(){return this.toHex()}}be.SIGHASH_ALL=1,be.SIGHASH_NONE=2,be.SIGHASH_SINGLE=3,be.SIGHASH_FORKID=64,be.SIGHASH_ANYONECANPAY=128;class Fe extends ze{constructor(e=[]){super({chunks:e})}fromJSON(e){return this.fromString(e)}toJSON(){return this.toString()}fromBuffer(e){this.chunks=[];const t=new ht(e);for(;!t.eof();){const r=t.readUInt8();let a=0,i=Y.from([]);if(r>0&&r<z.OP_PUSHDATA1)a=r,this.chunks.push({buf:t.read(a),len:a,opCodeNum:r});else if(r===z.OP_PUSHDATA1){try{a=t.readUInt8(),i=t.read(a)}catch{t.read()}this.chunks.push({buf:i,len:a,opCodeNum:r})}else if(r===z.OP_PUSHDATA2){try{a=t.readUInt16LE(),i=t.read(a)}catch{t.read()}this.chunks.push({buf:i,len:a,opCodeNum:r})}else if(r===z.OP_PUSHDATA4){try{a=t.readUInt32LE(),i=t.read(a)}catch{t.read()}this.chunks.push({buf:i,len:a,opCodeNum:r})}else this.chunks.push({opCodeNum:r})}return this}toBuffer(){const e=new qe;for(let t=0;t<this.chunks.length;t++){const r=this.chunks[t],a=r.opCodeNum;e.writeUInt8(a),r.buf&&(a<z.OP_PUSHDATA1?e.write(r.buf):a===z.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):a===z.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):a===z.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.toBuffer()}fromString(e){if(this.chunks=[],e===""||e===void 0)return this;const t=e.split(" ");let r=0;for(;r<t.length;){const a=t[r];let i;try{i=new z().fromString(a).toNumber()}catch{}if(i===void 0)if(i=parseInt(a,10),i>0&&i<z.OP_PUSHDATA1)this.chunks.push({buf:Y.from(t[r+1].slice(2),"hex"),len:i,opCodeNum:i}),r=r+2;else if(i===0)this.chunks.push({opCodeNum:0}),r=r+1;else throw new Error("Invalid script");else if(i===z.OP_PUSHDATA1||i===z.OP_PUSHDATA2||i===z.OP_PUSHDATA4){if(t[r+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");this.chunks.push({buf:Y.from(t[r+2].slice(2),"hex"),len:parseInt(t[r+1],10),opCodeNum:i}),r=r+3}else this.chunks.push({opCodeNum:i}),r=r+1}return this}toString(e={noOp:!1}){var r;let t="";for(let a=0;a<this.chunks.length;a++){const i=this.chunks[a],u=(r=i.opCodeNum)!=null&&r.num?i.opCodeNum.num:i.opCodeNum;i.buf?((u===z.OP_PUSHDATA1||u===z.OP_PUSHDATA2||u===z.OP_PUSHDATA4)&&(t=e.noOp?t+" "+new z(u).toNoOpString():t+" "+new z(u).toString()),t=t+" "+i.len,t=t+" 0x"+i.buf.toString("hex")):z.str[u]!==void 0||z.noopstr[u]!==void 0?t=e.noOp?t+" "+new z(u).toNoOpString():t+" "+new z(u).toString():t=t+" 0x"+u.toString(16)}return t.substr(1)}fromBitcoindString(e){const t=new qe,r=e.split(" ");let a;for(a=0;a<r.length;a++){const u=r[a];if(u!=="")if(u[0]==="0"&&u[1]==="x"){const c=u.slice(2);t.write(Y.from(c,"hex"))}else if(u[0]==="'"){const c=u.slice(1,u.length-1),h=Y.from(c),f=new Fe().writeBuffer(h).toBuffer();t.write(f)}else if(z["OP_"+u]!==void 0){const c="OP_"+u,h=z[c];t.writeUInt8(h)}else if(typeof z[u]=="number"){const h=z[u];t.writeUInt8(h)}else{if(isNaN(parseInt(u,10)))throw new Error("Could not determine type of script value");{const c=new ee(u),f=new Fe().writeBn(c).toBuffer();t.write(f)}}}const i=t.toBuffer();return this.fromBuffer(i)}static fromBitcoindString(e){return new this().fromBitcoindString(e)}toBitcoindString(){let e="";for(let t=0;t<this.chunks.length;t++){const r=this.chunks[t];if(r.buf){const i=new Fe([r]).toBuffer().toString("hex");e=e+" 0x"+i}else if(z.str[r.opCodeNum]!==void 0){const a=new z(r.opCodeNum).toString();e=e+" "+a.slice(3)}else e=e+" 0x"+r.opCodeNum.toString(16)}return e.substr(1)}fromAsmString(e){this.chunks=[];const t=e.split(" ");let r=0;for(;r<t.length;){const a=t[r];let i,u;try{i=z.fromString(a),u=i.toNumber()}catch{i=void 0,u=void 0}if(a==="0")u=0,this.chunks.push({opCodeNum:u}),r=r+1;else if(a==="-1")u=z.OP_1NEGATE,this.chunks.push({opCodeNum:u}),r=r+1;else if(i===void 0){const c=t[r],h=Y.from(c,"hex");if(h.toString("hex")!==c)throw new Error("invalid hex string in script");const f=h.length;f>=0&&f<z.OP_PUSHDATA1?u=f:f<Math.pow(2,8)?u=z.OP_PUSHDATA1:f<Math.pow(2,16)?u=z.OP_PUSHDATA2:f<Math.pow(2,32)&&(u=z.OP_PUSHDATA4),this.chunks.push({buf:h,len:h.length,opCodeNum:u}),r=r+1}else this.chunks.push({opCodeNum:u}),r=r+1}return this}static fromAsmString(e){return new this().fromAsmString(e)}toAsmString(e={noOp:!1}){let t="";for(let r=0;r<this.chunks.length;r++){const a=this.chunks[r];t+=this._chunkToString(a,e)}return t.substr(1)}_chunkToString(e,t={noOp:!1}){const r=e.opCodeNum;let a="";if(e.buf)e.len>0&&(a=a+" "+e.buf.toString("hex"));else if(typeof z.str[r]<"u")r===0?a=a+" 0":r===79?a=a+" -1":a=t.noOp?a+" "+new z(r).toNoOpString():a+" "+new z(r).toString();else{let i=r.toString(16);i.length%2!==0&&(i="0"+i),a=a+" "+i}return a}fromOpReturnData(e){return this.writeOpCode(z.OP_RETURN),this.writeBuffer(e),this}static fromOpReturnData(e){return new this().fromOpReturnData(e)}fromSafeData(e){return this.writeOpCode(z.OP_FALSE),this.writeOpCode(z.OP_RETURN),this.writeBuffer(e),this}static fromSafeData(e){return new this().fromSafeData(e)}fromSafeDataArray(e){this.writeOpCode(z.OP_FALSE),this.writeOpCode(z.OP_RETURN);for(const t in e){const r=e[t];this.writeBuffer(r)}return this}static fromSafeDataArray(e){return new this().fromSafeDataArray(e)}getData(){if(this.isSafeDataOut())return this.chunks.slice(2).map(r=>r.buf);if(this.isOpReturn())return this.chunks.slice(1).map(r=>r.buf);throw new Error("Unrecognized script type to get data from")}fromPubKeyHash(e){if(e.length!==20)throw new Error("hashBuf must be a 20 byte buffer");return this.writeOpCode(z.OP_DUP),this.writeOpCode(z.OP_HASH160),this.writeBuffer(e),this.writeOpCode(z.OP_EQUALVERIFY),this.writeOpCode(z.OP_CHECKSIG),this}static fromPubKeyHash(e){return new this().fromPubKeyHash(e)}static sortPubKeys(e){return e.slice().sort((t,r)=>{const a=t.toBuffer(),i=r.toBuffer(),u=Math.max(a.length,i.length);for(let c=0;c<=u;c++){if(a[c]===void 0)return-1;if(i[c]===void 0)return 1;if(a[c]<i[c])return-1;if(a[c]>i[c])return 1}})}fromPubKeys(e,t,r=!0){if(typeof e!="number")throw new Error("m must be a number");r===!0&&(t=Fe.sortPubKeys(t)),this.writeOpCode(e+z.OP_1-1);for(const a in t)this.writeBuffer(t[a].toBuffer());return this.writeOpCode(t.length+z.OP_1-1),this.writeOpCode(z.OP_CHECKMULTISIG),this}static fromPubKeys(e,t,r){return new this().fromPubKeys(e,t,r)}removeCodeseparators(){const e=[];for(let t=0;t<this.chunks.length;t++)this.chunks[t].opCodeNum!==z.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this}isPushOnly(){for(let e=0;e<this.chunks.length;e++)if(this.chunks[e].opCodeNum>z.OP_16)return!1;return!0}isNonSpendable(){const e=this.chunks[0].opCodeNum===z.OP_FALSE,t=this.chunks[1]&&this.chunks[1].opCodeNum===z.OP_RETURN;return!!e&&!!t}isOpReturn(){return this.chunks[0].opCodeNum===z.OP_RETURN&&this.chunks.filter(e=>Y.isBuffer(e.buf)).length===this.chunks.slice(1).length}isSafeDataOut(){if(this.chunks.length<2||this.chunks[0].opCodeNum!==z.OP_FALSE)return!1;const e=this.chunks.slice(1);return new Fe(e).isOpReturn()}isPubKeyHashOut(){return!!(this.chunks[0]&&this.chunks[0].opCodeNum===z.OP_DUP&&this.chunks[1]&&this.chunks[1].opCodeNum===z.OP_HASH160&&this.chunks[2].buf&&this.chunks[3]&&this.chunks[3].opCodeNum===z.OP_EQUALVERIFY&&this.chunks[4]&&this.chunks[4].opCodeNum===z.OP_CHECKSIG)}isPubKeyHashIn(){return!!(this.chunks.length===2&&(this.chunks[0].buf||this.chunks[0].opCodeNum===z.OP_0)&&(this.chunks[1].buf||this.chunks[0].opCodeNum===z.OP_0))}isScriptHashOut(){const e=this.toBuffer();return e.length===23&&e[0]===z.OP_HASH160&&e[1]===20&&e[22]===z.OP_EQUAL}isScriptHashIn(){if(!this.isPushOnly())return!1;try{new Fe().fromBuffer(this.chunks[this.chunks.length-1].buf)}catch{return!1}return!0}isMultiSigOut(){const e=this.chunks[0].opCodeNum-z.OP_1+1;if(!(e>=1&&e<=16)||!this.chunks.slice(1,this.chunks.length-2).every(a=>{try{const i=a.buf;return new Ze().fromDer(i).validate(),!0}catch{return!1}}))return!1;const r=this.chunks[this.chunks.length-2].opCodeNum-z.OP_1+1;return!(!(r>=e&&r<=16)||this.chunks[1+r+1].opCodeNum!==z.OP_CHECKMULTISIG)}isMultiSigIn(){if(this.chunks[0].opCodeNum!==z.OP_0)return!1;const e=this.chunks.slice(1);return e.length<1?!1:e.every(t=>Y.isBuffer(t.buf)&&be.IsTxDer(t.buf))}findAndDelete(e){const t=e.toBuffer();for(let r=0;r<this.chunks.length;r++){const i=new Fe([this.chunks[r]]).toBuffer();Ut(t,i)&&this.chunks.splice(r,1)}return this}writeScript(e){return this.chunks=this.chunks.concat(e.chunks),this}static writeScript(e){return new this().writeScript(e)}writeString(e){const t=new Fe().fromString(e);return this.chunks=this.chunks.concat(t.chunks),this}static writeString(e){return new this().writeString(e)}writeOpCode(e){return this.chunks.push({opCodeNum:e}),this}static writeOpCode(e){return new this().writeOpCode(e)}setChunkOpCode(e,t){return this.chunks[e]={opCodeNum:t},this}writeBn(e){if(e.cmp(0)===z.OP_0)this.chunks.push({opCodeNum:z.OP_0});else if(e.cmp(-1)===0)this.chunks.push({opCodeNum:z.OP_1NEGATE});else if(e.cmp(1)>=0&&e.cmp(16)<=0)this.chunks.push({opCodeNum:e.toNumber()+z.OP_1-1});else{const t=e.toSm({endian:"little"});this.writeBuffer(t)}return this}static writeBn(e){return new this().writeBn(e)}writeNumber(e){return this.writeBn(new ee().fromNumber(e)),this}static writeNumber(e){return new this().writeNumber(e)}setChunkBn(e,t){return this.chunks[e]=new Fe().writeBn(t).chunks[0],this}writeBuffer(e){let t;const r=e.length;if(e.length>0&&e.length<z.OP_PUSHDATA1)t=e.length;else if(e.length===0)t=z.OP_0;else if(e.length<Math.pow(2,8))t=z.OP_PUSHDATA1;else if(e.length<Math.pow(2,16))t=z.OP_PUSHDATA2;else if(e.length<Math.pow(2,32))t=z.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this.chunks.push({buf:e,len:r,opCodeNum:t}),this}static writeBuffer(e){return new this().writeBuffer(e)}setChunkBuffer(e,t){return this.chunks[e]=new Fe().writeBuffer(t).chunks[0],this}checkMinimalPush(e){const t=this.chunks[e],r=t.buf,a=t.opCodeNum;return r?r.length===0?a===z.OP_0:r.length===1&&r[0]>=1&&r[0]<=16?a===z.OP_1+(r[0]-1):r.length===1&&r[0]===129?a===z.OP_1NEGATE:r.length<=75?a===r.length:r.length<=255?a===z.OP_PUSHDATA1:r.length<=65535?a===z.OP_PUSHDATA2:!0:!0}}class It extends ze{constructor(e,t,r=null){super({versionByteNum:e,hashBuf:t}),r=r||Le.Default.Address,this.Constants=r}fromBuffer(e){if(e.length!==21)throw new Error("address buffers must be exactly 21 bytes");if(e[0]!==this.Constants.pubKeyHash)throw new Error("address: invalid versionByteNum byte");return this.versionByteNum=e[0],this.hashBuf=e.slice(1),this}fromPubKeyHashBuf(e){return this.hashBuf=e,this.versionByteNum=this.Constants.pubKeyHash,this}static fromPubKeyHashBuf(e){return new this().fromPubKeyHashBuf(e)}fromPubKey(e){const t=ce.sha256Ripemd160(e.toBuffer());return this.fromPubKeyHashBuf(t)}static fromPubKey(e){return new this().fromPubKey(e)}async asyncFromPubKey(e){const t=[e],r=await we.asyncObjectMethod(this,"fromPubKey",t);return this.fromFastBuffer(r.resbuf)}static asyncFromPubKey(e){return new this().asyncFromPubKey(e)}fromPrivKey(e){const t=new Ze().fromPrivKey(e),r=ce.sha256Ripemd160(t.toBuffer());return this.fromPubKeyHashBuf(r)}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){const t=[e],r=await we.asyncObjectMethod(this,"fromPrivKey",t);return this.fromFastBuffer(r.resbuf)}static asyncFromPrivKey(e){return new this().fromPrivKey(e)}fromRandom(){const e=new xt().fromRandom();return this.fromPrivKey(e)}static fromRandom(){return new this().fromRandom()}async asyncFromRandom(){const e=[],t=await we.asyncObjectMethod(this,"fromRandom",e);return this.fromFastBuffer(t.resbuf)}static asyncFromRandom(){return new this().fromRandom()}fromString(e){const t=Tt.decode(e);return this.fromBuffer(t)}async asyncFromString(e){const t=[e],r=await we.asyncObjectMethod(this,"fromString",t);return this.fromFastBuffer(r.resbuf)}static asyncFromString(e){return new this().asyncFromString(e)}static isValid(e){let t;try{t=new It().fromString(e)}catch{return!1}return t.isValid()}isValid(){try{return this.validate(),!0}catch{return!1}}toTxOutScript(){const e=new Fe;return e.writeOpCode(z.OP_DUP),e.writeOpCode(z.OP_HASH160),e.writeBuffer(this.hashBuf),e.writeOpCode(z.OP_EQUALVERIFY),e.writeOpCode(z.OP_CHECKSIG),e}fromTxInScript(e){const t=ce.sha256Ripemd160(e.chunks[1].buf||Y.from("00".repeat(32),"hex"));return this.fromPubKeyHashBuf(t)}static fromTxInScript(e){return new this().fromTxInScript(e)}fromTxOutScript(e){return this.fromPubKeyHashBuf(e.chunks[2].buf)}static fromTxOutScript(e){return new this().fromTxOutScript(e)}toBuffer(){const e=Y.from([this.versionByteNum]);return Y.concat([e,this.hashBuf])}toJSON(){const e={};return this.hashBuf&&(e.hashBuf=this.hashBuf.toString("hex")),typeof this.versionByteNum<"u"&&(e.versionByteNum=this.versionByteNum),e}fromJSON(e){return e.hashBuf&&(this.hashBuf=Y.from(e.hashBuf,"hex")),typeof e.versionByteNum<"u"&&(this.versionByteNum=e.versionByteNum),this}toString(){return Tt.encode(this.toBuffer())}async asyncToString(){const e=[],t=await we.asyncObjectMethod(this,"toString",e);return JSON.parse(t.resbuf.toString())}validate(){if(!Y.isBuffer(this.hashBuf)||this.hashBuf.length!==20)throw new Error("hashBuf must be a buffer of 20 bytes");if(this.versionByteNum!==this.Constants.pubKeyHash)throw new Error("invalid versionByteNum");return this}}It.Mainnet=class extends It{constructor(n,e){super(n,e,Le.Mainnet.Address)}},It.Testnet=class extends It{constructor(n,e){super(n,e,Le.Testnet.Address)}};class hr extends ze{constructor(e,t,r,a,i,u,c,h=null,f=xt){super({versionBytesNum:e,depth:t,parentFingerPrint:r,childIndex:a,chainCode:i,privKey:u,pubKey:c}),h=h||Le.Default.Bip32,this.Constants=h,this.PrivKey=f}fromRandom(){return this.versionBytesNum=this.Constants.privKey,this.depth=0,this.parentFingerPrint=Y.from([0,0,0,0]),this.childIndex=0,this.chainCode=Mt.getRandomBuffer(32),this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new Ze().fromPrivKey(this.privKey),this}static fromRandom(){return new this().fromRandom()}fromString(e){return this.fromBuffer(Tt.decode(e))}async asyncFromString(e){const t=[e],r=await we.asyncObjectMethod(this,"fromString",t);return this.fromFastBuffer(r.resbuf)}fromSeed(e){if(!Y.isBuffer(e))throw new Error("bytes must be a buffer");if(e.length<128/8)throw new Error("Need more than 128 bits of entropy");if(e.length>512/8)throw new Error("More than 512 bits of entropy is nonstandard");const t=ce.sha512Hmac(e,Y.from("Bitcoin seed"));return this.depth=0,this.parentFingerPrint=Y.from([0,0,0,0]),this.childIndex=0,this.chainCode=t.slice(32,64),this.versionBytesNum=this.Constants.privKey,this.privKey=new this.PrivKey().fromBn(ee().fromBuffer(t.slice(0,32))),this.pubKey=new Ze().fromPrivKey(this.privKey),this}static fromSeed(e){return new this().fromSeed(e)}async asyncFromSeed(e){const t=await we.asyncObjectMethod(this,"fromSeed",[e]);return this.fromFastBuffer(t.resbuf)}static asyncFromSeed(e){return new this().asyncFromSeed(e)}fromBuffer(e){if(e.length!==78)throw new Error("incorrect bip32 data length");this.versionBytesNum=e.slice(0,4).readUInt32BE(0),this.depth=e.slice(4,5).readUInt8(0),this.parentFingerPrint=e.slice(5,9),this.childIndex=e.slice(9,13).readUInt32BE(0),this.chainCode=e.slice(13,45);const t=e.slice(45,78),r=this.versionBytesNum===this.Constants.privKey,a=this.versionBytesNum===this.Constants.pubKey;if(r&&t[0]===0)this.privKey=new this.PrivKey().fromBn(ee().fromBuffer(t.slice(1,33))),this.pubKey=new Ze().fromPrivKey(this.privKey);else if(a&&(t[0]===2||t[0]===3))this.pubKey=new Ze().fromDer(t);else throw new Error("Invalid key");return this}fromFastBuffer(e){if(e.length===0)return this;if(e.length!==78&&e.length!==111)throw new Error("incorrect bip32 fastBuffer data length: "+e.length);this.versionBytesNum=e.slice(0,4).readUInt32BE(0),this.depth=e.slice(4,5).readUInt8(0),this.parentFingerPrint=e.slice(5,9),this.childIndex=e.slice(9,13).readUInt32BE(0),this.chainCode=e.slice(13,45);const t=e.slice(45,e.length),r=this.versionBytesNum===this.Constants.privKey,a=this.versionBytesNum===this.Constants.pubKey;if(r&&t[0]===0&&e.length===78)this.privKey=new this.PrivKey().fromBn(ee().fromBuffer(t.slice(1,33))),this.pubKey=new Ze().fromPrivKey(this.privKey);else if(a&&e.length===111)this.pubKey=new Ze().fromFastBuffer(t),this.pubKey.compressed=!0;else throw new Error("Invalid key");return this}derive(e){const t=e.split("/");if(e==="m")return this;let r=this;for(const a in t){const i=t[a];if(a==="0"){if(i!=="m")throw new Error("invalid path");continue}if(parseInt(i.replace("'",""),10).toString()!==i.replace("'",""))throw new Error("invalid path");const u=i.length>1&&i[i.length-1]==="'";let c=parseInt(u?i.slice(0,i.length-1):i,10)&2147483647;u&&(c+=2147483648),r=r.deriveChild(c)}return r}async asyncDerive(e){const t=await we.asyncObjectMethod(this,"derive",[e]);return new this.constructor().fromFastBuffer(t.resbuf)}deriveChild(e){if(typeof e!="number")throw new Error("i must be a number");let t=[];t.push(e>>24&255),t.push(e>>16&255),t.push(e>>8&255),t.push(e&255),t=Y.from(t);const r=(e&2147483648)!==0,a=this.versionBytesNum===this.Constants.privKey;if(r&&(!this.privKey||!a))throw new Error("Cannot do private key derivation without private key");let i=null;if(this.privKey){let c=null;r?c=Y.concat([Y.from([0]),this.privKey.bn.toBuffer({size:32}),t]):c=Y.concat([this.pubKey.toBuffer({size:32}),t]);const h=ce.sha512Hmac(c,this.chainCode),f=ee().fromBuffer(h.slice(0,32),{size:32}),o=h.slice(32,64),v=f.add(this.privKey.bn).mod(Ue.getN());i=new this.constructor,i.chainCode=o,i.privKey=new this.PrivKey().fromBn(v),i.pubKey=new Ze().fromPrivKey(i.privKey)}else{const c=Y.concat([this.pubKey.toBuffer(),t]),h=ce.sha512Hmac(c,this.chainCode),f=ee().fromBuffer(h.slice(0,32)),o=h.slice(32,64),v=Ue.getG().mul(f),w=this.pubKey.point,A=v.add(w),B=new Ze;B.point=A,i=new this.constructor,i.chainCode=o,i.pubKey=B}i.childIndex=e;const u=ce.sha256Ripemd160(this.pubKey.toBuffer());return i.parentFingerPrint=u.slice(0,4),i.versionBytesNum=this.versionBytesNum,i.depth=this.depth+1,i}toPublic(){const e=new this.constructor().fromObject(this);return e.versionBytesNum=this.Constants.pubKey,e.privKey=void 0,e}toBuffer(){const e=this.versionBytesNum===this.Constants.privKey,t=this.versionBytesNum===this.Constants.pubKey;if(e)return new qe().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).writeUInt8(0).write(this.privKey.bn.toBuffer({size:32})).toBuffer();if(t){if(this.pubKey.compressed===!1)throw new Error("cannot convert bip32 to buffer if pubKey is not compressed");return new qe().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).write(this.pubKey.toBuffer()).toBuffer()}else throw new Error("bip32: invalid versionBytesNum byte")}toFastBuffer(){if(!this.versionBytesNum)return Y.alloc(0);const e=this.versionBytesNum===this.Constants.privKey,t=this.versionBytesNum===this.Constants.pubKey;if(e)return new qe().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).writeUInt8(0).write(this.privKey.bn.toBuffer({size:32})).toBuffer();if(t)return new qe().writeUInt32BE(this.versionBytesNum).writeUInt8(this.depth).write(this.parentFingerPrint).writeUInt32BE(this.childIndex).write(this.chainCode).write(this.pubKey.toFastBuffer()).toBuffer();throw new Error("bip32: invalid versionBytesNum byte")}toString(){return Tt.encode(this.toBuffer())}async asyncToString(){const e=await we.asyncObjectMethod(this,"toString",[]);return JSON.parse(e.resbuf.toString())}toJSON(){return this.toFastHex()}fromJSON(e){return this.fromFastHex(e)}isPrivate(){return this.versionBytesNum===this.Constants.privKey}}hr.Mainnet=class extends hr{constructor(n,e,t,r,a,i,u){super(n,e,t,r,a,i,u,Le.Mainnet.Bip32,xt.Mainnet)}},hr.Testnet=class extends hr{constructor(n,e,t,r,a,i,u){super(n,e,t,r,a,i,u,Le.Testnet.Bip32,xt.Testnet)}};const Rr=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];Rr.space=" ";const Pr=["あいこくしん","あいさつ","あいだ","あおぞら","あかちゃん","あきる","あけがた","あける","あこがれる","あさい","あさひ","あしあと","あじわう","あずかる","あずき","あそぶ","あたえる","あたためる","あたりまえ","あたる","あつい","あつかう","あっしゅく","あつまり","あつめる","あてな","あてはまる","あひる","あぶら","あぶる","あふれる","あまい","あまど","あまやかす","あまり","あみもの","あめりか","あやまる","あゆむ","あらいぐま","あらし","あらすじ","あらためる","あらゆる","あらわす","ありがとう","あわせる","あわてる","あんい","あんがい","あんこ","あんぜん","あんてい","あんない","あんまり","いいだす","いおん","いがい","いがく","いきおい","いきなり","いきもの","いきる","いくじ","いくぶん","いけばな","いけん","いこう","いこく","いこつ","いさましい","いさん","いしき","いじゅう","いじょう","いじわる","いずみ","いずれ","いせい","いせえび","いせかい","いせき","いぜん","いそうろう","いそがしい","いだい","いだく","いたずら","いたみ","いたりあ","いちおう","いちじ","いちど","いちば","いちぶ","いちりゅう","いつか","いっしゅん","いっせい","いっそう","いったん","いっち","いってい","いっぽう","いてざ","いてん","いどう","いとこ","いない","いなか","いねむり","いのち","いのる","いはつ","いばる","いはん","いびき","いひん","いふく","いへん","いほう","いみん","いもうと","いもたれ","いもり","いやがる","いやす","いよかん","いよく","いらい","いらすと","いりぐち","いりょう","いれい","いれもの","いれる","いろえんぴつ","いわい","いわう","いわかん","いわば","いわゆる","いんげんまめ","いんさつ","いんしょう","いんよう","うえき","うえる","うおざ","うがい","うかぶ","うかべる","うきわ","うくらいな","うくれれ","うけたまわる","うけつけ","うけとる","うけもつ","うける","うごかす","うごく","うこん","うさぎ","うしなう","うしろがみ","うすい","うすぎ","うすぐらい","うすめる","うせつ","うちあわせ","うちがわ","うちき","うちゅう","うっかり","うつくしい","うったえる","うつる","うどん","うなぎ","うなじ","うなずく","うなる","うねる","うのう","うぶげ","うぶごえ","うまれる","うめる","うもう","うやまう","うよく","うらがえす","うらぐち","うらない","うりあげ","うりきれ","うるさい","うれしい","うれゆき","うれる","うろこ","うわき","うわさ","うんこう","うんちん","うんてん","うんどう","えいえん","えいが","えいきょう","えいご","えいせい","えいぶん","えいよう","えいわ","えおり","えがお","えがく","えきたい","えくせる","えしゃく","えすて","えつらん","えのぐ","えほうまき","えほん","えまき","えもじ","えもの","えらい","えらぶ","えりあ","えんえん","えんかい","えんぎ","えんげき","えんしゅう","えんぜつ","えんそく","えんちょう","えんとつ","おいかける","おいこす","おいしい","おいつく","おうえん","おうさま","おうじ","おうせつ","おうたい","おうふく","おうべい","おうよう","おえる","おおい","おおう","おおどおり","おおや","おおよそ","おかえり","おかず","おがむ","おかわり","おぎなう","おきる","おくさま","おくじょう","おくりがな","おくる","おくれる","おこす","おこなう","おこる","おさえる","おさない","おさめる","おしいれ","おしえる","おじぎ","おじさん","おしゃれ","おそらく","おそわる","おたがい","おたく","おだやか","おちつく","おっと","おつり","おでかけ","おとしもの","おとなしい","おどり","おどろかす","おばさん","おまいり","おめでとう","おもいで","おもう","おもたい","おもちゃ","おやつ","おやゆび","およぼす","おらんだ","おろす","おんがく","おんけい","おんしゃ","おんせん","おんだん","おんちゅう","おんどけい","かあつ","かいが","がいき","がいけん","がいこう","かいさつ","かいしゃ","かいすいよく","かいぜん","かいぞうど","かいつう","かいてん","かいとう","かいふく","がいへき","かいほう","かいよう","がいらい","かいわ","かえる","かおり","かかえる","かがく","かがし","かがみ","かくご","かくとく","かざる","がぞう","かたい","かたち","がちょう","がっきゅう","がっこう","がっさん","がっしょう","かなざわし","かのう","がはく","かぶか","かほう","かほご","かまう","かまぼこ","かめれおん","かゆい","かようび","からい","かるい","かろう","かわく","かわら","がんか","かんけい","かんこう","かんしゃ","かんそう","かんたん","かんち","がんばる","きあい","きあつ","きいろ","ぎいん","きうい","きうん","きえる","きおう","きおく","きおち","きおん","きかい","きかく","きかんしゃ","ききて","きくばり","きくらげ","きけんせい","きこう","きこえる","きこく","きさい","きさく","きさま","きさらぎ","ぎじかがく","ぎしき","ぎじたいけん","ぎじにってい","ぎじゅつしゃ","きすう","きせい","きせき","きせつ","きそう","きぞく","きぞん","きたえる","きちょう","きつえん","ぎっちり","きつつき","きつね","きてい","きどう","きどく","きない","きなが","きなこ","きぬごし","きねん","きのう","きのした","きはく","きびしい","きひん","きふく","きぶん","きぼう","きほん","きまる","きみつ","きむずかしい","きめる","きもだめし","きもち","きもの","きゃく","きやく","ぎゅうにく","きよう","きょうりゅう","きらい","きらく","きりん","きれい","きれつ","きろく","ぎろん","きわめる","ぎんいろ","きんかくじ","きんじょ","きんようび","ぐあい","くいず","くうかん","くうき","くうぐん","くうこう","ぐうせい","くうそう","ぐうたら","くうふく","くうぼ","くかん","くきょう","くげん","ぐこう","くさい","くさき","くさばな","くさる","くしゃみ","くしょう","くすのき","くすりゆび","くせげ","くせん","ぐたいてき","くださる","くたびれる","くちこみ","くちさき","くつした","ぐっすり","くつろぐ","くとうてん","くどく","くなん","くねくね","くのう","くふう","くみあわせ","くみたてる","くめる","くやくしょ","くらす","くらべる","くるま","くれる","くろう","くわしい","ぐんかん","ぐんしょく","ぐんたい","ぐんて","けあな","けいかく","けいけん","けいこ","けいさつ","げいじゅつ","けいたい","げいのうじん","けいれき","けいろ","けおとす","けおりもの","げきか","げきげん","げきだん","げきちん","げきとつ","げきは","げきやく","げこう","げこくじょう","げざい","けさき","げざん","けしき","けしごむ","けしょう","げすと","けたば","けちゃっぷ","けちらす","けつあつ","けつい","けつえき","けっこん","けつじょ","けっせき","けってい","けつまつ","げつようび","げつれい","けつろん","げどく","けとばす","けとる","けなげ","けなす","けなみ","けぬき","げねつ","けねん","けはい","げひん","けぶかい","げぼく","けまり","けみかる","けむし","けむり","けもの","けらい","けろけろ","けわしい","けんい","けんえつ","けんお","けんか","げんき","けんげん","けんこう","けんさく","けんしゅう","けんすう","げんそう","けんちく","けんてい","けんとう","けんない","けんにん","げんぶつ","けんま","けんみん","けんめい","けんらん","けんり","こあくま","こいぬ","こいびと","ごうい","こうえん","こうおん","こうかん","ごうきゅう","ごうけい","こうこう","こうさい","こうじ","こうすい","ごうせい","こうそく","こうたい","こうちゃ","こうつう","こうてい","こうどう","こうない","こうはい","ごうほう","ごうまん","こうもく","こうりつ","こえる","こおり","ごかい","ごがつ","ごかん","こくご","こくさい","こくとう","こくない","こくはく","こぐま","こけい","こける","ここのか","こころ","こさめ","こしつ","こすう","こせい","こせき","こぜん","こそだて","こたい","こたえる","こたつ","こちょう","こっか","こつこつ","こつばん","こつぶ","こてい","こてん","ことがら","ことし","ことば","ことり","こなごな","こねこね","このまま","このみ","このよ","ごはん","こひつじ","こふう","こふん","こぼれる","ごまあぶら","こまかい","ごますり","こまつな","こまる","こむぎこ","こもじ","こもち","こもの","こもん","こやく","こやま","こゆう","こゆび","こよい","こよう","こりる","これくしょん","ころっけ","こわもて","こわれる","こんいん","こんかい","こんき","こんしゅう","こんすい","こんだて","こんとん","こんなん","こんびに","こんぽん","こんまけ","こんや","こんれい","こんわく","ざいえき","さいかい","さいきん","ざいげん","ざいこ","さいしょ","さいせい","ざいたく","ざいちゅう","さいてき","ざいりょう","さうな","さかいし","さがす","さかな","さかみち","さがる","さぎょう","さくし","さくひん","さくら","さこく","さこつ","さずかる","ざせき","さたん","さつえい","ざつおん","ざっか","ざつがく","さっきょく","ざっし","さつじん","ざっそう","さつたば","さつまいも","さてい","さといも","さとう","さとおや","さとし","さとる","さのう","さばく","さびしい","さべつ","さほう","さほど","さます","さみしい","さみだれ","さむけ","さめる","さやえんどう","さゆう","さよう","さよく","さらだ","ざるそば","さわやか","さわる","さんいん","さんか","さんきゃく","さんこう","さんさい","ざんしょ","さんすう","さんせい","さんそ","さんち","さんま","さんみ","さんらん","しあい","しあげ","しあさって","しあわせ","しいく","しいん","しうち","しえい","しおけ","しかい","しかく","じかん","しごと","しすう","じだい","したうけ","したぎ","したて","したみ","しちょう","しちりん","しっかり","しつじ","しつもん","してい","してき","してつ","じてん","じどう","しなぎれ","しなもの","しなん","しねま","しねん","しのぐ","しのぶ","しはい","しばかり","しはつ","しはらい","しはん","しひょう","しふく","じぶん","しへい","しほう","しほん","しまう","しまる","しみん","しむける","じむしょ","しめい","しめる","しもん","しゃいん","しゃうん","しゃおん","じゃがいも","しやくしょ","しゃくほう","しゃけん","しゃこ","しゃざい","しゃしん","しゃせん","しゃそう","しゃたい","しゃちょう","しゃっきん","じゃま","しゃりん","しゃれい","じゆう","じゅうしょ","しゅくはく","じゅしん","しゅっせき","しゅみ","しゅらば","じゅんばん","しょうかい","しょくたく","しょっけん","しょどう","しょもつ","しらせる","しらべる","しんか","しんこう","じんじゃ","しんせいじ","しんちく","しんりん","すあげ","すあし","すあな","ずあん","すいえい","すいか","すいとう","ずいぶん","すいようび","すうがく","すうじつ","すうせん","すおどり","すきま","すくう","すくない","すける","すごい","すこし","ずさん","すずしい","すすむ","すすめる","すっかり","ずっしり","ずっと","すてき","すてる","すねる","すのこ","すはだ","すばらしい","ずひょう","ずぶぬれ","すぶり","すふれ","すべて","すべる","ずほう","すぼん","すまい","すめし","すもう","すやき","すらすら","するめ","すれちがう","すろっと","すわる","すんぜん","すんぽう","せあぶら","せいかつ","せいげん","せいじ","せいよう","せおう","せかいかん","せきにん","せきむ","せきゆ","せきらんうん","せけん","せこう","せすじ","せたい","せたけ","せっかく","せっきゃく","ぜっく","せっけん","せっこつ","せっさたくま","せつぞく","せつだん","せつでん","せっぱん","せつび","せつぶん","せつめい","せつりつ","せなか","せのび","せはば","せびろ","せぼね","せまい","せまる","せめる","せもたれ","せりふ","ぜんあく","せんい","せんえい","せんか","せんきょ","せんく","せんげん","ぜんご","せんさい","せんしゅ","せんすい","せんせい","せんぞ","せんたく","せんちょう","せんてい","せんとう","せんぬき","せんねん","せんぱい","ぜんぶ","ぜんぽう","せんむ","せんめんじょ","せんもん","せんやく","せんゆう","せんよう","ぜんら","ぜんりゃく","せんれい","せんろ","そあく","そいとげる","そいね","そうがんきょう","そうき","そうご","そうしん","そうだん","そうなん","そうび","そうめん","そうり","そえもの","そえん","そがい","そげき","そこう","そこそこ","そざい","そしな","そせい","そせん","そそぐ","そだてる","そつう","そつえん","そっかん","そつぎょう","そっけつ","そっこう","そっせん","そっと","そとがわ","そとづら","そなえる","そなた","そふぼ","そぼく","そぼろ","そまつ","そまる","そむく","そむりえ","そめる","そもそも","そよかぜ","そらまめ","そろう","そんかい","そんけい","そんざい","そんしつ","そんぞく","そんちょう","ぞんび","ぞんぶん","そんみん","たあい","たいいん","たいうん","たいえき","たいおう","だいがく","たいき","たいぐう","たいけん","たいこ","たいざい","だいじょうぶ","だいすき","たいせつ","たいそう","だいたい","たいちょう","たいてい","だいどころ","たいない","たいねつ","たいのう","たいはん","だいひょう","たいふう","たいへん","たいほ","たいまつばな","たいみんぐ","たいむ","たいめん","たいやき","たいよう","たいら","たいりょく","たいる","たいわん","たうえ","たえる","たおす","たおる","たおれる","たかい","たかね","たきび","たくさん","たこく","たこやき","たさい","たしざん","だじゃれ","たすける","たずさわる","たそがれ","たたかう","たたく","ただしい","たたみ","たちばな","だっかい","だっきゃく","だっこ","だっしゅつ","だったい","たてる","たとえる","たなばた","たにん","たぬき","たのしみ","たはつ","たぶん","たべる","たぼう","たまご","たまる","だむる","ためいき","ためす","ためる","たもつ","たやすい","たよる","たらす","たりきほんがん","たりょう","たりる","たると","たれる","たれんと","たろっと","たわむれる","だんあつ","たんい","たんおん","たんか","たんき","たんけん","たんご","たんさん","たんじょうび","だんせい","たんそく","たんたい","だんち","たんてい","たんとう","だんな","たんにん","だんねつ","たんのう","たんぴん","だんぼう","たんまつ","たんめい","だんれつ","だんろ","だんわ","ちあい","ちあん","ちいき","ちいさい","ちえん","ちかい","ちから","ちきゅう","ちきん","ちけいず","ちけん","ちこく","ちさい","ちしき","ちしりょう","ちせい","ちそう","ちたい","ちたん","ちちおや","ちつじょ","ちてき","ちてん","ちぬき","ちぬり","ちのう","ちひょう","ちへいせん","ちほう","ちまた","ちみつ","ちみどろ","ちめいど","ちゃんこなべ","ちゅうい","ちゆりょく","ちょうし","ちょさくけん","ちらし","ちらみ","ちりがみ","ちりょう","ちるど","ちわわ","ちんたい","ちんもく","ついか","ついたち","つうか","つうじょう","つうはん","つうわ","つかう","つかれる","つくね","つくる","つけね","つける","つごう","つたえる","つづく","つつじ","つつむ","つとめる","つながる","つなみ","つねづね","つのる","つぶす","つまらない","つまる","つみき","つめたい","つもり","つもる","つよい","つるぼ","つるみく","つわもの","つわり","てあし","てあて","てあみ","ていおん","ていか","ていき","ていけい","ていこく","ていさつ","ていし","ていせい","ていたい","ていど","ていねい","ていひょう","ていへん","ていぼう","てうち","ておくれ","てきとう","てくび","でこぼこ","てさぎょう","てさげ","てすり","てそう","てちがい","てちょう","てつがく","てつづき","でっぱ","てつぼう","てつや","でぬかえ","てぬき","てぬぐい","てのひら","てはい","てぶくろ","てふだ","てほどき","てほん","てまえ","てまきずし","てみじか","てみやげ","てらす","てれび","てわけ","てわたし","でんあつ","てんいん","てんかい","てんき","てんぐ","てんけん","てんごく","てんさい","てんし","てんすう","でんち","てんてき","てんとう","てんない","てんぷら","てんぼうだい","てんめつ","てんらんかい","でんりょく","でんわ","どあい","といれ","どうかん","とうきゅう","どうぐ","とうし","とうむぎ","とおい","とおか","とおく","とおす","とおる","とかい","とかす","ときおり","ときどき","とくい","とくしゅう","とくてん","とくに","とくべつ","とけい","とける","とこや","とさか","としょかん","とそう","とたん","とちゅう","とっきゅう","とっくん","とつぜん","とつにゅう","とどける","ととのえる","とない","となえる","となり","とのさま","とばす","どぶがわ","とほう","とまる","とめる","ともだち","ともる","どようび","とらえる","とんかつ","どんぶり","ないかく","ないこう","ないしょ","ないす","ないせん","ないそう","なおす","ながい","なくす","なげる","なこうど","なさけ","なたでここ","なっとう","なつやすみ","ななおし","なにごと","なにもの","なにわ","なのか","なふだ","なまいき","なまえ","なまみ","なみだ","なめらか","なめる","なやむ","ならう","ならび","ならぶ","なれる","なわとび","なわばり","にあう","にいがた","にうけ","におい","にかい","にがて","にきび","にくしみ","にくまん","にげる","にさんかたんそ","にしき","にせもの","にちじょう","にちようび","にっか","にっき","にっけい","にっこう","にっさん","にっしょく","にっすう","にっせき","にってい","になう","にほん","にまめ","にもつ","にやり","にゅういん","にりんしゃ","にわとり","にんい","にんか","にんき","にんげん","にんしき","にんずう","にんそう","にんたい","にんち","にんてい","にんにく","にんぷ","にんまり","にんむ","にんめい","にんよう","ぬいくぎ","ぬかす","ぬぐいとる","ぬぐう","ぬくもり","ぬすむ","ぬまえび","ぬめり","ぬらす","ぬんちゃく","ねあげ","ねいき","ねいる","ねいろ","ねぐせ","ねくたい","ねくら","ねこぜ","ねこむ","ねさげ","ねすごす","ねそべる","ねだん","ねつい","ねっしん","ねつぞう","ねったいぎょ","ねぶそく","ねふだ","ねぼう","ねほりはほり","ねまき","ねまわし","ねみみ","ねむい","ねむたい","ねもと","ねらう","ねわざ","ねんいり","ねんおし","ねんかん","ねんきん","ねんぐ","ねんざ","ねんし","ねんちゃく","ねんど","ねんぴ","ねんぶつ","ねんまつ","ねんりょう","ねんれい","のいず","のおづま","のがす","のきなみ","のこぎり","のこす","のこる","のせる","のぞく","のぞむ","のたまう","のちほど","のっく","のばす","のはら","のべる","のぼる","のみもの","のやま","のらいぬ","のらねこ","のりもの","のりゆき","のれん","のんき","ばあい","はあく","ばあさん","ばいか","ばいく","はいけん","はいご","はいしん","はいすい","はいせん","はいそう","はいち","ばいばい","はいれつ","はえる","はおる","はかい","ばかり","はかる","はくしゅ","はけん","はこぶ","はさみ","はさん","はしご","ばしょ","はしる","はせる","ぱそこん","はそん","はたん","はちみつ","はつおん","はっかく","はづき","はっきり","はっくつ","はっけん","はっこう","はっさん","はっしん","はったつ","はっちゅう","はってん","はっぴょう","はっぽう","はなす","はなび","はにかむ","はぶらし","はみがき","はむかう","はめつ","はやい","はやし","はらう","はろうぃん","はわい","はんい","はんえい","はんおん","はんかく","はんきょう","ばんぐみ","はんこ","はんしゃ","はんすう","はんだん","ぱんち","ぱんつ","はんてい","はんとし","はんのう","はんぱ","はんぶん","はんぺん","はんぼうき","はんめい","はんらん","はんろん","ひいき","ひうん","ひえる","ひかく","ひかり","ひかる","ひかん","ひくい","ひけつ","ひこうき","ひこく","ひさい","ひさしぶり","ひさん","びじゅつかん","ひしょ","ひそか","ひそむ","ひたむき","ひだり","ひたる","ひつぎ","ひっこし","ひっし","ひつじゅひん","ひっす","ひつぜん","ぴったり","ぴっちり","ひつよう","ひてい","ひとごみ","ひなまつり","ひなん","ひねる","ひはん","ひびく","ひひょう","ひほう","ひまわり","ひまん","ひみつ","ひめい","ひめじし","ひやけ","ひやす","ひよう","びょうき","ひらがな","ひらく","ひりつ","ひりょう","ひるま","ひるやすみ","ひれい","ひろい","ひろう","ひろき","ひろゆき","ひんかく","ひんけつ","ひんこん","ひんしゅ","ひんそう","ぴんち","ひんぱん","びんぼう","ふあん","ふいうち","ふうけい","ふうせん","ぷうたろう","ふうとう","ふうふ","ふえる","ふおん","ふかい","ふきん","ふくざつ","ふくぶくろ","ふこう","ふさい","ふしぎ","ふじみ","ふすま","ふせい","ふせぐ","ふそく","ぶたにく","ふたん","ふちょう","ふつう","ふつか","ふっかつ","ふっき","ふっこく","ぶどう","ふとる","ふとん","ふのう","ふはい","ふひょう","ふへん","ふまん","ふみん","ふめつ","ふめん","ふよう","ふりこ","ふりる","ふるい","ふんいき","ぶんがく","ぶんぐ","ふんしつ","ぶんせき","ふんそう","ぶんぽう","へいあん","へいおん","へいがい","へいき","へいげん","へいこう","へいさ","へいしゃ","へいせつ","へいそ","へいたく","へいてん","へいねつ","へいわ","へきが","へこむ","べにいろ","べにしょうが","へらす","へんかん","べんきょう","べんごし","へんさい","へんたい","べんり","ほあん","ほいく","ぼうぎょ","ほうこく","ほうそう","ほうほう","ほうもん","ほうりつ","ほえる","ほおん","ほかん","ほきょう","ぼきん","ほくろ","ほけつ","ほけん","ほこう","ほこる","ほしい","ほしつ","ほしゅ","ほしょう","ほせい","ほそい","ほそく","ほたて","ほたる","ぽちぶくろ","ほっきょく","ほっさ","ほったん","ほとんど","ほめる","ほんい","ほんき","ほんけ","ほんしつ","ほんやく","まいにち","まかい","まかせる","まがる","まける","まこと","まさつ","まじめ","ますく","まぜる","まつり","まとめ","まなぶ","まぬけ","まねく","まほう","まもる","まゆげ","まよう","まろやか","まわす","まわり","まわる","まんが","まんきつ","まんぞく","まんなか","みいら","みうち","みえる","みがく","みかた","みかん","みけん","みこん","みじかい","みすい","みすえる","みせる","みっか","みつかる","みつける","みてい","みとめる","みなと","みなみかさい","みねらる","みのう","みのがす","みほん","みもと","みやげ","みらい","みりょく","みわく","みんか","みんぞく","むいか","むえき","むえん","むかい","むかう","むかえ","むかし","むぎちゃ","むける","むげん","むさぼる","むしあつい","むしば","むじゅん","むしろ","むすう","むすこ","むすぶ","むすめ","むせる","むせん","むちゅう","むなしい","むのう","むやみ","むよう","むらさき","むりょう","むろん","めいあん","めいうん","めいえん","めいかく","めいきょく","めいさい","めいし","めいそう","めいぶつ","めいれい","めいわく","めぐまれる","めざす","めした","めずらしい","めだつ","めまい","めやす","めんきょ","めんせき","めんどう","もうしあげる","もうどうけん","もえる","もくし","もくてき","もくようび","もちろん","もどる","もらう","もんく","もんだい","やおや","やける","やさい","やさしい","やすい","やすたろう","やすみ","やせる","やそう","やたい","やちん","やっと","やっぱり","やぶる","やめる","ややこしい","やよい","やわらかい","ゆうき","ゆうびんきょく","ゆうべ","ゆうめい","ゆけつ","ゆしゅつ","ゆせん","ゆそう","ゆたか","ゆちゃく","ゆでる","ゆにゅう","ゆびわ","ゆらい","ゆれる","ようい","ようか","ようきゅう","ようじ","ようす","ようちえん","よかぜ","よかん","よきん","よくせい","よくぼう","よけい","よごれる","よさん","よしゅう","よそう","よそく","よっか","よてい","よどがわく","よねつ","よやく","よゆう","よろこぶ","よろしい","らいう","らくがき","らくご","らくさつ","らくだ","らしんばん","らせん","らぞく","らたい","らっか","られつ","りえき","りかい","りきさく","りきせつ","りくぐん","りくつ","りけん","りこう","りせい","りそう","りそく","りてん","りねん","りゆう","りゅうがく","りよう","りょうり","りょかん","りょくちゃ","りょこう","りりく","りれき","りろん","りんご","るいけい","るいさい","るいじ","るいせき","るすばん","るりがわら","れいかん","れいぎ","れいせい","れいぞうこ","れいとう","れいぼう","れきし","れきだい","れんあい","れんけい","れんこん","れんさい","れんしゅう","れんぞく","れんらく","ろうか","ろうご","ろうじん","ろうそく","ろくが","ろこつ","ろじうら","ろしゅつ","ろせん","ろてん","ろめん","ろれつ","ろんぎ","ろんぱ","ろんぶん","ろんり","わかす","わかめ","わかやま","わかれる","わしつ","わじまし","わすれもの","わらう","われる"];Pr.space=" ";const kr=["ábaco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","acción","aceite","acelga","acento","aceptar","ácido","aclarar","acné","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","aéreo","afectar","afición","afinar","afirmar","ágil","agitar","agonía","agosto","agotar","agregar","agrio","agua","agudo","águila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacrán","alambre","alarma","alba","álbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodón","aliado","aliento","alivio","alma","almeja","almíbar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","ámbar","ámbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","andén","anemia","ángulo","anillo","ánimo","anís","anotar","antena","antiguo","antojo","anual","anular","anuncio","añadir","añejo","año","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","araña","arar","árbitro","árbol","arbusto","archivo","arco","arder","ardilla","arduo","área","árido","aries","armonía","arnés","aroma","arpa","arpón","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","áspero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","ático","atleta","átomo","atraer","atroz","atún","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avión","aviso","ayer","ayuda","ayuno","azafrán","azar","azote","azúcar","azufre","azul","baba","babor","bache","bahía","baile","bajar","balanza","balcón","balde","bambú","banco","banda","baño","barba","barco","barniz","barro","báscula","bastón","basura","batalla","batería","batir","batuta","baúl","bazar","bebé","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsái","borde","borrar","bosque","bote","botín","bóveda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufón","búho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzón","caballo","cabeza","cabina","cabra","cacao","cadáver","cadena","caer","café","caída","caimán","caja","cajón","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","cáncer","candil","canela","canguro","canica","canto","caña","cañón","caoba","caos","capaz","capitán","capote","captar","capucha","cara","carbón","cárcel","careta","carga","cariño","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","célebre","celoso","célula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","césped","cetro","chacal","chaleco","champú","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclón","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","ciprés","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","clínica","cobre","cocción","cochino","cocina","coco","código","codo","cofre","coger","cohete","cojín","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","cómodo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazón","corbata","corcho","cordón","corona","correr","coser","cosmos","costa","cráneo","cráter","crear","crecer","creído","crema","cría","crimen","cripta","crisis","cromo","crónica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupón","cúpula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","dátil","deber","débil","década","decir","dedo","defensa","definir","dejar","delfín","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvío","detalle","detener","deuda","día","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difícil","digno","dilema","diluir","dinero","directo","dirigir","disco","diseño","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","dragón","droga","ducha","duda","duelo","dueño","dulce","dúo","duque","durar","dureza","duro","ébano","ebrio","echar","eco","ecuador","edad","edición","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","élite","elixir","elogio","eludir","embudo","emitir","emoción","empate","empeño","empleo","empresa","enano","encargo","enchufe","encía","enemigo","enero","enfado","enfermo","engaño","enigma","enlace","enorme","enredo","ensayo","enseñar","entero","entrar","envase","envío","época","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espía","esposa","espuma","esquí","estar","este","estilo","estufa","etapa","eterno","ética","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","éxito","experto","explicar","exponer","extremo","fábrica","fábula","fachada","fácil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","faraón","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fértil","fervor","festín","fiable","fianza","fiar","fibra","ficción","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flúor","fobia","foca","fogata","fogón","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","frágil","franja","frase","fraude","freír","freno","fresa","frío","frito","fruta","fuego","fuente","fuerza","fuga","fumar","función","funda","furgón","furia","fusil","fútbol","futuro","gacela","gafas","gaita","gajo","gala","galería","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavilán","gemelo","gemir","gen","género","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gráfico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","grúa","grueso","grumo","grupo","guante","guapo","guardia","guerra","guía","guiño","guion","guiso","guitarra","gusano","gustar","haber","hábil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazaña","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","héroe","hervir","hielo","hierro","hígado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","húmedo","humilde","humo","hundir","huracán","hurto","icono","ideal","idioma","ídolo","iglesia","iglú","igual","ilegal","ilusión","imagen","imán","imitar","impar","imperio","imponer","impulso","incapaz","índice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","interés","íntimo","intuir","inútil","invierno","ira","iris","ironía","isla","islote","jabalí","jabón","jamón","jarabe","jardín","jarra","jaula","jazmín","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","júpiter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladrón","lagarto","lágrima","laguna","laico","lamer","lámina","lámpara","lana","lancha","langosta","lanza","lápiz","largo","larva","lástima","lata","látex","latir","laurel","lavar","lazo","leal","lección","leche","lector","leer","legión","legumbre","lejano","lengua","lento","leña","león","leopardo","lesión","letal","letra","leve","leyenda","libertad","libro","licor","líder","lidiar","lienzo","liga","ligero","lima","límite","limón","limpio","lince","lindo","línea","lingote","lino","linterna","líquido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","loción","loco","locura","lógica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","maíz","maldad","maleta","malla","malo","mamá","mambo","mamut","manco","mando","manejar","manga","maniquí","manjar","mano","manso","manta","mañana","mapa","máquina","mar","marco","marea","marfil","margen","marido","mármol","marrón","martes","marzo","masa","máscara","masivo","matar","materia","matiz","matriz","máximo","mayor","mazorca","mecha","medalla","medio","médula","mejilla","mejor","melena","melón","memoria","menor","mensaje","mente","menú","mercado","merengue","mérito","mes","mesón","meta","meter","método","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millón","mimo","mina","minero","mínimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","moción","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","moño","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","móvil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","muñeca","mural","muro","músculo","museo","musgo","música","muslo","nácar","nación","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","náusea","naval","nave","navidad","necio","néctar","negar","negocio","negro","neón","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","niñez","niño","nítido","nivel","nobleza","noche","nómina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","núcleo","nudillo","nudo","nuera","nueve","nuez","nulo","número","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","océano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oído","oír","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opción","ópera","opinar","oponer","optar","óptica","opuesto","oración","orador","oral","órbita","orca","orden","oreja","órgano","orgía","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadía","oscuro","osezno","oso","ostra","otoño","otro","oveja","óvulo","óxido","oxígeno","oyente","ozono","pacto","padre","paella","página","pago","país","pájaro","palabra","palco","paleta","pálido","palma","paloma","palpar","pan","panal","pánico","pantera","pañuelo","papá","papel","papilla","paquete","parar","parcela","pared","parir","paro","párpado","parque","párrafo","parte","pasar","paseo","pasión","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peatón","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldaño","pelea","peligro","pellejo","pelo","peluca","pena","pensar","peñón","peón","peor","pepino","pequeño","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pésimo","pestaña","pétalo","petróleo","pez","pezuña","picar","pichón","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","piña","piojo","pipa","pirata","pisar","piscina","piso","pista","pitón","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesía","poeta","polen","policía","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porción","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","príncipe","prisión","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","próximo","prueba","público","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmón","pulpo","pulso","puma","punto","puñal","puño","pupa","pupila","puré","quedar","queja","quemar","querer","queso","quieto","química","quince","quitar","rábano","rabia","rabo","ración","radical","raíz","rama","rampa","rancho","rango","rapaz","rápido","rapto","rasgo","raspa","rato","rayo","raza","razón","reacción","realidad","rebaño","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refrán","refugio","regalo","regir","regla","regreso","rehén","reino","reír","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","revés","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","rígido","rigor","rincón","riñón","río","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubí","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sábado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmón","salón","salsa","salto","salud","salvar","samba","sanción","sandía","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sartén","sastre","satán","sauna","saxofón","sección","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","señal","señor","separar","sepia","sequía","ser","serie","sermón","servir","sesenta","sesión","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","sílaba","silbar","silencio","silla","símbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","sólido","soltar","solución","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","sostén","sótano","suave","subir","suceso","sudor","suegra","suelo","sueño","suerte","sufrir","sujeto","sultán","sumar","superar","suplir","suponer","supremo","sur","surco","sureño","surgir","susto","sutil","tabaco","tabique","tabla","tabú","taco","tacto","tajo","talar","talco","talento","talla","talón","tamaño","tambor","tango","tanque","tapa","tapete","tapia","tapón","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazón","teatro","techo","tecla","técnica","tejado","tejer","tejido","tela","teléfono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teoría","terapia","terco","término","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburón","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","tímido","timo","tinta","tío","típico","tipo","tira","tirón","titán","títere","título","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","tórax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","tóxico","trabajo","tractor","traer","tráfico","trago","traje","tramo","trance","trato","trauma","trazar","trébol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tubería","tubo","tuerto","tumba","tumor","túnel","túnica","turbina","turismo","turno","tutor","ubicar","úlcera","umbral","unidad","unir","universo","uno","untar","uña","urbano","urbe","urgente","urna","usar","usuario","útil","utopía","uva","vaca","vacío","vacuna","vagar","vago","vaina","vajilla","vale","válido","valle","valor","válvula","vampiro","vara","variar","varón","vaso","vecino","vector","vehículo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vía","viaje","vibrar","vicio","víctima","vida","vídeo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","viñedo","violín","viral","virgo","virtud","visor","víspera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volcán","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"];kr.space=" ";class Nr extends ze{constructor(e,t,r){super({mnemonic:e,seed:t,wordlist:r}),this.Wordlist=Rr,this.es=kr,this.jp=Pr}setLang(e){switch(e){case"es":this.Wordlist=kr;break;case"jp":this.Wordlist=Pr;break;case"en":default:this.Wordlist=Rr;break}}toBw(e){if(e||(e=new qe),this.mnemonic){const t=Y.from(this.mnemonic);e.writeVarIntNum(t.length),e.write(t)}else e.writeVarIntNum(0);return this.seed?(e.writeVarIntNum(this.seed.length),e.write(this.seed)):e.writeVarIntNum(0),e}fromBr(e){const t=e.readVarIntNum();t>0&&(this.mnemonic=e.read(t).toString());const r=e.readVarIntNum();return r>0&&(this.seed=e.read(r)),this}fromRandom(e){if(e||(e=128),e%32!==0)throw new Error("bits must be multiple of 32");if(e<128)throw new Error("bits must be at least 128");const t=Mt.getRandomBuffer(e/8);return this.entropy2Mnemonic(t),this.mnemonic2Seed(),this}static fromRandom(e){return new this().fromRandom(e)}async asyncFromRandom(e){e||(e=128);const t=Mt.getRandomBuffer(e/8);let r=await we.asyncObjectMethod(this,"entropy2Mnemonic",[t]);const a=new Nr().fromFastBuffer(r.resbuf);return r=await we.asyncObjectMethod(a,"mnemonic2Seed",[]),this.fromFastBuffer(r.resbuf)}static asyncFromRandom(e){return new this().asyncFromRandom(e)}fromEntropy(e){return this.entropy2Mnemonic(e),this}static fromEntropy(e){return new this().fromEntropy(e)}async asyncFromEntropy(e){const t=await we.asyncObjectMethod(this,"fromEntropy",[e]);return this.fromFastBuffer(t.resbuf)}static asyncFromEntropy(e){return new this().asyncFromEntropy(e)}fromString(e){return this.mnemonic=e.trim(),this}toString(){return this.mnemonic}toSeed(e){return this.mnemonic2Seed(e),this.seed}async asyncToSeed(e){e===void 0&&(e="");const t=[e];return(await we.asyncObjectMethod(this,"toSeed",t)).resbuf}entropy2Mnemonic(e){if(!Y.isBuffer(e)||e.length<128/8)throw new Error("Entropy is less than 128 bits. It must be 128 bits or more.");const t=ce.sha256(e);let r="";const a=e.length*8;for(let c=0;c<e.length;c++)r=r+("00000000"+e[c].toString(2)).slice(-8);let i=t[0].toString(2);if(i=("00000000"+i).slice(-8).slice(0,a/32),r=r+i,r.length%11!==0)throw new Error("internal error - entropy not an even multiple of 11 bits - "+r.length);let u="";for(let c=0;c<r.length/11;c++){u!==""&&(u=u+this.Wordlist.space);const h=parseInt(r.slice(c*11,(c+1)*11),2);u=u+this.Wordlist[h]}return this.mnemonic=u,this}check(){const t=this.mnemonic.split(this.Wordlist.space);let r="";for(let o=0;o<t.length;o++){const v=this.Wordlist.indexOf(t[o]);if(v<0)return!1;r=r+("00000000000"+v.toString(2)).slice(-11)}if(r.length%11!==0)throw new Error("internal error - entropy not an even multiple of 11 bits - "+r.length);const a=r.length/33,i=r.slice(-a),u=r.slice(0,r.length-a),c=Y.alloc(u.length/8);for(let o=0;o<u.length/8;o++)c.writeUInt8(parseInt(r.slice(o*8,(o+1)*8),2),o);let f=ce.sha256(c)[0].toString(2);return f=("00000000"+f).slice(-8).slice(0,a),f===i}mnemonic2Seed(e=""){let t=this.mnemonic;if(!this.check())throw new Error("Mnemonic does not pass the check - was the mnemonic typed incorrectly? Are there extra spaces?");if(typeof e!="string")throw new Error("passphrase must be a string or undefined");t=t.normalize("NFKD"),e=e.normalize("NFKD");const r=Y.from(t),a=Y.concat([Y.from("mnemonic"),Y.from(e)]);return this.seed=ff.pbkdf2Sync(r,a,2048,64,"sha512"),this}isValid(e=""){let t;try{t=!!this.mnemonic2Seed(e)}catch{t=!1}return t}static isValid(e,t=""){return new Nr(e).isValid(t)}}class pt extends ze{constructor(e,t,r=xt){super({privKey:e,pubKey:t}),this.PrivKey=r}fromJSON(e){return e.privKey&&(this.privKey=this.PrivKey.fromJSON(e.privKey)),e.pubKey&&(this.pubKey=Ze.fromJSON(e.pubKey)),this}fromBr(e){const t=e.readUInt8();t>0&&(this.privKey=new this.PrivKey().fromFastBuffer(e.read(t)));const r=e.readUInt8();return r>0&&(this.pubKey=new Ze().fromFastBuffer(e.read(r))),this}toBw(e){if(e||(e=new qe),this.privKey){const t=this.privKey.toFastBuffer();e.writeUInt8(t.length),e.write(t)}else e.writeUInt8(0);if(this.pubKey){const t=this.pubKey.toFastBuffer();e.writeUInt8(t.length),e.write(t)}else e.writeUInt8(0);return e}fromString(e){return this.fromJSON(JSON.parse(e))}toString(){return JSON.stringify(this.toJSON())}toPublic(){const e=new pt().fromObject(this);return e.privKey=void 0,e}fromPrivKey(e){return this.privKey=e,this.pubKey=new Ze().fromPrivKey(e),this}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){return this.privKey=e,this.pubKey=await new Ze().asyncFromPrivKey(e),this}static asyncFromPrivKey(e){return new this().asyncFromPrivKey(e)}fromRandom(){return this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new Ze().fromPrivKey(this.privKey),this}static fromRandom(){return new this().fromRandom()}async asyncFromRandom(){return this.privKey=new this.PrivKey().fromRandom(),this.asyncFromPrivKey(this.privKey)}static asyncFromRandom(){return new this().asyncFromRandom()}}pt.Mainnet=class extends pt{constructor(n,e){super(n,e,xt.Mainnet)}},pt.Testnet=class extends pt{constructor(n,e){super(n,e,xt.Testnet)}};class mt extends ze{constructor(e,t,r,a,i,u){super({sig:e,keyPair:t,hashBuf:r,k:a,endian:i,verified:u})}toJSON(){return{sig:this.sig?this.sig.toString():void 0,keyPair:this.keyPair?this.keyPair.toBuffer().toString("hex"):void 0,hashBuf:this.hashBuf?this.hashBuf.toString("hex"):void 0,k:this.k?this.k.toString():void 0,endian:this.endian,verified:this.verified}}fromJSON(e){return this.sig=e.sig?new be().fromString(e.sig):void 0,this.keyPair=e.keyPair?new pt().fromBuffer(Y.from(e.keyPair,"hex")):void 0,this.hashBuf=e.hashBuf?Y.from(e.hashBuf,"hex"):void 0,this.k=e.k?new ee().fromString(e.k):void 0,this.endian=e.endian,this.verified=e.verified,this}toBuffer(){const e=JSON.stringify(this.toJSON());return Y.from(e)}fromBuffer(e){const t=JSON.parse(e.toString());return this.fromJSON(t)}calcrecovery(){for(let e=0;e<4;e++){let t;this.sig.recovery=e;try{t=this.sig2PubKey()}catch{continue}if(t.point.eq(this.keyPair.pubKey.point)){const r=this.keyPair.pubKey.compressed;return this.sig.compressed=this.keyPair.pubKey.compressed===void 0?!0:r,this}}throw this.sig.recovery=void 0,new Error("Unable to find valid recovery factor")}async asyncCalcrecovery(){const e=await we.asyncObjectMethod(this,"calcrecovery",[]);return this.fromFastBuffer(e.resbuf)}static calcrecovery(e,t,r){return new mt().fromObject({sig:e,keyPair:new pt().fromObject({pubKey:t}),hashBuf:r}).calcrecovery().sig}static async asyncCalcrecovery(e,t,r){const a=await we.asyncClassMethod(mt,"calcrecovery",[e,t,r]);return new be().fromFastBuffer(a.resbuf)}fromString(e){const t=JSON.parse(e);return t.hashBuf&&(this.hashBuf=Y.from(t.hashBuf,"hex")),t.keyPair&&(this.keyPair=new pt().fromString(t.keyPair)),t.sig&&(this.sig=new be().fromString(t.sig)),t.k&&(this.k=new ee(t.k,10)),this}randomK(){const e=Ue.getN();let t;do t=new ee().fromBuffer(Mt.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(0)));return this.k=t,this}deterministicK(e){let t=Y.alloc(32);t.fill(1);let r=Y.alloc(32);r.fill(0);const a=this.keyPair.privKey.bn.toBuffer({size:32});r=ce.sha256Hmac(Y.concat([t,Y.from([0]),a,this.hashBuf]),r),t=ce.sha256Hmac(t,r),r=ce.sha256Hmac(Y.concat([t,Y.from([1]),a,this.hashBuf]),r),t=ce.sha256Hmac(t,r),t=ce.sha256Hmac(t,r);let i=new ee().fromBuffer(t);const u=Ue.getN();e===void 0&&(e=0);for(let c=0;c<e||!(i.lt(u)&&i.gt(0));c++)r=ce.sha256Hmac(Y.concat([t,Y.from([0])]),r),t=ce.sha256Hmac(t,r),t=ce.sha256Hmac(t,r),i=new ee().fromBuffer(t);return this.k=i,this}sig2PubKey(){const e=this.sig.recovery;if(!(e===0||e===1||e===2||e===3))throw new Error("i must be equal to 0, 1, 2, or 3");const t=new ee().fromBuffer(this.hashBuf),r=this.sig.r,a=this.sig.s,i=e&1,u=e>>1,c=Ue.getN(),h=Ue.getG(),f=u?r.add(c):r,o=Ue.fromX(i,f);let v="";try{o.mul(c)}catch(U){v=U.message}if(v!=="point mul out of range")throw new Error("nR is not a valid curve point");const w=t.neg().umod(c),A=r.invm(c),B=o.mul(a).add(h.mul(w)).mul(A),x=new Ze(B);return x.compressed=this.sig.compressed,x.validate(),x}async asyncSig2PubKey(){const e=await we.asyncObjectMethod(this,"sig2PubKey",[]);return Ze.fromFastBuffer(e.resbuf)}static sig2PubKey(e,t){return new mt().fromObject({sig:e,hashBuf:t}).sig2PubKey()}static async asyncSig2PubKey(e,t){return await new mt().fromObject({sig:e,hashBuf:t}).asyncSig2PubKey()}verifyStr(e=!0){if(!Y.isBuffer(this.hashBuf)||this.hashBuf.length!==32)return"hashBuf must be a 32 byte buffer";try{this.keyPair.pubKey.validate()}catch(o){return"Invalid pubKey: "+o}const t=this.sig.r,r=this.sig.s;if(!(t.gt(0)&&t.lt(Ue.getN()))||!(r.gt(0)&&r.lt(Ue.getN())))return"r and s not in range";if(e&&!this.sig.hasLowS())return"s is too high and does not satisfy low s contraint - see bip 62";const a=new ee().fromBuffer(this.hashBuf,this.endian?{endian:this.endian}:void 0),i=Ue.getN(),u=r.invm(i),c=u.mul(a).mod(i),h=u.mul(t).mod(i),f=Ue.getG().mulAdd(c,this.keyPair.pubKey.point,h);return f.isInfinity()?"p is infinity":f.getX().mod(i).cmp(t)!==0?"Invalid signature":!1}sign(){const e=this.endian==="little"?new ht(this.hashBuf).readReverse():this.hashBuf,t=this.keyPair.privKey,r=t.bn;if(!e||!t||!r)throw new Error("invalid parameters");if(!Y.isBuffer(e)||e.length!==32)throw new Error("hashBuf must be a 32 byte buffer");const a=Ue.getN(),i=Ue.getG(),u=new ee().fromBuffer(e);let c=0,h,f,o,v;do(!this.k||c>0)&&this.deterministicK(c),c++,h=this.k,f=i.mul(h),o=f.getX().mod(a),v=h.invm(a).mul(u.add(r.mul(o))).mod(a);while(o.cmp(0)<=0||v.cmp(0)<=0);return v.gt(new ee().fromBuffer(Y.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(v=Ue.getN().sub(v)),this.sig=be.fromObject({r:o,s:v,compressed:this.keyPair.pubKey.compressed}),this}async asyncSign(){const e=await we.asyncObjectMethod(this,"sign",[]);return this.fromFastBuffer(e.resbuf)}signRandomK(){return this.randomK(),this.sign()}toString(){const e={};return this.hashBuf&&(e.hashBuf=this.hashBuf.toString("hex")),this.keyPair&&(e.keyPair=this.keyPair.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)}verify(e=!0){return this.verifyStr(e)?this.verified=!1:this.verified=!0,this}async asyncVerify(e=!0){const t=await we.asyncObjectMethod(this,"verify",[e]);return this.fromFastBuffer(t.resbuf)}static sign(e,t,r){return new mt().fromObject({hashBuf:e,endian:r,keyPair:t}).sign().sig}static async asyncSign(e,t,r){const a=new mt().fromObject({hashBuf:e,endian:r,keyPair:t});return await a.asyncSign(),a.sig}static verify(e,t,r,a,i=!0){return new mt().fromObject({hashBuf:e,endian:a,sig:t,keyPair:new pt().fromObject({pubKey:r})}).verify(i).verified}static async asyncVerify(e,t,r,a,i=!0){const u=new mt().fromObject({hashBuf:e,endian:a,sig:t,keyPair:new pt().fromObject({pubKey:r})});return await u.asyncVerify(i),u.verified}}class _t extends ze{constructor(e,t,r,a,i){super({messageBuf:e,keyPair:t,sig:r,address:a,verified:i})}static magicHash(e){if(!Y.isBuffer(e))throw new Error("messageBuf must be a buffer");const t=new qe;t.writeVarIntNum(_t.magicBytes.length),t.write(_t.magicBytes),t.writeVarIntNum(e.length),t.write(e);const r=t.toBuffer();return ce.sha256Sha256(r)}static async asyncMagicHash(e){const t=[e];return(await we.asyncClassMethod(_t,"magicHash",t)).resbuf}static sign(e,t){const r=new _t(e,t);return r.sign(),r.sig.toCompact().toString("base64")}static async asyncSign(e,t){const r=[e,t],a=await we.asyncClassMethod(_t,"sign",r);return JSON.parse(a.resbuf.toString())}static verify(e,t,r){const a=Y.from(t,"base64"),i=new _t;return i.messageBuf=e,i.sig=new be().fromCompact(a),i.address=r,i.verify().verified}static async asyncVerify(e,t,r){const a=[e,t,r],i=await we.asyncClassMethod(_t,"verify",a);return JSON.parse(i.resbuf.toString())}sign(){const e=_t.magicHash(this.messageBuf),t=new mt().fromObject({hashBuf:e,keyPair:this.keyPair});return t.sign(),t.calcrecovery(),this.sig=t.sig,this}verify(){const e=_t.magicHash(this.messageBuf),t=new mt;if(t.hashBuf=e,t.sig=this.sig,t.keyPair=new pt,t.keyPair.pubKey=t.sig2PubKey(),!t.verify())return this.verified=!1,this;const r=new It().fromPubKey(t.keyPair.pubKey,void 0,this.sig.compressed);return Ut(r.hashBuf,this.address.hashBuf)?this.verified=!0:this.verified=!1,this}}_t.magicBytes=Y.from(`Bitcoin Signed Message:
13
+ `);class lr extends ze{constructor(e,t,r,a,i,u){super({versionBytesNum:e,prevBlockHashBuf:t,merkleRootBuf:r,time:a,bits:i,nonce:u})}fromJSON(e){return this.fromObject({versionBytesNum:e.versionBytesNum,prevBlockHashBuf:Y.from(e.prevBlockHashBuf,"hex"),merkleRootBuf:Y.from(e.merkleRootBuf,"hex"),time:e.time,bits:e.bits,nonce:e.nonce}),this}toJSON(){return{versionBytesNum:this.versionBytesNum,prevBlockHashBuf:this.prevBlockHashBuf.toString("hex"),merkleRootBuf:this.merkleRootBuf.toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}}fromBr(e){return this.versionBytesNum=e.readUInt32LE(),this.prevBlockHashBuf=e.read(32),this.merkleRootBuf=e.read(32),this.time=e.readUInt32LE(),this.bits=e.readUInt32LE(),this.nonce=e.readUInt32LE(),this}toBw(e){return e||(e=new qe),e.writeUInt32LE(this.versionBytesNum),e.write(this.prevBlockHashBuf),e.write(this.merkleRootBuf),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e}}class Gt extends ze{constructor(e,t,r,a){super({hashBuf:e,buf:t,merkle1:r,merkle2:a})}hash(){if(this.hashBuf)return this.hashBuf;if(this.buf)return ce.sha256Sha256(this.buf);const e=this.merkle1.hash(),t=this.merkle2.hash();return this.buf=Y.concat([e,t]),ce.sha256Sha256(this.buf)}fromBuffers(e){if(e.length<1)throw new Error("buffers must have a length");e=e.slice();const t=Math.log2(e.length);if(!Number.isInteger(t)){const i=e[e.length-1],u=Math.pow(2,Math.ceil(t));for(let c=e.length;c<u;c++)e.push(i)}const r=e.slice(0,e.length/2),a=e.slice(e.length/2);return this.fromBufferArrays(r,a),this}static fromBuffers(e){return new this().fromBuffers(e)}fromBufferArrays(e,t){if(e.length===1)return this.merkle1=new Gt(void 0,e[0]),this.merkle2=new Gt(void 0,t[0]),this;const r=e.slice(0,e.length/2),a=e.slice(e.length/2);this.merkle1=new Gt().fromBufferArrays(r,a);const i=t.slice(0,t.length/2),u=t.slice(t.length/2);return this.merkle2=new Gt().fromBufferArrays(i,u),this}static fromBufferArrays(e,t){return new this().fromBufferArrays(e,t)}leavesNum(){if(this.merkle1)return this.merkle1.leavesNum()+this.merkle2.leavesNum();if(this.buf)return 1;throw new Error("invalid number of leaves")}}class Tr extends ze{constructor(e,t,r){super(),this.fromObject({prevoutsHashBuf:e,sequenceHashBuf:t,outputsHashBuf:r})}fromBuffer(e){return this.fromJSON(JSON.parse(e.toString()))}toBuffer(){return Y.from(JSON.stringify(this.toJSON()))}fromJSON(e){return this.prevoutsHashBuf=e.prevoutsHashBuf?Y.from(e.prevoutsHashBuf,"hex"):void 0,this.sequenceHashBuf=e.sequenceHashBuf?Y.from(e.sequenceHashBuf,"hex"):void 0,this.outputsHashBuf=e.outputsHashBuf?Y.from(e.outputsHashBuf,"hex"):void 0,this}toJSON(){return{prevoutsHashBuf:this.prevoutsHashBuf?this.prevoutsHashBuf.toString("hex"):void 0,sequenceHashBuf:this.sequenceHashBuf?this.sequenceHashBuf.toString("hex"):void 0,outputsHashBuf:this.outputsHashBuf?this.outputsHashBuf.toString("hex"):void 0}}}class et extends ze{constructor(e){super({buf:e})}fromJSON(e){return this.fromObject({buf:Y.from(e,"hex")}),this}toJSON(){return this.buf.toString("hex")}fromBuffer(e){return this.buf=e,this}fromBr(e){return this.buf=e.readVarIntBuf(),this}fromBn(e){return this.buf=new qe().writeVarIntBn(e).toBuffer(),this}static fromBn(e){return new this().fromBn(e)}fromNumber(e){return this.buf=new qe().writeVarIntNum(e).toBuffer(),this}static fromNumber(e){return new this().fromNumber(e)}toBuffer(){return this.buf}toBn(){return new ht(this.buf).readVarIntBn()}toNumber(){return new ht(this.buf).readVarIntNum()}}class Je extends ze{constructor(e,t,r,a,i=4294967295){super({txHashBuf:e,txOutNum:t,scriptVi:r,script:a,nSequence:i})}setScript(e){return this.scriptVi=et.fromNumber(e.toBuffer().length),this.script=e,this}fromProperties(e,t,r,a){return this.fromObject({txHashBuf:e,txOutNum:t,nSequence:a}),this.setScript(r),this}static fromProperties(e,t,r,a){return new this().fromProperties(e,t,r,a)}fromJSON(e){return this.fromObject({txHashBuf:typeof e.txHashBuf<"u"?Y.from(e.txHashBuf,"hex"):void 0,txOutNum:e.txOutNum,scriptVi:typeof e.scriptVi<"u"?et.fromJSON(e.scriptVi):void 0,script:typeof e.script<"u"?Fe.fromJSON(e.script):void 0,nSequence:e.nSequence}),this}toJSON(){return{txHashBuf:typeof this.txHashBuf<"u"?this.txHashBuf.toString("hex"):void 0,txOutNum:this.txOutNum,scriptVi:typeof this.scriptVi<"u"?this.scriptVi.toJSON():void 0,script:typeof this.script<"u"?this.script.toJSON():void 0,nSequence:this.nSequence}}fromBr(e){return this.txHashBuf=e.read(32),this.txOutNum=e.readUInt32LE(),this.scriptVi=et.fromBuffer(e.readVarIntBuf()),this.script=Fe.fromBuffer(e.read(this.scriptVi.toNumber())),this.nSequence=e.readUInt32LE(),this}toBw(e){return e||(e=new qe),e.write(this.txHashBuf),e.writeUInt32LE(this.txOutNum),e.write(this.scriptVi.buf),e.write(this.script.toBuffer()),e.writeUInt32LE(this.nSequence),e}fromPubKeyHashTxOut(e,t,r,a){const i=new Fe;if(r.script.isPubKeyHashOut())i.writeOpCode(z.OP_0),a?i.writeBuffer(a.toBuffer()):i.writeOpCode(z.OP_0);else throw new Error("txOut must be of type pubKeyHash");return this.txHashBuf=e,this.txOutNum=t,this.setScript(i),this}hasNullInput(){return this.txHashBuf.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.txOutNum===4294967295}setNullInput(){this.txHashBuf=Y.alloc(32),this.txHashBuf.fill(0),this.txOutNum=4294967295}}Je.LOCKTIME_VERIFY_SEQUENCE=1,Je.SEQUENCE_FINAL=4294967295,Je.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31,Je.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22,Je.SEQUENCE_LOCKTIME_MASK=65535,Je.SEQUENCE_LOCKTIME_GRANULARITY=9;class St extends ze{constructor(e,t,r){super({valueBn:e,scriptVi:t,script:r})}setScript(e){return this.scriptVi=et.fromNumber(e.toBuffer().length),this.script=e,this}fromProperties(e,t){return this.fromObject({valueBn:e}),this.setScript(t),this}static fromProperties(e,t){return new this().fromProperties(e,t)}fromJSON(e){return this.fromObject({valueBn:new ee().fromJSON(e.valueBn),scriptVi:new et().fromJSON(e.scriptVi),script:new Fe().fromJSON(e.script)}),this}toJSON(){return{valueBn:this.valueBn.toJSON(),scriptVi:this.scriptVi.toJSON(),script:this.script.toJSON()}}fromBr(e){return this.valueBn=e.readUInt64LEBn(),this.scriptVi=et.fromNumber(e.readVarIntNum()),this.script=new Fe().fromBuffer(e.read(this.scriptVi.toNumber())),this}toBw(e){return e||(e=new qe),e.writeUInt64LEBn(this.valueBn),e.write(this.scriptVi.buf),e.write(this.script.toBuffer()),e}}class De extends ze{constructor(e=1,t=et.fromNumber(0),r=[],a=et.fromNumber(0),i=[],u=0){super({versionBytesNum:e,txInsVi:t,txIns:r,txOutsVi:a,txOuts:i,nLockTime:u})}fromJSON(e){const t=[];e.txIns.forEach(function(a){t.push(new Je().fromJSON(a))});const r=[];return e.txOuts.forEach(function(a){r.push(new St().fromJSON(a))}),this.fromObject({versionBytesNum:e.versionBytesNum,txInsVi:new et().fromJSON(e.txInsVi),txIns:t,txOutsVi:new et().fromJSON(e.txOutsVi),txOuts:r,nLockTime:e.nLockTime}),this}toJSON(){const e=[];this.txIns.forEach(function(r){e.push(r.toJSON())});const t=[];return this.txOuts.forEach(function(r){t.push(r.toJSON())}),{versionBytesNum:this.versionBytesNum,txInsVi:this.txInsVi.toJSON(),txIns:e,txOutsVi:this.txOutsVi.toJSON(),txOuts:t,nLockTime:this.nLockTime}}fromBr(e){this.versionBytesNum=e.readUInt32LE(),this.txInsVi=new et(e.readVarIntBuf());const t=this.txInsVi.toNumber();this.txIns=[];for(let a=0;a<t;a++)this.txIns.push(new Je().fromBr(e));this.txOutsVi=new et(e.readVarIntBuf());const r=this.txOutsVi.toNumber();this.txOuts=[];for(let a=0;a<r;a++)this.txOuts.push(new St().fromBr(e));return this.nLockTime=e.readUInt32LE(),this}toBw(e){e||(e=new qe),e.writeUInt32LE(this.versionBytesNum),e.write(this.txInsVi.buf);for(let t=0;t<this.txIns.length;t++)this.txIns[t].toBw(e);e.write(this.txOutsVi.buf);for(let t=0;t<this.txOuts.length;t++)this.txOuts[t].toBw(e);return e.writeUInt32LE(this.nLockTime),e}hashPrevouts(){const e=new qe;for(const t in this.txIns){const r=this.txIns[t];e.write(r.txHashBuf),e.writeUInt32LE(r.txOutNum)}return ce.sha256Sha256(e.toBuffer())}hashSequence(){const e=new qe;for(const t in this.txIns){const r=this.txIns[t];e.writeUInt32LE(r.nSequence)}return ce.sha256Sha256(e.toBuffer())}hashOutputs(){const e=new qe;for(const t in this.txOuts){const r=this.txOuts[t];e.write(r.toBuffer())}return ce.sha256Sha256(e.toBuffer())}sighash(e,t,r,a,i=De.SCRIPT_ENABLE_SIGHASH_FORKID,u=new Tr){const c=this.sighashPreimage(e,t,r,a,i,u);return c.compare(Y.from("0000000000000000000000000000000000000000000000000000000000000001","hex"))===0?c:new ht(ce.sha256Sha256(c)).readReverse()}async asyncSighash(e,t,r,a,i=0,u={}){return(await we.asyncObjectMethod(this,"sighash",[e,t,r,a,i,u])).resbuf}sighashPreimage(e,t,r,a,i=De.SCRIPT_ENABLE_SIGHASH_FORKID,u=new Tr){if(e&be.SIGHASH_FORKID&&i&De.SCRIPT_ENABLE_SIGHASH_FORKID){let f=Y.alloc(32,0),o=Y.alloc(32,0),v=Y.alloc(32,0);e&be.SIGHASH_ANYONECANPAY||(f=u.prevoutsHashBuf?u.prevoutsHashBuf:u.prevoutsHashBuf=this.hashPrevouts()),!(e&be.SIGHASH_ANYONECANPAY)&&(e&31)!==be.SIGHASH_SINGLE&&(e&31)!==be.SIGHASH_NONE&&(o=u.sequenceHashBuf?u.sequenceHashBuf:u.sequenceHashBuf=this.hashSequence()),(e&31)!==be.SIGHASH_SINGLE&&(e&31)!==be.SIGHASH_NONE?v=u.outputsHashBuf?u.outputsHashBuf:u.outputsHashBuf=this.hashOutputs():(e&31)===be.SIGHASH_SINGLE&&t<this.txOuts.length&&(v=ce.sha256Sha256(this.txOuts[t].toBuffer()));const w=new qe;return w.writeUInt32LE(this.versionBytesNum),w.write(f),w.write(o),w.write(this.txIns[t].txHashBuf),w.writeUInt32LE(this.txIns[t].txOutNum),w.writeVarIntNum(r.toBuffer().length),w.write(r.toBuffer()),w.writeUInt64LEBn(a),w.writeUInt32LE(this.txIns[t].nSequence),w.write(v),w.writeUInt32LE(this.nLockTime),w.writeUInt32LE(e>>>0),w.toBuffer()}const c=this.cloneByBuffer();r=new Fe().fromBuffer(r.toBuffer()),r.removeCodeseparators();for(let f=0;f<c.txIns.length;f++)c.txIns[f]=Je.fromBuffer(c.txIns[f].toBuffer()).setScript(new Fe);if(c.txIns[t]=Je.fromBuffer(c.txIns[t].toBuffer()).setScript(r),(e&31)===be.SIGHASH_NONE){c.txOuts.length=0,c.txOutsVi=et.fromNumber(0);for(let f=0;f<c.txIns.length;f++)f!==t&&(c.txIns[f].nSequence=0)}else if((e&31)===be.SIGHASH_SINGLE){if(t>c.txOuts.length-1)return Y.from("0000000000000000000000000000000000000000000000000000000000000001","hex");c.txOuts.length=t+1,c.txOutsVi=et.fromNumber(t+1);for(let f=0;f<c.txOuts.length;f++)f<t&&(c.txOuts[f]=St.fromProperties(new ee().fromBuffer(Y.from("ffffffffffffffff","hex")),new Fe));for(let f=0;f<c.txIns.length;f++)f!==t&&(c.txIns[f].nSequence=0)}return e&be.SIGHASH_ANYONECANPAY&&(c.txIns[0]=c.txIns[t],c.txIns.length=1,c.txInsVi=et.fromNumber(1)),new qe().write(c.toBuffer()).writeInt32LE(e).toBuffer()}async asyncSighashPreimage(e,t,r,a,i=0,u={}){return(await we.asyncObjectMethod(this,"sighashPreimage",[e,t,r,a,i,u])).resbuf}sign(e,t=be.SIGHASH_ALL|be.SIGHASH_FORKID,r,a,i,u=De.SCRIPT_ENABLE_SIGHASH_FORKID,c={}){const h=this.sighash(t,r,a,i,u,c);return this.preImageBuf=h,mt.sign(h,e,"little").fromObject({nHashType:t})}async asyncSign(e,t=be.SIGHASH_ALL|be.SIGHASH_FORKID,r,a,i,u=De.SCRIPT_ENABLE_SIGHASH_FORKID,c={}){const h=await we.asyncObjectMethod(this,"sign",[e,t,r,a,i,u,c]);return new be().fromFastBuffer(h.resbuf)}verify(e,t,r,a,i=!1,u,c=De.SCRIPT_ENABLE_SIGHASH_FORKID,h={}){const f=this.sighash(e.nHashType,r,a,u,c,h);return mt.verify(f,e,t,"little",i)}async asyncVerify(e,t,r,a,i=!1,u,c=De.SCRIPT_ENABLE_SIGHASH_FORKID,h={}){const f=await we.asyncObjectMethod(this,"verify",[e,t,r,a,i,u,c,h]);return JSON.parse(f.resbuf.toString())}hash(){return ce.sha256Sha256(this.toBuffer())}async asyncHash(){return(await we.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new ht(this.hash()).readReverse().toString("hex")}async asyncId(){const e=await we.asyncObjectMethod(this,"id",[]);return JSON.parse(e.resbuf.toString())}addTxIn(e,t,r,a){let i;return e instanceof Je?i=e:i=new Je().fromObject({txHashBuf:e,txOutNum:t,nSequence:a}).setScript(r),this.txIns.push(i),this.txInsVi=et.fromNumber(this.txInsVi.toNumber()+1),this}addTxOut(e,t){let r;return e instanceof St?r=e:r=new St().fromObject({valueBn:e}).setScript(t),this.txOuts.push(r),this.txOutsVi=et.fromNumber(this.txOutsVi.toNumber()+1),this}isCoinbase(){return this.txIns.length===1&&this.txIns[0].hasNullInput()}sort(){return this.txIns.sort((e,t)=>new ht(e.txHashBuf).readReverse().compare(new ht(t.txHashBuf).readReverse())||e.txOutNum-t.txOutNum),this.txOuts.sort((e,t)=>e.valueBn.sub(t.valueBn).toNumber()||e.script.toBuffer().compare(t.script.toBuffer())),this}}De.MAX_MONEY=21e6*1e8,De.SCRIPT_ENABLE_SIGHASH_FORKID=65536;class Mr extends ze{constructor(e,t,r){super({blockHeader:e,txsVi:t,txs:r})}fromJSON(e){const t=[];return e.txs.forEach(function(r){t.push(new De().fromJSON(r))}),this.fromObject({blockHeader:new lr().fromJSON(e.blockHeader),txsVi:new et().fromJSON(e.txsVi),txs:t}),this}toJSON(){const e=[];return this.txs.forEach(function(t){e.push(t.toJSON())}),{blockHeader:this.blockHeader.toJSON(),txsVi:this.txsVi.toJSON(),txs:e}}fromBr(e){this.blockHeader=new lr().fromBr(e),this.txsVi=new et(e.readVarIntBuf());const t=this.txsVi.toNumber();this.txs=[];for(let r=0;r<t;r++)this.txs.push(new De().fromBr(e));return this}toBw(e){e||(e=new qe),e.write(this.blockHeader.toBuffer()),e.write(this.txsVi.buf);const t=this.txsVi.toNumber();for(let r=0;r<t;r++)this.txs[r].toBw(e);return e}hash(){return ce.sha256Sha256(this.blockHeader.toBuffer())}async asyncHash(){return(await we.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new ht(this.hash()).readReverse().toString("hex")}async asyncId(){const e=await we.asyncObjectMethod(this,"id",[]);return JSON.parse(e.resbuf.toString())}verifyMerkleRoot(){const e=this.txs.map(r=>r.toBuffer()),t=Gt.fromBuffers(e).hash();return Y.compare(t,this.blockHeader.merkleRootBuf)}static iterateTxs(e){const t=new ht(e),r=new lr().fromBr(t),a=new et(t.readVarIntBuf()),i=a.toNumber();return{blockHeader:r,txsVi:a,txsNum:i,*[Symbol.iterator](){for(let u=0;u<i;u++)yield new De().fromBr(t)}}}}Mr.MAX_BLOCK_SIZE=1e6;class hf extends Mr{constructor(e,t,r){super(e,t,r)}async mine(e,t=0,r=null){return new Promise(a=>{const i=Date.now(),u=e.toString("hex");let c=0;const h=this.blockHeader.toBuffer(),f=()=>{for(;;){if(t&&c>=t)return a(!1);c++;let o=h.readUInt32LE(76)+1;h.writeUInt32LE(o,76),c%1e5===0&&h.writeUInt32LE(Math.floor(Date.now()/1e3),68);const v=ce.sha256Sha256(h);if(v.toString("hex")<u)return this.blockHeader.fromBuffer(h),r==null||r({success:!0,nonce:o,iterations:c,hashrate:c/((Date.now()-i)/1e3),hash:v.toString("hex")}),a(!0);if(r&&c%5e5===0&&r({success:!1,iterations:c,hashrate:c/((Date.now()-i)/1e3)}),c%1e6===0)return setImmediate(f)}};f()})}mineSync(e,t=0){const r=e.toString("hex");let a=0;const i=this.blockHeader.toBuffer();for(;!t||a<t;){a++;let u=i.readUInt32LE(76)+1;i.writeUInt32LE(u,76);const c=ce.sha256Sha256(i);if(c.toString("hex")<r)return this.blockHeader.fromBuffer(i),{success:!0,nonce:u,iterations:a,hashrate:a/10,hash:c.toString("hex")}}return{success:!1,iterations:a,hashrate:a/10}}verifyProofOfWork(e){return this.hash().toString("hex")<e.toString("hex")}hash(){return ce.sha256Sha256(this.blockHeader.toBuffer())}id(){return new ht(this.hash()).readReverse().toString("hex")}}class rc{static createBlock(e,t,r){const a=new lr({version:536870912,prevBlockHashBuf:t,merkleRootBuf:this.calcMerkleRoot(e),time:Math.floor(Date.now()/1e3),bits:r,nonce:0}),i=[this.createCoinbaseTx(),...e],u=new et().fromNumber(i.length);return new hf(a,u,i)}static calcMerkleRoot(e){return Gt.fromBuffers(e.map(t=>t.hash())).hash()}static createCoinbaseTx(){return new De}static validateBlock(e,t){if(!e.verifyProofOfWork(t))throw new Error("Invalid POW");if(e.verifyMerkleRoot()!==0)throw new Error("Invalid merkle root");return!0}}const lf=n=>{if(n.length===0)return n;const e=n[n.length-1];if((e&127)!==0)return n;if(n.length===1)return[];if((n[n.length-2]&128)!==0)return n;for(let t=n.length-1;t>0;t--)if(n[t-1]!==0)return(n[t-1]&128)!==0?(n[t]=e,n.slice(0,t+1)):(n[t-1]|=e,n.slice(0,t));return[]};class oe extends ze{constructor(e,t,r,a=[],i=[],u=0,c=0,h=0,f=[],o="",v=oe.defaultFlags,w=new ee(0)){super({script:e,tx:t,nIn:r,stack:a,altStack:i,pc:u,pBeginCodeHash:c,nOpCount:h,ifStack:f,errStr:o,flags:v,valueBn:w})}initialize(){return this.script=new Fe,this.stack=[],this.altStack=[],this.pc=0,this.pBeginCodeHash=0,this.nOpCount=0,this.ifStack=[],this.errStr="",this.flags=oe.defaultFlags,this.scriptLimit=1e7,this.stackLimit=1e7,this}fromJSON(e){return this.fromJSONNoTx(e),this.tx=e.tx?new De().fromJSON(e.tx):void 0,this}fromJSONNoTx(e){return this.fromObject({script:e.script!==void 0?new Fe().fromJSON(e.script):void 0,nIn:e.nIn}),this.stack=[],e.stack.forEach((function(t){this.stack.push(Y.from(t,"hex"))}).bind(this)),this.altStack=[],e.altStack.forEach((function(t){this.altStack.push(Y.from(t,"hex"))}).bind(this)),this.fromObject({pc:e.pc,pBeginCodeHash:e.pBeginCodeHash,nOpCount:e.nOpCount,ifStack:e.ifStack,errStr:e.errStr,flags:e.flags}),this}fromBr(e){let t=e.readVarIntNum(),r=e.read(t);this.fromJSONNoTx(JSON.parse(r.toString()));let a=e.readVarIntNum();if(a>0){let i=e.read(a);this.tx=new De().fromFastBuffer(i)}return this}toJSON(){let e=this.toJSONNoTx();return e.tx=this.tx?this.tx.toJSON():void 0,e}toJSONNoTx(){let e=[];this.stack.forEach(function(r){e.push(r.toString("hex"))});let t=[];return this.altStack.forEach(function(r){t.push(r.toString("hex"))}),{script:this.script?this.script.toJSON():void 0,nIn:this.nIn,stack:e,altStack:t,pc:this.pc,pBeginCodeHash:this.pBeginCodeHash,nOpCount:this.nOpCount,ifStack:this.ifStack,errStr:this.errStr,flags:this.flags,preImage:this!=null&&this.preImage?this.preImage.toString("hex"):"",hashBuf:this!=null&&this.hashBuf?this.hashBuf.toString("hex"):""}}toBw(e){e||(e=new qe);let t=Y.from(JSON.stringify(this.toJSONNoTx()));if(e.writeVarIntNum(t.length),e.write(t),this.tx){let r=this.tx.toFastBuffer();e.writeVarIntNum(r.length),e.write(r)}else e.writeVarIntNum(0);return e}static getFlags(e){let t=0;return e.indexOf("NONE")!==-1&&(t=t|oe.SCRIPT_VERIFY_NONE),e.indexOf("P2SH")!==-1&&(t=t|oe.SCRIPT_VERIFY_P2SH),e.indexOf("STRICTENC")!==-1&&(t=t|oe.SCRIPT_VERIFY_STRICTENC),e.indexOf("DERSIG")!==-1&&(t=t|oe.SCRIPT_VERIFY_DERSIG),e.indexOf("LOW_S")!==-1&&(t=t|oe.SCRIPT_VERIFY_LOW_S),e.indexOf("NULLDUMMY")!==-1&&(t=t|oe.SCRIPT_VERIFY_NULLDUMMY),e.indexOf("SIGPUSHONLY")!==-1&&(t=t|oe.SCRIPT_VERIFY_SIGPUSHONLY),e.indexOf("MINIMALDATA")!==-1&&(t=t|oe.SCRIPT_VERIFY_MINIMALDATA),e.indexOf("DISCOURAGE_UPGRADABLE_NOPS")!==-1&&(t=t|oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS),e.indexOf("CLEANSTACK")!==-1&&(t=t|oe.SCRIPT_VERIFY_CLEANSTACK),e.indexOf("CHECKLOCKTIMEVERIFY")!==-1&&(t=t|oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY),e.indexOf("CHECKSEQUENCEVERIFY")!==-1&&(t=t|oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY),e.indexOf("SIGHASH_FORKID")!==-1&&(t=t|oe.SCRIPT_ENABLE_SIGHASH_FORKID),t}static castToBool(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return!(t===e.length-1&&e[t]===128);return!1}checkSigEncoding(e){if(e.length===0)return!0;if((this.flags&(oe.SCRIPT_VERIFY_DERSIG|oe.SCRIPT_VERIFY_LOW_S|oe.SCRIPT_VERIFY_STRICTENC))!==0&&!be.IsTxDer(e))return this.errStr="SCRIPT_ERR_SIG_DER",!1;if((this.flags&oe.SCRIPT_VERIFY_LOW_S)!==0){if(!new be().fromTxFormat(e).hasLowS())return this.errStr="SCRIPT_ERR_SIG_DER",!1}else if((this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0&&!new be().fromTxFormat(e).hasDefinedHashType())return this.errStr="SCRIPT_ERR_SIG_HASHTYPE",!1;return!0}checkPubKeyEncoding(e){return(this.flags&oe.SCRIPT_VERIFY_STRICTENC)!==0&&!Ze.isCompressedOrUncompressed(e)?(this.errStr="SCRIPT_ERR_PUBKEYTYPE",!1):!0}checkLockTime(e){return!(!(this.tx.nLockTime<oe.LOCKTIME_THRESHOLD&&e<oe.LOCKTIME_THRESHOLD||this.tx.nLockTime>=oe.LOCKTIME_THRESHOLD&&e>=oe.LOCKTIME_THRESHOLD)||e>this.tx.nLockTime||Je.SEQUENCE_FINAL===this.tx.txIns[this.nIn].nSequence)}checkSequence(e){let t=this.tx.txIns[this.nIn].nSequence;if(this.tx.versionBytesNum<2||t&Je.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;let r=Je.SEQUENCE_LOCKTIME_TYPE_FLAG|Je.SEQUENCE_LOCKTIME_MASK,a=t&r,i=e&r;return!(!(a<Je.SEQUENCE_LOCKTIME_TYPE_FLAG&&i<Je.SEQUENCE_LOCKTIME_TYPE_FLAG||a>=Je.SEQUENCE_LOCKTIME_TYPE_FLAG&&i>=Je.SEQUENCE_LOCKTIME_TYPE_FLAG)||i>a)}*eval(){this.script.toBuffer().length>this.scriptLimit&&(this.errStr="SCRIPT_ERR_SCRIPT_SIZE",yield!1);try{for(;this.pc<this.script.chunks.length;){let e=this.step();e?yield e:yield!1}this.stack.length+this.altStack.length>this.stackLimit&&(this.errStr="SCRIPT_ERR_STACK_SIZE",yield!1)}catch(e){this.errStr="SCRIPT_ERR_UNKNOWN_ERROR: "+e,yield!1}this.ifStack.length>0&&(this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",yield!1),yield!0}step(){let e=(this.flags&oe.SCRIPT_VERIFY_MINIMALDATA)!==0,t=!(this.ifStack.indexOf(!1)+1),r=this.script.chunks[this.pc];this.pc++;let a=r.opCodeNum;if(a===void 0)return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;if(r.buf&&r.buf.length>oe.MAX_SCRIPT_ELEMENT_SIZE)return this.errStr="SCRIPT_ERR_PUSH_SIZE",!1;if(a>z.OP_16&&++this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;if(a===z.OP_2MUL||a===z.OP_2DIV)return this.errStr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(t&&a>=0&&a<=z.OP_PUSHDATA4){if(e&&!this.script.checkMinimalPush(this.pc-1))return this.errStr="SCRIPT_ERR_MINIMALDATA",!1;if(!r.buf)this.stack.push(oe.false);else{if(r.len!==r.buf.length)throw new Error("LEngth of push value not equal to length of data");this.stack.push(r.buf)}}else if(t||z.OP_IF<=a&&a<=z.OP_ENDIF)switch(a){case z.OP_1NEGATE:case z.OP_1:case z.OP_2:case z.OP_3:case z.OP_4:case z.OP_5:case z.OP_6:case z.OP_7:case z.OP_8:case z.OP_9:case z.OP_10:case z.OP_11:case z.OP_12:case z.OP_13:case z.OP_14:case z.OP_15:case z.OP_16:{let I=a-(z.OP_1-1),F=new ee(I).toScriptNumBuffer();this.stack.push(F)}break;case z.OP_NOP:break;case z.OP_CHECKLOCKTIMEVERIFY:{if(!(this.flags&oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-1],j=new ee().fromScriptNumBuffer(I,e,5).toNumber();if(j<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(j))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case z.OP_CHECKSEQUENCEVERIFY:{if(!(this.flags&oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-1],j=new ee().fromScriptNumBuffer(I,e,5).toNumber();if(j<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((j&Je.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(j))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case z.OP_NOP1:case z.OP_NOP3:case z.OP_NOP4:case z.OP_NOP5:case z.OP_NOP6:case z.OP_NOP7:case z.OP_NOP8:case z.OP_NOP9:case z.OP_NOP10:if(this.flags&oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case z.OP_IF:case z.OP_NOTIF:{let I=!1;if(t){if(this.stack.length<1)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;let F=this.stack.pop();I=oe.castToBool(F),a===z.OP_NOTIF&&(I=!I)}this.ifStack.push(I)}break;case z.OP_ELSE:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.ifStack[this.ifStack.length-1]=!this.ifStack[this.ifStack.length-1];break;case z.OP_ENDIF:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.ifStack.pop();break;case z.OP_VERIFY:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-1];if(oe.castToBool(I))this.stack.pop();else return this.errStr="SCRIPT_ERR_VERIFY",!1}break;case z.OP_RETURN:return this.errStr="SCRIPT_ERR_OP_RETURN",!1;case z.OP_TOALTSTACK:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altStack.push(this.stack.pop());break;case z.OP_FROMALTSTACK:if(this.altStack.length<1)return this.errStr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altStack.pop());break;case z.OP_2DROP:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case z.OP_2DUP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-2],F=this.stack[this.stack.length-1];this.stack.push(I),this.stack.push(F)}break;case z.OP_3DUP:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-3],F=this.stack[this.stack.length-2],j=this.stack[this.stack.length-1];this.stack.push(I),this.stack.push(F),this.stack.push(j)}break;case z.OP_2OVER:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-4],F=this.stack[this.stack.length-3];this.stack.push(I),this.stack.push(F)}break;case z.OP_2ROT:{if(this.stack.length<6)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack.splice(this.stack.length-6,2);this.stack.push(I[0]),this.stack.push(I[1])}break;case z.OP_2SWAP:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack.splice(this.stack.length-4,2);this.stack.push(I[0]),this.stack.push(I[1])}break;case z.OP_IFDUP:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-1];oe.castToBool(I)&&this.stack.push(I)}break;case z.OP_DEPTH:{let I=new ee(this.stack.length).toScriptNumBuffer();this.stack.push(I)}break;case z.OP_DROP:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case z.OP_DUP:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1]);break;case z.OP_NIP:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case z.OP_OVER:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2]);break;case z.OP_PICK:case z.OP_ROLL:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-1],j=new ee().fromScriptNumBuffer(I,e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS).toNumber();if(this.stack.pop(),j<0||j>=this.stack.length)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;I=this.stack[this.stack.length-j-1],a===z.OP_ROLL&&this.stack.splice(this.stack.length-j-1,1),this.stack.push(I)}break;case z.OP_ROT:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-3],F=this.stack[this.stack.length-2],j=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=F,this.stack[this.stack.length-2]=j,this.stack[this.stack.length-1]=I}break;case z.OP_SWAP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-2],F=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=F,this.stack[this.stack.length-1]=I}break;case z.OP_TUCK:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1]);break;case z.OP_SIZE:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=new ee(this.stack[this.stack.length-1].length);this.stack.push(I.toScriptNumBuffer())}break;case z.OP_OR:case z.OP_AND:case z.OP_XOR:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var i=this.stack[this.stack.length-2],u=this.stack[this.stack.length-1];if(i.length!=u.length)return this.errStr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(a){case z.OP_AND:for(let I=0;I<i.length;I++)i[I]&=u[I];break;case z.OP_OR:for(let I=0;I<i.length;I++)i[I]|=u[I];break;case z.OP_XOR:for(let I=0;I<i.length;I++)i[I]^=u[I];break}this.stack.pop();break;case z.OP_INVERT:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var c=this.stack[this.stack.length-1];for(let I=0;I<c.length;I++)c[I]=~c[I];break;case z.OP_LSHIFT:case z.OP_RSHIFT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-2],F=new ee(I),j=new ee().fromScriptNumBuffer(this.stack[this.stack.length-1],e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS).toNumber();if(j<0)return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;switch(this.stack.pop(),this.stack.pop(),a){case z.OP_LSHIFT:F=F.ushln(j);break;case z.OP_RSHIFT:F=F.ushrn(j);break}let W=F.toBuffer().slice(-I.length);W.length<I.length&&(W=Y.concat([Y.alloc(I.length-W.length),W])),this.stack.push(W);break}case z.OP_EQUAL:case z.OP_EQUALVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-2],F=this.stack[this.stack.length-1],j=Ut(I,F);if(this.stack.pop(),this.stack.pop(),this.stack.push(j?oe.true:oe.false),a===z.OP_EQUALVERIFY)if(j)this.stack.pop();else return this.errStr="SCRIPT_ERR_EQUALVERIFY",!1}break;case z.OP_1ADD:case z.OP_1SUB:case z.OP_NEGATE:case z.OP_ABS:case z.OP_NOT:case z.OP_0NOTEQUAL:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-1],F=new ee().fromScriptNumBuffer(I,e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS);switch(a){case z.OP_1ADD:F=F.add(1);break;case z.OP_1SUB:F=F.sub(1);break;case z.OP_NEGATE:F=F.neg();break;case z.OP_ABS:F.lt(0)&&(F=F.neg());break;case z.OP_NOT:F=new ee(F.eq(0)+0);break;case z.OP_0NOTEQUAL:F=new ee(F.neq(0)+0);break}this.stack.pop(),this.stack.push(F.toScriptNumBuffer())}break;case z.OP_ADD:case z.OP_SUB:case z.OP_MUL:case z.OP_DIV:case z.OP_MOD:case z.OP_BOOLAND:case z.OP_BOOLOR:case z.OP_NUMEQUAL:case z.OP_NUMEQUALVERIFY:case z.OP_NUMNOTEQUAL:case z.OP_LESSTHAN:case z.OP_GREATERTHAN:case z.OP_LESSTHANOREQUAL:case z.OP_GREATERTHANOREQUAL:case z.OP_MIN:case z.OP_MAX:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=new ee().fromScriptNumBuffer(this.stack[this.stack.length-2],e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),F=new ee().fromScriptNumBuffer(this.stack[this.stack.length-1],e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),j=new ee(0);switch(a){case z.OP_ADD:j=I.add(F);break;case z.OP_SUB:j=I.sub(F);break;case z.OP_MUL:j=I.mul(F);break;case z.OP_DIV:if(F==0)return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;j=I.div(F);break;case z.OP_MOD:if(F==0)return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;j=I.mod(F);break;case z.OP_BOOLAND:j=new ee((I.neq(0)&&F.neq(0))+0);break;case z.OP_BOOLOR:j=new ee((I.neq(0)||F.neq(0))+0);break;case z.OP_NUMEQUAL:j=new ee(I.eq(F)+0);break;case z.OP_NUMEQUALVERIFY:j=new ee(I.eq(F)+0);break;case z.OP_NUMNOTEQUAL:j=new ee(I.neq(F)+0);break;case z.OP_LESSTHAN:j=new ee(I.lt(F)+0);break;case z.OP_GREATERTHAN:j=new ee(I.gt(F)+0);break;case z.OP_LESSTHANOREQUAL:j=new ee(I.leq(F)+0);break;case z.OP_GREATERTHANOREQUAL:j=new ee(I.geq(F)+0);break;case z.OP_MIN:j=I.lt(F)?I:F;break;case z.OP_MAX:j=I.gt(F)?I:F;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(j.toScriptNumBuffer()),a===z.OP_NUMEQUALVERIFY)if(oe.castToBool(this.stack[this.stack.length-1]))this.stack.pop();else return this.errStr="SCRIPT_ERR_NUMEQUALVERIFY",!1}break;case z.OP_WITHIN:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=new ee().fromScriptNumBuffer(this.stack[this.stack.length-3],e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),F=new ee().fromScriptNumBuffer(this.stack[this.stack.length-2],e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),j=new ee().fromScriptNumBuffer(this.stack[this.stack.length-1],e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS),W=F.leq(I)&&I.lt(j);this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(W?oe.true:oe.false)}break;case z.OP_RIPEMD160:case z.OP_SHA1:case z.OP_SHA256:case z.OP_HASH160:case z.OP_HASH256:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-1],F;a===z.OP_RIPEMD160?F=ce.ripemd160(I):a===z.OP_SHA1?F=ce.sha1(I):a===z.OP_SHA256?F=ce.sha256(I):a===z.OP_HASH160?F=ce.sha256Ripemd160(I):a===z.OP_HASH256&&(F=ce.sha256Sha256(I)),this.stack.pop(),this.stack.push(F)}break;case z.OP_CODESEPARATOR:this.pBeginCodeHash=this.pc;break;case z.OP_CHECKSIG:case z.OP_CHECKSIGVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let I=this.stack[this.stack.length-2],F=this.stack[this.stack.length-1];if(!this.checkSigEncoding(I)||!this.checkPubKeyEncoding(F))return!1;let j=new Fe().fromObject({chunks:this.script.chunks.slice(this.pBeginCodeHash)});if((I.length>0?I.readUInt8(I.length-1):0)&be.SIGHASH_FORKID){if(!(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else j.findAndDelete(new Fe().writeBuffer(I));let Z;try{let ne=new be().fromTxFormat(I),ae=new Ze().fromBuffer(F,!1);this.nHashType=ne.nHashType,typeof this.nIn>"u"&&console.log("Missing tx input nIn"),typeof this.tx>"u"&&(this.tx=new De);try{this.preImage=this.tx.sighashPreimage(ne.nHashType,this.nIn,j,this.valueBn,De.SCRIPT_ENABLE_SIGHASH_FORKID),this.preImage.compare(Y.from("0000000000000000000000000000000000000000000000000000000000000001","hex"))===0?this.hashBuf=this.preImage:this.hashBuf=new ht(ce.sha256Sha256(this.preImage)).readReverse(),this.verify=mt.verify(this.hashBuf,ne,ae,"little",!0)}catch(N){console.log("ERROR: ",N.message)}Z=this.tx.verify(ne,ae,this.nIn,j,!!(this.flags&oe.SCRIPT_VERIFY_LOW_S),this.valueBn,De.SCRIPT_ENABLE_SIGHASH_FORKID)}catch{Z=!1}if(this.stack.pop(),this.stack.pop(),this.stack.push(Z?oe.true:oe.false),a===z.OP_CHECKSIGVERIFY)if(Z)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKSIGVERIFY",!1}break;case z.OP_CHECKMULTISIG:case z.OP_CHECKMULTISIGVERIFY:{let I=1;if(this.stack.length<I)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let F=new ee().fromScriptNumBuffer(this.stack[this.stack.length-I],e).toNumber();if(F<0||F>20)return this.errStr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=F,this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;let j=++I;if(I+=F,this.stack.length<I)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let W=new ee().fromScriptNumBuffer(this.stack[this.stack.length-I],e).toNumber();if(W<0||W>F)return this.errStr="SCRIPT_ERR_SIG_COUNT",!1;let Z=++I;if(I+=W,this.stack.length<I)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let ne=new Fe().fromObject({chunks:this.script.chunks.slice(this.pBeginCodeHash)});for(let N=0;N<W;N++){let E=this.stack[this.stack.length-Z-N];if((E.length>0?E.readUInt8(E.length-1):0)&be.SIGHASH_FORKID){if(!(this.flags&oe.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else ne.findAndDelete(new Fe().writeBuffer(E))}let ae=!0;for(;ae&&W>0;){let N=this.stack[this.stack.length-Z],E=this.stack[this.stack.length-j];if(!this.checkSigEncoding(N)||!this.checkPubKeyEncoding(E))return!1;let s;try{let y=new be().fromTxFormat(N),S=new Ze().fromBuffer(E,!1);s=this.tx.verify(y,S,this.nIn,ne,!!(this.flags&oe.SCRIPT_VERIFY_LOW_S),this.valueBn,this.flags)}catch{s=!1}s&&(Z++,W--),j++,F--,W>F&&(ae=!1)}for(;I-- >1;)this.stack.pop();if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&oe.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errStr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(ae?oe.true:oe.false),a===z.OP_CHECKMULTISIGVERIFY)if(ae)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1}break;case z.OP_CAT:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let A=this.stack[this.stack.length-2],B=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=Y.concat([A,B]),this.stack.pop();break;case z.OP_SPLIT:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let x=this.stack[this.stack.length-2],U=new ee().fromScriptNumBuffer(this.stack[this.stack.length-1],e);if(U.lt(0)||U.gt(x.length))return this.errStr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;let P=x.slice(0,U),k=x.slice(U);this.stack.pop(),this.stack.pop(),this.stack.push(P),this.stack.push(k);break;case z.OP_NUM2BIN:this.stack.length<2&&(this.errStr="OP_NUM2BIN requires at least two items to be on the stack.");let L=new ee().fromScriptNumBuffer(this.stack[this.stack.length-1],e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS).toNumber();L>oe.MAX_SCRIPT_ELEMENT_SIZE&&(this.errStr=`It's not currently possible to push data larger than ${oe.MAX_SCRIPT_ELEMENT_SIZE} bytes.`),this.stack.pop();let T=this.stack[this.stack.length-1];if(T=lf(T),T.length>L&&(this.errStr="OP_NUM2BIN requires that the size expressed in the top stack item is large enough to hold the value expressed in the second-from-top stack item."),T.length===L){this.stack[this.stack.length-1]=T;break}var h=0;T.length>0&&(h=T[T.length-1]&128,T[T.length-1]&=127);var f=new Array(L);f.fill(0);for(var o=0;o<L;o++)f[o]=T[o];for(o=T.length-1;o++<L-2;)f[o]=0;f[o]=h,this.stack[this.stack.length-1]=Y.from(new Uint8Array(f).buffer,"binary");break;case z.OP_BIN2NUM:this.stack.length<1&&(this.errStr="OP_BIN2NUM requires at least one item to be on the stack.");var v=this.stack[this.stack.length-1],w=lf(v);this.stack[this.stack.length-1]=new ee().fromScriptNumBuffer(w,e,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS);break;default:return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}verify(e,t,r,a,i,u){let c=this.results(e,t,r,a,i,u);for(let h of c)if(!h)return!1;return!0}*results(e,t,r,a,i,u){let c;this.fromObject({script:e,tx:r,nIn:a,flags:i,valueBn:u}),(i&oe.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!e.isPushOnly()&&(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1),yield*this.eval(),i&oe.SCRIPT_VERIFY_P2SH&&(c=this.stack.slice());let h=this.stack;this.initialize(),this.fromObject({script:t,stack:h,tx:r,nIn:a,flags:i,valueBn:u}),yield*this.eval(),this.stack.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1);let f=this.stack[this.stack.length-1];if(oe.castToBool(f)||(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),i&oe.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){e.isPushOnly()||(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1);let o=h;if(h=c,c=o,h.length===0)throw new Error("internal error - stack copy empty");let v=h[h.length-1],w=new Fe().fromBuffer(v);h.pop(),this.initialize(),this.fromObject({script:w,stack:h,tx:r,nIn:a,flags:i,valueBn:u}),yield*this.eval(),h.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),oe.castToBool(h[h.length-1])?yield!0:(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1)}if((i&oe.SCRIPT_VERIFY_CLEANSTACK)!==0){if(!(i&oe.SCRIPT_VERIFY_P2SH))throw new Error("cannot use CLEANSTACK without P2SH");h.length!==1&&(this.errStr=this.errStr||"SCRIPT_ERR_CLEANSTACK",yield!1)}yield!0}getDebugObject(){let e=this.pc-1;return{errStr:this.errStr,scriptStr:this.script?this.script.toString():"no script found",pc:e,stack:this.stack.map(t=>t.toString("hex")),altStack:this.altStack.map(t=>t.toString("hex")),opCodeStr:this.script?z.fromNumber(this.script.chunks[e].opCodeNum).toString():"no script found"}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}oe.true=Y.from([1]),oe.false=Y.from([]),oe.MAX_SCRIPT_ELEMENT_SIZE=500*1e3,oe.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS=10*1e3,oe.LOCKTIME_THRESHOLD=5e8,oe.SCRIPT_VERIFY_NONE=0,oe.SCRIPT_VERIFY_P2SH=1,oe.SCRIPT_VERIFY_STRICTENC=2,oe.SCRIPT_VERIFY_DERSIG=4,oe.SCRIPT_VERIFY_LOW_S=8,oe.SCRIPT_VERIFY_NULLDUMMY=16,oe.SCRIPT_VERIFY_SIGPUSHONLY=32,oe.SCRIPT_VERIFY_MINIMALDATA=64,oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,oe.SCRIPT_VERIFY_CLEANSTACK=256,oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024,oe.SCRIPT_ENABLE_SIGHASH_FORKID=65536,oe.defaultFlags=oe.SCRIPT_VERIFY_P2SH|oe.SCRIPT_VERIFY_STRICTENC|oe.SCRIPT_ENABLE_SIGHASH_FORKID|oe.SCRIPT_VERIFY_LOW_S|oe.SCRIPT_VERIFY_NULLDUMMY|oe.SCRIPT_VERIFY_DERSIG|oe.SCRIPT_VERIFY_MINIMALDATA|oe.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS|oe.SCRIPT_VERIFY_CLEANSTACK|oe.SCRIPT_VERIFY_SIGPUSHONLY|oe.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|oe.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;class $n extends ze{constructor(e=new Map){super({map:e})}toJSON(){const e={};return this.map.forEach((t,r)=>{e[r]=t.map(a=>({nScriptChunk:a.nScriptChunk,type:a.type,addressStr:a.addressStr,nHashType:a.nHashType,log:a.log}))}),e}fromJSON(e){return Object.keys(e).forEach(t=>{this.map.set(t,e[t].map(r=>({nScriptChunk:r.nScriptChunk,type:r.type,addressStr:r.addressStr,nHashType:r.nHashType,log:r.log})))}),this}setOne(e,t,r,a="sig",i,u=be.SIGHASH_ALL|be.SIGHASH_FORKID){const c=e.toString("hex")+":"+t,h={nScriptChunk:r,type:a,addressStr:i,nHashType:u};return this.map.set(c,[h]),this}setMany(e,t,r){const a=e.toString("hex")+":"+t;return r=r.map(i=>({type:i.type||"sig",nHashType:i.nHashType||be.SIGHASH_ALL|be.SIGHASH_FORKID,...i})),this.map.set(a,r),this}addOne(e,t,r,a="sig",i,u=be.SIGHASH_ALL|be.SIGHASH_FORKID){const c=this.get(e,t)||[];return c.push({nScriptChunk:r,type:a,addressStr:i,nHashType:u}),this.setMany(e,t,c),this}get(e,t){const r=e.toString("hex")+":"+t;return this.map.get(r)||[]}}class Jn extends ze{constructor(e=new Map){super({map:e})}toJSON(){const e={};return this.map.forEach((t,r)=>{e[r]=t.toHex()}),e}fromJSON(e){return Object.keys(e).forEach(t=>{this.map.set(t,St.fromHex(e[t]))}),this}set(e,t,r){const a=e.toString("hex")+":"+t;return this.map.set(a,r),this}get(e,t){const r=e.toString("hex")+":"+t;return this.map.get(r)}setTx(e){const t=e.hash().toString("hex");return e.txOuts.forEach((r,a)=>{const i=t+":"+a;this.map.set(i,r)}),this}}const Wn=Le.Default.TxBuilder;class ic extends ze{constructor(e=new De,t=[],r=[],a=new Jn,i=new $n,u,c,h,f=Wn.feePerKbNum,o=0,v=1,w=1,A=Wn.dust,B=!1,x=new Tr){super({tx:e,txIns:t,txOuts:r,uTxOutMap:a,sigOperations:i,changeScript:u,changeAmountBn:c,feeAmountBn:h,feePerKbNum:f,nLockTime:o,versionBytesNum:v,sigsPerInput:w,dust:A,dustChangeToFees:B,hashCache:x})}toJSON(){const e={};return e.tx=this.tx.toHex(),e.txIns=this.txIns.map(t=>t.toHex()),e.txOuts=this.txOuts.map(t=>t.toHex()),e.uTxOutMap=this.uTxOutMap.toJSON(),e.sigOperations=this.sigOperations.toJSON(),e.changeScript=this.changeScript?this.changeScript.toHex():void 0,e.changeAmountBn=this.changeAmountBn?this.changeAmountBn.toNumber():void 0,e.feeAmountBn=this.feeAmountBn?this.feeAmountBn.toNumber():void 0,e.feePerKbNum=this.feePerKbNum,e.sigsPerInput=this.sigsPerInput,e.dust=this.dust,e.dustChangeToFees=this.dustChangeToFees,e.hashCache=this.hashCache.toJSON(),e}fromJSON(e){return this.tx=new De().fromHex(e.tx),this.txIns=e.txIns.map(t=>Je.fromHex(t)),this.txOuts=e.txOuts.map(t=>St.fromHex(t)),this.uTxOutMap=new Jn().fromJSON(e.uTxOutMap),this.sigOperations=new $n().fromJSON(e.sigOperations),this.changeScript=e.changeScript?new Fe().fromHex(e.changeScript):void 0,this.changeAmountBn=e.changeAmountBn?new ee(e.changeAmountBn):void 0,this.feeAmountBn=e.feeAmountBn?new ee(e.feeAmountBn):void 0,this.feePerKbNum=e.feePerKbNum||this.feePerKbNum,this.sigsPerInput=e.sigsPerInput||this.sigsPerInput,this.dust=e.dust||this.dust,this.dustChangeToFees=e.dustChangeToFees||this.dustChangeToFees,this.hashCache=Tr.fromJSON(e.hashCache),this}setFeePerKbNum(e){if(typeof e!="number"||e<0)throw new Error("cannot set a fee of zero or less");return this.feePerKbNum=e,this}setChangeAddress(e){return this.changeScript=e.toTxOutScript(),this}setChangeScript(e){return this.changeScript=e,this}setNLocktime(e){return this.nLockTime=e,this}setVersion(e){return this.versionBytesNum=e,this}setDust(e=Wn.dust){return this.dust=e,this}sendDustChangeToFees(e=!1){return this.dustChangeToFees=e,this}importPartiallySignedTx(e,t=this.uTxOutMap,r=this.sigOperations){return this.tx=e,this.uTxOutMap=t,this.sigOperations=r,this}inputFromScript(e,t,r,a,i){if(!Y.isBuffer(e)||typeof t!="number"||!(r instanceof St)||!(a instanceof Fe))throw new Error("invalid one of: txHashBuf, txOutNum, txOut, script");return this.txIns.push(Je.fromProperties(e,t,a,i)),this.uTxOutMap.set(e,t,r),this}addSigOperation(e,t,r,a,i,u){return this.sigOperations.addOne(e,t,r,a,i,u),this}inputFromPubKeyHash(e,t,r,a,i,u){if(!Y.isBuffer(e)||typeof t!="number"||!(r instanceof St))throw new Error("invalid one of: txHashBuf, txOutNum, txOut");this.txIns.push(new Je().fromObject({nSequence:i}).fromPubKeyHashTxOut(e,t,r,a)),this.uTxOutMap.set(e,t,r);const c=It.fromTxOutScript(r.script).toString();return this.addSigOperation(e,t,0,"sig",c,u),this.addSigOperation(e,t,1,"pubKey",c),this}outputToAddress(e,t){if(!(t instanceof It)||!(e instanceof ee))throw new Error("addr must be an Address, and valueBn must be a Bn");const r=new Fe().fromPubKeyHash(t.hashBuf);return this.outputToScript(e,r),this}outputToScript(e,t){if(!(t instanceof Fe)||!(e instanceof ee))throw new Error("script must be a Script, and valueBn must be a Bn");const r=St.fromProperties(e,t);return this.txOuts.push(r),this}buildOutputs(){let e=new ee(0);return this.txOuts.forEach(t=>{if(t.valueBn.lt(this.dust)&&!t.script.isNonSpendable())throw new Error("cannot create output lesser than dust");e=e.add(t.valueBn),this.tx.addTxOut(t)}),e}buildInputs(e,t=0){let r=new ee(0);for(const a of this.txIns){const i=this.uTxOutMap.get(a.txHashBuf,a.txOutNum);if(r=r.add(i.valueBn),this.tx.addTxIn(a),r.geq(e)){if(t<=0)break;t--}}if(r.lt(e))throw new Error("not enough funds for outputs: inAmountBn "+r.toNumber()+" outAmountBn "+e.toNumber());return r}estimateSize(){let r=this.tx.toBuffer().length;return this.tx.txIns.forEach(a=>{const{txHashBuf:i,txOutNum:u}=a;this.sigOperations.get(i,u).forEach(h=>{const{nScriptChunk:f,type:o}=h,w=new Fe([a.script.chunks[f]]).toBuffer().length;if(r-=w,o==="sig")r+=72;else if(h.type==="pubKey")r+=35;else throw new Error("unsupported sig operations type")})}),r=r+1,Math.round(r)}estimateFee(e=new ee(0)){const t=Math.ceil(this.estimateSize()/1e3*this.feePerKbNum);return new ee(t).add(e)}build(e={useAllInputs:!1}){let t;if(this.txIns.length<=0)throw Error("tx-builder number of inputs must be greater than 0");if(!this.changeScript)throw new Error("must specify change script to use build method");for(let r=e.useAllInputs?this.txIns.length-1:0;r<this.txIns.length;r++){this.tx=new De;const a=this.buildOutputs(),i=St.fromProperties(new ee(0),this.changeScript);this.tx.addTxOut(i);let u;try{u=this.buildInputs(a,r)}catch(c){throw c.message.includes("not enough funds for outputs")?new Error("unable to gather enough inputs for outputs and fee"):c}if(this.changeAmountBn=u.sub(a),i.valueBn=this.changeAmountBn,t=this.estimateFee(),this.changeAmountBn.geq(t)&&this.changeAmountBn.sub(t).gt(this.dust))break}if(this.changeAmountBn.geq(t)){if(this.feeAmountBn=t,this.changeAmountBn=this.changeAmountBn.sub(this.feeAmountBn),this.tx.txOuts[this.tx.txOuts.length-1].valueBn=this.changeAmountBn,this.changeAmountBn.lt(this.dust))if(this.dustChangeToFees)this.tx.txOuts.pop(),this.tx.txOutsVi=et.fromNumber(this.tx.txOutsVi.toNumber()-1),this.feeAmountBn=this.feeAmountBn.add(this.changeAmountBn),this.changeAmountBn=new ee(0);else throw new Error("unable to create change amount greater than dust");if(this.tx.nLockTime=this.nLockTime,this.tx.versionBytesNum=this.versionBytesNum,this.tx.txOuts.length===0)throw new Error("outputs length is zero - unable to create any outputs greater than dust");return this}else throw new Error("unable to gather enough inputs for outputs and fee")}sort(){return this.tx.sort(),this}static allSigsPresent(e,t){let r=0;for(let a=1;a<t.chunks.length-1;a++)t.chunks[a].buf&&r++;return r===e}static removeBlankSigs(e){e=new Fe(e.chunks.slice());for(let t=1;t<e.chunks.length-1;t++)e.chunks[t].buf||e.chunks.splice(t,1);return e}fillSig(e,t,r){const a=this.tx.txIns[e];return a.script.chunks[t]=new Fe().writeBuffer(r.toTxFormat()).chunks[0],a.scriptVi=et.fromNumber(a.script.toBuffer().length),this}getSig(e,t=be.SIGHASH_ALL|be.SIGHASH_FORKID,r,a,i=De.SCRIPT_ENABLE_SIGHASH_FORKID){let u;if(t&be.SIGHASH_FORKID&&i&De.SCRIPT_ENABLE_SIGHASH_FORKID){const c=this.tx.txIns[r].txHashBuf,h=this.tx.txIns[r].txOutNum,f=this.uTxOutMap.get(c,h);if(!f)throw new Error("for SIGHASH_FORKID must provide UTXOs");u=f.valueBn}return this.tx.sign(e,t,r,a,u,i,this.hashCache)}asyncGetSig(e,t=be.SIGHASH_ALL|be.SIGHASH_FORKID,r,a,i=De.SCRIPT_ENABLE_SIGHASH_FORKID){let u;if(t&be.SIGHASH_FORKID&&i&De.SCRIPT_ENABLE_SIGHASH_FORKID){const c=this.tx.txIns[r].txHashBuf,h=this.tx.txIns[r].txOutNum,f=this.uTxOutMap.get(c,h);if(!f)throw new Error("for SIGHASH_FORKID must provide UTXOs");u=f.valueBn}return this.tx.asyncSign(e,t,r,a,u,i,this.hashCache)}signTxIn(e,t,r,a,i=be.SIGHASH_ALL|be.SIGHASH_FORKID,u=De.SCRIPT_ENABLE_SIGHASH_FORKID){const c=this.tx.txIns[e],h=c.script;if(a===void 0&&h.isPubKeyHashIn()&&(a=0),a===void 0)throw new Error("cannot sign unknown script type for input "+e);const f=c.txHashBuf,o=c.txOutNum;r||(r=this.uTxOutMap.get(f,o));const w=r.script,A=this.getSig(t,i,e,w,u,this.hashCache);return this.fillSig(e,a,A),this}async asyncSignTxIn(e,t,r,a,i=be.SIGHASH_ALL|be.SIGHASH_FORKID,u=De.SCRIPT_ENABLE_SIGHASH_FORKID){const c=this.tx.txIns[e],h=c.script;if(a===void 0&&h.isPubKeyHashIn()&&(a=0),a===void 0)throw new Error("cannot sign unknown script type for input "+e);const f=c.txHashBuf,o=c.txOutNum;r||(r=this.uTxOutMap.get(f,o));const w=r.script,A=await this.asyncGetSig(t,i,e,w,u,this.hashCache);return this.fillSig(e,a,A),this}signWithKeyPairs(e){const t={};for(const r of e){const a=It.fromPubKey(r.pubKey).toString();t[a]=r}for(const r in this.tx.txIns){const a=this.tx.txIns[r],i=this.sigOperations.get(a.txHashBuf,a.txOutNum);for(const u of i){const{nScriptChunk:c,type:h,addressStr:f,nHashType:o}=u,v=t[f];if(!v){u.log=`cannot find keyPair for addressStr ${f}`;continue}const w=this.uTxOutMap.get(a.txHashBuf,a.txOutNum);if(h==="sig")this.signTxIn(r,v,w,c,o),u.log="successfully inserted signature";else if(h==="pubKey")a.script.chunks[c]=new Fe().writeBuffer(v.pubKey.toBuffer()).chunks[0],a.setScript(a.script),u.log="successfully inserted public key";else{u.log=`cannot perform operation of type ${h}`;continue}}}return this}}class Cr extends ze{constructor(e,t,r,a){super({tx:e,txOutMap:t,errStr:r,interp:a})}verify(e=oe.SCRIPT_ENABLE_SIGHASH_FORKID){return!this.checkStr()&&!this.verifyStr(e)}async asyncVerify(e){const t=await this.asyncVerifyStr(e);return!this.checkStr()&&!t}static verify(e,t,r){return new Cr(e,t).verify(r)}static asyncVerify(e,t,r){return new Cr(e,t).asyncVerify(r)}checkStr(){if(this.tx.txIns.length===0||this.tx.txInsVi.toNumber()===0)return this.errStr="transaction txIns empty",this.errStr;if(this.tx.txOuts.length===0||this.tx.txOutsVi.toNumber()===0)return this.errStr="transaction txOuts empty",this.errStr;if(this.tx.toBuffer().length>Mr.MAX_BLOCK_SIZE)return this.errStr="transaction over the maximum block size",this.errStr;let e=new ee(0);for(let r=0;r<this.tx.txOuts.length;r++){const a=this.tx.txOuts[r];if(a.valueBn.lt(0))return this.errStr="transaction txOut "+r+" negative",this.errStr;if(a.valueBn.gt(De.MAX_MONEY))return this.errStr="transaction txOut "+r+" greater than MAX_MONEY",this.errStr;if(e=e.add(a.valueBn),e.gt(De.MAX_MONEY))return this.errStr="transaction txOut "+r+" total output greater than MAX_MONEY",this.errStr}const t={};for(let r=0;r<this.tx.txIns.length;r++){const a=this.tx.txIns[r],i=a.txHashBuf.toString("hex")+":"+a.txOutNum;if(t[i]!==void 0)return this.errStr="transaction input "+r+" duplicate input",this.errStr;t[i]=!0}if(this.tx.isCoinbase()){const r=this.tx.txIns[0].script.toBuffer();if(r.length<2||r.length>100)return this.errStr="coinbase trasaction script size invalid",this.errStr}else for(let r=0;r<this.tx.txIns.length;r++)if(this.tx.txIns[r].hasNullInput())return this.errStr="transaction input "+r+" has null input",this.errStr;return!1}verifyStr(e){for(let t=0;t<this.tx.txIns.length;t++)if(!this.verifyNIn(t,e))return this.errStr="input "+t+" failed script verify",this.errStr;return!1}async asyncVerifyStr(e){for(let t=0;t<this.tx.txIns.length;t++)if(!await this.asyncVerifyNIn(t,e))return this.errStr="input "+t+" failed script verify",this.errStr;return!1}verifyNIn(e,t){const r=this.tx.txIns[e],a=r.script,i=this.txOutMap.get(r.txHashBuf,r.txOutNum);if(!i)return console.log("output "+r.txOutNum+" not found"),!1;const u=i.script,c=i.valueBn;return this.interp=new oe,this.interp.verify(a,u,this.tx,e,t,c)}async asyncVerifyNIn(e,t){const r=this.tx.txIns[e],a=r.script,i=this.txOutMap.get(r.txHashBuf,r.txOutNum);if(!i)return console.log("output "+r.txOutNum+" not found"),!1;const u=i.script,c=i.valueBn;this.interp=new oe;const h=await we.asyncObjectMethod(this.interp,"verify",[a,u,this.tx,e,t,c]);return JSON.parse(h.resbuf.toString())}getDebugObject(){return{errStr:this.errStr,interpFailure:this.interp?this.interp.getDebugObject():void 0}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}class yt{}yt.encrypt=function(n,e){const t=yt.buf2Words(e),r=yt.buf2Words(n),i=new Lr(t).encrypt(r);return yt.words2Buf(i)},yt.decrypt=function(n,e){const t=yt.buf2Words(n),r=yt.buf2Words(e),i=new Lr(r).decrypt(t);return yt.words2Buf(i)},yt.buf2Words=function(n){if(n.length%4)throw new Error("buf length must be a multiple of 4");const e=[];for(let t=0;t<n.length/4;t++)e.push(n.readUInt32BE(t*4));return e},yt.words2Buf=function(n){const e=Y.alloc(n.length*4);for(let t=0;t<n.length;t++)e.writeUInt32BE(n[t],t*4);return e};class We{}We.buf2BlocksBuf=function(n,e){const t=e/8,r=[];for(let a=0;a<=n.length/t;a++){let i=n.slice(a*t,a*t+t);i.length<e&&(i=We.pkcs7Pad(i,e)),r.push(i)}return r},We.blockBufs2Buf=function(n){let e=n[n.length-1];return e=We.pkcs7Unpad(e),n[n.length-1]=e,Y.concat(n)},We.encrypt=function(n,e,t,r){const a=e.length*8,i=We.buf2BlocksBuf(n,a),u=We.encryptBlocks(i,e,t,r);return Y.concat(u)},We.decrypt=function(n,e,t,r){const a=e.length,i=[];for(let h=0;h<n.length/a;h++)i.push(n.slice(h*a,h*a+a));const u=We.decryptBlocks(i,e,t,r);return We.blockBufs2Buf(u)},We.encryptBlock=function(n,e,t,r){const a=We.xorBufs(n,e);return t.encrypt(a,r)},We.decryptBlock=function(n,e,t,r){const a=t.decrypt(n,r);return We.xorBufs(a,e)},We.encryptBlocks=function(n,e,t,r){const a=[];for(let i=0;i<n.length;i++){const u=n[i],c=We.encryptBlock(u,e,t,r);a.push(c),e=c}return a},We.decryptBlocks=function(n,e,t,r){const a=[];for(let i=0;i<n.length;i++){const u=n[i],c=We.decryptBlock(u,e,t,r);a.push(c),e=u}return a},We.pkcs7Pad=function(n,e){const r=e/8-n.length,a=Y.alloc(r);return a.fill(r),Y.concat([n,a])},We.pkcs7Unpad=function(n){const e=n[n.length-1],t=n.slice(n.length-e,n.length),r=Y.alloc(e);if(r.fill(e),!Ut(t,r))throw new Error("invalid padding");return n.slice(0,n.length-e)},We.xorBufs=function(n,e){if(n.length!==e.length)throw new Error("bufs must have the same length");const t=Y.alloc(n.length);for(let r=0;r<n.length;r++)t[r]=n[r]^e[r];return t};class Lt{}Lt.encrypt=function(n,e,t,r=!0){t=t||Mt.getRandomBuffer(128/8);const a=We.encrypt(n,t,yt,e);return r?Y.concat([t,a]):a},Lt.decrypt=function(n,e,t=!1){if(t){const r=n;return We.decrypt(r,t,yt,e)}else{const r=n.slice(0,16),a=n.slice(128/8);return We.decrypt(a,r,yt,e)}};class Yt{}Yt.encrypt=function(n,e,t){const r=Lt.encrypt(n,e,t),a=ce.sha256Hmac(r,e);return Y.concat([a,r])},Yt.asyncEncrypt=async function(n,e,t){t||(t=Mt.getRandomBuffer(128/8));const r=[n,e,t];return(await we.asyncClassMethod(Yt,"encrypt",r)).resbuf},Yt.decrypt=function(n,e){if(n.length<512/8)throw new Error("The encrypted data must be at least 256+128+128 bits, which is the length of the Hmac plus the iv plus the smallest encrypted data size");const t=n.slice(0,256/8);n=n.slice(256/8,n.length);const r=ce.sha256Hmac(n,e);if(!Ut(t,r))throw new Error("Message authentication failed - Hmacs are not equivalent");return Lt.decrypt(n,e)},Yt.asyncDecrypt=async function(n,e){const t=[n,e];return(await we.asyncClassMethod(Yt,"decrypt",t)).resbuf};class Et{}Et.ivkEkM=function(n,e){const t=n.bn,a=e.point.mul(t),u=new Ze(a).toBuffer(),c=ce.sha512(u);return{iv:c.slice(0,16),kE:c.slice(16,32),kM:c.slice(32,64)}},Et.electrumEncrypt=function(n,e,t,r=!1){if(!Y.isBuffer(n))throw new Error("messageBuf must be a buffer");let a;t===null&&(t=pt.fromRandom()),r||(a=t.pubKey.toDer(!0));const{iv:i,kE:u,kM:c}=Et.ivkEkM(t.privKey,e),h=Lt.encrypt(n,u,i,!1),f=Y.from("BIE1");let o;a?o=Y.concat([f,a,h]):o=Y.concat([f,h]);const v=ce.sha256Hmac(o,c);return Y.concat([o,v])},Et.electrumDecrypt=function(n,e,t=null){if(!Y.isBuffer(n))throw new Error("encBuf must be a buffer");const r=32;if(!n.slice(0,4).equals(Y.from("BIE1")))throw new Error("Invalid Magic");let i=4;if(t===null){const w=n.slice(4,37);t=Ze.fromDer(w),i=37}const{iv:u,kE:c,kM:h}=Et.ivkEkM(e,t),f=n.slice(i,n.length-r),o=n.slice(n.length-r,n.length),v=ce.sha256Hmac(n.slice(0,n.length-r),h);if(!o.equals(v))throw new Error("Invalid checksum");return Lt.decrypt(f,c,u)},Et.bitcoreEncrypt=function(n,e,t,r){t||(t=pt.fromRandom());const a=t.privKey.bn,u=t.pubKey.toDer(!0),o=e.point.mul(a).getX().toBuffer({size:32}),v=ce.sha512(o),w=v.slice(0,32),A=v.slice(32,64),B=Lt.encrypt(n,w,r),x=ce.sha256Hmac(B,A);return Y.concat([u,B,x])},Et.asyncBitcoreEncrypt=async function(n,e,t,r){t||(t=await pt.asyncFromRandom()),r||(r=Mt.getRandomBuffer(128/8));const a=[n,e,t,r];return(await we.asyncClassMethod(Et,"bitcoreEncrypt",a)).resbuf},Et.bitcoreDecrypt=function(n,e){const t=e.bn,i=Ze.fromDer(n.slice(0,33)).point.mul(t);if(i.eq(new Ue))throw new Error("P equals 0");const c=i.getX().toBuffer({size:32}),h=ce.sha512(c),f=h.slice(0,32),o=h.slice(32,64),v=n.slice(33,n.length-32),w=n.slice(n.length-32,n.length),A=ce.sha256Hmac(v,o);if(!Ut(w,A))throw new Error("Invalid checksum");return Lt.decrypt(v,f)},Et.asyncBitcoreDecrypt=async function(n,e){const t=[n,e];return(await we.asyncClassMethod(Et,"bitcoreDecrypt",t)).resbuf};const nc={aes:Lr,bnjs:lt,bs58:Hr,elliptic:es,hashjs:rr,pbkdf2:ff,Buffer:Yu},ac=$u.version;ge.Ach=Yt,ge.Address=It,ge.Aes=yt,ge.Aescbc=Lt,ge.Base58=er,ge.Base58Check=Tt,ge.Bip32=hr,ge.Bip39=Nr,ge.Block=Mr,ge.BlockHeader=lr,ge.Bn=ee,ge.Br=ht,ge.Bsm=_t,ge.Bw=qe,ge.Cbc=We,ge.Constants=Le,ge.Ecdsa=mt,ge.Ecies=Et,ge.Hash=ce,ge.Interp=oe,ge.KeyPair=pt,ge.MinableBlock=hf,ge.MiningUtils=rc,ge.OpCode=z,ge.Point=Ue,ge.PrivKey=xt,ge.PubKey=Ze,ge.Random=Mt,ge.Script=Fe,ge.Sig=be,ge.SigOperations=$n,ge.Struct=ze,ge.Tx=De,ge.TxBuilder=ic,ge.TxIn=Je,ge.TxOut=St,ge.TxOutMap=Jn,ge.TxVerifier=Cr,ge.VarInt=et,ge.Workers=we,ge.WorkersResult=Yn,ge.cmp=Ut,ge.deps=nc,ge.en=Rr,ge.es=kr,ge.getConstants=Qu,ge.jp=Pr,ge.version=ac,Object.defineProperty(ge,Symbol.toStringTag,{value:"Module"})});